...
Code Block | ||
---|---|---|
| ||
/** * Responsible for dynamically determining a @{link PartitionKey}. * * @param <K> Type of key * @param <V> Type of value */ public abstract class DynamicPartitioner<K, V> { /** * Initializes a DynamicPartitioner. * <p> * This method will be called only once per {@link DynamicPartitioner} instance. It is the first method call on that instance. * </p> * @param logicalStartTime see {@link co.cask.cdap.api.mapreduce.MapReduceContext#getLogicalStartTime} * */ public void initialize(long logicalStartTime) { // do nothing be default } /** * Destroys a DynamicPartitioner. * <p> * This method will be called only once per {@link DynamicPartitioner} instance. It is the last method call * on that instance. * </p> */ public void destroy() { // do nothing by default } /** * Determine the PartitionKey for the key-value pair to be written to. * * @param key the key to be written * @param value the value to be written * @return the {@link PartitionKey} for the key-value pair to be written to. */ public abstract PartitionKey getPartitionKey(K key, V value); } |
...