forked from apache/eventmesh
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
close to finish full read and begin full write
- Loading branch information
Showing
15 changed files
with
501 additions
and
200 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
...main/java/org/apache/eventmesh/common/config/connector/rdb/canal/CanalSinkFullConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package org.apache.eventmesh.common.config.connector.rdb.canal; | ||
|
||
import lombok.Data; | ||
import lombok.EqualsAndHashCode; | ||
import org.apache.eventmesh.common.config.connector.SinkConfig; | ||
|
||
|
||
@Data | ||
@EqualsAndHashCode(callSuper = true) | ||
public class CanalSinkFullConfig extends SinkConfig { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 4 additions & 1 deletion
5
.../main/java/org/apache/eventmesh/common/config/connector/rdb/canal/JobRdbFullPosition.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,18 @@ | ||
package org.apache.eventmesh.common.config.connector.rdb.canal; | ||
|
||
import lombok.Data; | ||
import lombok.ToString; | ||
|
||
import java.math.BigDecimal; | ||
|
||
@Data | ||
@ToString | ||
public class JobRdbFullPosition { | ||
private String jobId; | ||
private String schema; | ||
private String tableName; | ||
private String curPrimaryKey; | ||
private String primaryKeyRecords; | ||
private long maxCount; | ||
private boolean finished; | ||
private BigDecimal percent; | ||
} |
18 changes: 18 additions & 0 deletions
18
.../src/main/java/org/apache/eventmesh/common/remote/offset/canal/CanalFullRecordOffset.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package org.apache.eventmesh.common.remote.offset.canal; | ||
|
||
import lombok.Data; | ||
import lombok.EqualsAndHashCode; | ||
import lombok.ToString; | ||
import org.apache.eventmesh.common.config.connector.rdb.canal.JobRdbFullPosition; | ||
import org.apache.eventmesh.common.remote.offset.RecordOffset; | ||
|
||
@Data | ||
@EqualsAndHashCode(callSuper = true) | ||
@ToString | ||
public class CanalFullRecordOffset extends RecordOffset { | ||
private JobRdbFullPosition position; | ||
@Override | ||
public Class<? extends RecordOffset> getRecordOffsetClass() { | ||
return CanalFullRecordOffset.class; | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
...c/main/java/org/apache/eventmesh/common/remote/offset/canal/CanalFullRecordPartition.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.apache.eventmesh.common.remote.offset.canal; | ||
|
||
import lombok.Data; | ||
import lombok.EqualsAndHashCode; | ||
import lombok.ToString; | ||
import org.apache.eventmesh.common.remote.offset.RecordPartition; | ||
|
||
|
||
@Data | ||
@ToString | ||
@EqualsAndHashCode(callSuper = true) | ||
public class CanalFullRecordPartition extends RecordPartition { | ||
private String schema; | ||
private String table; | ||
|
||
@Override | ||
public Class<? extends RecordPartition> getRecordPartitionClass() { | ||
return CanalFullRecordPartition.class; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
...main/java/org/apache/eventmesh/connector/canal/sink/connector/CanalSinkFullConnector.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
package org.apache.eventmesh.connector.canal.sink.connector; | ||
|
||
import org.apache.eventmesh.common.config.connector.Config; | ||
import org.apache.eventmesh.common.config.connector.rdb.canal.CanalSinkFullConfig; | ||
import org.apache.eventmesh.openconnect.api.ConnectorCreateService; | ||
import org.apache.eventmesh.openconnect.api.connector.ConnectorContext; | ||
import org.apache.eventmesh.openconnect.api.connector.SinkConnectorContext; | ||
import org.apache.eventmesh.openconnect.api.sink.Sink; | ||
import org.apache.eventmesh.openconnect.offsetmgmt.api.data.ConnectRecord; | ||
|
||
import java.util.List; | ||
|
||
public class CanalSinkFullConnector implements Sink, ConnectorCreateService<Sink> { | ||
private CanalSinkFullConfig config; | ||
@Override | ||
public void start() throws Exception { | ||
|
||
} | ||
|
||
@Override | ||
public void stop() throws Exception { | ||
|
||
} | ||
|
||
@Override | ||
public Sink create() { | ||
return new CanalSinkFullConnector(); | ||
} | ||
|
||
@Override | ||
public Class<? extends Config> configClass() { | ||
return CanalSinkFullConfig.class; | ||
} | ||
|
||
@Override | ||
public void init(Config config) throws Exception { | ||
this.config = (CanalSinkFullConfig) config; | ||
} | ||
|
||
@Override | ||
public void init(ConnectorContext connectorContext) throws Exception { | ||
this.config = (CanalSinkFullConfig)((SinkConnectorContext)connectorContext).getSinkConfig(); | ||
} | ||
|
||
@Override | ||
public void commit(ConnectRecord record) { | ||
|
||
} | ||
|
||
@Override | ||
public String name() { | ||
return null; | ||
} | ||
|
||
@Override | ||
public void put(List<ConnectRecord> sinkRecords) { | ||
|
||
} | ||
} |
Oops, something went wrong.