|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.kitesdk.data.FieldPartitioner<Long,Integer> org.kitesdk.data.partition.CalendarFieldPartitioner
@Beta @NotThreadSafe public class CalendarFieldPartitioner
A FieldPartitioner
that extracts the value of a Calendar
field,
such as Calendar.YEAR
. The UTC timezone is assumed.
See subclasses for convenience classes,
e.g. YearFieldPartitioner
. Note that we don't use
SimpleDateFormat
patterns since we want to keep the type information
(values are ints).
Field Summary | |
---|---|
protected int |
calendarField
|
protected static TimeZone |
UTC
|
Constructor Summary | |
---|---|
CalendarFieldPartitioner(String sourceName,
String name,
int calendarField,
int cardinality)
|
Method Summary | |
---|---|
Integer |
apply(Long timestamp)
Apply the partition function to the given value . |
int |
compare(Integer o1,
Integer o2)
|
boolean |
equals(Object o)
|
int |
getCalendarField()
|
int |
hashCode()
|
com.google.common.base.Predicate<Integer> |
project(com.google.common.base.Predicate<Long> predicate)
Projects a source-data constraint Predicate into the image of the
backing partition function. |
String |
toString()
|
Integer |
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, wait, wait, wait |
Field Detail |
---|
protected static final TimeZone UTC
protected int calendarField
Constructor Detail |
---|
public CalendarFieldPartitioner(String sourceName, String name, int calendarField, int cardinality)
Method Detail |
---|
public Integer apply(@Nonnull Long timestamp)
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,Integer>
apply
in class FieldPartitioner<Long,Integer>
public com.google.common.base.Predicate<Integer> 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,Integer>
public int getCalendarField()
@Deprecated public Integer valueFromString(String stringValue)
FieldPartitioner
Retrieve the value for the field from the string representation.
valueFromString
in class FieldPartitioner<Long,Integer>
public boolean equals(Object o)
equals
in interface com.google.common.base.Function<Long,Integer>
equals
in interface Comparator<Integer>
equals
in class Object
public int compare(Integer o1, Integer o2)
public int hashCode()
hashCode
in class Object
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |