public abstract class BaseThirdPartyWriter extends QueueBackedScheduledService<Collection<WriteOperation<?>>> implements ThirdPartyWriter
ThirdPartyWriter implementations, backed by a QueueBackedScheduledService.DEFAULT_QUEUE_CAPACITY, queue| Modifier | Constructor and Description |
|---|---|
protected |
BaseThirdPartyWriter()
Construct a new writer with a default queue capacity of
QueueBackedScheduledService.DEFAULT_QUEUE_CAPACITY. |
protected |
BaseThirdPartyWriter(int queueCapacity)
Construct a new writer.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
offer(Collection<WriteOperation<?>> operations,
String id)
Offer a collection of
WriteOperations, typically all the operations performed within the context of a single
transaction, to the queue for processing. |
protected abstract void |
processOperations(List<Collection<WriteOperation<?>>> operations)
Process the given operations that have been pulled from the queue, i.e.
|
protected void |
retry(List<Collection<WriteOperation<?>>> operations)
A convenience method for failure scenarios, which will insert the provided operations into the front of the queue.
|
protected void |
runOneIteration() |
void |
write(Collection<WriteOperation<?>> operations,
String id) |
void |
write(WriteOperation<?> operation,
String id) |
equals, hashCode, logEmptyQueue, loggingFrequencyMs, offer, scheduler, shutDown, start, stopaddListener, awaitRunning, awaitRunning, awaitTerminated, awaitTerminated, executor, failureCause, isRunning, serviceName, startAsync, startUp, state, stopAsync, toStringprotected BaseThirdPartyWriter()
QueueBackedScheduledService.DEFAULT_QUEUE_CAPACITY.protected BaseThirdPartyWriter(int queueCapacity)
queueCapacity - capacity of the queue.protected void runOneIteration()
throws Exception
runOneIteration in class com.google.common.util.concurrent.AbstractScheduledServiceExceptionpublic void write(WriteOperation<?> operation, String id)
write in interface ThirdPartyWriterpublic void write(Collection<WriteOperation<?>> operations, String id)
write in interface ThirdPartyWriterprotected final void offer(Collection<WriteOperation<?>> operations, String id)
WriteOperations, typically all the operations performed within the context of a single
transaction, to the queue for processing. If the queue is full, the operations will be dropped and a warning logged.operations - to process.id - of the operations for logging purposes.protected abstract void processOperations(List<Collection<WriteOperation<?>>> operations)
retry(List) method is intended to help there.operations - to be processed.protected final void retry(List<Collection<WriteOperation<?>>> operations)
operations - to retry.Copyright © 2013-2016–2020 Graph Aware Limited. All rights reserved.