org.hibernate.search.store

## Interface Workspace

- All Known Implementing Classes:
    AbstractWorkspaceImpl, ExclusiveIndexWorkspaceImpl, NRTWorkspaceImpl, SharedIndexWorkspaceImpl

  Deprecated.
  This interface will be moved and should be considered non-public API [HSEARCH-1915]

      @Deprecated
      public interface Workspace

  Author:
    Sanne Grinovero (C) 2011 Red Hat Inc.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `afterTransactionApplied(boolean someFailureHappened, boolean streaming)` Deprecated. Invoked after all changes of a transaction are applied.
    `boolean` | `areSingleTermDeletesSafe()` Deprecated. Returns true if one and only one entity type is stored in the targeted index.
    `void` | `flush()` Deprecated. Makes sure eventually pending changes are made visible to IndexReaders.
    `Analyzer` | `getAnalyzer(String name)` Deprecated.
    `CommitPolicy` | `getCommitPolicy()` Deprecated. Get the commit policy applied to the workspace
    `DocumentBuilderIndexedEntity` | `getDocumentBuilder(IndexedTypeIdentifier type)` Deprecated.
    `IndexedTypeSet` | `getEntitiesInIndexManager()` Deprecated.
    `String` | `getIndexName()` Deprecated. Returns the name of the index this workspace is being used for.
    `IndexWriter` | `getIndexWriter()` Deprecated. Gets the IndexWriter, opening one if needed.
    `boolean` | `isDeleteByTermEnforced()` Deprecated. Returns true if either the configuration guarantees that one can use delete by term on all indexes or if we ensure that entity types stored in the index return positive to `IdUniquenessResolver` and that the document id and JPA id are the same property.
    `void` | `notifyWorkApplied(LuceneWork work)` Deprecated. Some workspaces need this to determine for example the kind of flush operations which are safe to apply.
    `void` | `optimizerPhase()` Deprecated. If optimization has not been forced give a chance to configured OptimizerStrategy to optimize the index.
    `void` | `performOptimization(IndexWriter writer)` Deprecated. Used by OptimizeLuceneWork to start an optimization process of the index.

- - ### Method Detail

    - #### getDocumentBuilder

          DocumentBuilderIndexedEntity getDocumentBuilder(IndexedTypeIdentifier type)

      Deprecated.

    - #### getAnalyzer

          Analyzer getAnalyzer(String name)

      Deprecated.

    - #### optimizerPhase

          void optimizerPhase()

      Deprecated.
      If optimization has not been forced give a chance to configured OptimizerStrategy to optimize the index.

    - #### performOptimization

          void performOptimization(IndexWriter writer)

      Deprecated.
      Used by OptimizeLuceneWork to start an optimization process of the index.
      Parameters:
        `writer` - the IndexWriter to use for optimization
      See Also:
        `OptimizeLuceneWork`, `SearchIntegrator.optimize()`, `SearchIntegrator.optimize(IndexedTypeIdentifier)`

    - #### getIndexWriter

          IndexWriter getIndexWriter()

      Deprecated.
      Gets the IndexWriter, opening one if needed.
      Returns:
        a new IndexWriter or an already open one, or null if an error happened.

    - #### getEntitiesInIndexManager

          IndexedTypeSet getEntitiesInIndexManager()

      Deprecated.
      Returns:
        The set of entity types being indexed in the underlying IndexManager backing this Workspace.

    - #### afterTransactionApplied

          void afterTransactionApplied(boolean someFailureHappened,
                                       boolean streaming)

      Deprecated.
      Invoked after all changes of a transaction are applied. Must be invoked strictly once after every `getIndexWriter()` in a finally block as implementations might rely on counters to release the IndexWriter.
      Parameters:
        `someFailureHappened` - usually false, set to true if errors where caught while using the IndexWriter
        `streaming` - if no immediate visibility of the change is required (hint for performance)

    - #### flush

          void flush()

      Deprecated.
      Makes sure eventually pending changes are made visible to IndexReaders.

    - #### areSingleTermDeletesSafe

          boolean areSingleTermDeletesSafe()

      Deprecated.
      Returns true if one and only one entity type is stored in the targeted index. This allows to use delete by the identifier term which is much faster. This method should really be named `isSingleClassInIndex` but that's a public contract.
      Returns:
        true if one and only one entity type is stored in the targeted index.

    - #### isDeleteByTermEnforced

          boolean isDeleteByTermEnforced()

      Deprecated.
      Returns true if either the configuration guarantees that one can use delete by term on all indexes or if we ensure that entity types stored in the index return positive to `IdUniquenessResolver` and that the document id and JPA id are the same property. This allows to use delete by identifier term in a safe way and is much more efficient. If unsure, we will delete taking the class field into account to avoid unwanted document deletions. The method should really be named `isDeleteByTermEnforcedOrSafe` but that's a public contract.
      Returns:
        true if either the configuration guarantees that one can use delete by term on all indexes

    - #### notifyWorkApplied

          void notifyWorkApplied(LuceneWork work)

      Deprecated.
      Some workspaces need this to determine for example the kind of flush operations which are safe to apply. Generally used for statistics.
      Parameters:
        `work` - the LuceneWork which was just processed

    - #### getCommitPolicy

          CommitPolicy getCommitPolicy()

      Deprecated.
      Get the commit policy applied to the workspace
      Returns:
        `CommitPolicy`

    - #### getIndexName

          String getIndexName()

      Deprecated.
      Returns the name of the index this workspace is being used for.
      Returns:
        the name of the index

Copyright © 2006-2017 Red Hat, Inc. All Rights Reserved