com.cloudera.cdk.data.partition
Class DayOfMonthFieldPartitioner

java.lang.Object
  extended by com.cloudera.cdk.data.FieldPartitioner<Long,Integer>
      extended by com.cloudera.cdk.data.partition.DayOfMonthFieldPartitioner
All Implemented Interfaces:
com.google.common.base.Function<Long,Integer>, Comparator<Integer>

@Beta
public class DayOfMonthFieldPartitioner
extends FieldPartitioner<Long,Integer>


Field Summary
protected  Calendar cal
           
protected  int calendarField
           
 
Constructor Summary
DayOfMonthFieldPartitioner(String sourceName, String name)
           
 
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 hashCode()
           
 String toString()
           
 Integer valueFromString(String stringValue)
          Deprecated. 
 String valueToString(Integer value)
          Deprecated. 
 
Methods inherited from class com.cloudera.cdk.data.FieldPartitioner
getCardinality, getName, getSourceName, getSourceType, getType
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

cal

protected Calendar cal

calendarField

protected int calendarField
Constructor Detail

DayOfMonthFieldPartitioner

public DayOfMonthFieldPartitioner(String sourceName,
                                  String name)
Method Detail

valueToString

@Deprecated
public String valueToString(Integer value)
Deprecated. 

Description copied from class: FieldPartitioner

Retrieve the value for the field formatted as a String. By default, this is the object's Object.toString() representation, but some FieldPartitioners may choose to provide a different representation.

Overrides:
valueToString in class FieldPartitioner<Long,Integer>

apply

public Integer apply(@Nonnull
                     Long timestamp)
Description copied from class: 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.

Specified by:
apply in interface com.google.common.base.Function<Long,Integer>
Specified by:
apply in class FieldPartitioner<Long,Integer>

valueFromString

@Deprecated
public Integer valueFromString(String stringValue)
Deprecated. 

Description copied from class: FieldPartitioner

Retrieve the value for the field from the string representation.

Specified by:
valueFromString in class FieldPartitioner<Long,Integer>

equals

public boolean equals(Object o)
Specified by:
equals in interface com.google.common.base.Function<Long,Integer>
Specified by:
equals in interface Comparator<Integer>
Overrides:
equals in class Object

compare

public int compare(Integer o1,
                   Integer o2)

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2013 Cloudera. All rights reserved.