Package org.apache.beam.sdk.util
Class ShardedKey<K>
- java.lang.Object
-
- org.apache.beam.sdk.util.ShardedKey<K>
-
public class ShardedKey<K> extends java.lang.Object
A sharded key consisting of a user key and an opaque shard id represented by bytes.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ShardedKey.Coder<K>
-
Constructor Summary
Constructors Modifier Constructor Description protected
ShardedKey(K key, byte[] shardId)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object o)
K
getKey()
int
hashCode()
static <K> ShardedKey<K>
of(K key, byte[] shardId)
Creates a ShardedKey with given key and shard id.java.lang.String
toString()
-
-
-
Constructor Detail
-
ShardedKey
protected ShardedKey(K key, byte[] shardId)
-
-
Method Detail
-
of
public static <K> ShardedKey<K> of(K key, byte[] shardId)
Creates a ShardedKey with given key and shard id. Shard id must not be null and must not be mutated.
-
getKey
public K getKey()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-