public class

OfBizReplicatedIndexOperationStore

extends Object
java.lang.Object
   ↳ com.atlassian.jira.index.ha.OfBizReplicatedIndexOperationStore

Class Overview

Stores index operation events

Summary

Public Constructors
OfBizReplicatedIndexOperationStore(OfBizDelegator ofBizDelegator)
Public Methods
boolean contains(long id)
@Nullable ReplicatedIndexOperation createIndexOperation(Timestamp indexTime, AffectedIndex affectedIndex, SharedEntityType entityType, ReplicatedIndexOperation.Operation operation, Set<Long> affectedIds, String backupFilename)
Creates and stores the index operation in the underlying database, only if the node is in a cluster.
Set<ReplicatedIndexOperation> getIndexOperationsAfter(String sourceNodeId, Long id)
Returns a set of IndexOperations that have happened since the time specified.
Set<ReplicatedIndexOperation> getIndexOperationsAfter(Date sinceTime)
Returns a set of IndexOperations that have happened since the time specified.
Long getLatestOperation(String sourceNodeId)
Returns The latest operation for this node
ReplicatedIndexOperation getOperation(long id)
get an operation by id
int purgeOldOperations(String sourceNodeId, Date before)
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public OfBizReplicatedIndexOperationStore (OfBizDelegator ofBizDelegator)

Public Methods

public boolean contains (long id)

Parameters
id the NodeIndexOperation id to check
Returns
  • true if the database contains this index operation

@Nullable public ReplicatedIndexOperation createIndexOperation (Timestamp indexTime, AffectedIndex affectedIndex, SharedEntityType entityType, ReplicatedIndexOperation.Operation operation, Set<Long> affectedIds, String backupFilename)

Creates and stores the index operation in the underlying database, only if the node is in a cluster.

Parameters
indexTime time of indexing operation
operation the ReplicatedIndexOperation.Operation that was performed on the underlying index
affectedIds Set of issueids that participated in the index opertaion
Returns
  • the operation that was inserted into the underlying db - may be null if the node is not clustered

public Set<ReplicatedIndexOperation> getIndexOperationsAfter (String sourceNodeId, Long id)

Returns a set of IndexOperations that have happened since the time specified. We do this by node as the ids are not monotonically increasing across nodes.

Parameters
sourceNodeId Node to get operations sent from
id Id of preceeding operation
Returns

public Set<ReplicatedIndexOperation> getIndexOperationsAfter (Date sinceTime)

Returns a set of IndexOperations that have happened since the time specified.

Returns

public Long getLatestOperation (String sourceNodeId)

Returns The latest operation for this node

Parameters
sourceNodeId source node of the operation
Returns
  • id of the latest operation.

public ReplicatedIndexOperation getOperation (long id)

get an operation by id

Returns
  • the operation.

public int purgeOldOperations (String sourceNodeId, Date before)