com.kolibrifx.plovercrest.server.internal.streams.TableStreamWriter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of plovercrest-server Show documentation
Show all versions of plovercrest-server Show documentation
Plovercrest server library.
The newest version!
/*
* Copyright (c) 2010-2017, KolibriFX AS. Licensed under the Apache License, version 2.0.
*/
package com.kolibrifx.plovercrest.server.internal.streams;
import java.nio.ByteBuffer;
import com.kolibrifx.plovercrest.server.TableWriter;
import com.kolibrifx.plovercrest.server.streams.StreamWriter;
public class TableStreamWriter implements StreamWriter {
private final TableWriter tableWriter;
public TableStreamWriter(final TableWriter tableWriter) {
this.tableWriter = tableWriter;
}
@Override
public void write(final long timestamp, final ByteBuffer buffer) {
tableWriter.write(timestamp, buffer);
}
@Override
public void freeze() {
tableWriter.freeze();
}
@Override
public void unfreeze() {
tableWriter.unfreeze();
}
@Override
public boolean isFrozen() {
return tableWriter.isFrozen();
}
@Override
public void flush() {
tableWriter.force();
}
@Override
public void updateLastValidTimestamp(final long timestamp) {
tableWriter.updateLastValidTimestamp(timestamp);
}
}