-
Notifications
You must be signed in to change notification settings - Fork 403
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a1c43d4
commit 82b9829
Showing
5 changed files
with
64 additions
and
4 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
29 changes: 29 additions & 0 deletions
29
raft-java-core/src/main/java/com/github/wenweihu86/raft/service/RaftClientServiceAsync.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,29 @@ | ||
package com.github.wenweihu86.raft.service; | ||
|
||
import com.github.wenweihu86.raft.proto.RaftMessage; | ||
import com.github.wenweihu86.rpc.client.RPCCallback; | ||
|
||
import java.util.concurrent.Future; | ||
|
||
/** | ||
* 用于生成client异步调用所需的proxy | ||
* Created by wenweihu86 on 2017/5/14. | ||
*/ | ||
public interface RaftClientServiceAsync extends RaftClientService { | ||
|
||
Future<RaftMessage.GetLeaderResponse> getLeader( | ||
RaftMessage.GetLeaderRequest request, | ||
RPCCallback<RaftMessage.GetLeaderResponse> callback); | ||
|
||
Future<RaftMessage.GetConfigurationResponse> getConfiguration( | ||
RaftMessage.GetConfigurationRequest request, | ||
RPCCallback<RaftMessage.GetConfigurationResponse> callback); | ||
|
||
Future<RaftMessage.AddPeersResponse> addPeers( | ||
RaftMessage.AddPeersRequest request, | ||
RPCCallback<RaftMessage.AddPeersResponse> callback); | ||
|
||
Future<RaftMessage.RemovePeersResponse> removePeers( | ||
RaftMessage.RemovePeersRequest request, | ||
RPCCallback<RaftMessage.RemovePeersResponse> callback); | ||
} |
25 changes: 25 additions & 0 deletions
25
...java-core/src/main/java/com/github/wenweihu86/raft/service/RaftConsensusServiceAsync.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,25 @@ | ||
package com.github.wenweihu86.raft.service; | ||
|
||
import com.github.wenweihu86.raft.proto.RaftMessage; | ||
import com.github.wenweihu86.rpc.client.RPCCallback; | ||
|
||
import java.util.concurrent.Future; | ||
|
||
/** | ||
* 用于生成client异步调用所需的proxy | ||
* Created by wenweihu86 on 2017/5/2. | ||
*/ | ||
public interface RaftConsensusServiceAsync extends RaftConsensusService { | ||
|
||
Future<RaftMessage.VoteResponse> requestVote( | ||
RaftMessage.VoteRequest request, | ||
RPCCallback<RaftMessage.VoteResponse> callback); | ||
|
||
Future<RaftMessage.AppendEntriesResponse> appendEntries( | ||
RaftMessage.AppendEntriesRequest request, | ||
RPCCallback<RaftMessage.AppendEntriesResponse> callback); | ||
|
||
Future<RaftMessage.InstallSnapshotResponse> installSnapshot( | ||
RaftMessage.InstallSnapshotRequest request, | ||
RPCCallback<RaftMessage.InstallSnapshotResponse> callback); | ||
} |