Class JdbcThinPartitionAwarenessMappingGroup

    • Constructor Detail

      • JdbcThinPartitionAwarenessMappingGroup

        public JdbcThinPartitionAwarenessMappingGroup​(@NotNull
                                                      @NotNull Integer cacheId,
                                                      Map<UUID,​@NotNull Set<Integer>> partitionsMappings)
        Constructor.
        Parameters:
        cacheId - Cache id.
        partitionsMappings - Partitions mappings.
    • 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.
      • cacheIds

        public Set<Integer> cacheIds()
        Returns:
        Cache ids.