Cache Properties¶
The prop_codes
module contains a list of ordinal
values, that represent various cache settings.
Please refer to the Configuring Caches documentation on cache synchronization, rebalance, affinity and other cache configuration-related matters.
Property name | Ordinal value | Property type | Description |
---|---|---|---|
Read/write cache properties, used to configure cache via create_cache() or
get_or_create_cache() of Client
(create_cache() or
get_or_create_cache() of AioClient ). |
|||
PROP_NAME | 0 | str | Cache name. This is the only required property. |
PROP_CACHE_MODE | 1 | int | Cache mode: LOCAL=0, REPLICATED=1, PARTITIONED=2 |
PROP_CACHE_ATOMICITY_MODE | 2 | int | Cache atomicity mode: TRANSACTIONAL=0, ATOMIC=1 |
PROP_BACKUPS_NUMBER | 3 | int | Number of backups |
PROP_WRITE_SYNCHRONIZATION_MODE | 4 | int | Write synchronization mode: FULL_SYNC=0, FULL_ASYNC=1, PRIMARY_SYNC=2 |
PROP_COPY_ON_READ | 5 | bool | Copy-on-read |
PROP_READ_FROM_BACKUP | 6 | bool | Read from backup |
PROP_DATA_REGION_NAME | 100 | str | Data region name |
PROP_IS_ONHEAP_CACHE_ENABLED | 101 | bool | Is OnHeap cache enabled? |
PROP_QUERY_ENTITIES | 200 | list | A list of query entities (see Query entity) |
PROP_QUERY_PARALLELISM | 201 | int | Query parallelism |
PROP_QUERY_DETAIL_METRIC_SIZE | 202 | int | Query detail metric size |
PROP_SQL_SCHEMA | 203 | str | SQL schema |
PROP_SQL_INDEX_INLINE_MAX_SIZE | 204 | int | SQL index inline maximum size |
PROP_SQL_ESCAPE_ALL | 205 | bool | Turns on SQL escapes |
PROP_MAX_QUERY_ITERATORS | 206 | int | Maximum number of query iterators |
PROP_REBALANCE_MODE | 300 | int | Rebalance mode: SYNC=0, ASYNC=1, NONE=2 |
PROP_REBALANCE_DELAY | 301 | int | Rebalance delay (ms) |
PROP_REBALANCE_TIMEOUT | 302 | int | Rebalance timeout (ms) |
PROP_REBALANCE_BATCH_SIZE | 303 | int | Rebalance batch size |
PROP_REBALANCE_BATCHES_PREFETCH_COUNT | 304 | int | Rebalance batches prefetch count |
PROP_REBALANCE_ORDER | 305 | int | Rebalance order |
PROP_REBALANCE_THROTTLE | 306 | int | Rebalance throttle (ms) |
PROP_GROUP_NAME | 400 | str | Group name |
PROP_CACHE_KEY_CONFIGURATION | 401 | list | Cache key configuration (see Cache key) |
PROP_DEFAULT_LOCK_TIMEOUT | 402 | int | Default lock timeout (ms) |
PROP_MAX_CONCURRENT_ASYNC_OPERATIONS | 403 | int | Maximum number of concurrent asynchronous operations |
PROP_PARTITION_LOSS_POLICY | 404 | int | Partition loss policy: READ_ONLY_SAFE=0, READ_ONLY_ALL=1, READ_WRITE_SAFE=2, READ_WRITE_ALL=3, IGNORE=4 |
PROP_EAGER_TTL | 405 | bool | Eager TTL |
PROP_STATISTICS_ENABLED | 406 | bool | Statistics enabled |
PROP_EXPIRY_POLICY | 407 | ExpiryPolicy |
Set expiry policy (see Expiry policy) |
Query entity¶
A dict with all ot the following keys:
- table_name: SQL table name,
- key_field_name: name of the key field,
- key_type_name: name of the key type (Java type or complex object),
- value_field_name: name of the value field,
- value_type_name: name of the value type,
- field_name_aliases: a list of 0 or more dicts of aliases (see Field name alias),
- query_fields: a list of 0 or more query field names (see Query field),
- query_indexes: a list of 0 or more query indexes (see Query index).
Field name alias¶
- field_name: field name,
- alias: alias (str).
Query field¶
- name: field name,
- type_name: name of Java type or complex object,
- is_key_field: (optional) boolean value, False by default,
- is_notnull_constraint_field: boolean value,
- default_value: (optional) anything that can be converted to type_name
type. None (
Null
) by default, - precision − (optional) decimal precision: total number of digits in decimal value. Defaults to -1 (use cluster default). Ignored for non-decimal SQL types (other than java.math.BigDecimal),
- scale − (optional) decimal precision: number of digits after the decimal point. Defaults to -1 (use cluster default). Ignored for non-decimal SQL types.
Query index¶
- index_name: index name,
- index_type: index type code as an integer value in unsigned byte range,
- inline_size: integer value,
- fields: a list of 0 or more indexed fields (see Fields).
Fields¶
- name: field name,
- is_descending: (optional) boolean value, False by default.
Cache key¶
A dict of the following format:
- type_name: name of the complex object,
- affinity_key_field_name: name of the affinity key field.
Expiry policy¶
Set expiry policy to cache (see ExpiryPolicy
). If set to None,
expiry policy will not be set.