Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ public class AppenderatorImpl implements Appenderator
private volatile FileLock basePersistDirLock = null;
private volatile FileChannel basePersistDirLockChannel = null;
private AtomicBoolean closed = new AtomicBoolean(false);
private final Object sinkLock = new Object();

AppenderatorImpl(
DataSchema schema,
Expand Down Expand Up @@ -474,9 +475,10 @@ public ListenableFuture<Object> persistAll(@Nullable final Committer committer)
indexesToPersist.add(Pair.of(hydrant, identifier));
}
}

if (sink.swappable()) {
indexesToPersist.add(Pair.of(sink.swap(), identifier));
synchronized (sinkLock) {
if (sink.swappable()) {
indexesToPersist.add(Pair.of(sink.swap(), identifier));
}
}
}

Expand Down Expand Up @@ -611,16 +613,17 @@ public ListenableFuture<SegmentsAndMetadata> push(
private ListenableFuture<?> pushBarrier()
{
return intermediateTempExecutor.submit(
(Runnable) () -> pushExecutor.submit(() -> {})
(Runnable) () -> pushExecutor.submit(() -> {
})
);
}

/**
* Merge segment, push to deep storage. Should only be used on segments that have been fully persisted. Must only
* be run in the single-threaded pushExecutor.
*
* @param identifier sink identifier
* @param sink sink to push
* @param identifier sink identifier
* @param sink sink to push
* @param useUniquePath true if the segment should be written to a path with a unique identifier
*
* @return segment descriptor, or null if the sink is no longer valid
Expand Down