com.atlassian.jira.index.ha
Class OfBizReplicatedIndexOperationStore

java.lang.Object
  extended by com.atlassian.jira.index.ha.OfBizReplicatedIndexOperationStore

public class OfBizReplicatedIndexOperationStore
extends Object

Stores index operation events

Since:
v6.1

Constructor Summary
OfBizReplicatedIndexOperationStore(OfBizDelegator ofBizDelegator)
           
 
Method Summary
 boolean contains(long id)
           
 ReplicatedIndexOperation createIndexOperation(Timestamp indexTime, ReplicatedIndexOperation.AffectedIndex affectedIndex, ReplicatedIndexOperation.SharedEntityType entityType, ReplicatedIndexOperation.Operation operation, Set<Long> affectedIds)
          Creates and stores the index operation in the underlying database, only if the node is in a cluster.
 Set<ReplicatedIndexOperation> getIndexOperationsAfter(Date sinceTime)
          Returns a set of IndexOperations that have happened since the time specified.
 Set<ReplicatedIndexOperation> getIndexOperationsAfter(String sourceNodeId, Long id)
          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)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OfBizReplicatedIndexOperationStore

public OfBizReplicatedIndexOperationStore(OfBizDelegator ofBizDelegator)
Method Detail

createIndexOperation

@Nullable
public ReplicatedIndexOperation createIndexOperation(@Nonnull
                                                              Timestamp indexTime,
                                                              @Nonnull
                                                              ReplicatedIndexOperation.AffectedIndex affectedIndex,
                                                              @Nonnull
                                                              ReplicatedIndexOperation.SharedEntityType entityType,
                                                              @Nonnull
                                                              ReplicatedIndexOperation.Operation operation,
                                                              @Nonnull
                                                              Set<Long> affectedIds)
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

getIndexOperationsAfter

public Set<ReplicatedIndexOperation> getIndexOperationsAfter(Date sinceTime)
Returns a set of IndexOperations that have happened since the time specified.

Parameters:
sinceTime -
Returns:
a set of ReplicatedIndexOperation that have taken place on other nodes after a specified time

purgeOldOperations

public int purgeOldOperations(String sourceNodeId,
                              Date before)

getIndexOperationsAfter

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:
a set of ReplicatedIndexOperation that have taken place on other nodes after a specified id

getOperation

public ReplicatedIndexOperation getOperation(long id)
get an operation by id

Returns:
the operation.

getLatestOperation

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.

contains

public boolean contains(long id)
Parameters:
id - the NodeIndexOperation id to check
Returns:
true if the database contains this index operation


Copyright © 2002-2014 Atlassian. All Rights Reserved.