Search in sources :

Example 11 with DefaultCheckpointableWatermark

use of org.apache.gobblin.source.extractor.DefaultCheckpointableWatermark in project incubator-gobblin by apache.

the class FineGrainedWatermarkTrackerBenchmark method scheduledNoRandomDelayedAcks.

@Benchmark
@Group("scheduledNoRandom")
public void scheduledNoRandomDelayedAcks(Control control, TrackerState trackerState) throws Exception {
    if (!control.stopMeasurement) {
        final AcknowledgableWatermark wmark = new AcknowledgableWatermark(new DefaultCheckpointableWatermark("0", new LongWatermark(trackerState._index)));
        trackerState._index++;
        int delay = 10;
        trackerState._executorService.schedule(new Runnable() {

            @Override
            public void run() {
                wmark.ack();
            }
        }, delay, TimeUnit.MILLISECONDS);
    }
}
Also used : DefaultCheckpointableWatermark(org.apache.gobblin.source.extractor.DefaultCheckpointableWatermark) LongWatermark(org.apache.gobblin.source.extractor.extract.LongWatermark) Group(org.openjdk.jmh.annotations.Group) Benchmark(org.openjdk.jmh.annotations.Benchmark)

Example 12 with DefaultCheckpointableWatermark

use of org.apache.gobblin.source.extractor.DefaultCheckpointableWatermark in project incubator-gobblin by apache.

the class FineGrainedWatermarkTrackerBenchmark method trackImmediateAcks.

@Benchmark
@Group("trackImmediate")
public void trackImmediateAcks(Control control, TrackerState trackerState) throws Exception {
    if (!control.stopMeasurement) {
        AcknowledgableWatermark wmark = new AcknowledgableWatermark(new DefaultCheckpointableWatermark("0", new LongWatermark(trackerState._index)));
        trackerState._watermarkTracker.track(wmark);
        trackerState._index++;
        wmark.ack();
    }
}
Also used : DefaultCheckpointableWatermark(org.apache.gobblin.source.extractor.DefaultCheckpointableWatermark) LongWatermark(org.apache.gobblin.source.extractor.extract.LongWatermark) Group(org.openjdk.jmh.annotations.Group) Benchmark(org.openjdk.jmh.annotations.Benchmark)

Aggregations

DefaultCheckpointableWatermark (org.apache.gobblin.source.extractor.DefaultCheckpointableWatermark)12 LongWatermark (org.apache.gobblin.source.extractor.extract.LongWatermark)12 CheckpointableWatermark (org.apache.gobblin.source.extractor.CheckpointableWatermark)8 Test (org.testng.annotations.Test)6 Benchmark (org.openjdk.jmh.annotations.Benchmark)4 Group (org.openjdk.jmh.annotations.Group)4 IOException (java.io.IOException)3 Random (java.util.Random)3 TreeSet (java.util.TreeSet)3 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)3 RecordEnvelope (org.apache.gobblin.stream.RecordEnvelope)3 Config (com.typesafe.config.Config)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1 ScheduledExecutorService (java.util.concurrent.ScheduledExecutorService)1 ScheduledThreadPoolExecutor (java.util.concurrent.ScheduledThreadPoolExecutor)1 Schema (org.apache.avro.Schema)1 GenericRecord (org.apache.avro.generic.GenericRecord)1 State (org.apache.gobblin.configuration.State)1 TestPartitioner (org.apache.gobblin.writer.test.TestPartitioner)1