Interface ICommitter

All Superinterfaces:
AutoCloseable
All Known Implementing Classes:
AbstractBatchCommitter, AbstractCommitter, AbstractFSCommitter, CSVFileCommitter, JSONFileCommitter, LogCommitter, MemoryCommitter, XMLFileCommitter

public interface ICommitter extends AutoCloseable
Commits documents to their final destination (e.g. search engine). Implementors are encouraged to use one of the abstract committer classes, which handles event handling and common use cases.
Since:
3.0.0
Author:
Pascal Essiembre
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Determines whether a request should be committed.
    void
    Cleans any persisted information (e.g. queue) to ensure next run will start fresh.
    void
    Closes this committer and releases resources.
    void
    delete(DeleteRequest deleteRequest)
    Deletes a document from the target repository.
    void
    init(CommitterContext committerContext)
    Initializes this committer with execution context.
    void
    upsert(UpsertRequest upsertRequest)
    Creates or updates a document in the target repository.
  • Method Details

    • init

      void init(CommitterContext committerContext) throws CommitterException
      Initializes this committer with execution context.
      Parameters:
      committerContext - committer execution context
      Throws:
      CommitterException - initialization failure
    • accept

      boolean accept(ICommitterRequest request) throws CommitterException
      Determines whether a request should be committed.
      Parameters:
      request - request to evaluate
      Returns:
      true if the request is accepted
      Throws:
      CommitterException - acceptance check failure
    • upsert

      void upsert(UpsertRequest upsertRequest) throws CommitterException
      Creates or updates a document in the target repository.
      Parameters:
      upsertRequest - request to upsert
      Throws:
      CommitterException - upsert failure
    • delete

      void delete(DeleteRequest deleteRequest) throws CommitterException
      Deletes a document from the target repository.
      Parameters:
      deleteRequest - request to delete
      Throws:
      CommitterException - delete failure
    • close

      void close() throws CommitterException
      Closes this committer and releases resources.
      Specified by:
      close in interface AutoCloseable
      Throws:
      CommitterException - close failure
    • clean

      void clean() throws CommitterException
      Cleans any persisted information (e.g. queue) to ensure next run will start fresh. Calling this method on Committers not persisting anything between each execution will have no effect. This method does NOT delete anything previously committed on the target repository.
      Throws:
      CommitterException - something went wrong cleaning the committer.