Interface SharedEntityIndexer

All Known Implementing Classes:
DefaultSharedEntityIndexer, MockSharedEntityIndexer

public interface SharedEntityIndexer
Responsible for actually indexing a SharedEntity.
Since:
v3.13
  • Method Details

    • index

      Index.Result index(SharedEntity entity)
      Add or update a document in the index.
      Parameters:
      entity - the entity to add to the index
    • deIndex

      Index.Result deIndex(SharedEntity entity)
      Delete a document from the index.
      Parameters:
      entity - the entity to remove from the index
    • index

      Index.Result index(SharedEntity entity, boolean shouldReplicate)
      Add or update a document in the index.
      Parameters:
      entity - the entity to add to the index
      shouldReplicate - whether or not the index changes should be replicated to the other nodes in the cluster.
      Since:
      v6.1
    • index

      Index.Result index(Set<SharedEntity> sharedEntities, boolean shouldReplicate)
      Add or update multiple documents in the index
      Parameters:
      sharedEntities - a Set of entities to add to the index
      shouldReplicate - whether or not the index changes should be replicated to the other nodes in the cluster.
      Since:
      v6.1
    • deIndex

      Index.Result deIndex(Set<SharedEntity> sharedEntities, boolean shouldReplicate)
      Delete multiple documents in the index
      Parameters:
      sharedEntities - a Set of entities to remove from the index
      shouldReplicate - whether or not the index changes should be replicated to the other nodes in the cluster.
      Since:
      v6.1
    • withSearcher

    • optimize

      long optimize(SharedEntity.TypeDescriptor<?> type)
      Optimize a particular type's index.
      Parameters:
      type - describes the particular index
      Returns:
      the number of milliseconds taken to optimize
    • shutdown

      void shutdown(SharedEntity.TypeDescriptor<?> type)
      Shutdown a particular type's index.
      Parameters:
      type - describes the particular index
    • clear

      Clear a particular type's index. Return the path.
      Parameters:
      type - describes the particular index
    • getAllIndexPaths

      Collection<String> getAllIndexPaths()
      Returns:
      all the paths where the indexes are
    • recreate

      void recreate(SharedEntity.TypeDescriptor<?> type)
      Recreate the index. Clear it if it currently exists, create a new one if it doesn't.
    • contributeToSnapshot

      default void contributeToSnapshot(SharedEntity.TypeDescriptor<? extends SharedEntity> entityType, BackupBuilder backupBuilder)
      Contribute a set of files that represent shared entity index of entityType to the given backupBuilder to include them in the backup being created when this method was called.
      Parameters:
      backupBuilder - temporary(reference should not be stored) builder of backup file. All existing and nonempty files passed to it's accept method will be included in archive being created during the call.
      entityType - type of SharedEntity index to be added to the snapshot