use of com.hedera.mirror.common.domain.transaction.RecordFile in project hedera-mirror-node by hashgraph.
the class SqlEntityListenerTest method completeFileAndCommit.
private void completeFileAndCommit() {
RecordFile recordFile = domainBuilder.recordFile().persist();
transactionTemplate.executeWithoutResult(status -> sqlEntityListener.onEnd(recordFile));
assertThat(recordFileRepository.findAll()).contains(recordFile);
}
use of com.hedera.mirror.common.domain.transaction.RecordFile in project hedera-mirror-node by hashgraph.
the class PerformanceIntegrationTest method parse.
void parse() throws Exception {
for (Resource resource : testFiles) {
RecordFile recordFile = recordFileReader.read(StreamFileData.from(resource.getFile()));
recordFileParser.parse(recordFile);
}
}
use of com.hedera.mirror.common.domain.transaction.RecordFile in project hedera-mirror-node by hashgraph.
the class RecordFileParserIntegrationTest method before.
@BeforeEach
void before() {
RecordFile recordFile1 = recordFile(recordFilePath1.toFile(), 0L);
RecordFile recordFile2 = recordFile(recordFilePath2.toFile(), 1L);
recordFileDescriptor1 = new RecordFileDescriptor(93, 8, recordFile1);
recordFileDescriptor2 = new RecordFileDescriptor(75, 5, recordFile2);
}
use of com.hedera.mirror.common.domain.transaction.RecordFile in project hedera-mirror-node by hashgraph.
the class RecordFileParserTest method endDate.
@ParameterizedTest(name = "endDate with offset {0}ns")
@CsvSource({ "-1", "0", "1" })
void endDate(long offset) {
// given
RecordFile recordFile = (RecordFile) getStreamFile();
RecordItem firstItem = recordFile.getItems().blockFirst();
long end = recordFile.getConsensusStart() + offset;
DateRangeFilter filter = new DateRangeFilter(Instant.EPOCH, Instant.ofEpochSecond(0, end));
doReturn(filter).when(mirrorDateRangePropertiesProcessor).getDateRangeFilter(parserProperties.getStreamType());
// when
parser.parse(recordFile);
// then
verify(recordStreamFileListener).onStart();
if (offset >= 0) {
verify(recordItemListener).onItem(firstItem);
}
verify(recordStreamFileListener).onEnd(recordFile);
assertPostParseStreamFile(recordFile, true);
}
use of com.hedera.mirror.common.domain.transaction.RecordFile in project hedera-mirror-node by hashgraph.
the class RecordFileParserTest method startDate.
@ParameterizedTest(name = "startDate with offset {0}ns")
@CsvSource({ "-1", "0", "1" })
void startDate(long offset) {
// given
RecordFile recordFile = (RecordFile) getStreamFile();
RecordItem firstItem = recordFile.getItems().blockFirst();
long start = recordFile.getConsensusStart() + offset;
DateRangeFilter filter = new DateRangeFilter(Instant.ofEpochSecond(0, start), null);
doReturn(filter).when(mirrorDateRangePropertiesProcessor).getDateRangeFilter(parserProperties.getStreamType());
// when
parser.parse(recordFile);
// then
verify(recordStreamFileListener).onStart();
if (offset < 0) {
verify(recordItemListener).onItem(firstItem);
}
verify(recordStreamFileListener).onEnd(recordFile);
assertPostParseStreamFile(recordFile, true);
}
Aggregations