K
- Type of keyV
- Type of valuepublic abstract class DynamicPartitioner<K,V> extends Object
Modifier and Type | Class and Description |
---|---|
static class |
DynamicPartitioner.PartitionWriteOption
Defines options for when writing to a partition.
|
Constructor and Description |
---|
DynamicPartitioner() |
Modifier and Type | Method and Description |
---|---|
void |
destroy()
Destroys a DynamicPartitioner.
|
abstract PartitionKey |
getPartitionKey(K key,
V value)
Determine the PartitionKey for the key-value pair to be written to.
|
void |
initialize(MapReduceTaskContext<K,V> mapReduceTaskContext)
Initializes a DynamicPartitioner.
|
public void initialize(MapReduceTaskContext<K,V> mapReduceTaskContext)
This method will be called only once per DynamicPartitioner
instance. It is the first method call
on that instance.
mapReduceTaskContext
- the mapReduceTaskContext for the task that this DynamicPartitioner is running in.
Note that the hadoop context is not available on this MapReduceTaskContext.public void destroy()
This method will be called only once per DynamicPartitioner
instance. It is the last method call
on that instance.
public abstract PartitionKey getPartitionKey(K key, V value)
key
- the key to be writtenvalue
- the value to be writtenPartitionKey
for the key-value pair to be written to.Copyright © 2021 Cask Data, Inc. Licensed under the Apache License, Version 2.0.