use of com.apple.foundationdb.record.lucene.directory.FDBLuceneFileReference in project fdb-record-layer by FoundationDB.
the class LuceneIndexTest method assertEntriesAndSegmentInfoStoredInCompoundFile.
private static void assertEntriesAndSegmentInfoStoredInCompoundFile(@Nonnull Subspace subspace, @Nonnull FDBRecordContext context, @Nonnull String segment, boolean cleanFiles) {
try (final FDBDirectory directory = new FDBDirectory(subspace, context)) {
final FDBLuceneFileReference reference = directory.getFDBLuceneFileReference(segment).join();
Assertions.assertNotNull(reference);
Assertions.assertTrue(reference.getEntries().length > 0);
Assertions.assertTrue(reference.getSegmentInfo().length > 0);
assertOnlyCompoundFileExisting(subspace, context, directory, cleanFiles);
}
}
use of com.apple.foundationdb.record.lucene.directory.FDBLuceneFileReference in project fdb-record-layer by FoundationDB.
the class LuceneOptimizedWrappedIndexOutput method close.
@Override
public void close() throws IOException {
FDBLuceneFileReference reference = new FDBLuceneFileReference(-1, -1, -1, -1);
if (isSegmentInfo) {
reference.setSegmentInfo(outputStream.toByteArray());
} else {
reference.setEntries(outputStream.toByteArray());
}
directory.writeFDBLuceneFileReference(name, reference);
}
Aggregations