Class JdbcThinPartitionAwarenessMappingGroup
- java.lang.Object
-
- org.apache.ignite.internal.jdbc.thin.JdbcThinPartitionAwarenessMappingGroup
-
- All Implemented Interfaces:
JdbcRawBinarylizable
public class JdbcThinPartitionAwarenessMappingGroup extends Object implements JdbcRawBinarylizable
Contains cache partitions distributions with corresponding set of cache ids.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Set<Integer>cacheIds()booleanmerge(int cacheId, Map<UUID,Set<Integer>> partitionsMappings)Tries to merge given partitions mappings and corresponding cache id with already existing mappings.voidreadBinary(BinaryReaderExImpl reader, JdbcProtocolContext protoCtx)Reads fields from provided reader.static JdbcThinPartitionAwarenessMappingGroupreadGroup(BinaryReaderExImpl reader, JdbcProtocolContext binCtx)ReadsJdbcThinPartitionAwarenessMappingGroupfrom provided reader.UUID[]revertMappings(int partsCnt)Reverts partitions mappings from the form 'node id -> set of partition ids' to the form 'partition id -> node id'.voidwriteBinary(BinaryWriterExImpl writer, JdbcProtocolContext protoCtx)Writes fields to provided writer.
-
-
-
Method Detail
-
merge
public boolean merge(int cacheId, Map<UUID,Set<Integer>> partitionsMappings)Tries to merge given partitions mappings and corresponding cache id with already existing mappings.- Parameters:
cacheId- Cache id.partitionsMappings- Partitions mappings.- Returns:
- True if merged successfully, false otherwise.
-
revertMappings
public UUID[] revertMappings(int partsCnt)
Reverts partitions mappings from the form 'node id -> set of partition ids' to the form 'partition id -> node id'. First form is more compact, so it's preferred in case of data transferring, second form is easier to use on client side, cause we mainly retrieve data using partition is as key.- Parameters:
partsCnt- Partitions count.- Returns:
- Reverted form of partitions mapping: partition id -> node id.
-
writeBinary
public void writeBinary(BinaryWriterExImpl writer, JdbcProtocolContext protoCtx) throws BinaryObjectException
Writes fields to provided writer.- Specified by:
writeBinaryin interfaceJdbcRawBinarylizable- Parameters:
writer- Binary object writer.protoCtx- JDBC protocol context.- Throws:
BinaryObjectException- In case of error.
-
readBinary
public void readBinary(BinaryReaderExImpl reader, JdbcProtocolContext protoCtx) throws BinaryObjectException
Reads fields from provided reader.- Specified by:
readBinaryin interfaceJdbcRawBinarylizable- Parameters:
reader- Binary object reader.protoCtx- JDBC protocol context.- Throws:
BinaryObjectException- In case of error.
-
readGroup
public static JdbcThinPartitionAwarenessMappingGroup readGroup(BinaryReaderExImpl reader, JdbcProtocolContext binCtx) throws BinaryObjectException
ReadsJdbcThinPartitionAwarenessMappingGroupfrom provided reader.- Parameters:
reader- Binary object reader.binCtx- Binary context.- Returns:
- Deserialized instance of
JdbcThinPartitionAwarenessMappingGroup. - Throws:
BinaryObjectException- In case of error.
-
-