@Override public void postDeleteTable(ObserverContext<MasterCoprocessorEnvironment> ctx, TableName tableName) throws IOException { try { RSGroupInfo group = groupAdminServer.getRSGroupInfoOfTable(tableName); if (group != null) { LOG.debug(String.format("Removing deleted table '%s' from rsgroup '%s'", tableName, group.getName())); groupAdminServer.moveTables(Sets.newHashSet(tableName), null); } } catch (IOException ex) { LOG.debug("Failed to perform RSGroup information cleanup for table: " + tableName, ex); } }
@Override public void getRSGroupInfoOfTable(RpcController controller, GetRSGroupInfoOfTableRequest request, RpcCallback<GetRSGroupInfoOfTableResponse> done) { GetRSGroupInfoOfTableResponse.Builder builder = GetRSGroupInfoOfTableResponse.newBuilder(); TableName tableName = ProtobufUtil.toTableName(request.getTableName()); LOG.info(master.getClientIdAuditPrefix() + " initiates rsgroup info retrieval, table=" + tableName); try { if (master.getMasterCoprocessorHost() != null) { master.getMasterCoprocessorHost().preGetRSGroupInfoOfTable(tableName); } checkPermission("getRSGroupInfoOfTable"); RSGroupInfo RSGroupInfo = groupAdminServer.getRSGroupInfoOfTable(tableName); if (RSGroupInfo != null) { builder.setRSGroupInfo(RSGroupProtobufUtil.toProtoGroupInfo(RSGroupInfo)); } if (master.getMasterCoprocessorHost() != null) { master.getMasterCoprocessorHost().postGetRSGroupInfoOfTable(tableName); } } catch (IOException e) { CoprocessorRpcUtils.setControllerException(controller, e); } done.run(builder.build()); }
@Override public void postDeleteTable(ObserverContext<MasterCoprocessorEnvironment> ctx, TableName tableName) throws IOException { try { RSGroupInfo group = groupAdminServer.getRSGroupInfoOfTable(tableName); if (group != null) { LOG.debug(String.format("Removing deleted table '%s' from rsgroup '%s'", tableName, group.getName())); groupAdminServer.moveTables(Sets.newHashSet(tableName), null); } } catch (IOException ex) { LOG.debug("Failed to perform RSGroup information cleanup for table: " + tableName, ex); } }
@Override public void postDeleteTable(ObserverContext<MasterCoprocessorEnvironment> ctx, TableName tableName) throws IOException { try { RSGroupInfo group = groupAdminServer.getRSGroupInfoOfTable(tableName); if (group != null) { LOG.debug(String.format("Removing deleted table '%s' from rsgroup '%s'", tableName, group.getName())); groupAdminServer.moveTables(Sets.newHashSet(tableName), null); } } catch (IOException ex) { LOG.debug("Failed to perform RSGroup information cleanup for table: " + tableName, ex); } }
@Override public void getRSGroupInfoOfTable(RpcController controller, GetRSGroupInfoOfTableRequest request, RpcCallback<GetRSGroupInfoOfTableResponse> done) { GetRSGroupInfoOfTableResponse.Builder builder = GetRSGroupInfoOfTableResponse.newBuilder(); TableName tableName = ProtobufUtil.toTableName(request.getTableName()); LOG.info(master.getClientIdAuditPrefix() + " initiates rsgroup info retrieval, table=" + tableName); try { checkPermission("getRSGroupInfoOfTable"); RSGroupInfo RSGroupInfo = groupAdminServer.getRSGroupInfoOfTable(tableName); if (RSGroupInfo != null) { builder.setRSGroupInfo(RSGroupProtobufUtil.toProtoGroupInfo(RSGroupInfo)); } } catch (IOException e) { CoprocessorRpcUtils.setControllerException(controller, e); } done.run(builder.build()); }
@Override public void getRSGroupInfoOfTable(RpcController controller, GetRSGroupInfoOfTableRequest request, RpcCallback<GetRSGroupInfoOfTableResponse> done) { GetRSGroupInfoOfTableResponse.Builder builder = GetRSGroupInfoOfTableResponse.newBuilder(); TableName tableName = ProtobufUtil.toTableName(request.getTableName()); LOG.info(master.getClientIdAuditPrefix() + " initiates rsgroup info retrieval, table=" + tableName); try { checkPermission("getRSGroupInfoOfTable"); RSGroupInfo RSGroupInfo = groupAdminServer.getRSGroupInfoOfTable(tableName); if (RSGroupInfo != null) { builder.setRSGroupInfo(RSGroupProtobufUtil.toProtoGroupInfo(RSGroupInfo)); } } catch (IOException e) { CoprocessorRpcUtils.setControllerException(controller, e); } done.run(builder.build()); }