All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.nextbreakpoint.flink.dummies.SampledTemperatureBucketAssigner Maven / Gradle / Ivy

There is a newer version: 0.0.6
Show newest version
/*
 * 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