Skip to main content
Version: 0.10.10

Constants

import aerospike_py as aerospike

Policy

Key

ConstantValueDescription
POLICY_KEY_DIGEST0Store only the digest (default)
POLICY_KEY_SEND1Send and store the key

Exists

ConstantValueDescription
POLICY_EXISTS_IGNORE0Write regardless; create or update (default)
POLICY_EXISTS_UPDATE1Alias of POLICY_EXISTS_UPDATE_ONLY
POLICY_EXISTS_UPDATE_ONLY1Update only; fail if the record does not exist
POLICY_EXISTS_REPLACE2Replace all bins; create or update
POLICY_EXISTS_REPLACE_ONLY3Replace only; fail if the record does not exist
POLICY_EXISTS_CREATE_ONLY4Create only; fail if the record exists

Generation

ConstantValueDescription
POLICY_GEN_IGNORE0Ignore generation (default)
POLICY_GEN_EQ1Write only if gen matches
POLICY_GEN_GT2Write only if gen is greater

Replica

ConstantValueDescription
POLICY_REPLICA_MASTER0Read from master
POLICY_REPLICA_SEQUENCE1Round-robin (default)
POLICY_REPLICA_PREFER_RACK2Prefer rack-local

Commit Level

ConstantValueDescription
POLICY_COMMIT_LEVEL_ALL0Wait for all replicas
POLICY_COMMIT_LEVEL_MASTER1Master only

Read Mode AP

ConstantValueDescription
POLICY_READ_MODE_AP_ONE0Read from one node
POLICY_READ_MODE_AP_ALL1Read from all nodes

Batch Concurrency

Controls how a batch request fans out across cluster nodes. Used as the concurrency key on BatchPolicy. Other integer values raise ValueError at parse time. (aerospike-core 2.0 has no MaxThreads(n) variant.)

ConstantValueDescription
BATCH_CONCURRENCY_SEQUENTIAL0Send the per-node sub-requests one at a time. Lower peak load, higher latency.
BATCH_CONCURRENCY_PARALLEL1Default. Send all per-node sub-requests in parallel.

Read Touch TTL Percent

Special values for the read_touch_ttl_percent policy key (server v8+). Integers 1–100 are interpreted as a percentage; the constants below are the special-meaning sentinels.

ConstantValueDescription
READ_TOUCH_TTL_PERCENT_SERVER_DEFAULT0Use the namespace's default-read-touch-ttl-pct
READ_TOUCH_TTL_PERCENT_DONT_RESET-1Never reset TTL on reads

Query Duration

Hint to the server about the expected duration of a query. Used as the expected_duration key on QueryPolicy.

ConstantValueDescription
QUERY_DURATION_LONG0Default. Long-running query with many records per node.
QUERY_DURATION_SHORT1Low-latency query with few records per node (server 6.0+).
QUERY_DURATION_LONG_RELAX_AP2Long query with relaxed AP consistency (server 7.1+).

TTL

ConstantValueDescription
TTL_NAMESPACE_DEFAULT0Use namespace default
TTL_NEVER_EXPIRE-1Never expire
TTL_DONT_UPDATE-2Don't update TTL on write
TTL_CLIENT_DEFAULT-3Use client default

Auth Mode

ConstantValueDescription
AUTH_INTERNAL0Internal authentication
AUTH_EXTERNAL1External (LDAP)
AUTH_PKI2PKI authentication

Operators

Used with operate() and batch_operate().

ConstantValueDescription
OPERATOR_READ1Read a bin
OPERATOR_WRITE2Write a bin
OPERATOR_INCR5Increment int/float bin
OPERATOR_APPEND9Append to string bin
OPERATOR_PREPEND10Prepend to string bin
OPERATOR_TOUCH11Reset record TTL
OPERATOR_DELETE14Delete the record

Index Type

ConstantValueDescription
INDEX_NUMERIC0Numeric
INDEX_STRING1String
INDEX_BLOB2Blob
INDEX_GEO2DSPHERE3Geospatial

Index Collection Type

ConstantValueDescription
INDEX_TYPE_DEFAULT0Scalar (default)
INDEX_TYPE_LIST1List elements
INDEX_TYPE_MAPKEYS2Map keys
INDEX_TYPE_MAPVALUES3Map values

Log Level

ConstantValueDescription
LOG_LEVEL_OFF-1Disabled
LOG_LEVEL_ERROR0Error only
LOG_LEVEL_WARN1Warnings+
LOG_LEVEL_INFO2Info+
LOG_LEVEL_DEBUG3Debug+
LOG_LEVEL_TRACE4All

Serializer

ConstantValueDescription
SERIALIZER_NONE0No serialization
SERIALIZER_PYTHON1Python pickle
SERIALIZER_USER2User-defined

List CDT

Return Type

ConstantDescription
LIST_RETURN_NONENo return
LIST_RETURN_INDEXIndex
LIST_RETURN_REVERSE_INDEXReverse index
LIST_RETURN_RANKRank
LIST_RETURN_REVERSE_RANKReverse rank
LIST_RETURN_COUNTCount
LIST_RETURN_VALUEValue
LIST_RETURN_EXISTSBoolean

Order

ConstantDescription
LIST_UNORDEREDUnordered (default)
LIST_ORDEREDOrdered

Sort Flags

ConstantDescription
LIST_SORT_DEFAULTDefault sort
LIST_SORT_DROP_DUPLICATESDrop duplicates

Write Flags

ConstantDescription
LIST_WRITE_DEFAULTDefault
LIST_WRITE_ADD_UNIQUEUnique values only
LIST_WRITE_INSERT_BOUNDEDEnforce boundaries
LIST_WRITE_NO_FAILNo-fail on violation
LIST_WRITE_PARTIALAllow partial success

Map CDT

Return Type

ConstantDescription
MAP_RETURN_NONENo return
MAP_RETURN_INDEXIndex
MAP_RETURN_REVERSE_INDEXReverse index
MAP_RETURN_RANKRank
MAP_RETURN_REVERSE_RANKReverse rank
MAP_RETURN_COUNTCount
MAP_RETURN_KEYKey
MAP_RETURN_VALUEValue
MAP_RETURN_KEY_VALUEKey-value pair
MAP_RETURN_EXISTSBoolean

Order

ConstantDescription
MAP_UNORDEREDUnordered (default)
MAP_KEY_ORDEREDKey-ordered
MAP_KEY_VALUE_ORDEREDKey-value ordered

Write Flags

ConstantDescription
MAP_WRITE_FLAGS_DEFAULTDefault
MAP_WRITE_FLAGS_CREATE_ONLYCreate only
MAP_WRITE_FLAGS_UPDATE_ONLYUpdate only
MAP_WRITE_FLAGS_NO_FAILNo-fail
MAP_WRITE_FLAGS_PARTIALPartial success
MAP_UPDATEUpdate map
MAP_UPDATE_ONLYUpdate existing only
MAP_CREATE_ONLYCreate new only

Bit / HLL Write Flags

ConstantDescription
BIT_WRITE_DEFAULTDefault
BIT_WRITE_CREATE_ONLYCreate only
BIT_WRITE_UPDATE_ONLYUpdate only
BIT_WRITE_NO_FAILNo-fail
BIT_WRITE_PARTIALPartial
HLL_WRITE_DEFAULTDefault
HLL_WRITE_CREATE_ONLYCreate only
HLL_WRITE_UPDATE_ONLYUpdate only
HLL_WRITE_NO_FAILNo-fail
HLL_WRITE_ALLOW_FOLDAllow fold

Privilege Codes

Privilege.code accepts either the int constant or the canonical string name (case-insensitive; _ is a synonym for -).

ConstantNameDescription
PRIV_READ"read"Read
PRIV_WRITE"write"Write
PRIV_READ_WRITE"read-write"Read-write
PRIV_READ_WRITE_UDF"read-write-udf"Read-write-UDF
PRIV_SYS_ADMIN"sys-admin"System admin
PRIV_USER_ADMIN"user-admin"User admin
PRIV_DATA_ADMIN"data-admin"Data admin
PRIV_UDF_ADMIN"udf-admin"UDF admin
PRIV_SINDEX_ADMIN"sindex-admin"Secondary index admin
PRIV_TRUNCATE"truncate"Truncate

Status Codes

ConstantDescription
AEROSPIKE_OKSuccess
AEROSPIKE_ERR_SERVERServer error
AEROSPIKE_ERR_RECORD_NOT_FOUNDRecord not found
AEROSPIKE_ERR_RECORD_GENERATIONGeneration mismatch
AEROSPIKE_ERR_PARAMInvalid parameter
AEROSPIKE_ERR_RECORD_EXISTSRecord exists
AEROSPIKE_ERR_BIN_EXISTSBin exists
AEROSPIKE_ERR_TIMEOUTTimeout
AEROSPIKE_ERR_BIN_TYPEBin type mismatch
AEROSPIKE_ERR_RECORD_TOO_BIGRecord too big
AEROSPIKE_ERR_BIN_NOT_FOUNDBin not found
AEROSPIKE_ERR_INVALID_NAMESPACEInvalid namespace
AEROSPIKE_ERR_BIN_NAMEInvalid bin name
AEROSPIKE_ERR_FILTERED_OUTFiltered out
AEROSPIKE_ERR_UDFUDF error
AEROSPIKE_ERR_INDEX_FOUNDIndex exists
AEROSPIKE_ERR_INDEX_NOT_FOUNDIndex not found
AEROSPIKE_ERR_QUERY_ABORTEDQuery aborted
AEROSPIKE_ERR_CLIENTClient error
AEROSPIKE_ERR_CONNECTIONConnection error
AEROSPIKE_ERR_CLUSTERCluster error
AEROSPIKE_ERR_INVALID_HOSTInvalid host
AEROSPIKE_ERR_NO_MORE_CONNECTIONSNo connections

See __init__.pyi for the complete list.