com.nextbreakpoint.flink.dummies.SampledTemperatureBucketAssigner 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 org.apache.flink.streaming.api.functions.sink.filesystem.bucketassigners.BasePathBucketAssigner;
import java.time.Clock;
import java.time.format.DateTimeFormatter;
public class SampledTemperatureBucketAssigner extends BasePathBucketAssigner {
private static final DateTimeFormatter FORMATTER = DateTimeFormatter
.ofPattern("yyyy-MM-dd--HH").withZone(Clock.systemUTC().getZone());
@Override
public String getBucketId(SampledTemperature element, Context context) {
return FORMATTER.format(element.getTimestamp());
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy