use of org.apache.hbase.thirdparty.com.google.protobuf.ServiceException in project hbase by apache.
the class MasterRpcServices method bypassProcedure.
/**
* Bypass specified procedure to completion. Procedure is marked completed but no actual work
* is done from the current state/ step onwards. Parents of the procedure are also marked for
* bypass.
*
* NOTE: this is a dangerous operation and may be used to unstuck buggy procedures. This may
* leave system in inconherent state. This may need to be followed by some cleanup steps/
* actions by operator.
*
* @return BypassProcedureToCompletionResponse indicating success or failure
*/
@Override
public MasterProtos.BypassProcedureResponse bypassProcedure(RpcController controller, MasterProtos.BypassProcedureRequest request) throws ServiceException {
try {
LOG.info("{} bypass procedures={}, waitTime={}, override={}, recursive={}", server.getClientIdAuditPrefix(), request.getProcIdList(), request.getWaitTime(), request.getOverride(), request.getRecursive());
List<Boolean> ret = server.getMasterProcedureExecutor().bypassProcedure(request.getProcIdList(), request.getWaitTime(), request.getOverride(), request.getRecursive());
return MasterProtos.BypassProcedureResponse.newBuilder().addAllBypassed(ret).build();
} catch (IOException e) {
throw new ServiceException(e);
}
}
use of org.apache.hbase.thirdparty.com.google.protobuf.ServiceException in project hbase by apache.
the class MasterRpcServices method reportFileArchival.
@Override
public FileArchiveNotificationResponse reportFileArchival(RpcController controller, FileArchiveNotificationRequest request) throws ServiceException {
try {
server.checkInitialized();
if (!QuotaUtil.isQuotaEnabled(server.getConfiguration())) {
return FileArchiveNotificationResponse.newBuilder().build();
}
server.getMasterQuotaManager().processFileArchivals(request, server.getConnection(), server.getConfiguration(), server.getFileSystem());
return FileArchiveNotificationResponse.newBuilder().build();
} catch (Exception e) {
throw new ServiceException(e);
}
}
use of org.apache.hbase.thirdparty.com.google.protobuf.ServiceException in project hbase by apache.
the class MasterRpcServices method getRSGroupInfoOfServer.
@Override
public GetRSGroupInfoOfServerResponse getRSGroupInfoOfServer(RpcController controller, GetRSGroupInfoOfServerRequest request) throws ServiceException {
Address hp = Address.fromParts(request.getServer().getHostName(), request.getServer().getPort());
LOG.info(server.getClientIdAuditPrefix() + " initiates rsgroup info retrieval, server=" + hp);
try {
if (server.getMasterCoprocessorHost() != null) {
server.getMasterCoprocessorHost().preGetRSGroupInfoOfServer(hp);
}
RSGroupInfo rsGroupInfo = server.getRSGroupInfoManager().getRSGroupOfServer(hp);
GetRSGroupInfoOfServerResponse resp;
if (rsGroupInfo != null) {
resp = GetRSGroupInfoOfServerResponse.newBuilder().setRSGroupInfo(ProtobufUtil.toProtoGroupInfo(rsGroupInfo)).build();
} else {
resp = GetRSGroupInfoOfServerResponse.getDefaultInstance();
}
if (server.getMasterCoprocessorHost() != null) {
server.getMasterCoprocessorHost().postGetRSGroupInfoOfServer(hp);
}
return resp;
} catch (IOException e) {
throw new ServiceException(e);
}
}
use of org.apache.hbase.thirdparty.com.google.protobuf.ServiceException in project hbase by apache.
the class MasterRpcServices method getTableDescriptors.
/**
* Get list of TableDescriptors for requested tables.
* @param c Unused (set to null).
* @param req GetTableDescriptorsRequest that contains:
* - tableNames: requested tables, or if empty, all are requested.
* @return GetTableDescriptorsResponse
* @throws ServiceException
*/
@Override
public GetTableDescriptorsResponse getTableDescriptors(RpcController c, GetTableDescriptorsRequest req) throws ServiceException {
try {
server.checkInitialized();
final String regex = req.hasRegex() ? req.getRegex() : null;
final String namespace = req.hasNamespace() ? req.getNamespace() : null;
List<TableName> tableNameList = null;
if (req.getTableNamesCount() > 0) {
tableNameList = new ArrayList<TableName>(req.getTableNamesCount());
for (HBaseProtos.TableName tableNamePB : req.getTableNamesList()) {
tableNameList.add(ProtobufUtil.toTableName(tableNamePB));
}
}
List<TableDescriptor> descriptors = server.listTableDescriptors(namespace, regex, tableNameList, req.getIncludeSysTables());
GetTableDescriptorsResponse.Builder builder = GetTableDescriptorsResponse.newBuilder();
if (descriptors != null && descriptors.size() > 0) {
// Add the table descriptors to the response
for (TableDescriptor htd : descriptors) {
builder.addTableSchema(ProtobufUtil.toTableSchema(htd));
}
}
return builder.build();
} catch (IOException ioe) {
throw new ServiceException(ioe);
}
}
use of org.apache.hbase.thirdparty.com.google.protobuf.ServiceException in project hbase by apache.
the class MasterRpcServices method getRSGroupInfo.
@Override
public GetRSGroupInfoResponse getRSGroupInfo(RpcController controller, GetRSGroupInfoRequest request) throws ServiceException {
String groupName = request.getRSGroupName();
LOG.info(server.getClientIdAuditPrefix() + " initiates rsgroup info retrieval, group=" + groupName);
try {
if (server.getMasterCoprocessorHost() != null) {
server.getMasterCoprocessorHost().preGetRSGroupInfo(groupName);
}
RSGroupInfo rsGroupInfo = server.getRSGroupInfoManager().getRSGroup(groupName);
GetRSGroupInfoResponse resp;
if (rsGroupInfo != null) {
resp = GetRSGroupInfoResponse.newBuilder().setRSGroupInfo(ProtobufUtil.toProtoGroupInfo(rsGroupInfo)).build();
} else {
resp = GetRSGroupInfoResponse.getDefaultInstance();
}
if (server.getMasterCoprocessorHost() != null) {
server.getMasterCoprocessorHost().postGetRSGroupInfo(groupName);
}
return resp;
} catch (IOException e) {
throw new ServiceException(e);
}
}
Aggregations