org.kitesdk.data.partition
Class HashFieldPartitioner

java.lang.Object
  extended by org.kitesdk.data.FieldPartitioner<Object,Integer>
      extended by org.kitesdk.data.partition.HashFieldPartitioner
All Implemented Interfaces:
com.google.common.base.Function<Object,Integer>, Comparator<Integer>

public class HashFieldPartitioner
extends FieldPartitioner<Object,Integer>


Constructor Summary
HashFieldPartitioner(String name, int buckets)
           
HashFieldPartitioner(String sourceName, String name, int buckets)
           
 
Method Summary
 Integer apply(Object value)
           Apply the partition function to the given value.
 int compare(Integer o1, Integer o2)
           
 boolean equals(Object o)
           
 int hashCode()
           
 com.google.common.base.Predicate<Integer> project(com.google.common.base.Predicate<Object> 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
 

Constructor Detail

HashFieldPartitioner

public HashFieldPartitioner(String name,
                            int buckets)

HashFieldPartitioner

public HashFieldPartitioner(String sourceName,
                            String name,
                            int buckets)
Method Detail

apply

public Integer apply(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,Integer>
Specified by:
apply in class FieldPartitioner<Object,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<Object,Integer>

project

public com.google.common.base.Predicate<Integer> project(com.google.common.base.Predicate<Object> predicate)
Description copied from class: FieldPartitioner
Projects a source-data constraint 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.

Specified by:
project in class FieldPartitioner<Object,Integer>

equals

public boolean equals(Object o)
Specified by:
equals in interface com.google.common.base.Function<Object,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–2014. All rights reserved.