@Override public TableState getTableState(TableName tableName) throws IOException { checkClosed(); TableState tableState = MetaTableAccessor.getTableState(this, tableName); if (tableState == null) { throw new TableNotFoundException(tableName); } return tableState; }
@Override public RegionLocations locateRegion(final TableName tableName, final byte[] row, boolean useCache, boolean retry, int replicaId) throws IOException { checkClosed(); if (tableName == null || tableName.getName().length == 0) { throw new IllegalArgumentException("table name cannot be null or zero length"); } if (tableName.equals(TableName.META_TABLE_NAME)) { return locateMeta(tableName, useCache, replicaId); } else { // Region not in the cache - have to go to the meta RS return locateRegionInMeta(tableName, row, useCache, retry, replicaId); } }
@Override public BlockingInterface getClient(ServerName serverName) throws IOException { checkClosed(); if (isDeadServer(serverName)) { throw new RegionServerStoppedException(serverName + " is dead."); } String key = getStubKey(ClientProtos.ClientService.BlockingInterface.class.getName(), serverName, this.hostnamesCanChange); return (ClientProtos.ClientService.BlockingInterface) computeIfAbsentEx(stubs, key, () -> { BlockingRpcChannel channel = this.rpcClient.createBlockingRpcChannel(serverName, user, rpcTimeout); return ClientProtos.ClientService.newBlockingStub(channel); }); }
@Override public AdminProtos.AdminService.BlockingInterface getAdmin(ServerName serverName) throws IOException { checkClosed(); if (isDeadServer(serverName)) { throw new RegionServerStoppedException(serverName + " is dead."); } String key = getStubKey(AdminProtos.AdminService.BlockingInterface.class.getName(), serverName, this.hostnamesCanChange); return (AdminProtos.AdminService.BlockingInterface) computeIfAbsentEx(stubs, key, () -> { BlockingRpcChannel channel = this.rpcClient.createBlockingRpcChannel(serverName, user, rpcTimeout); return AdminProtos.AdminService.newBlockingStub(channel); }); }
@Override public Hbck getHbck(ServerName masterServer) throws IOException { checkClosed(); if (isDeadServer(masterServer)) { throw new RegionServerStoppedException(masterServer + " is dead."); } String key = getStubKey(MasterProtos.HbckService.BlockingInterface.class.getName(), masterServer, this.hostnamesCanChange); return new HBaseHbck( (MasterProtos.HbckService.BlockingInterface) computeIfAbsentEx(stubs, key, () -> { BlockingRpcChannel channel = this.rpcClient.createBlockingRpcChannel(masterServer, user, rpcTimeout); return MasterProtos.HbckService.newBlockingStub(channel); }), rpcControllerFactory); }
@Override public boolean isTableAvailable(final TableName tableName, @Nullable final byte[][] splitKeys) throws IOException { checkClosed(); try { if (!isTableEnabled(tableName)) {
@Override public TableState getTableState(TableName tableName) throws IOException { checkClosed(); TableState tableState = MetaTableAccessor.getTableState(this, tableName); if (tableState == null) { throw new TableNotFoundException(tableName); } return tableState; }
@Override public RegionLocations locateRegion(final TableName tableName, final byte[] row, boolean useCache, boolean retry, int replicaId) throws IOException { checkClosed(); if (tableName == null || tableName.getName().length == 0) { throw new IllegalArgumentException("table name cannot be null or zero length"); } if (tableName.equals(TableName.META_TABLE_NAME)) { return locateMeta(tableName, useCache, replicaId); } else { // Region not in the cache - have to go to the meta RS return locateRegionInMeta(tableName, row, useCache, retry, replicaId); } }
@Override public BlockingInterface getClient(ServerName serverName) throws IOException { checkClosed(); if (isDeadServer(serverName)) { throw new RegionServerStoppedException(serverName + " is dead."); } String key = getStubKey(ClientProtos.ClientService.BlockingInterface.class.getName(), serverName, this.hostnamesCanChange); return (ClientProtos.ClientService.BlockingInterface) computeIfAbsentEx(stubs, key, () -> { BlockingRpcChannel channel = this.rpcClient.createBlockingRpcChannel(serverName, user, rpcTimeout); return ClientProtos.ClientService.newBlockingStub(channel); }); }
@Override public AdminProtos.AdminService.BlockingInterface getAdmin(ServerName serverName) throws IOException { checkClosed(); if (isDeadServer(serverName)) { throw new RegionServerStoppedException(serverName + " is dead."); } String key = getStubKey(AdminProtos.AdminService.BlockingInterface.class.getName(), serverName, this.hostnamesCanChange); return (AdminProtos.AdminService.BlockingInterface) computeIfAbsentEx(stubs, key, () -> { BlockingRpcChannel channel = this.rpcClient.createBlockingRpcChannel(serverName, user, rpcTimeout); return AdminProtos.AdminService.newBlockingStub(channel); }); }
@Override public Hbck getHbck(ServerName masterServer) throws IOException { checkClosed(); if (isDeadServer(masterServer)) { throw new RegionServerStoppedException(masterServer + " is dead."); } String key = getStubKey(MasterProtos.HbckService.BlockingInterface.class.getName(), masterServer, this.hostnamesCanChange); return new HBaseHbck(this, (MasterProtos.HbckService.BlockingInterface) computeIfAbsentEx(stubs, key, () -> { BlockingRpcChannel channel = this.rpcClient.createBlockingRpcChannel(masterServer, user, rpcTimeout); return MasterProtos.HbckService.newBlockingStub(channel); })); }
@Override public boolean isTableAvailable(final TableName tableName, @Nullable final byte[][] splitKeys) throws IOException { checkClosed(); try { if (!isTableEnabled(tableName)) {
@Override public TableState getTableState(TableName tableName) throws IOException { checkClosed(); TableState tableState = MetaTableAccessor.getTableState(this, tableName); if (tableState == null) { throw new TableNotFoundException(tableName); } return tableState; }
@Override public RegionLocations locateRegion(final TableName tableName, final byte[] row, boolean useCache, boolean retry, int replicaId) throws IOException { checkClosed(); if (tableName == null || tableName.getName().length == 0) { throw new IllegalArgumentException("table name cannot be null or zero length"); } if (tableName.equals(TableName.META_TABLE_NAME)) { return locateMeta(tableName, useCache, replicaId); } else { // Region not in the cache - have to go to the meta RS return locateRegionInMeta(tableName, row, useCache, retry, replicaId); } }
@Override public boolean isTableAvailable(final TableName tableName, @Nullable final byte[][] splitKeys) throws IOException { checkClosed(); try { if (!isTableEnabled(tableName)) {
@Override public BlockingInterface getClient(ServerName serverName) throws IOException { checkClosed(); if (isDeadServer(serverName)) { throw new RegionServerStoppedException(serverName + " is dead."); } ServerName vhostSN = detectVServerName(serverName); String key = getStubKey(ClientProtos.ClientService.BlockingInterface.class.getName(), vhostSN, this.hostnamesCanChange); return (ClientProtos.ClientService.BlockingInterface) computeIfAbsentEx(stubs, key, () -> { BlockingRpcChannel channel = this.rpcClient.createBlockingRpcChannel(vhostSN, user, rpcTimeout); return ClientProtos.ClientService.newBlockingStub(channel); }); }
@Override public AdminProtos.AdminService.BlockingInterface getAdmin(ServerName serverName) throws IOException { checkClosed(); if (isDeadServer(serverName)) { throw new RegionServerStoppedException(serverName + " is dead."); } ServerName vhostSN = detectVServerName(serverName); String key = getStubKey(AdminProtos.AdminService.BlockingInterface.class.getName(), vhostSN, this.hostnamesCanChange); return (AdminProtos.AdminService.BlockingInterface) computeIfAbsentEx(stubs, key, () -> { BlockingRpcChannel channel = this.rpcClient.createBlockingRpcChannel(vhostSN, user, rpcTimeout); return AdminProtos.AdminService.newBlockingStub(channel); }); }