@Override public void prepare(boolean reload) throws IOException { super.prepare(reload); this.reload = reload; }
@Override public void prepare(boolean reload) throws IOException { if (Thread.interrupted()) { throw new InterruptedIOException(); } if (reload || location == null) { location = getLocation(!reload); } if (location == null) { // With this exception, there will be a retry. throw new HBaseIOException(getExceptionMessage()); } this.setStub(connection.getAdmin(location.getServerName())); }
public HRegionLocation getLocation(boolean useCache) throws IOException { RegionLocations rl = getRegionLocations(connection, tableName, row, useCache, replicaId); if (rl == null) { throw new HBaseIOException(getExceptionMessage()); } HRegionLocation location = rl.getRegionLocation(replicaId); if (location == null) { throw new HBaseIOException(getExceptionMessage()); } return location; }
regionAdminServiceCallable.prepare(false); for (int i = 0; i < HConstants.RETRY_BACKOFF.length; i++) { pauseTime = regionAdminServiceCallable.sleep(baseTime, i); assertTrue(pauseTime >= (baseTime * HConstants.RETRY_BACKOFF[i])); assertTrue(pauseTime <= (baseTime * HConstants.RETRY_BACKOFF[i] * 1.01f));
/** * Override that changes Exception from {@link Exception} to {@link IOException}. It also does * setup of an rpcController and calls through to the unimplemented * call(PayloadCarryingRpcController) method; implement this method to add your rpc invocation. */ @Override // Same trick as in RegionServerCallable so users don't have to copy/paste so much boilerplate // and so we contain references to protobuf. We can't set priority on the rpcController as // we do in RegionServerCallable because we don't always have a Table when we call. public T call(int callTimeout) throws IOException { this.controller = rpcControllerFactory.newController(); this.controller.setPriority(this.tableName); this.controller.setCallTimeout(callTimeout); try { return call(this.controller); } catch (Exception e) { throw ProtobufUtil.handleRemoteException(e); } }
@Override public void throwable(Throwable t, boolean retrying) { if (t instanceof SocketTimeoutException || t instanceof ConnectException || t instanceof RetriesExhaustedException || (location != null && getConnection().isDeadServer(location.getServerName()))) { // if thrown these exceptions, we clear all the cache entries that // map to that slow/dead server; otherwise, let cache miss and ask // hbase:meta again to find the new location if (this.location != null) getConnection().clearCaches(location.getServerName()); } else if (t instanceof RegionMovedException) { getConnection().updateCachedLocations(tableName, row, t, location); } else if (t instanceof NotServingRegionException) { // Purge cache entries for this specific region from hbase:meta cache // since we don't call connect(true) when number of retries is 1. getConnection().deleteCachedRegionLocation(location); } }
regionAdminServiceCallable.prepare(false); for (int i = 0; i < HConstants.RETRY_BACKOFF.length; i++) { pauseTime = regionAdminServiceCallable.sleep(baseTime, i); assertTrue(pauseTime >= (baseTime * HConstants.RETRY_BACKOFF[i])); assertTrue(pauseTime <= (baseTime * HConstants.RETRY_BACKOFF[i] * 1.01f));
/** * Override that changes Exception from {@link Exception} to {@link IOException}. It also does * setup of an rpcController and calls through to the unimplemented * call(PayloadCarryingRpcController) method; implement this method to add your rpc invocation. */ @Override // Same trick as in RegionServerCallable so users don't have to copy/paste so much boilerplate // and so we contain references to protobuf. We can't set priority on the rpcController as // we do in RegionServerCallable because we don't always have a Table when we call. public T call(int callTimeout) throws IOException { this.controller = rpcControllerFactory.newController(); this.controller.setPriority(this.tableName); this.controller.setCallTimeout(callTimeout); try { return call(this.controller); } catch (Exception e) { throw ProtobufUtil.handleRemoteException(e); } }
@Override public void prepare(boolean reload) throws IOException { if (Thread.interrupted()) { throw new InterruptedIOException(); } if (reload || location == null) { location = getLocation(!reload); } if (location == null) { // With this exception, there will be a retry. throw new HBaseIOException(getExceptionMessage()); } this.setStub(connection.getAdmin(location.getServerName())); }
public HRegionLocation getLocation(boolean useCache) throws IOException { RegionLocations rl = getRegionLocations(connection, tableName, row, useCache, replicaId); if (rl == null) { throw new HBaseIOException(getExceptionMessage()); } HRegionLocation location = rl.getRegionLocation(replicaId); if (location == null) { throw new HBaseIOException(getExceptionMessage()); } return location; }
@Override public void prepare(boolean reload) throws IOException { super.prepare(reload); this.reload = reload; }
/** * Override that changes Exception from {@link Exception} to {@link IOException}. It also does * setup of an rpcController and calls through to the unimplemented * call(PayloadCarryingRpcController) method; implement this method to add your rpc invocation. */ @Override // Same trick as in RegionServerCallable so users don't have to copy/paste so much boilerplate // and so we contain references to protobuf. We can't set priority on the rpcController as // we do in RegionServerCallable because we don't always have a Table when we call. public T call(int callTimeout) throws IOException { this.controller = rpcControllerFactory.newController(); this.controller.setPriority(this.tableName); this.controller.setCallTimeout(callTimeout); try { return call(this.controller); } catch (Exception e) { throw ProtobufUtil.handleRemoteException(e); } }
@Override public void prepare(boolean reload) throws IOException { if (Thread.interrupted()) { throw new InterruptedIOException(); } if (reload || location == null) { location = getLocation(!reload); } if (location == null) { // With this exception, there will be a retry. throw new HBaseIOException(getExceptionMessage()); } this.setStub(connection.getAdmin(location.getServerName())); }
public HRegionLocation getLocation(boolean useCache) throws IOException { RegionLocations rl = getRegionLocations(connection, tableName, row, useCache, replicaId); if (rl == null) { throw new HBaseIOException(getExceptionMessage()); } HRegionLocation location = rl.getRegionLocation(replicaId); if (location == null) { throw new HBaseIOException(getExceptionMessage()); } return location; }
@Override public void prepare(boolean reload) throws IOException { super.prepare(reload); this.reload = reload; }
@Override public void prepare(boolean reload) throws IOException { if (Thread.interrupted()) { throw new InterruptedIOException(); } if (reload || location == null) { location = getLocation(!reload); } if (location == null) { // With this exception, there will be a retry. throw new HBaseIOException(getExceptionMessage()); } this.setStub(connection.getAdmin(location.getServerName())); }
public HRegionLocation getLocation(boolean useCache) throws IOException { RegionLocations rl = getRegionLocations(connection, tableName, row, useCache, replicaId); if (rl == null) { throw new HBaseIOException(getExceptionMessage()); } HRegionLocation location = rl.getRegionLocation(replicaId); if (location == null) { throw new HBaseIOException(getExceptionMessage()); } return location; }
@Override public void prepare(boolean reload) throws IOException { super.prepare(reload); this.reload = reload; }