Class UpdateHandler

    • Constructor Detail

      • UpdateHandler

        public UpdateHandler​(SolrCore core)
      • UpdateHandler

        public UpdateHandler​(SolrCore core,
                             UpdateLog updateLog,
                             boolean initUlog)
        Subclasses should call this ctor, with `initUlog=false` and should then, as the last action in the subclass ctor, call initUlog(boolean).

        NOTE: as an abstract class, if subclasses are supposed to always call this with `initUlog=false`, we could simply never init ulog in this method, and avoid the extra arg. But the arg is present for 3 reasons:

        1. for backward compatibility with subclasses (plugins) that may have called UpdateHandler ctor with the assumption that ulog will be initialized
        2. to force subclass implementations to be aware that they must init ulog
        3. because it's likely that deferring ulog init until the last action of the top-level ctor is actually unnecessary (see below)

        As noted in a comment in DirectUpdateHandler2(SolrCore, UpdateHandler), it's unclear why we are advised to defer ulog init until the last action of the top-level ctor, as opposed to simply delegating init to the base-class UpdateHandler ctor. If we were to follow this approach, this "extra-arg" ctor could be removed in favor of UpdateHandler(SolrCore, UpdateLog), initializing any non-null ulog (and removing the initUlog(boolean) helper method as well).

    • Method Detail

      • callPostCommitCallbacks

        protected void callPostCommitCallbacks()
      • callPostSoftCommitCallbacks

        protected void callPostSoftCommitCallbacks()
      • callPostOptimizeCallbacks

        protected void callPostOptimizeCallbacks()
      • initUlog

        protected final void initUlog​(boolean closeOnError)
        Helper method to init ulog. As discussed in the javadocs for UpdateHandler(SolrCore, UpdateLog, boolean), this should be called as the last action of each top-level ctor.
        Parameters:
        closeOnError - if the calling context is responsible for creating ulog, then we should respond to an init failure by closing ulog, and this param should be set to true. If the calling context is not responsible for creating ulog, then references exist elsewhere and we should not close on init error (set this param to false).
      • newIndexWriter

        public abstract void newIndexWriter​(boolean rollback)
                                     throws IOException
        Called when the Writer should be opened again - eg when replication replaces all of the index files.
        Parameters:
        rollback - IndexWriter if true else close
        Throws:
        IOException - If there is a low-level I/O error.
      • getSolrCoreState

        public abstract SolrCoreState getSolrCoreState()
      • getUpdateLog

        public abstract UpdateLog getUpdateLog()
      • registerCommitCallback

        public void registerCommitCallback​(SolrEventListener listener)
        NOTE: this function is not thread safe. However, it is safe to call within the inform( SolrCore core ) function for SolrCoreAware classes. Outside inform, this could potentially throw a ConcurrentModificationException
        See Also:
        SolrCoreAware
      • registerSoftCommitCallback

        public void registerSoftCommitCallback​(SolrEventListener listener)
        NOTE: this function is not thread safe. However, it is safe to call within the inform( SolrCore core ) function for SolrCoreAware classes. Outside inform, this could potentially throw a ConcurrentModificationException
        See Also:
        SolrCoreAware
      • registerOptimizeCallback

        public void registerOptimizeCallback​(SolrEventListener listener)
        NOTE: this function is not thread safe. However, it is safe to call within the inform( SolrCore core ) function for SolrCoreAware classes. Outside inform, this could potentially throw a ConcurrentModificationException
        See Also:
        SolrCoreAware