Skip to content

Commit

Permalink
Merge pull request #209 from aerospike/3.1.0-release-candidate
Browse files Browse the repository at this point in the history
3.1.0 release candidate
  • Loading branch information
aerospikerobertmarks authored Mar 14, 2018
2 parents 860911b + 4a0ec7e commit 239d2c9
Show file tree
Hide file tree
Showing 7 changed files with 70 additions and 6 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.0.2
3.1.0
32 changes: 32 additions & 0 deletions api-changes.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,37 @@
# API Changes

## Version 3.1.0

### Additional Features
* Updated to C client `4.3.6`
* Added `exists` policy field to operate policies

### Backwards Incompatible API changes
* Updated the args passed to AerospikeError constructor internally to contain 5 arguments.
The arguments previously were `error code`, `error message`, `error file`, `error line`.
A fifth argument `in_doubt` has been added to the internal calls. so the arguments passed to the constructor are now : `error_code`, `error_message`, `error_file`, `error_line`, `in_doubt`

This means that code such as the following will now raise a ValueError

```python
try:
client.get(key)
except AerospikeError as e:
code, msg, file, line = e.args
print(code, msg, file, line)
```

This can be fixed by unpacking the fifth value from the Error's `args` tuple

```python
try:
client.get(key)
except AerospikeError as e:
code, msg, file, line, in_doubt = e.args
print(code, msg, file, line)
```


## Version 3.0.0


Expand Down
4 changes: 4 additions & 0 deletions doc/aerospike.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1093,6 +1093,10 @@ Specifies the behavior for whether keys or digests should be sent to the cluster
Specifies which partition replica to read from.
.. data:: POLICY_REPLICA_SEQUENCE
Always try node containing master partition first. If connection fails and `retry_on_timeout` is true, try node containing prole partition. Currently restricted to master and one prole.
.. data:: POLICY_REPLICA_MASTER
Read from the partition master replica node
Expand Down
33 changes: 30 additions & 3 deletions doc/client.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2657,10 +2657,15 @@ Write Policies
|
| Default: ``1000``
* **key** one of the ``aerospike.POLICY_KEY_*`` values such as :data:`aerospike.POLICY_KEY_DIGEST`
| Default: ``aerospike.POLICY_KEY_DIGEST``
* **exists** one of the ``aerospike.POLICY_EXISTS_*`` values such as :data:`aerospike.POLICY_EXISTS_CREATE`
| Default: ```aerospike.POLICY_GEN_IGNORE``
* **gen** one of the ``aerospike.POLICY_GEN_*`` values such as :data:`aerospike.POLICY_GEN_IGNORE`
| Default: ``aerospike.POLICY_GEN_IGNORE``
* **commit_level** one of the ``aerospike.POLICY_COMMIT_LEVEL_*`` values such as :data:`aerospike.POLICY_COMMIT_LEVEL_ALL`
| Default: ``aerospike.POLICY_COMMIT_LEVEL_ALL``
* **durable_delete** boolean value: True to perform durable delete (requires Enterprise server version >= 3.10)
| Default: ``False``
.. _aerospike_read_policies:
Expand Down Expand Up @@ -2711,8 +2716,11 @@ Read Policies
| Force reads to be linearized for server namespaces that support CP mode. Setting this policy to ``True`` requires an Enterprise server with version 4.0.0 or greater.
| Default: ``False``
* **key** one of the ``aerospike.POLICY_KEY_*`` values such as :data:`aerospike.POLICY_KEY_DIGEST`
| Default: ``aerospike.POLICY_KEY_DIGEST``
* **consistency_level** one of the ``aerospike.POLICY_CONSISTENCY_*`` values such as :data:`aerospike.POLICY_CONSISTENCY_ONE`
| Default: ``aerospike.POLICY_CONSISTENCY_ONE``
* **replica** one of the ``aerospike.POLICY_REPLICA_*`` values such as :data:`aerospike.POLICY_REPLICA_MASTER`
| Default: ``aerospike.POLICY_REPLICA_SEQUENCE``
.. _aerospike_operate_policies:
Expand Down Expand Up @@ -2760,11 +2768,18 @@ Operate Policies
| Force reads to be linearized for server namespaces that support CP mode. Setting this policy to ``True`` requires an Enterprise server with version 4.0.0 or greater.
| Default: ``False``
* **key** one of the ``aerospike.POLICY_KEY_*`` values such as :data:`aerospike.POLICY_KEY_DIGEST`
| Default: ``aerospike.POLICY_KEY_DIGEST``
* **gen** one of the ``aerospike.POLICY_GEN_*`` values such as :data:`aerospike.POLICY_GEN_IGNORE`
| Default: ``aerospike.POLICY_GEN_IGNORE``
* **replica** one of the ``aerospike.POLICY_REPLICA_*`` values such as :data:`aerospike.POLICY_REPLICA_MASTER`
| Default: ``aerospike.POLICY_REPLICA_SEQUENCE``
* **commit_level** one of the ``aerospike.POLICY_COMMIT_LEVEL_*`` values such as :data:`aerospike.POLICY_COMMIT_LEVEL_ALL`
| Default: ``aerospike.POLICY_COMMIT_LEVEL_ALL``
* **consistency_level** one of the ``aerospike.POLICY_CONSISTENCY_*`` values such as :data:`aerospike.POLICY_CONSISTENCY_ONE`
* **durable_delete** boolean value: True to perform durable delete (requires Enterprise server version >= 3.10)
| Default: ``aerospike.POLICY_CONSISTENCY_ONE``
* **exists** one of the ``aerospike.POLICY_EXISTS_*`` values such as :data:`aerospike.POLICY_EXISTS_CREATE`
| Default: ```aerospike.POLICY_GEN_IGNORE``
* **durable_delete** boolean value: True to perform durable delete (requires Enterprise server version >= 3.10) Default: ``False``
.. _aerospike_apply_policies:
Expand Down Expand Up @@ -2810,8 +2825,15 @@ Apply Policies
| Force reads to be linearized for server namespaces that support CP mode. Setting this policy to ``True`` requires an Enterprise server with version 4.0.0 or greater.
| Default: ``False``
* **key** one of the ``aerospike.POLICY_KEY_*`` values such as :data:`aerospike.POLICY_KEY_DIGEST`
| Default: ``aerospike.POLICY_KEY_DIGEST``
* **replica** one of the ``aerospike.POLICY_REPLICA_*`` values such as :data:`aerospike.POLICY_REPLICA_MASTER`
| Default: ``aerospike.POLICY_REPLICA_SEQUENCE``
* **gen** one of the ``aerospike.POLICY_GEN_*`` values such as :data:`aerospike.POLICY_GEN_IGNORE`
| Default: ``aerospike.POLICY_GEN_IGNORE``
* **commit_level** one of the ``aerospike.POLICY_COMMIT_LEVEL_*`` values such as :data:`aerospike.POLICY_COMMIT_LEVEL_ALL`
| Default: ``aerospike.POLICY_COMMIT_LEVEL_ALL``
* **durable_delete** boolean value: True to perform durable delete (requires Enterprise server version >= 3.10)
| Default: ``False``
.. _aerospike_remove_policies:
Expand Down Expand Up @@ -2853,10 +2875,14 @@ Remove Policies
|
| Default: ``1000``
* **key** one of the ``aerospike.POLICY_KEY_*`` values such as :data:`aerospike.POLICY_KEY_DIGEST`
| Default: ``aerospike.POLICY_KEY_DIGEST``
* **commit_level** one of the ``aerospike.POLICY_COMMIT_LEVEL_*`` values such as :data:`aerospike.POLICY_COMMIT_LEVEL_ALL`
| Default: ``aerospike.POLICY_COMMIT_LEVEL_ALL``
* **gen** one of the ``aerospike.POLICY_GEN_*`` values such as :data:`aerospike.POLICY_GEN_IGNORE`
* **max_retries** integer, number of times to retry the operation if it fails due to netowrk error. Default `2`
* **durable_delete** boolean value: True to perform durable delete (requires Enterprise server version >= 3.10)
| Default: ``aerospike.POLICY_GEN_IGNORE``
* **durable_delete** boolean value: True to perform durable delete (requires Enterprise server version >= 3.10) Default: ``False``
* **replica** one of the ``aerospike.POLICY_REPLICA_*`` values such as :data:`aerospike.POLICY_REPLICA_MASTER`
| Default: ``aerospike.POLICY_REPLICA_SEQUENCE``
.. _aerospike_batch_policies:
Expand Down Expand Up @@ -2906,6 +2932,7 @@ Batch Policies
| Force reads to be linearized for server namespaces that support CP mode. Setting this policy to ``True`` requires an Enterprise server with version 4.0.0 or greater.
| Default: ``False``
* **consistency_level** one of the ``aerospike.POLICY_CONSISTENCY_*`` values such as :data:`aerospike.POLICY_CONSISTENCY_ONE`
| Default: ``aerospike.POLICY_CONSISTENCY_ONE``
* **concurrent** :class:`bool` Determine if batch commands to each server are run in parallel threads. Default `False`
* **allow_inline** :class:`bool` . Allow batch to be processed immediately in the server's receiving thread when the server deems it to be appropriate. If `False`, the batch will always be processed in separate transaction threads. This field is only relevant for the new batch index protocol. Default `True`.
* **send_set_name** :class:`bool` Send set name field to server for every key in the batch for batch index protocol. This is only necessary when authentication is enabled and security roles are defined on a per set basis. Default: `False`
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def run(self):
os.environ['ARCHFLAGS'] = '-arch x86_64'
AEROSPIKE_C_VERSION = os.getenv('AEROSPIKE_C_VERSION')
if not AEROSPIKE_C_VERSION:
AEROSPIKE_C_VERSION = '4.3.5'
AEROSPIKE_C_VERSION = '4.3.6'
DOWNLOAD_C_CLIENT = os.getenv('DOWNLOAD_C_CLIENT')
AEROSPIKE_C_HOME = os.getenv('AEROSPIKE_C_HOME')
PREFIX = None
Expand Down
2 changes: 1 addition & 1 deletion src/main/aerospike.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ AerospikeConstants operator_constants[] = {
MOD_INIT(aerospike)
{

const char version[8] = "3.0.2";
const char version[8] = "3.1.0";
// Makes things "thread-safe"
PyEval_InitThreads();
int i = 0;
Expand Down
1 change: 1 addition & 0 deletions src/main/policy.c
Original file line number Diff line number Diff line change
Expand Up @@ -655,6 +655,7 @@ as_status pyobject_to_policy_operate(as_error * err, PyObject * py_policy,
POLICY_SET_FIELD(durable_delete, bool);
POLICY_SET_FIELD(deserialize, bool);
POLICY_SET_FIELD(linearize_read, bool);
POLICY_SET_FIELD(exists, as_policy_exists);

// Update the policy
POLICY_UPDATE();
Expand Down

0 comments on commit 239d2c9

Please sign in to comment.