Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 453
RATIS-1709 Support specify ThreadGroup for Daemon threads#733
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
84af08911c54697a7524817f7fc268f6a764ca2d8717d2e9ef80a88b4777d5c705c4ebeb76c1a66cac90ec50556c694ddfae22a81119ec6b77f92d8574f5cfb4a20193ddcae9443a37e9df41157e5e01281977929ce128100681d953ba4b9b82430805575a72ddce34File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -64,7 +64,9 @@ int update(AtomicInteger outstanding) { | ||
| private final AtomicInteger outstandingOp = new AtomicInteger(); | ||
| FollowerState(RaftServerImpl server, Object reason) { | ||
| super(newBuilder().setName(server.getMemberId() + "-" + JavaUtils.getClassSimpleName(FollowerState.class))); | ||
| super(newBuilder() | ||
ContributorAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is to get rid of the extra | ||
| .setName(server.getMemberId() + "-" + JavaUtils.getClassSimpleName(FollowerState.class)) | ||
| .setThreadGroup(server.getThreadGroup())); | ||
| this.server = server; | ||
| this.reason = reason; | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -97,7 +97,7 @@ | ||
| class RaftServerImpl implements RaftServer.Division, | ||
| RaftServerProtocol, RaftServerAsynchronousProtocol, | ||
| RaftClientProtocol, RaftClientAsynchronousProtocol{ | ||
| RaftClientProtocol, RaftClientAsynchronousProtocol{ | ||
| private static final String CLASS_NAME = JavaUtils.getClassSimpleName(RaftServerImpl.class); | ||
| static final String REQUEST_VOTE = CLASS_NAME + ".requestVote"; | ||
| static final String APPEND_ENTRIES = CLASS_NAME + ".appendEntries"; | ||
| @@ -189,6 +189,7 @@ public long[] getFollowerNextIndices() { | ||
| private final ExecutorService clientExecutor; | ||
| private final AtomicBoolean firstElectionSinceStartup = new AtomicBoolean(true); | ||
| private final ThreadGroup threadGroup; | ||
| RaftServerImpl(RaftGroup group, StateMachine stateMachine, RaftServerProxy proxy, RaftStorage.StartupOption option) | ||
| throws IOException { | ||
| @@ -216,6 +217,7 @@ public long[] getFollowerNextIndices() { | ||
| getMemberId(), () -> commitInfoCache::get, retryCache::getStatistics); | ||
| this.startComplete = new AtomicBoolean(false); | ||
| this.threadGroup = new ThreadGroup(proxy.getThreadGroup(), getMemberId().toString()); | ||
| this.raftClient = JavaUtils.memoize(() -> RaftClient.newBuilder() | ||
| .setRaftGroup(group) | ||
| @@ -274,6 +276,11 @@ TimeDuration getSleepDeviationThreshold() { | ||
| return sleepDeviationThreshold; | ||
| } | ||
| @Override | ||
| public ThreadGroup getThreadGroup() { | ||
jiacheliu3 marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| return threadGroup; | ||
| } | ||
| @Override | ||
| public StateMachine getStateMachine() { | ||
| return stateMachine; | ||
Uh oh!
There was an error while loading. Please reload this page.