public class AppenderatorDriver extends Object implements Closeable
| Constructor and Description |
|---|
AppenderatorDriver(Appenderator appenderator,
SegmentAllocator segmentAllocator,
SegmentHandoffNotifierFactory handoffNotifierFactory,
UsedSegmentChecker usedSegmentChecker,
com.fasterxml.jackson.databind.ObjectMapper objectMapper,
FireDepartmentMetrics metrics)
Create a driver.
|
| Modifier and Type | Method and Description |
|---|---|
AppenderatorDriverAddResult |
add(InputRow row,
String sequenceName,
com.google.common.base.Supplier<Committer> committerSupplier)
Add a row.
|
void |
clear()
Clears out all our state and also calls
Appenderator.clear() on the underlying Appenderator. |
void |
close()
Closes this driver.
|
void |
moveSegmentOut(String sequenceName,
List<SegmentIdentifier> identifiers)
Move a set of identifiers out from "active", making way for newer segments.
|
Object |
persist(Committer committer)
Persist all data indexed through this driver so far.
|
com.google.common.util.concurrent.ListenableFuture<SegmentsAndMetadata> |
publish(TransactionalSegmentPublisher publisher,
Committer committer,
Collection<String> sequenceNames)
Execute a task in background to publish all segments corresponding to the given sequence names.
|
com.google.common.util.concurrent.ListenableFuture<SegmentsAndMetadata> |
publishAndRegisterHandoff(TransactionalSegmentPublisher publisher,
Committer committer,
Collection<String> sequenceNames) |
com.google.common.util.concurrent.ListenableFuture<SegmentsAndMetadata> |
registerHandoff(SegmentsAndMetadata segmentsAndMetadata)
Register the segments in the given
SegmentsAndMetadata to be handed off and execute a background task which
waits until the hand off completes. |
Object |
startJob()
Perform any initial setup and return currently persisted commit metadata.
|
public AppenderatorDriver(Appenderator appenderator, SegmentAllocator segmentAllocator, SegmentHandoffNotifierFactory handoffNotifierFactory, UsedSegmentChecker usedSegmentChecker, com.fasterxml.jackson.databind.ObjectMapper objectMapper, FireDepartmentMetrics metrics)
appenderator - appenderatorsegmentAllocator - segment allocatorhandoffNotifierFactory - handoff notifier factoryusedSegmentChecker - used segment checkerobjectMapper - object mapper, used for serde of commit metadatametrics - Firedepartment metricspublic Object startJob()
public void clear()
throws InterruptedException
Appenderator.clear() on the underlying Appenderator.InterruptedExceptionpublic AppenderatorDriverAddResult add(InputRow row, String sequenceName, com.google.common.base.Supplier<Committer> committerSupplier) throws IOException
row - the row to addsequenceName - sequenceName for this row's segmentcommitterSupplier - supplier of a committer associated with all data that has been added, including this rowIOException - if there is an I/O error while allocating or writing to a segmentpublic Object persist(Committer committer) throws InterruptedException
add(InputRow, String, Supplier).committer - committer representing all data that has been added so farInterruptedExceptionpublic com.google.common.util.concurrent.ListenableFuture<SegmentsAndMetadata> registerHandoff(SegmentsAndMetadata segmentsAndMetadata)
SegmentsAndMetadata to be handed off and execute a background task which
waits until the hand off completes.segmentsAndMetadata - the result segments and metadata of
publish(TransactionalSegmentPublisher, Committer, Collection)ListenableFuture for the submitted task
which returns SegmentsAndMetadata containing the segments successfully handed off and the metadata
of the caller of FiniteAppenderatorDriverMetadatapublic void close()
close in interface Closeableclose in interface AutoCloseablepublic void moveSegmentOut(String sequenceName, List<SegmentIdentifier> identifiers)
public com.google.common.util.concurrent.ListenableFuture<SegmentsAndMetadata> publish(TransactionalSegmentPublisher publisher, Committer committer, Collection<String> sequenceNames)
publisher - segment publishercommitter - committersequenceNames - a collection of sequence names to be publishedListenableFuture for the submitted task which removes published sequenceNames from
activeSegments and publishPendingSegments.public com.google.common.util.concurrent.ListenableFuture<SegmentsAndMetadata> publishAndRegisterHandoff(TransactionalSegmentPublisher publisher, Committer committer, Collection<String> sequenceNames)
Copyright © 2011–2017. All rights reserved.