public class OfBizReplicatedIndexOperationStore extends Object
Constructor and Description |
---|
OfBizReplicatedIndexOperationStore(OfBizDelegator ofBizDelegator,
QueryDslAccessor queryDslAccessor) |
Modifier and Type | Method and Description |
---|---|
boolean |
contains(long id) |
Long |
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.
|
Long |
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.
|
Set<ReplicatedIndexOperation> |
getIndexOperationsAfter(String sourceNodeId,
Long operationId)
Returns a set of IndexOperations that have happened after the given
operationId . |
Set<ReplicatedIndexOperation> |
getIndexOperationsAfterIdAndOlderThan(String sourceNodeId,
Long operationId,
int ageThresholdInSec)
Returns a set of IndexOperations that have happened after the given
operationId and
are older then given ageThresholdInSec (i.e. |
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) |
public OfBizReplicatedIndexOperationStore(OfBizDelegator ofBizDelegator, QueryDslAccessor queryDslAccessor)
@Nullable public Long createIndexOperation(AffectedIndex affectedIndex, SharedEntityType entityType, ReplicatedIndexOperation.Operation operation, Map<Long,Long> affectedIdToVersion, String backupFilename)
operation
- the ReplicatedIndexOperation.Operation
that was performed on the underlying indexaffectedIdToVersion
- Map of affectedId to local version that participated in the index operation@Nullable public Long createIndexOperationForNonVersionEntities(AffectedIndex affectedIndex, SharedEntityType entityType, ReplicatedIndexOperation.Operation operation, Collection<Long> affectedIds, String backupFilename)
operation
- the ReplicatedIndexOperation.Operation
that was performed on the underlying indexaffectedIds
- list of affectedIds that participated in the index operationpublic Set<ReplicatedIndexOperation> getIndexOperationsAfter(String sourceNodeId, Long operationId)
operationId
.
We do this by node as the ids are not monotonically increasing across nodes.sourceNodeId
- Node to get operations sent fromoperationId
- identifier for the Operation to get the operations after (exclusively)ReplicatedIndexOperation
that have taken place on other nodes after a specified idpublic Set<ReplicatedIndexOperation> getIndexOperationsAfterIdAndOlderThan(String sourceNodeId, Long operationId, int ageThresholdInSec)
operationId
and
are older then given ageThresholdInSec
(i.e. ReplicatedIndexOperation.indexTime is < DB.now() - ageThresholdInSec).
We do this by node as the ids are not monotonically increasing across nodes.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 thanReplicatedIndexOperation
that have taken place on other nodes after a specified idpublic ReplicatedIndexOperation getOperation(long id)
public Long getLatestOperation(String sourceNodeId)
sourceNodeId
- source node of the operationpublic boolean contains(long id)
id
- the NodeIndexOperation id to checkCopyright © 2002-2021 Atlassian. All Rights Reserved.