@Override protected Object invokeMethod(Method method, Object[] args) throws Throwable { Object result = super.invokeMethod(method, args); int retryCount = RetryCount.get(); if (retryCount < this.numToDrop) { RetryCount.set(++retryCount); if (LOG.isDebugEnabled()) { LOG.debug("Drop the response. Current retryCount == " + retryCount); } throw new RetriableException("Fake Exception"); } else { if (LOG.isDebugEnabled()) { LOG.debug("retryCount == " + retryCount + ". It's time to normally process the response"); } return result; } } }
break; } catch (RetriableException e) { LOG.debug("{}: retrying {}", this, e.getMessage());
} catch (RetriableException e) { if (LOG.isDebugEnabled()) { LOG.debug(this + ": retrying " + e.getMessage());
private static NamenodeProtocols getRPCServer(NameNode namenode) throws IOException { final NamenodeProtocols np = namenode.getRpcServer(); if (np == null) { throw new RetriableException("Namenode is in startup mode"); } return np; }
} catch (RetriableException e) { if (LOG.isDebugEnabled()) { LOG.debug(this + ": retrying " + e.getMessage());
protected ClientProtocol getRpcClientProtocol() throws IOException { final NameNode namenode = (NameNode)context.getAttribute("name.node"); final ClientProtocol cp = namenode.getRpcServer(); if (cp == null) { throw new RetriableException("Namenode is in startup mode"); } return cp; }
public void queueExternalCall(ExternalCall<?> extCall) throws IOException, InterruptedException { if (rpcServer == null) { throw new RetriableException("Namenode is in startup mode"); } rpcServer.getClientRpcServer().queueCall(extCall); }
private void checkNNStartup() throws IOException { if (!this.nn.isStarted()) { String message = NameNode.composeNotStartedMessage(this.nn.getRole()); throw new RetriableException(message); } }
private void checkReadAccess(final ExtendedBlock block) throws IOException { // Make sure this node has registered for the block pool. try { getDNRegistrationForBP(block.getBlockPoolId()); } catch (IOException e) { // if it has not registered with the NN, throw an exception back. throw new org.apache.hadoop.ipc.RetriableException( "Datanode not registered. Try again later."); } if (isBlockTokenEnabled) { Set<TokenIdentifier> tokenIds = UserGroupInformation.getCurrentUser() .getTokenIdentifiers(); if (tokenIds.size() != 1) { throw new IOException("Can't continue since none or more than one " + "BlockTokenIdentifier is found."); } for (TokenIdentifier tokenId : tokenIds) { BlockTokenIdentifier id = (BlockTokenIdentifier) tokenId; LOG.debug("Got: {}", id); blockPoolTokenSecretManager.checkAccess(id, null, block, BlockTokenIdentifier.AccessMode.READ, null, null); } } }
/** * Verifies that the given identifier and password are valid and match. * @param identifier Token identifier. * @param password Password in the token. */ public synchronized void verifyToken(DelegationTokenIdentifier identifier, byte[] password) throws InvalidToken, RetriableException { try { getDelegationTokenSecretManager().verifyToken(identifier, password); } catch (InvalidToken it) { if (inTransitionToActive()) { throw new RetriableException(it); } throw it; } }
@Override public byte[] retriableRetrievePassword(DelegationTokenIdentifier identifier) throws InvalidToken, StandbyException, RetriableException, IOException { namesystem.checkOperation(OperationCategory.READ); try { return super.retrievePassword(identifier); } catch (InvalidToken it) { if (namesystem.inTransitionToActive()) { // if the namesystem is currently in the middle of transition to // active state, let client retry since the corresponding editlog may // have not been applied yet throw new RetriableException(it); } else { throw it; } } }
/** * @throws RetriableException * If 1) The NameNode is in SafeMode, 2) HA is enabled, and 3) * NameNode is in active state * @throws SafeModeException * Otherwise if NameNode is in SafeMode. */ void checkNameNodeSafeMode(String errorMsg) throws RetriableException, SafeModeException { if (isInSafeMode()) { SafeModeException se = newSafemodeException(errorMsg); if (haEnabled && haContext != null && haContext.getState().getServiceState() == HAServiceState.ACTIVE && isInStartupSafeMode()) { throw new RetriableException(se); } else { throw se; } } }
throw new RetriableException( new NotReplicatedYetException("append: lastBlock=" + lastBlock + " of src=" + path
private static NamenodeProtocols getRPCServer(NameNode namenode) throws IOException { final NamenodeProtocols np = namenode.getRpcServer(); if (np == null) { throw new RetriableException("Namenode is in startup mode"); } return np; }
private static NamenodeProtocols getRPCServer(NameNode namenode) throws IOException { final NamenodeProtocols np = namenode.getRpcServer(); if (np == null) { throw new RetriableException("Namenode is in startup mode"); } return np; }
@Override protected Object invokeMethod(Method method, Object[] args) throws Throwable { Object result = super.invokeMethod(method, args); int retryCount = RetryCount.get(); if (retryCount < this.numToDrop) { RetryCount.set(++retryCount); if (LOG.isDebugEnabled()) { LOG.debug("Drop the response. Current retryCount == " + retryCount); } throw new RetriableException("Fake Exception"); } else { if (LOG.isDebugEnabled()) { LOG.debug("retryCount == " + retryCount + ". It's time to normally process the response"); } return result; } } }
@Override protected Object invokeMethod(Method method, Object[] args) throws Throwable { Object result = super.invokeMethod(method, args); int retryCount = RetryCount.get(); if (retryCount < this.numToDrop) { RetryCount.set(++retryCount); if (LOG.isDebugEnabled()) { LOG.debug("Drop the response. Current retryCount == " + retryCount); } throw new RetriableException("Fake Exception"); } else { if (LOG.isDebugEnabled()) { LOG.debug("retryCount == " + retryCount + ". It's time to normally process the response"); } return result; } } }
@Override protected Object invokeMethod(Method method, Object[] args) throws Throwable { Object result = super.invokeMethod(method, args); int retryCount = RetryCount.get(); if (retryCount < this.numToDrop) { RetryCount.set(++retryCount); if (LOG.isDebugEnabled()) { LOG.debug("Drop the response. Current retryCount == " + retryCount); } throw new RetriableException("Fake Exception"); } else { if (LOG.isDebugEnabled()) { LOG.debug("retryCount == " + retryCount + ". It's time to normally process the response"); } return result; } } }
private void checkNNStartup() throws IOException { if (!this.nn.isStarted()) { throw new RetriableException(this.nn.getRole() + " still not started"); } }
private void checkNNStartup() throws IOException { if (!this.nn.isStarted()) { throw new RetriableException(this.nn.getRole() + " still not started"); } }