public class PeriodicIndexWriterCommitScheduler extends Object
Modifier and Type | Field and Description |
---|---|
static String |
PERIODIC_COMMIT_BARRIER |
Constructor and Description |
---|
PeriodicIndexWriterCommitScheduler(PeriodicIndexWriterCommitObserver commitObserver,
ApplicationProperties applicationProperties,
BarrierFactory barrierFactory,
com.atlassian.event.api.EventPublisher eventPublisher) |
Modifier and Type | Method and Description |
---|---|
protected void |
commitWriters()
Moves uncommitted writers from commit queue and attempts to commit them.
|
void |
forceImmediateCommit()
Forces an immediate write of Lucene files to disk.
|
void |
onPluginFrameworkShutdownEvent(com.atlassian.plugin.event.events.PluginFrameworkShutdownEvent event) |
void |
onPluginFrameworkStartedEvent(com.atlassian.plugin.event.events.PluginFrameworkStartedEvent event) |
void |
scheduleForCommit(DefaultIndexEngine.WriterReference writer)
Add writer to commit queue.
|
public static final String PERIODIC_COMMIT_BARRIER
public PeriodicIndexWriterCommitScheduler(PeriodicIndexWriterCommitObserver commitObserver, ApplicationProperties applicationProperties, BarrierFactory barrierFactory, com.atlassian.event.api.EventPublisher eventPublisher)
@EventListener public void onPluginFrameworkStartedEvent(com.atlassian.plugin.event.events.PluginFrameworkStartedEvent event)
@EventListener public void onPluginFrameworkShutdownEvent(com.atlassian.plugin.event.events.PluginFrameworkShutdownEvent event)
public void forceImmediateCommit() throws ExecutionException, InterruptedException, TimeoutException
ExecutionException
- will never happenInterruptedException
TimeoutException
- when 5 minutes is not enough to write to a disk - indicates a seriously overloaded machinepublic void scheduleForCommit(DefaultIndexEngine.WriterReference writer)
commitWriters()
writer
- protected void commitWriters()
Throwable
.
In case any exceptions are thrown internally before operation was completed, moves all scheduled writers back to queue.Copyright © 2002-2023 Atlassian. All Rights Reserved.