@Deprecated public interface

ChangesetIndexer

com.atlassian.stash.idx.ChangesetIndexer

This interface is deprecated.
in 3.7 for removal in 5.0. All things "changeset" are being renamed to "commit", the more common term for the data they represent. Due to the significant number of touchpoints, the deprecated classes and interfaces will be left in for an entire major release cycle, rather than being removed in 4.0. Indexers should implement CommitIndexer instead.

Class Overview

Indexer that is called for any changeset indexing operation.

Any ChangesetIndexer implementations must be threadsafe because the same instance can be used for multiple parallel indexing operations. Any state that needs to be stored during an indexing run should be stored in the provided IndexingContext

Summary

Public Methods
@Nonnull String getId()
boolean isEnabledForRepository(Repository repository)
void onAfterIndexing(IndexingContext context)
Callback that is called after the last changeset has been processed.
void onBeforeIndexing(IndexingContext context)
Callback that is called at the beginning of an indexing run.
void onChangesetAdded(Changeset changeset, IndexingContext ctx)
Important: This method will only be called once for a changeset during an indexing run, but may be called multiple times for the same changeset across different indexing run.
void onChangesetRemoved(Changeset changeset, IndexingContext ctx)
Important: This method will only be called once for a changeset during an indexing run, but may be called multiple times for the same changeset across different indexing run.

Public Methods

@Nonnull public String getId ()

Returns
  • the id for the indexer. This id is used by the ChangesetIndexingService to keep track of which changesets have already been indexed by the ChangesetIndexer.

public boolean isEnabledForRepository (Repository repository)

Parameters
repository the repository
Returns
  • whether the indexer should index changesets for repository

public void onAfterIndexing (IndexingContext context)

Callback that is called after the last changeset has been processed. Any cleanup / teardown that needs to be done can be done at this point.

Parameters
context the indexing context

public void onBeforeIndexing (IndexingContext context)

Callback that is called at the beginning of an indexing run. ChangesetIndexers must be threadsafe, because they can be called in parallel for different repositories. If the indexer requires any kind of state during the indexing of a repository, it store that state in context.

Note that the context is shared between all ChangesetIndexer instances that are enabled for the repository.

Parameters
context the indexing context

public void onChangesetAdded (Changeset changeset, IndexingContext ctx)

Important: This method will only be called once for a changeset during an indexing run, but may be called multiple times for the same changeset across different indexing run. The reason for this is that when multiple changeset indexers are enabled. All changesets that have been added since the last time any ChangesetIndexer ran will be returned to all ChangesetIndexers.

Parameters
changeset the changeset
ctx the indexing context

public void onChangesetRemoved (Changeset changeset, IndexingContext ctx)

Important: This method will only be called once for a changeset during an indexing run, but may be called multiple times for the same changeset across different indexing run. The reason for this is that when multiple changeset indexers are enabled. All changesets that have been removed since the last time any ChangesetIndexer ran will be returned to all ChangesetIndexers.

Parameters
changeset the changeset
ctx the indexing context