Class DefaultIndexJournalService
java.lang.Object
com.atlassian.confluence.impl.journal.DefaultJournalService
com.atlassian.confluence.impl.index.DefaultIndexJournalService
- All Implemented Interfaces:
IndexJournalService
,JournalService
,JournalServiceInternal
public class DefaultIndexJournalService
extends DefaultJournalService
implements IndexJournalService
Implementation of
IndexJournalService
.
The supplied JournalManager
is configured with the JournalStateStore
implementation that's specific for indexing.- Since:
- 8.8
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultIndexJournalService
(JournalManager journalManager, SearchPlatformConfig searchPlatformConfig, com.atlassian.beehive.ClusterLockService clusterLockService) -
Method Summary
Modifier and TypeMethodDescription<V> V
processNewEntries
(@NonNull JournalIdentifier journalId, int maxEntries, @NonNull Function<Iterable<JournalEntry>, EntryProcessorResult<V>> entryProcessor) Processes journal entries that were added since the last time this method was called for this journal on this cluster node.Methods inherited from class com.atlassian.confluence.impl.journal.DefaultJournalService
countEntries, enqueue, getMostRecentId, peek, removeEntriesOlderThan, removeEntriesOlderThanExclusive, reset, waitForRecentEntriesToBecomeVisible
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.atlassian.confluence.api.service.journal.JournalService
countEntries, enqueue, peek, reset, waitForRecentEntriesToBecomeVisible
-
Constructor Details
-
DefaultIndexJournalService
public DefaultIndexJournalService(JournalManager journalManager, SearchPlatformConfig searchPlatformConfig, com.atlassian.beehive.ClusterLockService clusterLockService)
-
-
Method Details
-
processNewEntries
public <V> V processNewEntries(@NonNull JournalIdentifier journalId, int maxEntries, @NonNull Function<Iterable<JournalEntry>, EntryProcessorResult<V>> entryProcessor) throws ServiceExceptionDescription copied from interface:JournalService
Processes journal entries that were added since the last time this method was called for this journal on this cluster node.This method does not return entries that were added immediately before calling this method. Use
JournalService.waitForRecentEntriesToBecomeVisible()
for ensuring these entries will be included.This method can miss some entries due to identifier assignment and entry insertion not being an atomic operation. The risk of missed entries can be reduced by creating new entries as close to transaction commit as possible.
If entryProcessor throws an exception, the same entries will be returned again when this method is next called for this journal on this cluster node.
New journal is automatically created if a journal with the given name does not exists.
- Specified by:
processNewEntries
in interfaceJournalService
- Overrides:
processNewEntries
in classDefaultJournalService
- Parameters:
journalId
- only entries with this journal id will be returnedmaxEntries
- maximum number of entries to processentryProcessor
- function that will process entries that were added since the last time- Returns:
- result of entryProcessor
- Throws:
ServiceException
- if entries could not be fetched or the journal state could not be saved
-