Created
April 23, 2021 16:44
-
-
Save ngollperrier/677c5526010f9c289e3ffbc6b466c5ff to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface Partitioner<T> { | |
void configure(Map<String, Object> config); | |
/** | |
* Returns string representing the output path for a sinkRecord to be encoded and stored. | |
* | |
* @param sinkRecord The record to be stored by the Sink Connector | |
* @return The path/filename the SinkRecord will be stored into after it is encoded | |
*/ | |
String encodePartition(SinkRecord sinkRecord); | |
/** | |
* Returns string representing the output path for a sinkRecord to be encoded and stored. | |
* | |
* @param sinkRecord The record to be stored by the Sink Connector | |
* @param nowInMillis The current time in ms. Some Partitioners will use this option, but by | |
* default it is unused. | |
* @return The path/filename the SinkRecord will be stored into after it is encoded | |
*/ | |
default String encodePartition(SinkRecord sinkRecord, long nowInMillis) { | |
return encodePartition(sinkRecord); | |
} | |
String generatePartitionedPath(String topic, String encodedPartition); | |
List<T> partitionFields(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment