|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.kitesdk.data.FieldPartitioner<Long,String> org.kitesdk.data.partition.DateFormatPartitioner
@Beta public class DateFormatPartitioner
A FieldPartitioner that formats a timestamp (long) in milliseconds since
epoch, such as those returned by System.currentTimeMillis()
, using
SimpleDateFormat
.
Constructor Summary | |
---|---|
DateFormatPartitioner(String sourceName,
String name,
String format)
Construct a new DateFormatPartitioner for Universal Coordinated
Time, UTC (+00:00), and cardinality 1095 (3 years, 1 day = 1 partition). |
|
DateFormatPartitioner(String sourceName,
String name,
String format,
int cardinality,
TimeZone zone)
Construct a new DateFormatPartitioner for Universal Coordinated
Time, UTC (+00:00). |
Method Summary | |
---|---|
String |
apply(Long value)
Apply the partition function to the given value . |
int |
compare(String o1,
String o2)
|
boolean |
equals(Object o)
|
int |
hashCode()
|
com.google.common.base.Predicate<String> |
project(com.google.common.base.Predicate<Long> predicate)
Projects a source-data constraint Predicate into the image of the
backing partition function. |
String |
valueFromString(String stringValue)
Deprecated. |
Methods inherited from class org.kitesdk.data.FieldPartitioner |
---|
getCardinality, getName, getSourceName, getSourceType, getType, valueToString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DateFormatPartitioner(String sourceName, String name, String format)
DateFormatPartitioner
for Universal Coordinated
Time, UTC (+00:00), and cardinality 1095 (3 years, 1 day = 1 partition).
sourceName
- Source field name (the field should be a long)name
- Partition nameformat
- A String format for the SimpleDateFormat
constructorpublic DateFormatPartitioner(String sourceName, String name, String format, int cardinality, TimeZone zone)
DateFormatPartitioner
for Universal Coordinated
Time, UTC (+00:00).
sourceName
- Source field name (the field should be a long)name
- Partition nameformat
- A String format for the SimpleDateFormat
constructorcardinality
- A cardinality hint for the number of partitions that will be
created by this partitioner. For example, "MM-dd" produces about
365 partitions per year.Method Detail |
---|
public String apply(Long value)
FieldPartitioner
Apply the partition function to the given value
.
The type of value must be compatible with the field partitioner implementation. Normally, this is validated at the time of initial configuration rather than at runtime.
apply
in interface com.google.common.base.Function<Long,String>
apply
in class FieldPartitioner<Long,String>
@Deprecated public String valueFromString(String stringValue)
FieldPartitioner
Retrieve the value for the field from the string representation.
valueFromString
in class FieldPartitioner<Long,String>
public com.google.common.base.Predicate<String> project(com.google.common.base.Predicate<Long> predicate)
FieldPartitioner
Predicate
into the image of the
backing partition function.
If the function cannot be projected exactly, the resulting predicate must
be more permissive than the original predicate.
project
in class FieldPartitioner<Long,String>
public int compare(String o1, String o2)
public boolean equals(Object o)
equals
in interface com.google.common.base.Function<Long,String>
equals
in interface Comparator<String>
equals
in class Object
public int hashCode()
hashCode
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |