- LocalHistorySuccess destroy(final long sequence) throws RequestException {
- if (state != State.CLOSED) {
- LOG.debug("{}: closing history {}", persistenceId(), getIdentifier());
-
- // FIXME: add any finalization as needed
- state = State.CLOSED;
- }
-
- // FIXME: record a DESTROY tombstone in the journal
- return new LocalHistorySuccess(getIdentifier(), sequence);
+ void destroy(final long sequence, final RequestEnvelope envelope, final long now)
+ throws RequestException {
+ LOG.debug("{}: closing history {}", persistenceId(), getIdentifier());
+ tree.closeTransactionChain(getIdentifier(), () -> {
+ envelope.sendSuccess(new LocalHistorySuccess(getIdentifier(), sequence), readTime() - now);
+ });