|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.kitesdk.data.PartitionStrategy.Builder
public static class PartitionStrategy.Builder
A fluent builder to aid in the construction of PartitionStrategy
s.
Constructor Summary | |
---|---|
PartitionStrategy.Builder()
|
Method Summary | ||
---|---|---|
PartitionStrategy |
build()
Build a configured PartitionStrategy instance. |
|
PartitionStrategy.Builder |
dateFormat(String sourceName,
String name,
String format)
Configure a partitioner that applies a custom date format to a timestamp field. |
|
PartitionStrategy.Builder |
day(String sourceName)
Configure a partitioner for extracting the day from a timestamp field. |
|
PartitionStrategy.Builder |
day(String sourceName,
String name)
Configure a partitioner for extracting the day from a timestamp field. |
|
PartitionStrategy.Builder |
hash(String name,
int buckets)
Configure a hash partitioner with the specified number of buckets
. |
|
PartitionStrategy.Builder |
hash(String sourceName,
String name,
int buckets)
Configure a hash partitioner with the specified number of buckets
. |
|
PartitionStrategy.Builder |
hour(String sourceName)
Configure a partitioner for extracting the hour from a timestamp field. |
|
PartitionStrategy.Builder |
hour(String sourceName,
String name)
Configure a partitioner for extracting the hour from a timestamp field. |
|
|
identity(String name,
Class<S> type,
int buckets)
Configure an identity partitioner for a given type with a cardinality hint of buckets size. |
|
PartitionStrategy.Builder |
identity(String name,
int buckets)
Deprecated. Use identity(String, Class, int) . |
|
PartitionStrategy.Builder |
minute(String sourceName)
Configure a partitioner for extracting the minute from a timestamp field. |
|
PartitionStrategy.Builder |
minute(String sourceName,
String name)
Configure a partitioner for extracting the minute from a timestamp field. |
|
PartitionStrategy.Builder |
month(String sourceName)
Configure a partitioner for extracting the month from a timestamp field. |
|
PartitionStrategy.Builder |
month(String sourceName,
String name)
Configure a partitioner for extracting the month from a timestamp field. |
|
PartitionStrategy.Builder |
range(String name,
int... upperBounds)
Configure a range partitioner with a set of upperBounds . |
|
PartitionStrategy.Builder |
range(String name,
String... upperBounds)
Configure a range partitioner for strings with a set of upperBounds . |
|
PartitionStrategy.Builder |
year(String sourceName)
Configure a partitioner for extracting the year from a timestamp field. |
|
PartitionStrategy.Builder |
year(String sourceName,
String name)
Configure a partitioner for extracting the year from a timestamp field. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PartitionStrategy.Builder()
Method Detail |
---|
public PartitionStrategy.Builder hash(String name, int buckets)
buckets
.
name
- The entity field name from which to get values to be
partitioned.buckets
- The number of buckets into which data is to be partitioned.
public PartitionStrategy.Builder hash(String sourceName, String name, int buckets)
buckets
.
sourceName
- The entity field name from which to get values to be
partitioned.name
- The entity field name of the partition.buckets
- The number of buckets into which data is to be partitioned.
@Deprecated public PartitionStrategy.Builder identity(String name, int buckets)
identity(String, Class, int)
.
buckets
size.
name
- The entity field name from which to get values to be
partitioned.buckets
- A hint as to the number of partitions that will be created (i.e.
the number of discrete values for the field name
in the
data).
IdentityFieldPartitioner
public <S> PartitionStrategy.Builder identity(String name, Class<S> type, int buckets)
buckets
size.
name
- The entity field name from which to get values to be
partitioned.type
- The type of the field. This must match the schema.buckets
- A hint as to the number of partitions that will be created (i.e.
the number of discrete values for the field name
in the
data).
IdentityFieldPartitioner
public PartitionStrategy.Builder range(String name, int... upperBounds)
upperBounds
.
name
- The entity field name from which to get values to be
partitioned.upperBounds
- A variadic list of upper bounds of each partition.
IntRangeFieldPartitioner
public PartitionStrategy.Builder range(String name, String... upperBounds)
upperBounds
.
name
- The entity field name from which to get values to be
partitioned.upperBounds
- A variadic list of upper bounds of each partition.
RangeFieldPartitioner
public PartitionStrategy.Builder year(String sourceName, String name)
sourceName
- The entity field name from which to get values to be
partitioned.name
- The entity field name of the partition.
public PartitionStrategy.Builder year(String sourceName)
sourceName
- The entity field name from which to get values to be
partitioned.
public PartitionStrategy.Builder month(String sourceName, String name)
sourceName
- The entity field name from which to get values to be
partitioned.name
- The entity field name of the partition.
public PartitionStrategy.Builder month(String sourceName)
sourceName
- The entity field name from which to get values to be
partitioned.
public PartitionStrategy.Builder day(String sourceName, String name)
sourceName
- The entity field name from which to get values to be
partitioned.name
- The entity field name of the partition.
public PartitionStrategy.Builder day(String sourceName)
sourceName
- The entity field name from which to get values to be
partitioned.
public PartitionStrategy.Builder hour(String sourceName, String name)
sourceName
- The entity field name from which to get values to be
partitioned.name
- The entity field name of the partition.
public PartitionStrategy.Builder hour(String sourceName)
sourceName
- The entity field name from which to get values to be
partitioned.
public PartitionStrategy.Builder minute(String sourceName, String name)
sourceName
- The entity field name from which to get values to be
partitioned.name
- The entity field name of the partition.
public PartitionStrategy.Builder minute(String sourceName)
sourceName
- The entity field name from which to get values to be
partitioned.
public PartitionStrategy.Builder dateFormat(String sourceName, String name, String format)
sourceName
- The entity field name of the timestamp to formatname
- A name for the partitions created by the format (e.g. "day")format
- A SimpleDateFormat
format-string.
public PartitionStrategy build()
PartitionStrategy
instance.
This builder should be considered single use and discarded after a call
to this method.
PartitionStrategy
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |