Class StreamPartitioner<K, V>
Listener for Kafka StreamPartitioner. Extends JVMBridgeListener, implements IStreamPartitioner<K, V>
public class StreamPartitioner<K, V> : JVMBridgeListener, IDynamicMetaObjectProvider, IJVMBridgeCore, IDisposable, IJVMBridgeBaseStatic, IStreamPartitioner<K, V>, IJVMBridgeBase, IJVMBridgeDefinition
Type Parameters
K
V
- Inheritance
-
StreamPartitioner<K, V>
- Implements
-
IStreamPartitioner<K, V>
- Derived
- Inherited Members
Remarks
Dispose the object to avoid a resource leak, the object contains a reference to the corresponding JVM object
Constructors
StreamPartitioner()
Default constructor: even if the corresponding Java class does not have one, it is mandatory for JCOBridge
public StreamPartitioner()
StreamPartitioner(params object[])
Generic constructor: it is useful for JCOBridge when there is a derived class which needs to pass arguments to the highest JVMBridgeBase class
public StreamPartitioner(params object[] args)
Parameters
args
object[]
Properties
BridgeClassName
Java class name to be instantiated
public override string BridgeClassName { get; }
Property Value
OnPartitions
public Func<String, K, V, int, Optional<Set<Integer>>> OnPartitions { get; set; }
Property Value
Remarks
If OnPartitions has a value it takes precedence over corresponding class method
Methods
InitializeHandlers()
Handlers initializer for StreamPartitioner
protected virtual void InitializeHandlers()
Partition(String, K, V, int)
Executes the StreamPartitioner action in the CLR
public virtual int Partition(String topic, K key, V value, int numPartitions)
Parameters
topic
StringThe StreamPartitioner object
key
KThe StreamPartitioner object
value
VThe StreamPartitioner object
numPartitions
intThe StreamPartitioner object
Returns
- int
an integer between 0 and
numPartitions
-1, or -1 if the default partitioning logic should be used
Partitions(String, K, V, int)
public virtual Optional<Set<Integer>> Partitions(String arg0, K arg1, V arg2, int arg3)