com.nextbreakpoint.flink.dummies.SampledTemperatureSplit Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of com.nextbreakpoint.flink.dummies Show documentation
Show all versions of com.nextbreakpoint.flink.dummies Show documentation
Collection of dummy jobs for Apache Flink
/*
* This file is part of Flink Dummies
* https://github.com/nextbreakpoint/flink-dummies
*/
package com.nextbreakpoint.flink.dummies;
import lombok.Getter;
import org.apache.flink.api.connector.source.lib.util.IteratorSourceSplit;
import java.util.List;
import java.util.Objects;
public class SampledTemperatureSplit implements IteratorSourceSplit {
private final String splitId;
@Getter
private final int maxCount;
@Getter
private final long maxDelay;
@Getter
private final List sensors;
public SampledTemperatureSplit(String splitId, int maxCount, long maxDelay, List sensors) {
this.splitId = Objects.requireNonNull(splitId);
this.maxCount = maxCount;
this.maxDelay = maxDelay;
this.sensors = Objects.requireNonNull(sensors);
}
@Override
public SampledTemperatureIterator getIterator() {
return new SampledTemperatureIterator(maxCount, maxDelay, sensors);
}
@Override
public IteratorSourceSplit getUpdatedSplitForIterator(SampledTemperatureIterator iterator) {
return new SampledTemperatureSplit(splitId, iterator.getMaxCount(), iterator.getMaxDelay(), iterator.getSensors());
}
@Override
public String splitId() {
return splitId;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy