public class FiniteAppenderatorDriver extends Object implements Closeable
Constructor and Description |
---|
FiniteAppenderatorDriver(Appenderator appenderator,
SegmentAllocator segmentAllocator,
SegmentHandoffNotifierFactory handoffNotifierFactory,
UsedSegmentChecker usedSegmentChecker,
com.fasterxml.jackson.databind.ObjectMapper objectMapper,
int maxRowsPerSegment,
long handoffConditionTimeout,
FireDepartmentMetrics metrics)
Create a driver.
|
Modifier and Type | Method and Description |
---|---|
SegmentIdentifier |
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.
|
SegmentsAndMetadata |
finish(TransactionalSegmentPublisher publisher,
Committer committer)
Publish all data indexed through this driver so far, and waits for it to be handed off.
|
Object |
persist(Committer committer)
Persist all data indexed through this driver so far.
|
Object |
startJob()
Perform any initial setup and return currently persisted commit metadata.
|
public FiniteAppenderatorDriver(Appenderator appenderator, SegmentAllocator segmentAllocator, SegmentHandoffNotifierFactory handoffNotifierFactory, UsedSegmentChecker usedSegmentChecker, com.fasterxml.jackson.databind.ObjectMapper objectMapper, int maxRowsPerSegment, long handoffConditionTimeout, FireDepartmentMetrics metrics)
appenderator
- appenderatorsegmentAllocator
- segment allocatorhandoffNotifierFactory
- handoff notifier factoryusedSegmentChecker
- used segment checkerobjectMapper
- object mapper, used for serde of commit metadatamaxRowsPerSegment
- maximum number of rows allowed in an entire segment (not a single persist)handoffConditionTimeout
- maximum number of millis allowed for handoff (not counting push/publish), zero
means wait forever.metrics
- Firedepartment metricspublic Object startJob()
public void clear() throws InterruptedException
Appenderator.clear()
on the underlying Appenderator.InterruptedException
public SegmentIdentifier 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 farInterruptedException
public SegmentsAndMetadata finish(TransactionalSegmentPublisher publisher, Committer committer) throws InterruptedException
add(InputRow, String, Supplier)
and
persist(Committer)
.publisher
- publisher to use for this set of segmentscommitter
- committer representing all data that has been added so farInterruptedException
public void close()
close
in interface Closeable
close
in interface AutoCloseable
Copyright © 2011–2017. All rights reserved.