Interface ShardManager
- All Known Implementing Classes:
DatabaseShardManager
public interface ShardManager
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddColumn(long tableId, ColumnInfo column) Add a column to the end of the table.longBegin a transaction for creating shards.voidcommitShards(long transactionId, long tableId, List<ColumnInfo> columns, Collection<ShardInfo> shards, Optional<String> externalBatchId, long updateTime) Commit data for a table.voidcreateBuckets(long distributionId, int bucketCount) Create initial bucket assignments for a distribution.voidcreateTable(long tableId, List<ColumnInfo> columns, boolean bucketed, OptionalLong temporalColumnId) Create a table.voiddropTable(long tableId) Drop a table.getBucketAssignments(long distributionId) Get map of buckets to node identifiers for a distribution.getBucketNodes(long distributionId) Get list of bucket nodes for a distribution.Get all active distributions.longgetDistributionSizeInBytes(long distributionId) Get total physical size of all tables in a distribution.getExistingShardUuids(long tableId, Set<UUID> shardUuids) Return the subset of shard uuids that existGet the number of bytes used by assigned shards per node.getNodeShards(String nodeIdentifier) Get shard metadata for shards on a given node.getNodeShards(String nodeIdentifier, long tableId) Get shard metadata for shards on a given node.Get shard metadata for a shard.org.jdbi.v3.core.result.ResultIterator<BucketShards>getShardNodes(long tableId, TupleDomain<RaptorColumnHandle> effectivePredicate) Return the shard nodes for a non-bucketed table.org.jdbi.v3.core.result.ResultIterator<BucketShards>getShardNodesBucketed(long tableId, boolean merged, List<String> bucketToNode, TupleDomain<RaptorColumnHandle> effectivePredicate) Return the shard nodes for a bucketed table.voidreplaceShardAssignment(long tableId, UUID shardUuid, String nodeIdentifier, boolean gracePeriod) Remove all old shard assignments and assign a shard to a nodevoidreplaceShardUuids(long transactionId, long tableId, List<ColumnInfo> columns, Set<UUID> oldShardUuids, Collection<ShardInfo> newShards, OptionalLong updateTime) Replace oldShardsUuids with newShards.voidrollbackTransaction(long transactionId) Rollback a transaction.voidupdateBucketAssignment(long distributionId, int bucketNumber, String nodeId) Change the node a bucket is assigned to.
-
Method Details
-
createTable
void createTable(long tableId, List<ColumnInfo> columns, boolean bucketed, OptionalLong temporalColumnId) Create a table. -
dropTable
void dropTable(long tableId) Drop a table. -
addColumn
Add a column to the end of the table. -
commitShards
void commitShards(long transactionId, long tableId, List<ColumnInfo> columns, Collection<ShardInfo> shards, Optional<String> externalBatchId, long updateTime) Commit data for a table. -
replaceShardUuids
void replaceShardUuids(long transactionId, long tableId, List<ColumnInfo> columns, Set<UUID> oldShardUuids, Collection<ShardInfo> newShards, OptionalLong updateTime) Replace oldShardsUuids with newShards. -
getShard
Get shard metadata for a shard. -
getNodeShards
Get shard metadata for shards on a given node. -
getNodeShards
Get shard metadata for shards on a given node. -
getShardNodes
org.jdbi.v3.core.result.ResultIterator<BucketShards> getShardNodes(long tableId, TupleDomain<RaptorColumnHandle> effectivePredicate) Return the shard nodes for a non-bucketed table. -
getShardNodesBucketed
org.jdbi.v3.core.result.ResultIterator<BucketShards> getShardNodesBucketed(long tableId, boolean merged, List<String> bucketToNode, TupleDomain<RaptorColumnHandle> effectivePredicate) Return the shard nodes for a bucketed table. -
replaceShardAssignment
void replaceShardAssignment(long tableId, UUID shardUuid, String nodeIdentifier, boolean gracePeriod) Remove all old shard assignments and assign a shard to a node -
getNodeBytes
Get the number of bytes used by assigned shards per node. -
beginTransaction
long beginTransaction()Begin a transaction for creating shards.- Returns:
- transaction ID
-
rollbackTransaction
void rollbackTransaction(long transactionId) Rollback a transaction. -
createBuckets
void createBuckets(long distributionId, int bucketCount) Create initial bucket assignments for a distribution. -
getBucketAssignments
Get map of buckets to node identifiers for a distribution. -
updateBucketAssignment
Change the node a bucket is assigned to. -
getDistributions
List<Distribution> getDistributions()Get all active distributions. -
getDistributionSizeInBytes
long getDistributionSizeInBytes(long distributionId) Get total physical size of all tables in a distribution. -
getBucketNodes
Get list of bucket nodes for a distribution. -
getExistingShardUuids
Return the subset of shard uuids that exist
-