use of org.graylog.plugins.views.search.export.SimpleMessageChunk in project graylog2-server by Graylog2.
the class ElasticsearchExportBackendIT method collectTotalResult.
private SimpleMessageChunk collectTotalResult(ExportMessagesCommand command) {
LinkedHashSet<SimpleMessageChunk> allChunks = collectChunksFor(command);
LinkedHashSet<SimpleMessage> allMessages = new LinkedHashSet<>();
for (SimpleMessageChunk chunk : allChunks) {
keepOnlyRelevantFields(chunk, command.fieldsInOrder());
allMessages.addAll(chunk.messages());
}
return SimpleMessageChunk.from(command.fieldsInOrder(), allMessages);
}
use of org.graylog.plugins.views.search.export.SimpleMessageChunk in project graylog2-server by Graylog2.
the class ElasticsearchExportBackendIT method deliversCompleteLastChunkIfLimitIsReached.
@Test
public void deliversCompleteLastChunkIfLimitIsReached() {
importFixture("messages.json");
ExportMessagesCommand command = commandBuilderWithAllStreams().chunkSize(2).limit(3).build();
SimpleMessageChunk totalResult = collectTotalResult(command);
assertThat(totalResult.messages()).hasSize(4);
}
Aggregations