use of com.torodb.mongodb.commands.pojos.MemberState in project torodb by torodb.
the class ReplCoordinatorStateMachine method setState.
private void setState(@Nonnull ReplCoordinatorState state) {
this.state = state;
MemberState rsMemberState;
switch(state) {
case RECOVERY:
assert recoveryService != null;
assert oplogReplierService == null;
rsMemberState = MemberState.RS_RECOVERING;
break;
case SECONDARY:
assert recoveryService == null;
assert oplogReplierService != null;
rsMemberState = MemberState.RS_SECONDARY;
break;
default:
assert recoveryService == null;
assert oplogReplierService == null;
rsMemberState = MemberState.RS_UNKNOWN;
}
metrics.getMemberState().setValue(rsMemberState.name());
metrics.getMemberStateCounters().get(rsMemberState).inc();
}
Aggregations