-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(runtime) [ISSUE #570] ASoC connect runtime optimization: Offset …
…synchronization (#624) * Optimize configuration synchronization * Slave nodes serve read-only requests, and fix format problems * Fix format * Fix offset synchronization have the same partitions * Update taskId and Fix bug when task restart * Change offset commit mode to incremental updating * Fix get clientId problem * Add RPC * Fix format * Fix gRPC generated files checkstyle * Fix bugs and adjust the format * Fix bug
- Loading branch information
Showing
49 changed files
with
5,016 additions
and
724 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
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
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
50 changes: 50 additions & 0 deletions
50
...nnect-runtime/src/main/java/org/apache/rocketmq/connect/runtime/common/ConfigWrapper.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,50 @@ | ||
/* | ||
* 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.rocketmq.connect.runtime.common; | ||
|
||
public class ConfigWrapper extends ConnAndTaskConfigs { | ||
|
||
private String leader; | ||
|
||
private ConnAndTaskConfigs connAndTaskConfigs; | ||
|
||
public String getLeader() { | ||
return leader; | ||
} | ||
|
||
public void setLeader(String leader) { | ||
this.leader = leader; | ||
} | ||
|
||
public ConnAndTaskConfigs getConnAndTaskConfigs() { | ||
return connAndTaskConfigs; | ||
} | ||
|
||
public void setConnAndTaskConfigs(ConnAndTaskConfigs connAndTaskConfigs) { | ||
this.connAndTaskConfigs = connAndTaskConfigs; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "ConnAndTaskConfigs{" + | ||
"leader={" + this.getLeader() + "}" + | ||
"connectorConfigs=" + this.connAndTaskConfigs.getConnectorConfigs() + | ||
", taskConfigs=" + this.connAndTaskConfigs.getTaskConfigs() + | ||
'}'; | ||
} | ||
} |
64 changes: 64 additions & 0 deletions
64
...nnect-runtime/src/main/java/org/apache/rocketmq/connect/runtime/common/PositionValue.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,64 @@ | ||
/* | ||
* 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.rocketmq.connect.runtime.common; | ||
|
||
import java.io.Serializable; | ||
import java.nio.ByteBuffer; | ||
import java.util.Objects; | ||
|
||
public class PositionValue implements Serializable { | ||
|
||
private ByteBuffer partition; | ||
|
||
private ByteBuffer position; | ||
|
||
public PositionValue(ByteBuffer partition, ByteBuffer position) { | ||
this.partition = partition; | ||
this.position = position; | ||
} | ||
|
||
public ByteBuffer getPartition() { | ||
return partition; | ||
} | ||
|
||
public void setPartition(ByteBuffer partition) { | ||
this.partition = partition; | ||
} | ||
|
||
public ByteBuffer getPosition() { | ||
return position; | ||
} | ||
|
||
public void setPosition(ByteBuffer position) { | ||
this.position = position; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) return true; | ||
if (!(o instanceof PositionValue)) return false; | ||
PositionValue that = (PositionValue) o; | ||
return Objects.equals(getPartition(), that.getPartition()) && | ||
Objects.equals(getPosition(), that.getPosition()); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(getPartition(), getPosition()); | ||
} | ||
} |
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
22 changes: 22 additions & 0 deletions
22
...ect-runtime/src/main/java/org/apache/rocketmq/connect/runtime/config/RPCConfigDefine.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,22 @@ | ||
/* | ||
* 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.rocketmq.connect.runtime.config; | ||
|
||
public class RPCConfigDefine { | ||
public static final int PORT = 50051; | ||
} |
Oops, something went wrong.