public class Operations extends Object
Modifier and Type | Method and Description |
---|---|
static Index.Operation |
newCompletionDelegate(Index.Operation operation,
Runnable completionJob)
Create an operation that delegates to another Operation and then runs the supplied
completionJob as soon as the operation is performed (in whatever thread the operation
is performed in).
|
static Index.Operation |
newConditionalReplaceCollection(Collection<org.apache.lucene.document.Document> documents,
Index.UpdateMode mode) |
static Index.Operation |
newConditionalUpdate(org.apache.lucene.index.Term term,
org.apache.lucene.document.Document document,
Index.UpdateMode mode,
String optimisticLockField)
Deprecated.
#newConditionalUpdateWithVersion(Document, UpdateMode) |
static Index.Operation |
newConditionalUpdateWithVersion(Collection<org.apache.lucene.document.Document> documents,
Index.UpdateMode mode) |
static Index.Operation |
newConditionalUpdateWithVersion(org.apache.lucene.document.Document document,
Index.UpdateMode mode) |
static Index.Operation |
newCreate(Collection<org.apache.lucene.document.Document> documents,
Index.UpdateMode mode) |
static Index.Operation |
newCreate(org.apache.lucene.document.Document document,
Index.UpdateMode mode) |
static Index.Operation |
newCreateCommitPoint(java.util.function.Consumer<org.apache.lucene.index.IndexCommit> commitConsumer)
Uses
SnapshotDeletionPolicy to create IndexFileDeleter.CommitPoint
and passes it to the commitConsumer . |
static Index.Operation |
newDelete(org.apache.lucene.index.Term term,
Index.UpdateMode mode) |
static Index.Operation |
newOptimize() |
static Index.Operation |
newReleaseCommitPoint(java.util.function.Supplier<org.apache.lucene.index.IndexCommit> commitProvider)
Attempts to use
SnapshotDeletionPolicy to release IndexFileDeleter.CommitPoint
provided by commitProvider . |
static Index.Operation |
newUpdate(org.apache.lucene.index.Term term,
Collection<org.apache.lucene.document.Document> documents,
Index.UpdateMode mode) |
static Index.Operation |
newUpdate(org.apache.lucene.index.Term term,
org.apache.lucene.document.Document document,
Index.UpdateMode mode) |
public static Index.Operation newDelete(@Nonnull org.apache.lucene.index.Term term, @Nonnull Index.UpdateMode mode)
public static Index.Operation newCreate(@Nonnull org.apache.lucene.document.Document document, @Nonnull Index.UpdateMode mode)
public static Index.Operation newCreate(@Nonnull Collection<org.apache.lucene.document.Document> documents, @Nonnull Index.UpdateMode mode)
public static Index.Operation newUpdate(@Nonnull org.apache.lucene.index.Term term, @Nonnull org.apache.lucene.document.Document document, @Nonnull Index.UpdateMode mode)
@Deprecated public static Index.Operation newConditionalUpdate(@Nonnull org.apache.lucene.index.Term term, @Nonnull org.apache.lucene.document.Document document, @Nonnull Index.UpdateMode mode, @Nonnull String optimisticLockField)
#newConditionalUpdateWithVersion(Document, UpdateMode)
public static Index.Operation newConditionalUpdateWithVersion(@Nonnull org.apache.lucene.document.Document document, @Nonnull Index.UpdateMode mode)
public static Index.Operation newConditionalUpdateWithVersion(@Nonnull Collection<org.apache.lucene.document.Document> documents, @Nonnull Index.UpdateMode mode)
public static Index.Operation newConditionalReplaceCollection(@Nonnull Collection<org.apache.lucene.document.Document> documents, @Nonnull Index.UpdateMode mode)
public static Index.Operation newUpdate(@Nonnull org.apache.lucene.index.Term term, @Nonnull Collection<org.apache.lucene.document.Document> documents, @Nonnull Index.UpdateMode mode)
public static Index.Operation newOptimize()
public static Index.Operation newCreateCommitPoint(java.util.function.Consumer<org.apache.lucene.index.IndexCommit> commitConsumer)
SnapshotDeletionPolicy
to create IndexFileDeleter.CommitPoint
and passes it to the commitConsumer
. Warning: May not pass anything if the index is emptyClassCastException
- if the writer is not configured to use SnapshotDeletionPolicy
SnapshotDeletionPolicy
public static Index.Operation newReleaseCommitPoint(java.util.function.Supplier<org.apache.lucene.index.IndexCommit> commitProvider)
SnapshotDeletionPolicy
to release IndexFileDeleter.CommitPoint
provided by commitProvider
.ClassCastException
- if the writer is not configured to use SnapshotDeletionPolicy
SnapshotDeletionPolicy
public static Index.Operation newCompletionDelegate(Index.Operation operation, Runnable completionJob)
operation
- the operation to delegate the actual work to.completionJob
- the Runnable instance that is run after the supplied operation completes.Copyright © 2002-2021 Atlassian. All Rights Reserved.