public class OracleShardingKeyImpl extends Object implements OracleShardingKey
| Modifier | Constructor and Description | 
|---|---|
protected | 
OracleShardingKeyImpl(OracleShardingKeyBuilderImpl builder)  | 
| Modifier and Type | Method and Description | 
|---|---|
int | 
compareTo(OracleShardingKey o)
Used to compare two OracleShardingKey keys. 
 | 
protected void | 
debug(Logger logger, Level level, Executable method, String msg)  | 
static List<OracleShardingKeyImpl> | 
decodeKeys(InputStream keysData, ShardingMetadata metadata, boolean isSuperKey, boolean isKeyHigh)
Builds a list of sharding keys from the key data available as input stream from the database sharding metadata table LOCAL_CHUNKS. 
 | 
String | 
encodeKeyinB64Format()
Encodes the sharding key as per the standard Base 64 format to be added into the connect string during connection creation. 
 | 
boolean | 
equals(Object otherObj)
Compares this ShardingKey with the specified Object for equality 
 | 
int | 
hashCode()
Returns the hashcode for this sharding key object. 
 | 
boolean | 
isSuperShardingKey()
Checks if the the key is a super sharding key 
 | 
boolean | 
isValid(ShardingMetadata metadata)
Checks if this sharding key is valid for the sharded database represented by the metadata 
 | 
void | 
markSuperShardingKey(boolean isSuperShardingKey)
Marks the key to be used as a super sharding key 
 | 
long | 
shardKeyOraHash(ShardingMetadata metadata)
Computes the hash value of the Sharding key as per Oracle's internal hash function. 
 | 
String | 
toString()  | 
String | 
toString(Connection conn)  | 
protected OracleShardingKeyImpl(OracleShardingKeyBuilderImpl builder)
public void markSuperShardingKey(boolean isSuperShardingKey)
isSuperShardingKey - if the key is to be used as a super sharding keypublic boolean isSuperShardingKey()
public int compareTo(OracleShardingKey o)
compareTo in interface Comparable<OracleShardingKey>o - ShardingKey to which this sharding key is to be compared.public String toString()
toString in class ObjectObject.toString()public String toString(Connection conn) throws SQLException
conn - to be used to get the string value if there is a subkey of type oracle.sql.TIMESTAMPLTZSQLExceptionpublic boolean equals(Object otherObj)
equals in class ObjectotherObj - Object to which this sharding key is to be compared.Object.equals(java.lang.Object)public int hashCode()
hashCode in class ObjectObject.hashCode()public String encodeKeyinB64Format() throws SQLException
metadata - Metadata of the sharded database which needs to be accessed. neededSQLExceptionpublic long shardKeyOraHash(ShardingMetadata metadata)
metadata - sharded database metadatapublic boolean isValid(ShardingMetadata metadata)
metadata - Sharded database metadata to be used during the validation of this keypublic static List<OracleShardingKeyImpl> decodeKeys(InputStream keysData, ShardingMetadata metadata, boolean isSuperKey, boolean isKeyHigh) throws SQLException
keysData - Input stream containing the byte value of key or list of keys stored in the database table local_chunksmetadata - Contains the sharding metadata information that is used to build the keys.isSuperKey - true if the keys to be constructed are super sharding keys,false otherwiseisKeyHigh - true if the sharding keys to be constructed indicate the higher boundary if the sharding type is RANGE basedSQLException - if there is an exception while building the keys.protected void debug(Logger logger, Level level, Executable method, String msg)