Package org.alfresco.solr.content
Class ChangeSet
- java.lang.Object
-
- org.alfresco.solr.content.ChangeSet
-
- All Implemented Interfaces:
java.lang.AutoCloseable
public class ChangeSet extends java.lang.Object implements java.lang.AutoCloseableStores and manages changes occurred in a content store. Note this entity is part of the content store only when it is set on writable mode (i.e. only when the hosting node is a standalone instance or it is a master node). That means if the hosting node has at least one standalone core or one master node, then the managed content store will be set in write mode and therefore aChangeSetinstance will track all changes applied to it. In that mode, each change is associated to a given (incremental) version; changes consist of adds/updates and deletes. Each time theCommitTrackerexecutes a commit in the main index, all content store changes accumulated in the meantime in the currentChangeSetinstance are flushed in an auxiliary Lucene index and therefore persisted. On the other side, when all cores on a given node are configured as slaves, the content store is in read-only mode, and there's no need to track any change (i.e. changes are coming from master through the replication procedure). As a side note: we can have a persistent or transientChangeSetinstance. The first one is used to manage, as the name suggests, in a persistent way the content store changes accumulated during the indexing operations (see the description above about its behaviour in master nodes). The second one is used instead for computing/reducing the "merged" list of changes that we need to communicate to slave nodes: as part of the replication mechanism, a slave communicates its last synched content store version; on the master side, we need to compute and communicate back all changes that the slave needs to apply since that version in order to be in synch with master.- Since:
- 1.5
- Author:
- Andrea Gazzarini
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classChangeSet.BuilderBuilds class for creatingChangeSetinstances.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()ChangeSetsince(long version)Returns the content store changes (adds / deletes) since the given version (exclusive).
-
-
-
Method Detail
-
close
public void close()
- Specified by:
closein interfacejava.lang.AutoCloseable
-
since
public ChangeSet since(long version)
Returns the content store changes (adds / deletes) since the given version (exclusive).- Parameters:
version- the start offset version (exclusive).- Returns:
- the content store changes (adds / deletes) since the given version (exclusive).
-
-