use of org.spf4j.base.MutableHolder in project spf4j by zolyfarkas.
the class TSDBTailerTest method main.
public static void main(final String[] parameters) throws IOException {
final MutableHolder<Integer> counter = new MutableHolder<>(0);
TimeSeriesDatabase tsdb = new TimeSeriesDatabase(new File(parameters[0]));
tsdb.tail(10, 0, new TSDataHandler() {
private int count = 0;
@Override
public void newTable(final String tableName, final String[] columnNames) {
LOG.info("New Table: {} columns: {}", tableName, columnNames);
}
@Override
public void newData(final String tableName, final TimeSeries data) {
LOG.debug("Table {} - {}", tableName, data);
counter.setValue(counter.getValue() + data.getTimeStamps().length);
}
@Override
public boolean finish() {
return count++ > 400;
}
});
System.exit(counter.getValue());
}
Aggregations