reset lastEpochMilli when opening a new export file

This commit is contained in:
2019-02-06 15:52:37 +00:00
parent 99cdf557b3
commit 58bfba23bb

View File

@@ -78,7 +78,8 @@ public class PdbExport {
long count = 0;
long lastEpochMilli = 0;
long begin = System.currentTimeMillis();
for (final PdbFile pdbFile : pdbFiles) {
if (writer == null || Files.size(exportFile) > GB) {
@@ -90,6 +91,8 @@ public class PdbExport {
exportFiles.add(exportFile);
writer = createWriter(exportFile);
LOGGER.info("new export file: {}", exportFile);
lastEpochMilli = 0;
}
final Stream<LongList> timeValueStream = PdbFile.toStream(Arrays.asList(pdbFile), db.getDataStore());
@@ -97,6 +100,7 @@ public class PdbExport {
final Tags tags = pdbFile.getTags();
final long tagsId = addNewTagsToDictionary(writer, tags, tagsIdCounter);
final Iterator<LongList> it = timeValueStream.iterator();
while (it.hasNext()) {
final LongList entry = it.next();
@@ -117,8 +121,13 @@ public class PdbExport {
writer.write('\n');
count++;
if (count % 100000 == 0) {
LOGGER.info("progress: " + count);
final long chunk = 10_000_000;
if (count % chunk == 0) {
long end = System.currentTimeMillis();
long duration = end-begin;
long entriesPerSecond = (long)((double)chunk / (duration / 1000.0));
LOGGER.info("progress: {} - {} entries/s + duration {}" , String.format("%,d",count), String.format("%,d",entriesPerSecond), duration);
begin = System.currentTimeMillis();
}
}
}