@NotThreadSafe public class PartitionKey extends Object
A key for retrieving partitions from a Dataset.
A PartitionKey is an ordered sequence of values corresponding to the
FieldPartitioners in a
PartitionStrategy. You can obtain a PartitionKey using
partitionKeyForEntity(org.kitesdk.data.PartitionStrategy, Object, EntityAccessor, PartitionKey).
Implementations of PartitionKey are typically not thread-safe; that
is, the behavior when accessing a single instance from multiple threads is
undefined.
PartitionStrategy,
FieldPartitioner,
Dataset| Constructor and Description |
|---|
PartitionKey(Object... values) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object o) |
Object |
get(int index)
Return the value at the specified index in the key.
|
int |
getLength()
Return the number of values in the key.
|
List<Object> |
getValues() |
int |
hashCode() |
static <E> PartitionKey |
partitionKeyForEntity(PartitionStrategy strategy,
E entity,
EntityAccessor<E> accessor)
Construct a partition key for the given entity.
|
static <E> PartitionKey |
partitionKeyForEntity(PartitionStrategy strategy,
E entity,
EntityAccessor<E> accessor,
PartitionKey reuseKey)
Construct a partition key for the given entity, reusing the supplied key if
not null.
|
protected void |
set(int index,
Object value) |
String |
toString() |
public PartitionKey(Object... values)
public Object get(int index)
protected void set(int index,
Object value)
public static <E> PartitionKey partitionKeyForEntity(PartitionStrategy strategy, E entity, EntityAccessor<E> accessor)
Construct a partition key for the given entity.
This is a convenient way to find the partition that a given entity is written to, or to find a partition using objects from the entity domain.
public static <E> PartitionKey partitionKeyForEntity(PartitionStrategy strategy, E entity, EntityAccessor<E> accessor, @Nullable PartitionKey reuseKey)
Construct a partition key for the given entity, reusing the supplied key if not null.
This is a convenient way to find the partition that a given entity is written to, or to find a partition using objects from the entity domain.
public int getLength()
Copyright © 2013–2015. All rights reserved.