@Immutable public class PartitionStrategy extends Object
The strategy used to determine how a dataset is partitioned.
When a Dataset
is configured
with a partition strategy, that data is considered partitioned. Any entities
written to a partitioned dataset are evaluated with its
PartitionStrategy
to determine which partition to write to.
You should use the inner PartitionStrategy.Builder
to create new instances.
DatasetDescriptor
,
Dataset
Modifier and Type | Class and Description |
---|---|
static class |
PartitionStrategy.Builder
A fluent builder to aid in the construction of
PartitionStrategy s. |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
int |
getCardinality()
Return the cardinality produced by the contained field partitioners.
|
List<org.kitesdk.data.spi.FieldPartitioner> |
getFieldPartitioners()
Deprecated.
will be removed in 0.18.0
|
org.kitesdk.data.spi.FieldPartitioner |
getPartitioner(String name)
Deprecated.
will be removed in 0.18.0
|
int |
hashCode() |
boolean |
hasPartitioner(String name)
Deprecated.
will be removed in 0.18.0
|
String |
toString() |
String |
toString(boolean pretty) |
@Deprecated public List<org.kitesdk.data.spi.FieldPartitioner> getFieldPartitioners()
Get the list of field partitioners used for partitioning.
FieldPartitioner
s are returned in the same order they are used
during partition selection.
@Deprecated public org.kitesdk.data.spi.FieldPartitioner getPartitioner(String name)
@Deprecated public boolean hasPartitioner(String name)
true
if this strategy has a partitioner for the namepublic int getCardinality()
Return the cardinality produced by the contained field partitioners.
This can be used to aid in calculating resource usage during certain operations. For example, when writing data to a partitioned dataset, you can use this method to estimate (or discover exactly, depending on the partition functions) how many leaf partitions exist.
Warning: This method is allowed to lie and should be treated only as a hint. Some partition functions are fixed (for example, hash modulo number of buckets), while others are open-ended (for example, discrete value) and depend on the input data.
public String toString(boolean pretty)
pretty
- true
to indent and format JSONCopyright © 2013–2014. All rights reserved.