Search in sources :

Example 1 with OnDiskInvertedIndex

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);
}
Also used : OnDiskInvertedIndex(org.apache.hyracks.storage.am.lsm.invertedindex.ondisk.OnDiskInvertedIndex)

Example 2 with OnDiskInvertedIndex

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());
}
Also used : OnDiskInvertedIndex(org.apache.hyracks.storage.am.lsm.invertedindex.ondisk.OnDiskInvertedIndex) IBufferCache(org.apache.hyracks.storage.common.buffercache.IBufferCache)

Example 3 with OnDiskInvertedIndex

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);
}
Also used : OnDiskInvertedIndex(org.apache.hyracks.storage.am.lsm.invertedindex.ondisk.OnDiskInvertedIndex) PartitionedOnDiskInvertedIndex(org.apache.hyracks.storage.am.lsm.invertedindex.ondisk.PartitionedOnDiskInvertedIndex) IInvertedListBuilder(org.apache.hyracks.storage.am.lsm.invertedindex.api.IInvertedListBuilder) FixedSizeElementInvertedListBuilder(org.apache.hyracks.storage.am.lsm.invertedindex.ondisk.FixedSizeElementInvertedListBuilder) FileReference(org.apache.hyracks.api.io.FileReference)

Example 4 with OnDiskInvertedIndex

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;
}
Also used : OnDiskInvertedIndex(org.apache.hyracks.storage.am.lsm.invertedindex.ondisk.OnDiskInvertedIndex) HashSet(java.util.HashSet)

Aggregations

OnDiskInvertedIndex (org.apache.hyracks.storage.am.lsm.invertedindex.ondisk.OnDiskInvertedIndex)4 HashSet (java.util.HashSet)1 FileReference (org.apache.hyracks.api.io.FileReference)1 IInvertedListBuilder (org.apache.hyracks.storage.am.lsm.invertedindex.api.IInvertedListBuilder)1 FixedSizeElementInvertedListBuilder (org.apache.hyracks.storage.am.lsm.invertedindex.ondisk.FixedSizeElementInvertedListBuilder)1 PartitionedOnDiskInvertedIndex (org.apache.hyracks.storage.am.lsm.invertedindex.ondisk.PartitionedOnDiskInvertedIndex)1 IBufferCache (org.apache.hyracks.storage.common.buffercache.IBufferCache)1