/** * Returns the set of keys for the nodes which has been changed. * * @return the set of changed node keys; never {@code null} * @see org.modeshape.jcr.cache.change.ChangeSet#changedNodes() */ public Set<NodeKey> changedNodes() { return content.changedNodes(); }
/** * Returns the set of keys for the nodes which has been changed. * * @return the set of changed node keys; never {@code null} * @see org.modeshape.jcr.cache.change.ChangeSet#changedNodes() */ public Set<NodeKey> changedNodes() { return content.changedNodes(); }
private void nextBatchOfKeys() { if ((currentBatchOfKeys == null || !currentBatchOfKeys.hasNext()) && recordsIterator.hasNext()) { while (recordsIterator.hasNext()) { JournalRecord record = recordsIterator.next(); // we searched using a delta, so we must eliminate false positives if (record.getChangeTimeMillis() >= timestamp) { currentBatchOfKeys = record.getChangeSet().changedNodes().iterator(); break; } } } if (currentBatchOfKeys != null && !currentBatchOfKeys.hasNext()) { currentBatchOfKeys = null; } } };
private void nextBatchOfKeys() { if ((currentBatchOfKeys == null || !currentBatchOfKeys.hasNext()) && recordsIterator.hasNext()) { while (recordsIterator.hasNext()) { JournalRecord record = recordsIterator.next(); // we searched using a delta, so we must eliminate false positives if (record.getChangeTimeMillis() >= timestamp) { currentBatchOfKeys = record.getChangeSet().changedNodes().iterator(); break; } } } if (currentBatchOfKeys != null && !currentBatchOfKeys.hasNext()) { currentBatchOfKeys = null; } } };
if (changeSet == null) return; changedNodes.addAll(changeSet.changedNodes());
if (changeSet == null) return; changedNodes.addAll(changeSet.changedNodes());
protected void evictChangedNodes( ChangeSet changes ) { if (!closed) { if (LOGGER.isTraceEnabled()) { LOGGER.trace("Cache for workspace '{0}' received {1} changes from remote sessions: {2}", workspaceName, changes.size(), changes); } // Clear this workspace's cached nodes (iteratively is okay since it's a ConcurrentMap) ... for (NodeKey key : changes.changedNodes()) { if (closed) break; nodesByKey.remove(key); } } }
protected void evictChangedNodes( ChangeSet changes ) { if (!closed) { if (LOGGER.isTraceEnabled()) { LOGGER.trace("Cache for workspace '{0}' received {1} changes from remote sessions: {2}", workspaceName, changes.size(), changes); } // Clear this workspace's cached nodes (iteratively is okay since it's a ConcurrentMap) ... for (NodeKey key : changes.changedNodes()) { if (closed) break; nodesByKey.remove(key); } } }
@Override public void notify( ChangeSet changeSet ) { // Track all changes, even those that originate in remote processes ... increment(ValueMetric.NODE_CHANGES, changeSet.changedNodes().size()); if (changeSet.getWorkspaceName() == null) { // This is a change in the workspaces or repository metadata ... for (Change change : changeSet) { if (change instanceof WorkspaceAdded) { increment(ValueMetric.WORKSPACE_COUNT); } else if (change instanceof WorkspaceRemoved) { decrement(ValueMetric.WORKSPACE_COUNT); } } } // ValueMetric.SESSION_SAVES are tracked in JcrSession.save() ... }
@Override public void notify( ChangeSet changeSet ) { // Track all changes, even those that originate in remote processes ... increment(ValueMetric.NODE_CHANGES, changeSet.changedNodes().size()); if (changeSet.getWorkspaceName() == null) { // This is a change in the workspaces or repository metadata ... for (Change change : changeSet) { if (change instanceof WorkspaceAdded) { increment(ValueMetric.WORKSPACE_COUNT); } else if (change instanceof WorkspaceRemoved) { decrement(ValueMetric.WORKSPACE_COUNT); } } } // ValueMetric.SESSION_SAVES are tracked in JcrSession.save() ... }
/** * Signal that changes have been made to the persisted data. Related information in the cache is cleared, and this workspace's * listener is notified of the changes. * * @param changes the changes to be made; may not be null */ public void changed( ChangeSet changes ) { checkNotClosed(); if (LOGGER.isTraceEnabled()) { LOGGER.trace("Cache for workspace '{0}' received {1} changes from local sessions: {2}", workspaceName, changes.size(), changes); } // Clear this workspace's cached nodes (iteratively is okay since it's a ConcurrentMap) ... for (NodeKey key : changes.changedNodes()) { if (closed) break; nodesByKey.remove(key); } // Send the changes to the change bus so that others can see them ... if (changeBus != null) changeBus.notify(changes); }
/** * Signal that changes have been made to the persisted data. Related information in the cache is cleared, and this workspace's * listener is notified of the changes. * * @param changes the changes to be made; may not be null */ public void changed( ChangeSet changes ) { checkNotClosed(); if (LOGGER.isTraceEnabled()) { LOGGER.trace("Cache for workspace '{0}' received {1} changes from local sessions: {2}", workspaceName, changes.size(), changes); } // Clear this workspace's cached nodes (iteratively is okay since it's a ConcurrentMap) ... for (NodeKey key : changes.changedNodes()) { if (closed) break; nodesByKey.remove(key); } // Send the changes to the change bus so that others can see them ... if (changeBus != null) changeBus.notify(changes); }