final Instant writeInstant = wr.getWriteTimestamp(); final Instant expireInstant = writeInstant.plus(lockExpire); return new ConsistentKeyLockStatus(writeInstant, expireInstant);
@Override protected void checkSingleLock(final KeyColumn kc, final ConsistentKeyLockStatus ls, final StoreTransaction tx) throws BackendException, InterruptedException { if (ls.isChecked()) return; final Instant now = times.sleepPast(ls.getWriteTimestamp().plus(lockWait)); cleanerService.clean(kc, cutoffTime, tx); if (rid.equals(tr.getRid()) && ls.getWriteTimestamp().equals(tr.getTimestamp())) { throw new ExpiredLockException("Expired lock on " + kc.toString() + ": lock timestamp " + tr.getTimestamp() + " " + times.getUnit() + " is older than " + ls.setChecked();
@Override protected void deleteSingleLock(KeyColumn kc, ConsistentKeyLockStatus ls, StoreTransaction tx) { List<StaticBuffer> dels = ImmutableList.of(serializer.toLockCol(ls.getWriteTimestamp(), rid, times)); for (int i = 0; i < lockRetryCount; i++) { try { StoreTransaction newTx = overrideTimestamp(tx, times.getTime()); store.mutate(serializer.toLockKey(kc.getKey(), kc.getColumn()), ImmutableList.<Entry>of(), dels, newTx); return; } catch (TemporaryBackendException e) { log.warn("Temporary storage exception while deleting lock", e); // don't return -- iterate and retry } catch (BackendException e) { log.error("Storage exception while deleting lock", e); return; // give up on this lock } } }
if (tr.getTimestamp().equals(ls.getWriteTimestamp())) { ls.getWriteTimestamp()}); + rid + " but mismatched timestamps; no lock column contained our timestamp (" + ls.getWriteTimestamp() + ")"; throw new PermanentBackendException(msg);
@Override protected void checkSingleLock(final KeyColumn kc, final ConsistentKeyLockStatus ls, final StoreTransaction tx) throws BackendException, InterruptedException { if (ls.isChecked()) return; final Instant now = times.sleepPast(ls.getWriteTimestamp().plus(lockWait)); cleanerService.clean(kc, cutoffTime, tx); if (rid.equals(tr.getRid()) && ls.getWriteTimestamp().equals(tr.getTimestamp())) { throw new ExpiredLockException("Expired lock on " + kc.toString() + ": lock timestamp " + tr.getTimestamp() + " " + times.getUnit() + " is older than " + ls.setChecked();
@Override protected void deleteSingleLock(KeyColumn kc, ConsistentKeyLockStatus ls, StoreTransaction tx) { List<StaticBuffer> dels = ImmutableList.of(serializer.toLockCol(ls.getWriteTimestamp(), rid, times)); for (int i = 0; i < lockRetryCount; i++) { try { StoreTransaction newTx = overrideTimestamp(tx, times.getTime()); store.mutate(serializer.toLockKey(kc.getKey(), kc.getColumn()), ImmutableList.<Entry>of(), dels, newTx); return; } catch (TemporaryBackendException e) { log.warn("Temporary storage exception while deleting lock", e); // don't return -- iterate and retry } catch (BackendException e) { log.error("Storage exception while deleting lock", e); return; // give up on this lock } } }
final Instant writeInstant = wr.getWriteTimestamp(); final Instant expireInstant = writeInstant.plus(lockExpire); return new ConsistentKeyLockStatus(writeInstant, expireInstant);
@Override protected void checkSingleLock(final KeyColumn kc, final ConsistentKeyLockStatus ls, final StoreTransaction tx) throws BackendException, InterruptedException { if (ls.isChecked()) return; final Timepoint now = times.sleepPast(ls.getWriteTimestamp().add(lockWait)); cleanerService.clean(kc, cutoffTime, tx); if (rid.equals(tr.getRid()) && ls.getWriteTimestamp(timeUnit) == tr.getTimestamp()) { throw new ExpiredLockException("Expired lock on " + kc.toString() + ": lock timestamp " + tr.getTimestamp() + " " + timeUnit + " is older than " + ls.setChecked();
@Override protected void deleteSingleLock(KeyColumn kc, ConsistentKeyLockStatus ls, StoreTransaction tx) { List<StaticBuffer> dels = ImmutableList.of(serializer.toLockCol(ls.getWriteTimestamp(timeUnit), rid)); for (int i = 0; i < lockRetryCount; i++) { try { StoreTransaction newTx = overrideTimestamp(tx, times.getTime()); store.mutate(serializer.toLockKey(kc.getKey(), kc.getColumn()), ImmutableList.<Entry>of(), dels, newTx); return; } catch (TemporaryBackendException e) { log.warn("Temporary storage exception while deleting lock", e); // don't return -- iterate and retry } catch (BackendException e) { log.error("Storage exception while deleting lock", e); return; // give up on this lock } } }
final Timepoint writeInstant = wr.getWriteTimestamp(); final Timepoint expireInstant = writeInstant.add(lockExpire); return new ConsistentKeyLockStatus(writeInstant, expireInstant);
if (tr.getTimestamp() == ls.getWriteTimestamp(timeUnit)) { ls.getWriteTimestamp(timeUnit)}); + rid + " but mismatched timestamps; no lock column contained our timestamp (" + ls.getWriteTimestamp(timeUnit) + ")"; throw new PermanentBackendException(msg);
if (tr.getTimestamp().equals(ls.getWriteTimestamp())) { ls.getWriteTimestamp()}); + rid + " but mismatched timestamps; no lock column contained our timestamp (" + ls.getWriteTimestamp() + ")"; throw new PermanentBackendException(msg);