Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,8 @@ protected void processSourceFile(String originalFilePath) throws IOException, Me
}
}
}
originStorage.close();
// Do not close originStorage: StorageFactory caches one Storage instance per scheme, and the same
// instance is used by flushRemainingData() to write the data files when they share the scheme.
}

@Override
Expand Down Expand Up @@ -263,8 +264,6 @@ private void flushRowBatch(PerVirtualNodeWriter bucketWriter) throws IOException
queue.clear();
}
}
bucketWriter.indexService.flushIndexEntriesOfFile(index.getTableId(), index.getId(),
bucketWriter.currFile.getId(), true, bucketWriter.defaultIndexOption);
}

private void closePixelsFile(PerVirtualNodeWriter bucketWriter) throws IOException, IndexException
Expand All @@ -275,6 +274,10 @@ private void closePixelsFile(PerVirtualNodeWriter bucketWriter) throws IOExcepti
flushRowBatch(bucketWriter);
}

// The main index of a file can only be flushed once, hence it is flushed here instead of in flushRowBatch()
bucketWriter.indexService.flushIndexEntriesOfFile(index.getTableId(), index.getId(),
bucketWriter.currFile.getId(), true, bucketWriter.defaultIndexOption);

closeWriterAndAddFile(bucketWriter.pixelsWriter, bucketWriter.currFile, bucketWriter.currTargetPath, bucketWriter.targetNode);
}

Expand Down
Loading