Table of Contents

Class StreamPartitioner<K, V>

Namespace
Org.Apache.Kafka.Streams.Processor
Assembly
MASES.KNet.dll

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
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

string

OnPartitions

public Func<String, K, V, int, Optional<Set<Integer>>> OnPartitions { get; set; }

Property Value

Func<String, K, V, int, Optional<Set<Integer>>>

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 String

The StreamPartitioner object

key K

The StreamPartitioner object

value V

The StreamPartitioner object

numPartitions int

The 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)

Parameters

arg0 String

String

arg1 K

K

arg2 V

V

arg3 int

int

Returns

Optional<Set<Integer>>

Optional