Source:
long run(Connection connection, @Nullable Long oldLimit) throws SQLException; } @GuardedBy("this") private long runOperation(final Operation operation) { TransactionResult<Long> result = RetriableTransactions.run(connManager, connection -> { Long oldLimit = readLimit(connection); if (currentLimit != null) { if (oldLimit != null) { if (currentLimit.equals(oldLimit)) { } else { throw new MultipleRunningTimestampServiceError( "Timestamp limit changed underneath us (limit in memory: " + currentLimit + ", limit in DB: " + oldLimit + "). This may indicate that " + "another timestamp service is running against this database! " + "This may indicate that your services are not properly configured " + "to run in an HA configuration, or to have a CLI run against them."); } } else { throw new IllegalStateException( "Unable to retrieve a timestamp when expected. " + "This service is in a dangerous state and should be taken down " + "until a new safe timestamp value can be established in the KVS. " + "Please contact support."); } } else { } return operation.run(connection, oldLimit); }); switch (result.getStatus()) { case SUCCESSFUL: currentLimit = result.getResultValue(); return currentLimit; case UNKNOWN: case FAILED: if (result.getStatus() == RetriableTransactions.TransactionStatus.UNKNOWN) { currentLimit = null; } Throwable error = result.getError(); if (error instanceof SQLException) { throw PalantirSqlException.create((SQLException) error); } throw Throwables.rewrapAndThrowUncheckedException(error); default: throw new IllegalStateException("Unrecognized transaction status " + result.getStatus()); } }

Target:
long run(Connection connection, @Nullable Long oldLimit) throws SQLException; } @GuardedBy("this") private long runOperation(final Operation operation) { TransactionResult<Long> result = RetriableTransactions.run(connManager, new RetriableWriteTransaction<Long>() { @GuardedBy("InDbTimestampBoundStore.this") @Override public Long run(Connection connection) throws SQLException { Long oldLimit = readLimit(connection); if (currentLimit != null) { if (oldLimit != null) { if (currentLimit.equals(oldLimit)) { } else { throw new MultipleRunningTimestampServiceError( "Timestamp limit changed underneath us (limit in memory: " + currentLimit + ", limit in DB: " + oldLimit + "). This may indicate that " + "another timestamp service is running against this database! " + "This may indicate that your services are not properly configured " + "to run in an HA configuration, or to have a CLI run against them."); } } else { throw new IllegalStateException( "Unable to retrieve a timestamp when expected. " + "This service is in a dangerous state and should be taken down " + "until a new safe timestamp value can be established in the KVS. " + "Please contact support."); } } else { } return operation.run(connection, oldLimit); } }); switch (result.getStatus()) { case SUCCESSFUL: currentLimit = result.getResultValue(); return currentLimit; case UNKNOWN: case FAILED: if (result.getStatus() == RetriableTransactions.TransactionStatus.UNKNOWN) { currentLimit = null; } Throwable error = result.getError(); if (error instanceof SQLException) { throw PalantirSqlException.create((SQLException) error); } throw Throwables.rewrapAndThrowUncheckedException(error); default: throw new IllegalStateException("Unrecognized transaction status " + result.getStatus()); } }