Package oracle.jdbc.pool
Class ShardingMetadata
- java.lang.Object
-
- oracle.jdbc.pool.ShardingMetadata
-
public class ShardingMetadata extends Object
Holds the Sharded Database metadata that is required during encoding and decoding of sharding keys. The metadata is normally populated after the first connection to the database is established. The metadata object is designed to be immutable once created.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ShardingMetadata.ShardingType
Enum to hold the different sharding methods supported for shard keys and shard groups in the Oracle sharded database.static class
ShardingMetadata.SubKeyMetadata
Holds the shard sub key metadata information extracted from the database.
-
Field Summary
Fields Modifier and Type Field Description static int
SHARDING_KEY_LEVEL
static int
SUPER_SHARDING_KEY_LEVEL
-
Constructor Summary
Constructors Constructor Description ShardingMetadata(int version, ShardingMetadata.ShardingType shardingType, ShardingMetadata.ShardingType superShardingType, List<ShardingMetadata.SubKeyMetadata> keyColumns, List<ShardingMetadata.SubKeyMetadata> superKeyColumns)
Constructs an immutable object with all the metadata information.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<ShardingMetadata.SubKeyMetadata>
getShardingKeyColumns()
ShardingMetadata.ShardingType
getShardingType()
List<ShardingMetadata.SubKeyMetadata>
getSuperShardingKeyColumns()
ShardingMetadata.ShardingType
getSuperShardingType()
int
getVersion()
-
-
-
Field Detail
-
SUPER_SHARDING_KEY_LEVEL
public static final int SUPER_SHARDING_KEY_LEVEL
- See Also:
- Constant Field Values
-
SHARDING_KEY_LEVEL
public static final int SHARDING_KEY_LEVEL
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ShardingMetadata
public ShardingMetadata(int version, ShardingMetadata.ShardingType shardingType, ShardingMetadata.ShardingType superShardingType, List<ShardingMetadata.SubKeyMetadata> keyColumns, List<ShardingMetadata.SubKeyMetadata> superKeyColumns)
Constructs an immutable object with all the metadata information.- Parameters:
version
- version of the metadata object being builtshardingType
- sharding type in the databasesuperShardingType
- super sharding type in the databasekeyColumns
- sub key column metadata for sharding sub keys on the databasesuperKeyColumns
- sub key column metadata for sub keys of the super sharding key on the database
-
-
Method Detail
-
getVersion
public int getVersion()
- Returns:
- version of this metadata
-
getShardingType
public ShardingMetadata.ShardingType getShardingType()
- Returns:
- sharding type in the metadata
-
getSuperShardingType
public ShardingMetadata.ShardingType getSuperShardingType()
- Returns:
- super sharding type in the metadata
-
getShardingKeyColumns
public List<ShardingMetadata.SubKeyMetadata> getShardingKeyColumns()
- Returns:
- list of sharding sub key column metadata
-
getSuperShardingKeyColumns
public List<ShardingMetadata.SubKeyMetadata> getSuperShardingKeyColumns()
- Returns:
- list of super sharding sub key columns metadata
-
-