use of org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.CompactionSwitchResponse in project hbase by apache.
the class RSRpcServices method compactionSwitch.
@Override
public CompactionSwitchResponse compactionSwitch(RpcController controller, CompactionSwitchRequest request) throws ServiceException {
rpcPreCheck("compactionSwitch");
final CompactSplit compactSplitThread = server.getCompactSplitThread();
requestCount.increment();
boolean prevState = compactSplitThread.isCompactionsEnabled();
CompactionSwitchResponse response = CompactionSwitchResponse.newBuilder().setPrevState(prevState).build();
if (prevState == request.getEnabled()) {
// passed in requested state is same as current state. No action required
return response;
}
compactSplitThread.switchCompaction(request.getEnabled());
return response;
}
Aggregations