com.cloudera.cdk.data.partition
Class HourFieldPartitioner

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

@Beta
public class HourFieldPartitioner
extends FieldPartitioner


Field Summary
protected  Calendar cal
           
protected  int calendarField
           
 
Constructor Summary
HourFieldPartitioner(String sourceName, String name)
           
 
Method Summary
 Object apply(Object value)
           Apply the partition function to the given value.
 boolean equals(Object o)
           
 int hashCode()
           
 String toString()
           
 Object valueFromString(String stringValue)
           Retrieve the value for the field from the string representation.
 String valueToString(Object value)
           Retrieve the value for the field formatted as a String.
 
Methods inherited from class com.cloudera.cdk.data.FieldPartitioner
getCardinality, getName, getSourceName
 
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

HourFieldPartitioner

public HourFieldPartitioner(String sourceName,
                            String name)
Method Detail

valueToString

public String valueToString(Object value)
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

apply

public Object apply(@Nonnull
                    Object value)
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<Object,Object>
Specified by:
apply in class FieldPartitioner

valueFromString

public Object valueFromString(String stringValue)
Description copied from class: FieldPartitioner

Retrieve the value for the field from the string representation.

Specified by:
valueFromString in class FieldPartitioner

equals

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

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2013 Cloudera. All rights reserved.