@Override public void unreserve(long tid, long deferTime) { store.unreserve(tid, deferTime); }
@Override public void unreserve(long tid, long deferTime) { store.unreserve(tid, deferTime); }
public Exception getException(long tid) { store.reserve(tid); try { if (store.getStatus(tid) != TStatus.FAILED) throw new IllegalStateException("Tried to get exception when transaction " + String.format("%016x", tid) + " not in failed state"); return (Exception) store.getProperty(tid, EXCEPTION_PROP); } finally { store.unreserve(tid, 0); } }
public String getReturn(long tid) { store.reserve(tid); try { if (store.getStatus(tid) != TStatus.SUCCESSFUL) throw new IllegalStateException("Tried to get exception when transaction " + String.format("%016x", tid) + " not in successful state"); return (String) store.getProperty(tid, RETURN_PROP); } finally { store.unreserve(tid, 0); } }
store.unreserve(txid, 0);
public void delete(long tid) { store.reserve(tid); try { switch (store.getStatus(tid)) { case NEW: case FAILED: case SUCCESSFUL: store.delete(tid); break; case FAILED_IN_PROGRESS: case IN_PROGRESS: throw new IllegalStateException( "Can not delete in progress transaction " + String.format("%016x", tid)); case UNKNOWN: // nothing to do, it does not exist break; } } finally { store.unreserve(tid, 0); } }
zs.unreserve(txid, 0); return state;
zs.unreserve(txid, 0); return state;
public AgeOffStore(TStore<T> store, long ageOffTime, TimeSource timeSource) { this.store = store; this.ageOffTime = ageOffTime; this.timeSource = timeSource; candidates = new HashMap<>(); minTime = Long.MAX_VALUE; List<Long> txids = store.list(); for (Long txid : txids) { store.reserve(txid); try { switch (store.getStatus(txid)) { case NEW: case FAILED: case SUCCESSFUL: addCandidate(txid); break; default: break; } } finally { store.unreserve(txid, 0); } } }
public void seedTransaction(long tid, Repo<T> repo, boolean autoCleanUp) { store.reserve(tid); try { if (store.getStatus(tid) == TStatus.NEW) { if (store.top(tid) == null) { try { store.push(tid, repo); } catch (StackOverflowException e) { // this should not happen throw new RuntimeException(e); } } if (autoCleanUp) store.setProperty(tid, AUTO_CLEAN_PROP, autoCleanUp); store.setProperty(tid, DEBUG_PROP, repo.getDescription()); store.setStatus(tid, TStatus.IN_PROGRESS); } } finally { store.unreserve(tid, 0); } }
@Override public void unreserve(long tid, long deferTime) { store.unreserve(tid, deferTime); }
@Override public void unreserve(long tid, long deferTime) { store.unreserve(tid, deferTime); }
public String getReturn(long tid) { store.reserve(tid); try { if (store.getStatus(tid) != TStatus.SUCCESSFUL) throw new IllegalStateException("Tried to get exception when transaction " + String.format("%016x", tid) + " not in successful state"); return (String) store.getProperty(tid, RETURN_PROP); } finally { store.unreserve(tid, 0); } }
public Exception getException(long tid) { store.reserve(tid); try { if (store.getStatus(tid) != TStatus.FAILED) throw new IllegalStateException("Tried to get exception when transaction " + String.format("%016x", tid) + " not in failed state"); return (Exception) store.getProperty(tid, EXCEPTION_PROP); } finally { store.unreserve(tid, 0); } }
public void delete(long tid) { store.reserve(tid); try { switch (store.getStatus(tid)) { case NEW: case FAILED: case SUCCESSFUL: store.delete(tid); break; case FAILED_IN_PROGRESS: case IN_PROGRESS: throw new IllegalStateException( "Can not delete in progress transaction " + String.format("%016x", tid)); case UNKNOWN: // nothing to do, it does not exist break; } } finally { store.unreserve(tid, 0); } }
zs.unreserve(txid, 0); return state;
zs.unreserve(txid, 0); return state;
store.unreserve(txid, 0);
public AgeOffStore(TStore<T> store, long ageOffTime, TimeSource timeSource) { this.store = store; this.ageOffTime = ageOffTime; this.timeSource = timeSource; candidates = new HashMap<>(); minTime = Long.MAX_VALUE; List<Long> txids = store.list(); for (Long txid : txids) { store.reserve(txid); try { switch (store.getStatus(txid)) { case NEW: case FAILED: case SUCCESSFUL: addCandidate(txid); break; default: break; } } finally { store.unreserve(txid, 0); } } }
public void seedTransaction(long tid, Repo<T> repo, boolean autoCleanUp) { store.reserve(tid); try { if (store.getStatus(tid) == TStatus.NEW) { if (store.top(tid) == null) { try { store.push(tid, repo); } catch (StackOverflowException e) { // this should not happen throw new RuntimeException(e); } } if (autoCleanUp) store.setProperty(tid, AUTO_CLEAN_PROP, Boolean.valueOf(autoCleanUp)); store.setProperty(tid, DEBUG_PROP, repo.getDescription()); store.setStatus(tid, TStatus.IN_PROGRESS); } } finally { store.unreserve(tid, 0); } }