throw new MultipleRunningTimestampServiceError( "Timestamp limit changed underneath us (limit in memory: " + currentLimit + ", limit in DB: " + oldLimit + "). This may indicate that "
@Override public void storeUpperLimit(long newLimit) throws MultipleRunningTimestampServiceError { if (shouldThrowErrorMultipleServerError) { throw new MultipleRunningTimestampServiceError("error"); } if (error.isPresent()) { throw error.orElse(null); } numberOfAllocations++; upperLimit = newLimit; }
+ " leaders or a CLI being run with an embedded timestamp service against an already running" + " service."; MultipleRunningTimestampServiceError err = new MultipleRunningTimestampServiceError( String.format(replaceBracesWithStringFormatSpecifier(msg), oldVal,
@Override public synchronized void storeUpperLimit(final long limit) throws MultipleRunningTimestampServiceError { kvs.runInTransaction((Function<DSLContext, Void>) ctx -> { int rowsUpdated = ctx.update(TABLE) .set(LATEST_TIMESTAMP, limit) .where(DUMMY_COLUMN.eq(0).and(LATEST_TIMESTAMP.eq(latestTimestamp))) .execute(); if (rowsUpdated != 1) { long actualLatestTimestamp = getLatestTimestamp(ctx); throw new MultipleRunningTimestampServiceError("Timestamp limit changed underneath " + "us (limit in memory: " + latestTimestamp + ", limit in db: " + actualLatestTimestamp + "). This may indicate that another timestamp service is running against this db!"); } latestTimestamp = limit; return null; }); }
throw new MultipleRunningTimestampServiceError( "Timestamp limit changed underneath us (limit in memory: " + currentLimit + ", limit in DB: " + oldLimit + "). This may indicate that "
+ " leaders or a CLI being run with an embedded timestamp service against an already running" + " service."; MultipleRunningTimestampServiceError err = new MultipleRunningTimestampServiceError( String.format(replaceBracesWithStringFormatSpecifier(msg), oldVal,