prepare the addition of a date index
This commit is contained in:
@@ -24,11 +24,7 @@ class PdbWriter implements AutoCloseable, Flushable {
|
||||
bsFile = BSFile.existingFile(pdbFile.getRootBlockNumber(), diskStorage);
|
||||
final Optional<Long> optionalLastValue = bsFile.getLastValue();
|
||||
|
||||
if (optionalLastValue.isPresent()) {
|
||||
lastEpochMilli = optionalLastValue.get();
|
||||
} else {
|
||||
lastEpochMilli = 0;
|
||||
}
|
||||
lastEpochMilli = optionalLastValue.orElse(0L);
|
||||
}
|
||||
|
||||
public PdbFile getPdbFile() {
|
||||
|
||||
@@ -3,7 +3,9 @@ package org.lucares.performance.db;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.time.Instant;
|
||||
import java.time.OffsetDateTime;
|
||||
import java.time.ZoneOffset;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
@@ -84,7 +86,9 @@ public class PerformanceDbTest {
|
||||
|
||||
for (long i = 0; i < n; i++) {
|
||||
final long value = ThreadLocalRandom.current().nextInt(0, Integer.MAX_VALUE);
|
||||
result.add(new Entry(currentTime + addToDate, value, tags));
|
||||
final OffsetDateTime date = OffsetDateTime.ofInstant(Instant.ofEpochMilli(currentTime + addToDate),
|
||||
ZoneOffset.UTC);
|
||||
result.add(new Entry(date, value, tags));
|
||||
|
||||
currentTime += differenceInMs;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user