Java Code Examples for org.apache.bookkeeper.client.BKException.Code#NoSuchEntryException

The following examples show how to use org.apache.bookkeeper.client.BKException.Code#NoSuchEntryException . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ManagedLedgerImpl.java    From pulsar with Apache License 2.0 5 votes vote down vote up
/**
 * return BK error codes that are considered not likely to be recoverable.
 */
private static boolean isBkErrorNotRecoverable(int rc) {
    switch (rc) {
    case Code.NoSuchLedgerExistsException:
    case Code.NoSuchLedgerExistsOnMetadataServerException:
    case Code.NoSuchEntryException:
        return true;

    default:
        return false;
    }
}
 
Example 2
Source File: BKExceptionStatsLogger.java    From distributedlog with Apache License 2.0 4 votes vote down vote up
public static String getMessage(int code) {
    switch (code) {
        case Code.OK:
            return "OK";
        case Code.ReadException:
            return "ReadException";
        case Code.QuorumException:
            return "QuorumException";
        case Code.NoBookieAvailableException:
            return "NoBookieAvailableException";
        case Code.DigestNotInitializedException:
            return "DigestNotInitializedException";
        case Code.DigestMatchException:
            return "DigestMatchException";
        case Code.NotEnoughBookiesException:
            return "NotEnoughBookiesException";
        case Code.NoSuchLedgerExistsException:
            return "NoSuchLedgerExistsException";
        case Code.BookieHandleNotAvailableException:
            return "BookieHandleNotAvailableException";
        case Code.ZKException:
            return "ZKException";
        case Code.LedgerRecoveryException:
            return "LedgerRecoveryException";
        case Code.LedgerClosedException:
            return "LedgerClosedException";
        case Code.WriteException:
            return "WriteException";
        case Code.NoSuchEntryException:
            return "NoSuchEntryException";
        case Code.IncorrectParameterException:
            return "IncorrectParameterException";
        case Code.InterruptedException:
            return "InterruptedException";
        case Code.ProtocolVersionException:
            return "ProtocolVersionException";
        case Code.MetadataVersionException:
            return "MetadataVersionException";
        case Code.LedgerFencedException:
            return "LedgerFencedException";
        case Code.UnauthorizedAccessException:
            return "UnauthorizedAccessException";
        case Code.UnclosedFragmentException:
            return "UnclosedFragmentException";
        case Code.WriteOnReadOnlyBookieException:
            return "WriteOnReadOnlyBookieException";
        case Code.IllegalOpException:
            return "IllegalOpException";
        default:
            return "UnexpectedException";
    }
}