@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. |
public 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–2015. All rights reserved.