Table of Contents

Class KNetConnector

Namespace
MASES.KNet.Connect
Assembly
MASES.KNet.dll

The generic class which is the base of both source or sink connectors

public abstract class KNetConnector : IKNetConnector, IConnector, IVersion, IKNetConnectLogging
Inheritance
KNetConnector
Implements
Derived
Inherited Members

Constructors

KNetConnector()

Initializer

public KNetConnector()

Fields

taskDictionary

The set of allocated KNetTask with their associated identifiers

protected ConcurrentDictionary<long, KNetTask> taskDictionary

Field Value

ConcurrentDictionary<long, KNetTask>

Properties

ConnectorName

The unique name of the connector

public abstract string ConnectorName { get; }

Property Value

string

IsDebugEnabled

Reports if debug level is enabled

public bool IsDebugEnabled { get; }

Property Value

bool

IsErrorEnabled

Reports if error level is enabled

public bool IsErrorEnabled { get; }

Property Value

bool

IsInfoEnabled

Reports if info level is enabled

public bool IsInfoEnabled { get; }

Property Value

bool

IsTraceEnabled

Reports if trace level is enabled

public bool IsTraceEnabled { get; }

Property Value

bool

IsWarnEnabled

Reports if warning level is enabled

public bool IsWarnEnabled { get; }

Property Value

bool

Properties

The properties retrieved from StartInternal()

public IReadOnlyDictionary<string, string> Properties { get; }

Property Value

IReadOnlyDictionary<string, string>

ReflectedConnectorClassName

The unique name used to map objects between JVM and .NET

public abstract string ReflectedConnectorClassName { get; }

Property Value

string

TaskClassType

The Type of task to be allocated, it shall inherits from KNetTask

public abstract Type TaskClassType { get; }

Property Value

Type

Methods

AllocateTask(long)

Allocates a task object based on KNetTask

public object AllocateTask(long taskId)

Parameters

taskId long

The unique id generated from JAva side

Returns

object

The local .NET object

Config()

Not implemented

public ConfigDef Config()

Returns

ConfigDef

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

T

The expected return Type

Exceptions

InvalidOperationException

DataToExchange(object)

An helper function to read the data from Java side

protected void DataToExchange(object data)

Parameters

data object

Exceptions

InvalidOperationException

DataToExchange<T>()

An helper function to read the data from Java side

protected T DataToExchange<T>()

Returns

T

The T

Type Parameters

T

The expected return Type

Exceptions

InvalidOperationException

ExecuteOnConnector(string, params object[])

An helper function to read the data from Java side

protected void ExecuteOnConnector(string method, params object[] args)

Parameters

method string

Method name to be invoked

args object[]

Arguments of the method to be invoked

Exceptions

InvalidOperationException

ExecuteOnConnector<T>(string, params object[])

An helper function to read the data from Java side

protected T ExecuteOnConnector<T>(string method, params object[] args)

Parameters

method string

Method name to be invoked

args object[]

Arguments of the method to be invoked

Returns

T

The T

Type Parameters

T

The expected return Type

Exceptions

InvalidOperationException

Initialize(ConnectorContext)

Not implemented

public void Initialize(ConnectorContext ctx)

Parameters

ctx ConnectorContext

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

ctx ConnectorContext
taskConfigs List<Map<String, String>>

Exceptions

NotImplementedException

Invoked in Java before any initialization

LogDebug(string)

Write a debug

public void LogDebug(string var1)

Parameters

var1 string

String to write

LogDebug(string, JVMBridgeException)

Write a debug

public void LogDebug(string var1, JVMBridgeException var2)

Parameters

var1 string

String to write

var2 JVMBridgeException

Associated MASES.JCOBridge.C2JBridge.JVMBridgeException

LogError(string)

Write a error

public void LogError(string var1)

Parameters

var1 string

String to write

LogError(string, JVMBridgeException)

Write a error

public void LogError(string var1, JVMBridgeException var2)

Parameters

var1 string

String to write

var2 JVMBridgeException

Associated MASES.JCOBridge.C2JBridge.JVMBridgeException

LogInfo(string)

Write a info

public void LogInfo(string var1)

Parameters

var1 string

String to write

LogInfo(string, JVMBridgeException)

Write a info

public void LogInfo(string var1, JVMBridgeException var2)

Parameters

var1 string

String to write

var2 JVMBridgeException

Associated MASES.JCOBridge.C2JBridge.JVMBridgeException

LogTrace(string)

Write a trace

public void LogTrace(string var1)

Parameters

var1 string

String to write

LogTrace(string, JVMBridgeException)

Write a trace

public void LogTrace(string var1, JVMBridgeException var2)

Parameters

var1 string

String to write

var2 JVMBridgeException

Associated MASES.JCOBridge.C2JBridge.JVMBridgeException

LogWarn(string)

Write a warning

public void LogWarn(string var1)

Parameters

var1 string

String to write

LogWarn(string, JVMBridgeException)

Write a warning

public void LogWarn(string var1, JVMBridgeException var2)

Parameters

var1 string

String to write

var2 JVMBridgeException

Associated MASES.JCOBridge.C2JBridge.JVMBridgeException

Reconfigure(Map<String, String>)

Not implemented

public void Reconfigure(Map<String, String> props)

Parameters

props Map<String, String>

Exceptions

NotImplementedException

Start(Map<String, String>)

Not implemented

public void Start(Map<String, String> props)

Parameters

props Map<String, String>

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

props IReadOnlyDictionary<string, string>

The set of properties returned from Apache Kafka Connect framework: the IReadOnlyDictionary<TKey, TValue> contains the same info from configuration file.

StartInternal()

Public method used from Java to trigger Start(Map<String, String>)

public void StartInternal()

Stop()

Implement the method to execute the stop action

public abstract void Stop()

StopInternal()

Public method used from Java to trigger Stop()

public void StopInternal()

TaskClass()

Not implemented

public Class TaskClass()

Returns

Class

Exceptions

NotImplementedException

Invoked in Java before any initialization

TaskConfigs(int)

Not implemented

public List<Map<String, String>> TaskConfigs(int maxTasks)

Parameters

maxTasks int

Returns

List<Map<String, String>>

Exceptions

NotImplementedException

Invoked using the other signature

TaskConfigs(int, IDictionary<string, string>)

Invoked during allocation of tasks from Apache Kafka Connect

public abstract void TaskConfigs(int index, IDictionary<string, string> config)

Parameters

index int

The actual index

config IDictionary<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>)

TaskConfigsInternal(int)

Public method used from Java to trigger TaskConfigs(int, IDictionary<string, string>)

public void TaskConfigsInternal(int index)

Parameters

index int

Validate(Map<String, String>)

Not implemented

public Config Validate(Map<String, String> connectorConfigs)

Parameters

connectorConfigs Map<String, String>

Returns

Config

Exceptions

NotImplementedException

Invoked in Java before any initialization

Version()

Not implemented

public string Version()

Returns

string

Exceptions

NotImplementedException

Invoked in Java before any initialization