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 aBatchTransactionId
and aPartition
. The combination of these two are needed to execute a partition of a partitioned query on aConnection
. APartitionId
can 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 PartitionId
decodeFromString(String id)
Deserializes a string representation of aPartitionId
.static String
encodeToString(BatchTransactionId transactionId, Partition partition)
boolean
equals(Object o)
Partition
getPartition()
BatchTransactionId
getTransactionId()
int
hashCode()
-
-
-
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 otherConnection
to be executed there, including connections on different hosts than the current host.
-
getTransactionId
public BatchTransactionId getTransactionId()
-
getPartition
public Partition getPartition()
-
-