Class ChangeSet

  • All Implemented Interfaces:
    java.lang.AutoCloseable

    public class ChangeSet
    extends java.lang.Object
    implements java.lang.AutoCloseable
    Stores 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 a ChangeSet instance 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 the CommitTracker executes a commit in the main index, all content store changes accumulated in the meantime in the current ChangeSet instance 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 transient ChangeSet instance. 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 class  ChangeSet.Builder
      Builds class for creating ChangeSet instances.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()  
      ChangeSet since​(long version)
      Returns the content store changes (adds / deletes) since the given version (exclusive).
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • close

        public void close()
        Specified by:
        close in interface java.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).