pygridgain.datatypes package¶
Submodules¶
pygridgain.datatypes.base module¶
-
class
pygridgain.datatypes.base.
GridGainDataType
¶ Bases:
object
This is a base class for all GridGain data types, a.k.a. parser/constructor classes, both object and payload varieties.
-
class
pygridgain.datatypes.base.
GridGainDataTypeMeta
¶ Bases:
type
,pygridgain.datatypes.base.GridGainDataTypeProps
Class variant of Ignate data type properties.
pygridgain.datatypes.binary module¶
pygridgain.datatypes.cache_config module¶
-
class
pygridgain.datatypes.cache_config.
CacheMode
¶ Bases:
pygridgain.datatypes.primitive.Int
-
LOCAL
= 0¶
-
PARTITIONED
= 2¶
-
REPLICATED
= 1¶
-
-
class
pygridgain.datatypes.cache_config.
PartitionLossPolicy
¶ Bases:
pygridgain.datatypes.primitive.Int
-
IGNORE
= 4¶
-
READ_ONLY_ALL
= 1¶
-
READ_ONLY_SAFE
= 0¶
-
READ_WRITE_ALL
= 3¶
-
READ_WRITE_SAFE
= 2¶
-
-
class
pygridgain.datatypes.cache_config.
RebalanceMode
¶ Bases:
pygridgain.datatypes.primitive.Int
-
ASYNC
= 1¶
-
NONE
= 2¶
-
SYNC
= 0¶
-
-
class
pygridgain.datatypes.cache_config.
WriteSynchronizationMode
¶ Bases:
pygridgain.datatypes.primitive.Int
-
FULL_ASYNC
= 1¶
-
FULL_SYNC
= 0¶
-
PRIMARY_SYNC
= 2¶
-
-
class
pygridgain.datatypes.cache_config.
IndexType
¶ Bases:
pygridgain.datatypes.primitive.Byte
-
FULLTEXT
= 1¶
-
GEOSPATIAL
= 2¶
-
SORTED
= 0¶
-
pygridgain.datatypes.cache_properties module¶
-
class
pygridgain.datatypes.cache_properties.
PropName
¶ Bases:
pygridgain.datatypes.cache_properties.PropBase
-
prop_code
= 0¶
-
prop_data_class
¶ alias of
pygridgain.datatypes.standard.String
-
-
class
pygridgain.datatypes.cache_properties.
PropCacheMode
¶ Bases:
pygridgain.datatypes.cache_properties.PropBase
-
prop_code
= 1¶
-
prop_data_class
¶
-
-
class
pygridgain.datatypes.cache_properties.
PropCacheAtomicityMode
¶ Bases:
pygridgain.datatypes.cache_properties.PropBase
-
prop_code
= 2¶
-
prop_data_class
¶ alias of
pygridgain.datatypes.cache_config.CacheAtomicityMode
-
-
class
pygridgain.datatypes.cache_properties.
PropBackupsNumber
¶ Bases:
pygridgain.datatypes.cache_properties.PropBase
-
prop_code
= 3¶
-
prop_data_class
¶ alias of
pygridgain.datatypes.primitive.Int
-
-
class
pygridgain.datatypes.cache_properties.
PropWriteSynchronizationMode
¶ Bases:
pygridgain.datatypes.cache_properties.PropBase
-
prop_code
= 4¶
-
prop_data_class
¶ alias of
pygridgain.datatypes.cache_config.WriteSynchronizationMode
-
-
class
pygridgain.datatypes.cache_properties.
PropCopyOnRead
¶ Bases:
pygridgain.datatypes.cache_properties.PropBase
-
prop_code
= 5¶
-
prop_data_class
¶ alias of
pygridgain.datatypes.primitive.Bool
-
-
class
pygridgain.datatypes.cache_properties.
PropReadFromBackup
¶ Bases:
pygridgain.datatypes.cache_properties.PropBase
-
prop_code
= 6¶
-
prop_data_class
¶ alias of
pygridgain.datatypes.primitive.Bool
-
-
class
pygridgain.datatypes.cache_properties.
PropDataRegionName
¶ Bases:
pygridgain.datatypes.cache_properties.PropBase
-
prop_code
= 100¶
-
prop_data_class
¶ alias of
pygridgain.datatypes.standard.String
-
-
class
pygridgain.datatypes.cache_properties.
PropIsOnheapCacheEnabled
¶ Bases:
pygridgain.datatypes.cache_properties.PropBase
-
prop_code
= 101¶
-
prop_data_class
¶ alias of
pygridgain.datatypes.primitive.Bool
-
-
class
pygridgain.datatypes.cache_properties.
PropQueryEntities
¶ Bases:
pygridgain.datatypes.cache_properties.PropBase
-
prop_code
= 200¶
-
prop_data_class
= StructArray(following=[('key_type_name', <class 'pygridgain.datatypes.standard.String'>), ('value_type_name', <class 'pygridgain.datatypes.standard.String'>), ('table_name', <class 'pygridgain.datatypes.standard.String'>), ('key_field_name', <class 'pygridgain.datatypes.standard.String'>), ('value_field_name', <class 'pygridgain.datatypes.standard.String'>), ('query_fields', StructArray(following=[('name', <class 'pygridgain.datatypes.standard.String'>), ('type_name', <class 'pygridgain.datatypes.standard.String'>), ('is_key_field', <class 'pygridgain.datatypes.primitive.Bool'>), ('is_notnull_constraint_field', <class 'pygridgain.datatypes.primitive.Bool'>), ('default_value', <class 'pygridgain.datatypes.internal.AnyDataObject'>), ('precision', <class 'pygridgain.datatypes.primitive.Int'>), ('scale', <class 'pygridgain.datatypes.primitive.Int'>)], counter_type=<class 'ctypes.c_int'>, defaults={'is_key_field': False, 'is_notnull_constraint_field': False, 'default_value': None, 'precision': -1, 'scale': -1})), ('field_name_aliases', StructArray(following=[('field_name', <class 'pygridgain.datatypes.standard.String'>), ('alias', <class 'pygridgain.datatypes.standard.String'>)], counter_type=<class 'ctypes.c_int'>, defaults={})), ('query_indexes', StructArray(following=[('index_name', <class 'pygridgain.datatypes.standard.String'>), ('index_type', <class 'pygridgain.datatypes.cache_config.IndexType'>), ('inline_size', <class 'pygridgain.datatypes.primitive.Int'>), ('fields', StructArray(following=[('name', <class 'pygridgain.datatypes.standard.String'>), ('is_descending', <class 'pygridgain.datatypes.primitive.Bool'>)], counter_type=<class 'ctypes.c_int'>, defaults={'is_descending': False}))], counter_type=<class 'ctypes.c_int'>, defaults={}))], counter_type=<class 'ctypes.c_int'>, defaults={})¶
-
-
class
pygridgain.datatypes.cache_properties.
PropQueryParallelism
¶ Bases:
pygridgain.datatypes.cache_properties.PropBase
-
prop_code
= 201¶
-
prop_data_class
¶ alias of
pygridgain.datatypes.primitive.Int
-
-
class
pygridgain.datatypes.cache_properties.
PropQueryDetailMetricSize
¶ Bases:
pygridgain.datatypes.cache_properties.PropBase
-
prop_code
= 202¶
-
prop_data_class
¶ alias of
pygridgain.datatypes.primitive.Int
-
-
class
pygridgain.datatypes.cache_properties.
PropSQLSchema
¶ Bases:
pygridgain.datatypes.cache_properties.PropBase
-
prop_code
= 203¶
-
prop_data_class
¶ alias of
pygridgain.datatypes.standard.String
-
-
class
pygridgain.datatypes.cache_properties.
PropSQLIndexInlineMaxSize
¶ Bases:
pygridgain.datatypes.cache_properties.PropBase
-
prop_code
= 204¶
-
prop_data_class
¶ alias of
pygridgain.datatypes.primitive.Int
-
-
class
pygridgain.datatypes.cache_properties.
PropSqlEscapeAll
¶ Bases:
pygridgain.datatypes.cache_properties.PropBase
-
prop_code
= 205¶
-
prop_data_class
¶ alias of
pygridgain.datatypes.primitive.Bool
-
-
class
pygridgain.datatypes.cache_properties.
PropMaxQueryIterators
¶ Bases:
pygridgain.datatypes.cache_properties.PropBase
-
prop_code
= 206¶
-
prop_data_class
¶ alias of
pygridgain.datatypes.primitive.Int
-
-
class
pygridgain.datatypes.cache_properties.
PropRebalanceMode
¶ Bases:
pygridgain.datatypes.cache_properties.PropBase
-
prop_code
= 300¶
-
prop_data_class
¶
-
-
class
pygridgain.datatypes.cache_properties.
PropRebalanceDelay
¶ Bases:
pygridgain.datatypes.cache_properties.PropBase
-
prop_code
= 301¶
-
prop_data_class
¶ alias of
pygridgain.datatypes.primitive.Long
-
-
class
pygridgain.datatypes.cache_properties.
PropRebalanceTimeout
¶ Bases:
pygridgain.datatypes.cache_properties.PropBase
-
prop_code
= 302¶
-
prop_data_class
¶ alias of
pygridgain.datatypes.primitive.Long
-
-
class
pygridgain.datatypes.cache_properties.
PropRebalanceBatchSize
¶ Bases:
pygridgain.datatypes.cache_properties.PropBase
-
prop_code
= 303¶
-
prop_data_class
¶ alias of
pygridgain.datatypes.primitive.Int
-
-
class
pygridgain.datatypes.cache_properties.
PropRebalanceBatchesPrefetchCount
¶ Bases:
pygridgain.datatypes.cache_properties.PropBase
-
prop_code
= 304¶
-
prop_data_class
¶ alias of
pygridgain.datatypes.primitive.Long
-
-
class
pygridgain.datatypes.cache_properties.
PropRebalanceOrder
¶ Bases:
pygridgain.datatypes.cache_properties.PropBase
-
prop_code
= 305¶
-
prop_data_class
¶ alias of
pygridgain.datatypes.primitive.Int
-
-
class
pygridgain.datatypes.cache_properties.
PropRebalanceThrottle
¶ Bases:
pygridgain.datatypes.cache_properties.PropBase
-
prop_code
= 306¶
-
prop_data_class
¶ alias of
pygridgain.datatypes.primitive.Long
-
-
class
pygridgain.datatypes.cache_properties.
PropGroupName
¶ Bases:
pygridgain.datatypes.cache_properties.PropBase
-
prop_code
= 400¶
-
prop_data_class
¶ alias of
pygridgain.datatypes.standard.String
-
-
class
pygridgain.datatypes.cache_properties.
PropCacheKeyConfiguration
¶ Bases:
pygridgain.datatypes.cache_properties.PropBase
-
prop_code
= 401¶
-
prop_data_class
= StructArray(following=[('type_name', <class 'pygridgain.datatypes.standard.String'>), ('affinity_key_field_name', <class 'pygridgain.datatypes.standard.String'>)], counter_type=<class 'ctypes.c_int'>, defaults={})¶
-
-
class
pygridgain.datatypes.cache_properties.
PropDefaultLockTimeout
¶ Bases:
pygridgain.datatypes.cache_properties.PropBase
-
prop_code
= 402¶
-
prop_data_class
¶ alias of
pygridgain.datatypes.primitive.Long
-
-
class
pygridgain.datatypes.cache_properties.
PropMaxConcurrentAsyncOperation
¶ Bases:
pygridgain.datatypes.cache_properties.PropBase
-
prop_code
= 403¶
-
prop_data_class
¶ alias of
pygridgain.datatypes.primitive.Int
-
-
class
pygridgain.datatypes.cache_properties.
PropPartitionLossPolicy
¶ Bases:
pygridgain.datatypes.cache_properties.PropBase
-
prop_code
= 404¶
-
prop_data_class
¶ alias of
pygridgain.datatypes.cache_config.PartitionLossPolicy
-
-
class
pygridgain.datatypes.cache_properties.
PropEagerTTL
¶ Bases:
pygridgain.datatypes.cache_properties.PropBase
-
prop_code
= 405¶
-
prop_data_class
¶ alias of
pygridgain.datatypes.primitive.Bool
-
-
class
pygridgain.datatypes.cache_properties.
PropStatisticsEnabled
¶ Bases:
pygridgain.datatypes.cache_properties.PropBase
-
prop_code
= 406¶
-
prop_data_class
¶ alias of
pygridgain.datatypes.primitive.Bool
-
-
pygridgain.datatypes.cache_properties.
prop_map
(code: int)¶
pygridgain.datatypes.complex module¶
-
class
pygridgain.datatypes.complex.
Map
¶ Bases:
pygridgain.datatypes.base.GridGainDataType
Dictionary type, payload-only.
Keys and values in map are independent data objects, but count counts pairs. Very annoying.
-
HASH_MAP
= 1¶
-
LINKED_HASH_MAP
= 2¶
-
classmethod
build_header
()¶
-
classmethod
from_python
(value, type_id=None)¶
-
static
hashcode
(value: Dict[KT, VT]) → int¶
-
classmethod
parse
(client: Client)¶
-
classmethod
to_python
(ctype_object, *args, **kwargs)¶
-
-
class
pygridgain.datatypes.complex.
ObjectArrayObject
¶ Bases:
pygridgain.datatypes.base.GridGainDataType
Array of GridGain objects of any consistent type. Its Python representation is tuple(type_id, iterable of any type). The only type ID that makes sense in Python client is
OBJECT
, that corresponds directly to the root object type in Java type hierarchy (java.lang.Object).-
OBJECT
= -1¶
-
classmethod
build_header
()¶
-
classmethod
from_python
(value)¶
-
static
hashcode
(value: Iterable[T_co]) → int¶
-
classmethod
parse
(client: Client)¶
-
classmethod
to_python
(ctype_object, *args, **kwargs)¶
-
type_code
= b'\x17'¶
-
-
class
pygridgain.datatypes.complex.
CollectionObject
¶ Bases:
pygridgain.datatypes.base.GridGainDataType
Similar to object array, but contains platform-agnostic deserialization type hint instead of type ID.
Represented as tuple(hint, iterable of any type) in Python. Hints are:
USER_SET
− a set of unique GridGain thin data objects. The exact Java type of a set is undefined,USER_COL
− a collection of GridGain thin data objects. The exact Java type of a collection is undefined,ARR_LIST
− represents the java.util.ArrayList type,LINKED_LIST
− represents the java.util.LinkedList type,HashSet
type,LINKED_HASH_SET
− represents the java.util.LinkedHashSet type,SINGLETON_LIST
− represents the return type of the java.util.Collection.singletonList method.
It is safe to say that USER_SET (set in Python) and USER_COL (list) can cover all the imaginable use cases from Python perspective.
-
ARR_LIST
= 1¶
-
HASH_SET
= 3¶
-
LINKED_HASH_SET
= 4¶
-
LINKED_LIST
= 2¶
-
SINGLETON_LIST
= 5¶
-
USER_COL
= 0¶
-
USER_SET
= -1¶
-
classmethod
build_header
()¶
-
default
= []¶
-
classmethod
from_python
(value)¶
-
static
hashcode
(value: Iterable[T_co]) → int¶
-
classmethod
parse
(client: Client)¶
-
pythonic
¶ alias of
builtins.list
-
classmethod
to_python
(ctype_object, *args, **kwargs)¶
-
type_code
= b'\x18'¶
-
class
pygridgain.datatypes.complex.
MapObject
¶ Bases:
pygridgain.datatypes.complex.Map
This is a dictionary type.
Represented as tuple(type_id, value).
Type ID can be a
HASH_MAP
(corresponds to an ordinary dict in Python) or aLINKED_HASH_MAP
(collections.OrderedDict).-
classmethod
build_header
()¶
-
default
= {}¶
-
classmethod
from_python
(value)¶
-
pythonic
¶ alias of
builtins.dict
-
classmethod
to_python
(ctype_object, *args, **kwargs)¶
-
type_code
= b'\x19'¶
-
classmethod
-
class
pygridgain.datatypes.complex.
WrappedDataObject
¶ Bases:
pygridgain.datatypes.base.GridGainDataType
One or more binary objects can be wrapped in an array. This allows reading, storing, passing and writing objects efficiently without understanding their contents, performing simple byte copy.
Python representation: tuple(payload: bytes, offset: integer). Offset points to the root object of the array.
-
classmethod
build_header
()¶
-
classmethod
from_python
(value)¶
-
classmethod
parse
(client: Client)¶
-
classmethod
to_python
(ctype_object, *args, **kwargs)¶
-
type_code
= b'\x1b'¶
-
classmethod
-
class
pygridgain.datatypes.complex.
BinaryObject
¶ Bases:
pygridgain.datatypes.base.GridGainDataType
-
COMPACT_FOOTER
= 32¶
-
HAS_RAW_DATA
= 4¶
-
HAS_SCHEMA
= 2¶
-
OFFSET_ONE_BYTE
= 8¶
-
OFFSET_TWO_BYTES
= 16¶
-
USER_TYPE
= 1¶
-
classmethod
build_header
()¶
-
static
find_client
()¶ A nice hack. Extracts the nearest Client instance from the call stack.
-
classmethod
from_python
(value: object)¶
-
static
get_dataclass
(conn: Connection, header) → collections.OrderedDict¶
-
static
hashcode
(value: object, client: Client = None, *args, **kwargs) → int¶
-
classmethod
offset_c_type
(flags: int)¶
-
classmethod
parse
(client: Client)¶
-
classmethod
schema_type
(flags: int)¶
-
classmethod
to_python
(ctype_object, client: Client = None, *args, **kwargs)¶
-
type_code
= b'g'¶
-
pygridgain.datatypes.internal module¶
-
class
pygridgain.datatypes.internal.
AnyDataArray
(counter_type=<class 'ctypes.c_int'>)¶ Bases:
pygridgain.datatypes.internal.AnyDataObject
Sequence of AnyDataObjects, payload-only.
-
__init__
(counter_type=<class 'ctypes.c_int'>) → None¶ Initialize self. See help(type(self)) for accurate signature.
-
build_header
()¶
-
from_python
(value)¶
-
parse
(client: Client)¶
-
classmethod
to_python
(ctype_object, *args, **kwargs)¶
-
-
class
pygridgain.datatypes.internal.
AnyDataObject
¶ Bases:
object
Not an actual GridGain type, but contains a guesswork on serializing Python data or parsing an unknown GridGain data object.
-
classmethod
from_python
(value)¶
-
static
get_subtype
(iterable, allow_none=False)¶
-
classmethod
map_python_type
(value)¶
-
classmethod
parse
(client: Client)¶
-
classmethod
to_python
(ctype_object, *args, **kwargs)¶
-
classmethod
-
class
pygridgain.datatypes.internal.
Struct
(fields: list, dict_type=<class 'collections.OrderedDict'>, defaults: dict = {})¶ Bases:
object
Sequence of fields, including variable-sized and nested.
-
__init__
(fields: list, dict_type=<class 'collections.OrderedDict'>, defaults: dict = {}) → None¶ Initialize self. See help(type(self)) for accurate signature.
-
from_python
(value) → bytes¶
-
parse
(client: Client) → Tuple[ctypes._endian.BigEndianStructure, bytes]¶
-
to_python
(ctype_object, *args, **kwargs) → Union[dict, collections.OrderedDict]¶
-
-
class
pygridgain.datatypes.internal.
StructArray
(following: list = NOTHING, counter_type=<class 'ctypes.c_int'>, defaults: dict = {})¶ Bases:
object
counter_type counter, followed by count*following structure.
-
__init__
(following: list = NOTHING, counter_type=<class 'ctypes.c_int'>, defaults: dict = {}) → None¶ Initialize self. See help(type(self)) for accurate signature.
-
build_header_class
()¶
-
from_python
(value)¶
-
parse
(client: Client)¶
-
to_python
(ctype_object, *args, **kwargs)¶
-
-
pygridgain.datatypes.internal.
tc_map
(key: bytes, _memo_map: dict = {})¶ Returns a default parser/generator class for the given type code.
This mapping is used internally inside listed complex parser/generator classes, so it has to be a function. Local imports are used for the same reason.
Parameters: - key – GridGain type code,
- _memo_map – do not use this parameter, it is for memoization of the “type code-type class” mapping,
Returns: parser/generator class for the type code.
-
pygridgain.datatypes.internal.
infer_from_python
(value: Any)¶ Convert pythonic value to ctypes buffer, type hint-aware.
Parameters: value – pythonic value or (value, type_hint) tuple, Returns: bytes.
pygridgain.datatypes.key_value module¶
pygridgain.datatypes.null_object module¶
Null object.
There can’t be null type, because null payload takes exactly 0 bytes.
-
class
pygridgain.datatypes.null_object.
Null
¶ Bases:
pygridgain.datatypes.base.GridGainDataType
-
classmethod
build_c_type
()¶
-
default
= None¶
-
static
from_python
(*args)¶
-
static
hashcode
(value: Any) → int¶
-
classmethod
parse
(client: Client)¶
-
pythonic
¶ alias of
builtins.NoneType
-
static
to_python
(*args, **kwargs)¶
-
classmethod
pygridgain.datatypes.primitive module¶
-
class
pygridgain.datatypes.primitive.
Primitive
¶ Bases:
pygridgain.datatypes.base.GridGainDataType
GridGain primitive type. Base type for the following types:
- Byte,
- Short,
- Int,
- Long,
- Float,
- Double,
- Char,
- Bool.
-
c_type
= None¶
-
classmethod
from_python
(value)¶
-
classmethod
parse
(client: Client)¶
-
static
to_python
(ctype_object, *args, **kwargs)¶
-
class
pygridgain.datatypes.primitive.
Byte
¶ Bases:
pygridgain.datatypes.primitive.Primitive
-
c_type
¶ alias of
ctypes.c_byte
-
-
class
pygridgain.datatypes.primitive.
Short
¶ Bases:
pygridgain.datatypes.primitive.Primitive
-
c_type
¶ alias of
ctypes.c_short
-
-
class
pygridgain.datatypes.primitive.
Int
¶ Bases:
pygridgain.datatypes.primitive.Primitive
-
c_type
¶ alias of
ctypes.c_int
-
-
class
pygridgain.datatypes.primitive.
Long
¶ Bases:
pygridgain.datatypes.primitive.Primitive
-
c_type
¶ alias of
ctypes.c_long
-
-
class
pygridgain.datatypes.primitive.
Float
¶ Bases:
pygridgain.datatypes.primitive.Primitive
-
c_type
¶ alias of
ctypes.c_float
-
-
class
pygridgain.datatypes.primitive.
Double
¶ Bases:
pygridgain.datatypes.primitive.Primitive
-
c_type
¶ alias of
ctypes.c_double
-
-
class
pygridgain.datatypes.primitive.
Char
¶ Bases:
pygridgain.datatypes.primitive.Primitive
-
c_type
¶ alias of
ctypes.c_short
-
classmethod
from_python
(value)¶
-
classmethod
to_python
(ctype_object, *args, **kwargs)¶
-
-
class
pygridgain.datatypes.primitive.
Bool
¶ Bases:
pygridgain.datatypes.primitive.Primitive
-
c_type
¶ alias of
ctypes.c_bool
-
pygridgain.datatypes.primitive_arrays module¶
-
class
pygridgain.datatypes.primitive_arrays.
ByteArray
¶ Bases:
pygridgain.datatypes.primitive_arrays.PrimitiveArray
-
classmethod
from_python
(value)¶
-
primitive_type
¶ alias of
pygridgain.datatypes.primitive.Byte
-
classmethod
to_python
(ctype_object, *args, **kwargs)¶
-
type_code
= b'\x0c'¶
-
classmethod
-
class
pygridgain.datatypes.primitive_arrays.
ByteArrayObject
¶ Bases:
pygridgain.datatypes.primitive_arrays.PrimitiveArrayObject
-
classmethod
from_python
(value)¶
-
primitive_type
¶ alias of
pygridgain.datatypes.primitive.Byte
-
classmethod
to_python
(ctype_object, *args, **kwargs)¶
-
type_code
= b'\x0c'¶
-
classmethod
-
class
pygridgain.datatypes.primitive_arrays.
ShortArray
¶ Bases:
pygridgain.datatypes.primitive_arrays.PrimitiveArray
-
primitive_type
¶ alias of
pygridgain.datatypes.primitive.Short
-
type_code
= b'\r'¶
-
-
class
pygridgain.datatypes.primitive_arrays.
ShortArrayObject
¶ Bases:
pygridgain.datatypes.primitive_arrays.PrimitiveArrayObject
-
primitive_type
¶ alias of
pygridgain.datatypes.primitive.Short
-
type_code
= b'\r'¶
-
-
class
pygridgain.datatypes.primitive_arrays.
IntArray
¶ Bases:
pygridgain.datatypes.primitive_arrays.PrimitiveArray
-
primitive_type
¶ alias of
pygridgain.datatypes.primitive.Int
-
type_code
= b'\x0e'¶
-
-
class
pygridgain.datatypes.primitive_arrays.
IntArrayObject
¶ Bases:
pygridgain.datatypes.primitive_arrays.PrimitiveArrayObject
-
primitive_type
¶ alias of
pygridgain.datatypes.primitive.Int
-
type_code
= b'\x0e'¶
-
-
class
pygridgain.datatypes.primitive_arrays.
LongArray
¶ Bases:
pygridgain.datatypes.primitive_arrays.PrimitiveArray
-
primitive_type
¶ alias of
pygridgain.datatypes.primitive.Long
-
type_code
= b'\x0f'¶
-
-
class
pygridgain.datatypes.primitive_arrays.
LongArrayObject
¶ Bases:
pygridgain.datatypes.primitive_arrays.PrimitiveArrayObject
-
primitive_type
¶ alias of
pygridgain.datatypes.primitive.Long
-
type_code
= b'\x0f'¶
-
-
class
pygridgain.datatypes.primitive_arrays.
FloatArray
¶ Bases:
pygridgain.datatypes.primitive_arrays.PrimitiveArray
-
primitive_type
¶ alias of
pygridgain.datatypes.primitive.Float
-
type_code
= b'\x10'¶
-
-
class
pygridgain.datatypes.primitive_arrays.
FloatArrayObject
¶ Bases:
pygridgain.datatypes.primitive_arrays.PrimitiveArrayObject
-
primitive_type
¶ alias of
pygridgain.datatypes.primitive.Float
-
type_code
= b'\x10'¶
-
-
class
pygridgain.datatypes.primitive_arrays.
DoubleArray
¶ Bases:
pygridgain.datatypes.primitive_arrays.PrimitiveArray
-
primitive_type
¶
-
type_code
= b'\x11'¶
-
-
class
pygridgain.datatypes.primitive_arrays.
DoubleArrayObject
¶ Bases:
pygridgain.datatypes.primitive_arrays.PrimitiveArrayObject
-
primitive_type
¶
-
type_code
= b'\x11'¶
-
-
class
pygridgain.datatypes.primitive_arrays.
CharArray
¶ Bases:
pygridgain.datatypes.primitive_arrays.PrimitiveArray
-
primitive_type
¶ alias of
pygridgain.datatypes.primitive.Char
-
type_code
= b'\x12'¶
-
-
class
pygridgain.datatypes.primitive_arrays.
CharArrayObject
¶ Bases:
pygridgain.datatypes.primitive_arrays.PrimitiveArrayObject
-
primitive_type
¶ alias of
pygridgain.datatypes.primitive.Char
-
classmethod
to_python
(ctype_object, *args, **kwargs)¶
-
type_code
= b'\x12'¶
-
-
class
pygridgain.datatypes.primitive_arrays.
BoolArray
¶ Bases:
pygridgain.datatypes.primitive_arrays.PrimitiveArray
-
primitive_type
¶ alias of
pygridgain.datatypes.primitive.Bool
-
type_code
= b'\x13'¶
-
-
class
pygridgain.datatypes.primitive_arrays.
BoolArrayObject
¶ Bases:
pygridgain.datatypes.primitive_arrays.PrimitiveArrayObject
-
primitive_type
¶ alias of
pygridgain.datatypes.primitive.Bool
-
type_code
= b'\x13'¶
-
pygridgain.datatypes.primitive_objects module¶
-
class
pygridgain.datatypes.primitive_objects.
DataObject
¶ Bases:
pygridgain.datatypes.base.GridGainDataType
Base class for primitive data objects.
Primitive data objects are built of primitive data prepended by the corresponding type code.
-
classmethod
build_c_type
()¶
-
c_type
= None¶
-
classmethod
from_python
(value)¶
-
classmethod
parse
(client: Client)¶
-
static
to_python
(ctype_object, *args, **kwargs)¶
-
type_code
= None¶
-
classmethod
-
class
pygridgain.datatypes.primitive_objects.
ByteObject
¶ Bases:
pygridgain.datatypes.primitive_objects.DataObject
-
c_type
¶ alias of
ctypes.c_byte
-
default
= 0¶
-
static
hashcode
(value: int, *args, **kwargs) → int¶
-
pythonic
¶ alias of
builtins.int
-
type_code
= b'\x01'¶
-
-
class
pygridgain.datatypes.primitive_objects.
ShortObject
¶ Bases:
pygridgain.datatypes.primitive_objects.DataObject
-
c_type
¶ alias of
ctypes.c_short
-
default
= 0¶
-
static
hashcode
(value: int, *args, **kwargs) → int¶
-
pythonic
¶ alias of
builtins.int
-
type_code
= b'\x02'¶
-
-
class
pygridgain.datatypes.primitive_objects.
IntObject
¶ Bases:
pygridgain.datatypes.primitive_objects.DataObject
-
c_type
¶ alias of
ctypes.c_int
-
default
= 0¶
-
static
hashcode
(value: int, *args, **kwargs) → int¶
-
pythonic
¶ alias of
builtins.int
-
type_code
= b'\x03'¶
-
-
class
pygridgain.datatypes.primitive_objects.
LongObject
¶ Bases:
pygridgain.datatypes.primitive_objects.DataObject
-
c_type
¶ alias of
ctypes.c_long
-
default
= 0¶
-
static
hashcode
(value: int, *args, **kwargs) → int¶
-
pythonic
¶ alias of
builtins.int
-
type_code
= b'\x04'¶
-
-
class
pygridgain.datatypes.primitive_objects.
FloatObject
¶ Bases:
pygridgain.datatypes.primitive_objects.DataObject
-
c_type
¶ alias of
ctypes.c_float
-
default
= 0.0¶
-
static
hashcode
(value: float, *args, **kwargs) → int¶
-
pythonic
¶ alias of
builtins.float
-
type_code
= b'\x05'¶
-
-
class
pygridgain.datatypes.primitive_objects.
DoubleObject
¶ Bases:
pygridgain.datatypes.primitive_objects.DataObject
-
c_type
¶ alias of
ctypes.c_double
-
default
= 0.0¶
-
static
hashcode
(value: float, *args, **kwargs) → int¶
-
pythonic
¶ alias of
builtins.float
-
type_code
= b'\x06'¶
-
-
class
pygridgain.datatypes.primitive_objects.
CharObject
¶ Bases:
pygridgain.datatypes.primitive_objects.DataObject
This type is a little tricky. It stores character values in UTF-16 Little-endian encoding. We have to encode/decode it to/from UTF-8 to keep the coding hassle to minimum. Bear in mind though: decoded character may take 1..4 bytes in UTF-8.
-
c_type
¶ alias of
ctypes.c_short
-
default
= ' '¶
-
classmethod
from_python
(value)¶
-
static
hashcode
(value: str, *args, **kwargs) → int¶
-
pythonic
¶ alias of
builtins.str
-
classmethod
to_python
(ctype_object, *args, **kwargs)¶
-
type_code
= b'\x07'¶
-
pygridgain.datatypes.prop_codes module¶
pygridgain.datatypes.sql module¶
-
class
pygridgain.datatypes.sql.
StatementType
¶ Bases:
pygridgain.datatypes.primitive.Byte
-
ANY
= 0¶
-
SELECT
= 1¶
-
UPDATE
= 2¶
-
pygridgain.datatypes.standard module¶
-
class
pygridgain.datatypes.standard.
String
¶ Bases:
pygridgain.datatypes.base.GridGainDataType
Pascal-style string: c_int counter, followed by count*bytes. UTF-8-encoded, so that one character may take 1 to 4 bytes.
-
classmethod
build_c_type
(length: int)¶
-
classmethod
from_python
(value)¶
-
static
hashcode
(value: str, *args, **kwargs) → int¶
-
classmethod
parse
(client: Client)¶
-
pythonic
¶ alias of
builtins.str
-
static
to_python
(ctype_object, *args, **kwargs)¶
-
type_code
= b'\t'¶
-
classmethod
-
class
pygridgain.datatypes.standard.
DecimalObject
¶ Bases:
pygridgain.datatypes.base.GridGainDataType
-
classmethod
build_c_header
()¶
-
default
= Decimal('0.00')¶
-
classmethod
from_python
(value: decimal.Decimal)¶
-
static
hashcode
(value: decimal.Decimal, *args, **kwargs) → int¶
-
classmethod
parse
(client: Client)¶
-
pythonic
¶ alias of
decimal.Decimal
-
classmethod
to_python
(ctype_object, *args, **kwargs)¶
-
type_code
= b'\x1e'¶
-
classmethod
-
class
pygridgain.datatypes.standard.
UUIDObject
¶ Bases:
pygridgain.datatypes.standard.StandardObject
Universally unique identifier (UUID), aka Globally unique identifier (GUID). Payload takes up 16 bytes.
Byte order in
to_python()
andfrom_python()
methods is changed for compatibility with java.util.UUID.-
UUID_BYTE_ORDER
= (7, 6, 5, 4, 3, 2, 1, 0, 15, 14, 13, 12, 11, 10, 9, 8)¶
-
classmethod
build_c_type
()¶
-
classmethod
from_python
(value: uuid.UUID)¶
-
static
hashcode
(value: UUID, *args, **kwargs) → int¶
-
classmethod
to_python
(ctypes_object, *args, **kwargs)¶
-
type_code
= b'\n'¶
-
-
class
pygridgain.datatypes.standard.
TimestampObject
¶ Bases:
pygridgain.datatypes.standard.StandardObject
A signed integer number of milliseconds past 1 Jan 1970, aka Epoch (8 bytes long integer), plus the delta in nanoseconds (4 byte integer, only 0..999 range used).
The accuracy is ridiculous. For instance, common HPETs have less than 10ms accuracy. Therefore no ns range calculations is made; epoch and fraction stored separately and represented as tuple(datetime.datetime, integer).
-
classmethod
build_c_type
()¶
-
default
= (datetime.datetime(1970, 1, 1, 0, 0), 0)¶
-
classmethod
from_python
(value: tuple)¶
-
static
hashcode
(value: Tuple[datetime.datetime, int], *args, **kwargs) → int¶
-
pythonic
¶ alias of
builtins.tuple
-
classmethod
to_python
(ctypes_object, *args, **kwargs)¶
-
type_code
= b'!'¶
-
classmethod
-
class
pygridgain.datatypes.standard.
DateObject
¶ Bases:
pygridgain.datatypes.standard.StandardObject
A signed integer number of milliseconds past 1 Jan 1970, aka Epoch (8 bytes long integer).
Represented as a naive datetime.datetime in Python.
-
classmethod
build_c_type
()¶
-
default
= datetime.datetime(1970, 1, 1, 0, 0)¶
-
classmethod
from_python
(value: [<class 'datetime.date'>, <class 'datetime.datetime'>])¶
-
static
hashcode
(value: datetime.datetime, *args, **kwargs) → int¶
-
pythonic
¶ alias of
datetime.datetime
-
classmethod
to_python
(ctypes_object, *args, **kwargs)¶
-
type_code
= b'\x0b'¶
-
classmethod
-
class
pygridgain.datatypes.standard.
TimeObject
¶ Bases:
pygridgain.datatypes.standard.StandardObject
Time of the day as a number of milliseconds since midnight.
Represented as a datetime.timedelta in Python.
-
classmethod
build_c_type
()¶
-
default
= datetime.timedelta(0)¶
-
classmethod
from_python
(value: datetime.timedelta)¶
-
static
hashcode
(value: datetime.timedelta, *args, **kwargs) → int¶
-
pythonic
¶ alias of
datetime.timedelta
-
classmethod
to_python
(ctypes_object, *args, **kwargs)¶
-
type_code
= b'$'¶
-
classmethod
-
class
pygridgain.datatypes.standard.
StringArray
¶ Bases:
pygridgain.datatypes.standard.StandardArray
Array of Pascal-like strings. Payload-only, i.e. no type_code field in binary representation.
List(str) in Python.
-
class
pygridgain.datatypes.standard.
DecimalArray
¶ Bases:
pygridgain.datatypes.standard.StandardArray
-
standard_type
¶ alias of
DecimalObject
-
-
class
pygridgain.datatypes.standard.
UUIDArray
¶ Bases:
pygridgain.datatypes.standard.StandardArray
-
standard_type
¶ alias of
UUIDObject
-
-
class
pygridgain.datatypes.standard.
TimestampArray
¶ Bases:
pygridgain.datatypes.standard.StandardArray
-
standard_type
¶ alias of
TimestampObject
-
-
class
pygridgain.datatypes.standard.
DateArray
¶ Bases:
pygridgain.datatypes.standard.StandardArray
-
standard_type
¶ alias of
DateObject
-
-
class
pygridgain.datatypes.standard.
TimeArray
¶ Bases:
pygridgain.datatypes.standard.StandardArray
-
standard_type
¶ alias of
TimeObject
-
-
class
pygridgain.datatypes.standard.
StringArrayObject
¶ Bases:
pygridgain.datatypes.standard.StandardArrayObject
List of strings.
-
type_code
= b'\x14'¶
-
-
class
pygridgain.datatypes.standard.
DecimalArrayObject
¶ Bases:
pygridgain.datatypes.standard.StandardArrayObject
List of decimal.Decimal objects.
-
standard_type
¶ alias of
DecimalObject
-
type_code
= b'\x1f'¶
-
-
class
pygridgain.datatypes.standard.
UUIDArrayObject
¶ Bases:
pygridgain.datatypes.standard.StandardArrayObject
Translated into Python as a list(uuid.UUID).
-
standard_type
¶ alias of
UUIDObject
-
type_code
= b'\x15'¶
-
-
class
pygridgain.datatypes.standard.
TimestampArrayObject
¶ Bases:
pygridgain.datatypes.standard.StandardArrayObject
Translated into Python as a list of (datetime.datetime, integer) tuples.
-
standard_type
¶ alias of
TimestampObject
-
type_code
= b'"'¶
-
-
class
pygridgain.datatypes.standard.
TimeArrayObject
¶ Bases:
pygridgain.datatypes.standard.StandardArrayObject
List of datetime.timedelta type values.
-
standard_type
¶ alias of
TimeObject
-
type_code
= b'%'¶
-
-
class
pygridgain.datatypes.standard.
DateArrayObject
¶ Bases:
pygridgain.datatypes.standard.StandardArrayObject
List of datetime.datetime type values.
-
standard_type
¶ alias of
DateObject
-
type_code
= b'\x16'¶
-
-
class
pygridgain.datatypes.standard.
EnumObject
¶ Bases:
pygridgain.datatypes.standard.StandardObject
Two integers used as the ID of the enumeration type, and its value.
This type itself is useless in Python, but can be used for interoperability (using language-specific type serialization is a good way to kill the interoperability though), so it represented by tuple(int, int) in Python.
-
classmethod
build_c_type
()¶
-
classmethod
from_python
(value: tuple)¶
-
classmethod
to_python
(ctypes_object, *args, **kwargs)¶
-
type_code
= b'\x1c'¶
-
classmethod
-
class
pygridgain.datatypes.standard.
EnumArray
¶ Bases:
pygridgain.datatypes.standard.StandardArray
-
standard_type
¶ alias of
EnumObject
-
-
class
pygridgain.datatypes.standard.
EnumArrayObject
¶ Bases:
pygridgain.datatypes.standard.StandardArrayObject
Array of (int, int) tuples, plus it holds a type_id in its header. The only type_id value of -1 (user type) works from Python perspective.
-
classmethod
build_header_class
()¶
-
classmethod
from_python
(value)¶
-
standard_type
¶ alias of
EnumObject
-
classmethod
to_python
(ctype_object, *args, **kwargs)¶
-
type_code
= b'\x1d'¶
-
classmethod
-
class
pygridgain.datatypes.standard.
BinaryEnumObject
¶ Bases:
pygridgain.datatypes.standard.EnumObject
Another way of representing the enum type. Same, but different.
-
type_code
= b'&'¶
-
-
class
pygridgain.datatypes.standard.
BinaryEnumArrayObject
¶ Bases:
pygridgain.datatypes.standard.EnumArrayObject
-
standard_type
¶ alias of
BinaryEnumObject
-
-
class
pygridgain.datatypes.standard.
ObjectArray
¶ Bases:
pygridgain.datatypes.standard.EnumArrayObject
-
standard_type
¶ alias of
BinaryEnumObject
-
pygridgain.datatypes.type_codes module¶
pygridgain.datatypes.type_ids module¶
pygridgain.datatypes.type_names module¶
Module contents¶
This module contains classes, used internally by pygridgain for parsing and creating binary data.