Class KNetConnector
The generic class which is the base of both source or sink connectors
public abstract class KNetConnector : KNetCommon, IKNetConnector, IKNetCommon, IKNetConnectLogging, IConnector, IVersion
- Inheritance
-
KNetConnector
- Implements
- Derived
- Inherited Members
Fields
taskDictionary
The set of allocated KNetTask with their associated identifiers
protected ConcurrentDictionary<long, KNetTask> taskDictionary
Field Value
Properties
ConnectorName
The unique name of the connector
public abstract string ConnectorName { get; }
Property Value
Properties
The properties retrieved from MASES.KNet.Connect.KNetConnector.StartInternal()
public IReadOnlyDictionary<string, string> Properties { get; }
Property Value
TaskClassType
public abstract Type TaskClassType { get; }
Property Value
Methods
AllocateTask(long)
Allocates a task object based on KNetTask
public object AllocateTask(long taskId)
Parameters
taskIdlongThe unique id generated from JAva side
Returns
- object
The local .NET object
Config()
Not implemented
public ConfigDef Config()
Returns
Exceptions
- NotImplementedException
Invoked in Java before any initialization
Context<T>()
An helper function to read context data from Java side
protected T Context<T>()
Returns
- T
The
T
Type Parameters
TThe expected return Type
Exceptions
Initialize(ConnectorContext)
Not implemented
public void Initialize(ConnectorContext ctx)
Parameters
ctxConnectorContext
Exceptions
- NotImplementedException
Invoked in Java before any initialization
Initialize(ConnectorContext, List<Map<String, String>>)
Not implemented
public void Initialize(ConnectorContext ctx, List<Map<String, String>> taskConfigs)
Parameters
ctxConnectorContexttaskConfigsList<Map<String, String>>
Exceptions
- NotImplementedException
Invoked in Java before any initialization
Reconfigure(Map<String, String>)
Not implemented
public void Reconfigure(Map<String, String> props)
Parameters
Exceptions
Start(Map<String, String>)
Not implemented
public virtual void Start(Map<String, String> props)
Parameters
Exceptions
- NotImplementedException
Local version with a different signature
Start(IReadOnlyDictionary<string, string>)
Implement the method to execute the start action
public abstract void Start(IReadOnlyDictionary<string, string> props)
Parameters
propsIReadOnlyDictionary<string, string>The set of properties returned from Apache Kafka Connect framework: the IReadOnlyDictionary<TKey, TValue> contains the same info from configuration file.
Stop()
Implement the method to execute the stop action
public abstract void Stop()
TaskClass()
Not implemented
public Class TaskClass()
Returns
Exceptions
- NotImplementedException
Invoked in Java before any initialization
TaskConfigs(int)
Not implemented
public List<Map<String, String>> TaskConfigs(int maxTasks)
Parameters
maxTasksint
Returns
Exceptions
- NotImplementedException
Invoked using the other signature
TaskConfigs(int, int, Map<String, String>)
Direct implementation can be used instead of TaskConfigs(int, int, IDictionary<string, string>)
public virtual bool TaskConfigs(int currentTask, int maxTasks, Map<String, String> props)
Parameters
Returns
TaskConfigs(int, int, IDictionary<string, string>)
Invoked during allocation of tasks from Apache Kafka Connect
public abstract bool TaskConfigs(int currentTask, int maxTasks, IDictionary<string, string> config)
Parameters
currentTaskintThe actual task index
maxTasksintMax tasks as defined from Apache Kafka Connect framework
configIDictionary<string, string>The IDictionary<TKey, TValue> to be filled in with properties for the task: the same will be received from Start(IReadOnlyDictionary<string, string>)
Returns
Remarks
If the connector needs a single task and maxTasks is higher than 1, returning true immediately only one configuration is returned to Apache Kafka Connect framework.
In other word it is possible to stop the configuration requests at any time; only the first one is reported in any case since at least one shall be available.
To configure all maxTasks return always false.
Validate(Map<String, String>)
Not implemented
public Config Validate(Map<String, String> connectorConfigs)
Parameters
Returns
Exceptions
- NotImplementedException
Invoked in Java before any initialization
Version()
Not implemented
public string Version()
Returns
Exceptions
- NotImplementedException
Invoked in Java before any initialization