Class PartitionId
- java.lang.Object
-
- com.google.cloud.spanner.connection.PartitionId
-
- All Implemented Interfaces:
Serializable
public class PartitionId extends Object implements Serializable
Contains a reference to aBatchTransactionIdand aPartition. The combination of these two are needed to execute a partition of a partitioned query on aConnection. APartitionIdcan safely be given to a different connection and/or host to be executed there.- See Also:
- Serialized Form
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static PartitionIddecodeFromString(String id)Deserializes a string representation of aPartitionId.static StringencodeToString(BatchTransactionId transactionId, Partition partition)booleanequals(Object o)PartitiongetPartition()BatchTransactionIdgetTransactionId()inthashCode()
-
-
-
Method Detail
-
decodeFromString
public static PartitionId decodeFromString(String id)
Deserializes a string representation of aPartitionId. The string must have been created with theencodeToString(BatchTransactionId, Partition)method.
-
encodeToString
public static String encodeToString(BatchTransactionId transactionId, Partition partition)
- Returns:
- A string-encoded version of this
PartitionId. This encoded version can be sent to any otherConnectionto be executed there, including connections on different hosts than the current host.
-
getTransactionId
public BatchTransactionId getTransactionId()
-
getPartition
public Partition getPartition()
-
-