Changes are reported by calling {@link #contentChanged(NodeState,CommitInfo)}.
The {@link #addObserver(Observer)} method registers an {@link Observer} for receivingnotifications for all changes reported to this instance.
116117118119120121122
try { this.root = cache.get(kernel.getHeadRevision() + '/'); } catch (Exception e) { throw new RuntimeException(e); } changeDispatcher = new ChangeDispatcher(root); }
283284285286287288289290291292293
// no revision read from other cluster nodes setHeadRevision(newRevision()); } } getRevisionComparator().add(headRevision, Revision.newRevision(0)); dispatcher = new ChangeDispatcher(getRoot()); commitQueue = new CommitQueue(this, dispatcher); backgroundThread = new Thread( new BackgroundOperation(this, isDisposed), "MongoNodeStore background thread"); backgroundThread.setDaemon(true);
59606162636465
} }; public MongoNodeStoreBranch(MongoNodeStore store, MongoNodeState base) { super(store, new ChangeDispatcher(store.getRoot()), base); }
311312313314315316317318319320321
424344454647484950
private final ReadWriteLock mergeLock; DocumentNodeStoreBranch(DocumentNodeStore store, DocumentNodeState base, ReadWriteLock mergeLock) { super(store, new ChangeDispatcher(store.getRoot()), mergeLock.readLock(), base, null, getMaxBackoffMillis(store)); this.mergeLock = mergeLock; }
392393394395396397398399400401402
setHeadRevision(newRevision()); } } getRevisionComparator().add(headRevision, Revision.newRevision(0)); dispatcher = new ChangeDispatcher(getRoot()); commitQueue = new CommitQueue(this, dispatcher); batchCommitQueue = new BatchCommitQueue(store, revisionComparator); backgroundThread = new Thread( new BackgroundOperation(this, isDisposed), "DocumentNodeStore background thread");
75767778798081
private long maximumBackoff = MILLISECONDS.convert(10, SECONDS); public SegmentNodeStore(SegmentStore store) { this.store = store; this.head = new AtomicReference<SegmentNodeState>(store.getHead()); this.changeDispatcher = new ChangeDispatcher(getRoot()); }
411412413414415416417418419420421
44454647484950515253
private final ReadWriteLock mergeLock; DocumentNodeStoreBranch(DocumentNodeStore store, DocumentNodeState base, ReadWriteLock mergeLock) { super(store, new ChangeDispatcher(store.getRoot()), mergeLock.readLock(), base, null, store.getMaxBackOffMillis(), store.getMaxBackOffMillis() * 3); this.mergeLock = mergeLock; }