Search in sources :

Example 6 with TaskStatus

use of org.apache.kafka.connect.runtime.TaskStatus in project kafka by apache.

the class MemoryStatusBackingStoreTest method deleteTaskStatus.

@Test
public void deleteTaskStatus() {
    MemoryStatusBackingStore store = new MemoryStatusBackingStore();
    ConnectorTaskId taskId = new ConnectorTaskId("connector", 0);
    store.put(new TaskStatus(taskId, ConnectorStatus.State.RUNNING, "localhost:8083", 0));
    store.put(new TaskStatus(taskId, ConnectorStatus.State.DESTROYED, "localhost:8083", 0));
    assertNull(store.get(taskId));
}
Also used : ConnectorTaskId(org.apache.kafka.connect.util.ConnectorTaskId) TaskStatus(org.apache.kafka.connect.runtime.TaskStatus) Test(org.junit.Test)

Example 7 with TaskStatus

use of org.apache.kafka.connect.runtime.TaskStatus in project kafka by apache.

the class MemoryStatusBackingStoreTest method putAndGetTaskStatus.

@Test
public void putAndGetTaskStatus() {
    MemoryStatusBackingStore store = new MemoryStatusBackingStore();
    ConnectorTaskId taskId = new ConnectorTaskId("connector", 0);
    TaskStatus status = new TaskStatus(taskId, ConnectorStatus.State.RUNNING, "localhost:8083", 0);
    store.put(status);
    assertEquals(status, store.get(taskId));
    assertEquals(Collections.singleton(status), store.getAll("connector"));
}
Also used : ConnectorTaskId(org.apache.kafka.connect.util.ConnectorTaskId) TaskStatus(org.apache.kafka.connect.runtime.TaskStatus) Test(org.junit.Test)

Aggregations

TaskStatus (org.apache.kafka.connect.runtime.TaskStatus)7 ConnectorTaskId (org.apache.kafka.connect.util.ConnectorTaskId)4 Test (org.junit.Test)4 HashMap (java.util.HashMap)2 MockTime (org.apache.kafka.common.utils.MockTime)2 SchemaAndValue (org.apache.kafka.connect.data.SchemaAndValue)2 Map (java.util.Map)1 Callback (org.apache.kafka.clients.producer.Callback)1 ConfigException (org.apache.kafka.common.config.ConfigException)1 RetriableException (org.apache.kafka.common.errors.RetriableException)1 Schema (org.apache.kafka.connect.data.Schema)1 Struct (org.apache.kafka.connect.data.Struct)1 EasyMock.anyObject (org.easymock.EasyMock.anyObject)1