Package com.atlassian.jira.index.ha
Class OfBizReplicatedIndexOperationStore
java.lang.Object
com.atlassian.jira.index.ha.OfBizReplicatedIndexOperationStore
Stores index operation events
- Since:
- v6.1
-
Constructor Summary
ConstructorsConstructorDescriptionOfBizReplicatedIndexOperationStore
(OfBizDelegator ofBizDelegator, QueryDslAccessor queryDslAccessor) -
Method Summary
Modifier and TypeMethodDescriptionboolean
contains
(long id) createIndexOperation
(AffectedIndex affectedIndex, SharedEntityType entityType, ReplicatedIndexOperation.Operation operation, Map<Long, Long> affectedIdToVersion, String backupFilename) Creates and stores the index operation in the underlying database, only if the node is in a cluster.createIndexOperationForNonVersionEntities
(AffectedIndex affectedIndex, SharedEntityType entityType, ReplicatedIndexOperation.Operation operation, Collection<Long> affectedIds, String backupFilename) Creates and stores the index operation in the underlying database, only if the node is in a cluster.getIndexOperationsAfter
(String sourceNodeId, Long operationId) Returns a set of IndexOperations that have happened after the givenoperationId
.getIndexOperationsAfterIdAndOlderThan
(String sourceNodeId, Long operationId, int ageThresholdInSec) Returns a set of IndexOperations that have happened after the givenoperationId
and are older then givenageThresholdInSec
(i.e.getLatestOperation
(String sourceNodeId) Returns The latest operation for this nodegetOperation
(long id) get an operation by idgetUnprocessedReindexOperationsAfterId
(String sourceNodeId, Long operationId) int
purgeOldOperations
(String sourceNodeId, Date before)
-
Constructor Details
-
OfBizReplicatedIndexOperationStore
public OfBizReplicatedIndexOperationStore(OfBizDelegator ofBizDelegator, QueryDslAccessor queryDslAccessor)
-
-
Method Details
-
purgeOldOperations
-
getIndexOperationsAfter
Returns a set of IndexOperations that have happened after the givenoperationId
. We do this by node as the ids are not monotonically increasing across nodes.- Parameters:
sourceNodeId
- Node to get operations sent fromoperationId
- identifier for the Operation to get the operations after (exclusively)- Returns:
- a set of
ReplicatedIndexOperation
that have taken place on other nodes after a specified id
-
getIndexOperationsAfterIdAndOlderThan
public Set<ReplicatedIndexOperation> getIndexOperationsAfterIdAndOlderThan(String sourceNodeId, Long operationId, int ageThresholdInSec) Returns a set of IndexOperations that have happened after the givenoperationId
and are older then givenageThresholdInSec
(i.e. ReplicatedIndexOperation.indexTime is invalid input: '<' DB.now() - ageThresholdInSec). We do this by node as the ids are not monotonically increasing across nodes.- Parameters:
sourceNodeId
- Node to get operations sent fromoperationId
- identifier for the Operation to get the operations after (exclusively)ageThresholdInSec
- threshold to get the operations which is older than- Returns:
- a set of
ReplicatedIndexOperation
that have taken place on other nodes after a specified id
-
getUnprocessedReindexOperationsAfterId
public Set<ReplicatedIndexOperation> getUnprocessedReindexOperationsAfterId(String sourceNodeId, Long operationId) -
getOperation
get an operation by id- Returns:
- the operation.
-
getLatestOperation
Returns The latest operation for this node- Parameters:
sourceNodeId
- source node of the operation- Returns:
- id of the latest operation.
-
contains
public boolean contains(long id) - Parameters:
id
- the NodeIndexOperation id to check- Returns:
- true if the database contains this index operation