use of org.apache.hyracks.storage.am.lsm.invertedindex.ondisk.OnDiskInvertedIndex in project asterixdb by apache.
the class LSMInvertedIndex method getMergeFileReferences.
@Override
protected LSMComponentFileReferences getMergeFileReferences(ILSMDiskComponent firstComponent, ILSMDiskComponent lastComponent) throws HyracksDataException {
LSMInvertedIndexDiskComponent first = (LSMInvertedIndexDiskComponent) firstComponent;
OnDiskInvertedIndex firstInvIndex = (OnDiskInvertedIndex) first.getInvIndex();
String firstFileName = firstInvIndex.getBTree().getFileReference().getFile().getName();
LSMInvertedIndexDiskComponent last = (LSMInvertedIndexDiskComponent) lastComponent;
OnDiskInvertedIndex lastInvIndex = (OnDiskInvertedIndex) last.getInvIndex();
String lastFileName = lastInvIndex.getBTree().getFileReference().getFile().getName();
return fileManager.getRelMergeFileReference(firstFileName, lastFileName);
}
use of org.apache.hyracks.storage.am.lsm.invertedindex.ondisk.OnDiskInvertedIndex in project asterixdb by apache.
the class LSMInvertedIndex method markAsValid.
@Override
public void markAsValid(ILSMDiskComponent lsmComponent) throws HyracksDataException {
LSMInvertedIndexDiskComponent invIndexComponent = (LSMInvertedIndexDiskComponent) lsmComponent;
OnDiskInvertedIndex invIndex = (OnDiskInvertedIndex) invIndexComponent.getInvIndex();
IBufferCache bufferCache = invIndex.getBufferCache();
markAsValidInternal(invIndex.getBufferCache(), invIndexComponent.getBloomFilter());
// Flush inverted index second.
bufferCache.force(invIndex.getInvListsFileId(), true);
markAsValidInternal(invIndex.getBTree());
// Flush deleted keys BTree.
markAsValidInternal(invIndexComponent.getDeletedKeysBTree());
}
use of org.apache.hyracks.storage.am.lsm.invertedindex.ondisk.OnDiskInvertedIndex in project asterixdb by apache.
the class InvertedIndexUtils method createOnDiskInvertedIndex.
public static OnDiskInvertedIndex createOnDiskInvertedIndex(IIOManager ioManager, IBufferCache bufferCache, IFileMapProvider fileMapProvider, ITypeTraits[] invListTypeTraits, IBinaryComparatorFactory[] invListCmpFactories, ITypeTraits[] tokenTypeTraits, IBinaryComparatorFactory[] tokenCmpFactories, FileReference invListsFile, IPageManagerFactory pageManagerFactory) throws HyracksDataException {
IInvertedListBuilder builder = new FixedSizeElementInvertedListBuilder(invListTypeTraits);
FileReference btreeFile = getBTreeFile(ioManager, invListsFile);
return new OnDiskInvertedIndex(bufferCache, fileMapProvider, builder, invListTypeTraits, invListCmpFactories, tokenTypeTraits, tokenCmpFactories, btreeFile, invListsFile, pageManagerFactory);
}
use of org.apache.hyracks.storage.am.lsm.invertedindex.ondisk.OnDiskInvertedIndex in project asterixdb by apache.
the class LSMInvertedIndex method getLSMComponentPhysicalFiles.
@Override
public Set<String> getLSMComponentPhysicalFiles(ILSMComponent lsmComponent) {
Set<String> files = new HashSet<>();
LSMInvertedIndexDiskComponent invIndexComponent = (LSMInvertedIndexDiskComponent) lsmComponent;
OnDiskInvertedIndex invIndex = (OnDiskInvertedIndex) invIndexComponent.getInvIndex();
files.add(invIndex.getInvListsFile().getFile().getAbsolutePath());
files.add(invIndex.getBTree().getFileReference().getFile().getAbsolutePath());
files.add(invIndexComponent.getBloomFilter().getFileReference().getFile().getAbsolutePath());
files.add(invIndexComponent.getDeletedKeysBTree().getFileReference().getFile().getAbsolutePath());
return files;
}
Aggregations