Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ISSUE#19] Fix the compilation errors that method parameters do not match when implementing the SinkTaskContext in WorkerSinkTask #20

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import io.openmessaging.connect.runtime.common.ConnectKeyValue;
import io.openmessaging.connect.runtime.common.LoggerName;
import io.openmessaging.connect.runtime.common.QueuePartition;
import io.openmessaging.connector.api.common.QueueMetaData;
import io.openmessaging.connector.api.data.Converter;
import io.openmessaging.connector.api.data.SinkDataEntry;
import io.openmessaging.connector.api.data.SourceDataEntry;
Expand Down Expand Up @@ -105,38 +106,34 @@ public void run() {
try {
sinkTask.initialize(new SinkTaskContext() {
@Override
public void resetOffset(String queueName, Long offset) {
//TODO oms-1.0.0-alpha支持获取, 并且queueName 是否需要换成QueuePartition
QueuePartition queuePartition = new QueuePartition(queueName, 0);
public void resetOffset(QueueMetaData queueMetaData, Long offset) {
QueuePartition queuePartition = new QueuePartition(queueMetaData.getQueueName(), 0);
partitionOffsetMap.put(queuePartition, offset);
}

@Override
public void resetOffset(Map<String, Long> offsets) {
//TODO oms-1.0.0-alpha支持获取, 并且queueName 是否需要换成QueuePartition
for (Map.Entry<String, Long> entry : offsets.entrySet()) {
QueuePartition queuePartition = new QueuePartition(entry.getKey(), 0);
public void resetOffset(Map<QueueMetaData, Long> offsets) {
for (Map.Entry<QueueMetaData, Long> entry : offsets.entrySet()) {
QueuePartition queuePartition = new QueuePartition(entry.getKey().getQueueName(), 0);
partitionOffsetMap.put(queuePartition, entry.getValue());
}
}

@Override
public void pause(List<String> queueNames) {
//TODO queueName 是否需要换成QueuePartition
if (null != queueNames && queueNames.size() > 0) {
for (String queueName : queueNames) {
QueuePartition queuePartition = new QueuePartition(queueName, 0);
public void pause(List<QueueMetaData> queueMetaDataList) {
if (null != queueMetaDataList && queueMetaDataList.size() > 0) {
for (QueueMetaData queueMetaData : queueMetaDataList) {
QueuePartition queuePartition = new QueuePartition(queueMetaData.getQueueName(), 0);
partitionStatusMap.put(queuePartition, PartitionStatus.PAUSE);
}
}
}

@Override
public void resume(List<String> queueNames) {
//TODO queueName 是否需要换成QueuePartition
if (null != queueNames && queueNames.size() > 0) {
for (String queueName : queueNames) {
QueuePartition queuePartition = new QueuePartition(queueName, 0);
public void resume(List<QueueMetaData> queueMetaDataList) {
if (null != queueMetaDataList && queueMetaDataList.size() > 0) {
for (QueueMetaData queueMetaData : queueMetaDataList) {
QueuePartition queuePartition = new QueuePartition(queueMetaData.getQueueName(), 0);
partitionStatusMap.remove(queuePartition);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

import java.util.List;

public class TestConnector implements Connector {
public class TestConnector extends Connector {

@Override
public String verifyAndSetConfig(KeyValue config) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ public void testGetTaskConfigs() throws Exception {

}

class TestConnector implements Connector {
class TestConnector extends Connector {

private KeyValue config;

Expand Down