use of net.openhft.chronicle.queue.impl.single.SingleChronicleQueue in project Chronicle-Queue by OpenHFT.
the class ResultGenerator method main.
public static void main(String[] args) throws IOException {
if (args.length != 1) {
throw new IllegalArgumentException("Usage: <program> [resource-name]");
}
final ConfigParser configParser = new ConfigParser(args[0]);
final List<StageConfig> allStageConfigs = configParser.getAllStageConfigs();
final StageConfig lastStageConfig = allStageConfigs.get(allStageConfigs.size() - 1);
Jvm.setExceptionHandlers((c, m, t) -> {
System.out.println(m);
}, (c, m, t) -> {
System.out.println(m);
if (t != null) {
t.printStackTrace();
}
}, (c, m, t) -> System.out.println(m));
try (final SingleChronicleQueue queue = SingleChronicleQueueBuilder.binary(lastStageConfig.getOutputPath()).build();
final Writer resultsWriter = new FileWriter("results.txt", false)) {
final MethodReader methodReader = queue.createTailer().methodReader(new CapturingReceiver(resultsWriter));
while (methodReader.readOne()) {
// report
}
}
}
Aggregations