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

com.kolibrifx.plovercrest.server.internal.folds.FoldReaderInputs Maven / Gradle / Ivy

The newest version!
/*
 * Copyright (c) 2010-2017, KolibriFX AS. Licensed under the Apache License, version 2.0.
 */

package com.kolibrifx.plovercrest.server.internal.folds;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import org.apache.commons.lang3.tuple.ImmutablePair;
import com.kolibrifx.plovercrest.server.streams.Stream;

/**
 * Specifies how input streams are set up when reading from a fold stream.
 * 

* Adding inputs both decides the ordering of the readers (which can be significant if the inputs * have elements on the same timestamp) and the timestamps that each input should read from. */ public class FoldReaderInputs { private final List, Long>> inputs = new ArrayList<>(); public void addInput(final Stream stream, final long fromTimestamp) { inputs.add(new ImmutablePair, Long>(stream, fromTimestamp)); } public void addInputs(final Collection> streams, final long fromTimestamp) { for (final Stream s : streams) { addInput(s, fromTimestamp); } } public List, Long>> getInputs() { return Collections.unmodifiableList(inputs); } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy