Search in sources :

Example 1 with IVirtualBufferCache

use of org.apache.hyracks.storage.am.lsm.common.api.IVirtualBufferCache in project asterixdb by apache.

the class TestVirtualBufferCacheProvider method getVirtualBufferCaches.

@Override
public List<IVirtualBufferCache> getVirtualBufferCaches(INCServiceContext ctx, FileReference fileRef) throws HyracksDataException {
    List<IVirtualBufferCache> vbcs = new ArrayList<>();
    for (int i = 0; i < 2; i++) {
        IVirtualBufferCache vbc = new VirtualBufferCache(new HeapBufferAllocator(), pageSize, numPages / 2);
        vbcs.add(vbc);
    }
    return vbcs;
}
Also used : HeapBufferAllocator(org.apache.hyracks.storage.common.buffercache.HeapBufferAllocator) IVirtualBufferCache(org.apache.hyracks.storage.am.lsm.common.api.IVirtualBufferCache) VirtualBufferCache(org.apache.hyracks.storage.am.lsm.common.impls.VirtualBufferCache) IVirtualBufferCache(org.apache.hyracks.storage.am.lsm.common.api.IVirtualBufferCache) ArrayList(java.util.ArrayList)

Example 2 with IVirtualBufferCache

use of org.apache.hyracks.storage.am.lsm.common.api.IVirtualBufferCache in project asterixdb by apache.

the class LSMInvertedIndexLocalResource method createInstance.

@Override
public ILSMIndex createInstance(INCServiceContext serviceCtx) throws HyracksDataException {
    IIOManager ioManager = serviceCtx.getIoManager();
    FileReference file = ioManager.resolve(path);
    List<IVirtualBufferCache> virtualBufferCaches = vbcProvider.getVirtualBufferCaches(serviceCtx, file);
    IBufferCache bufferCache = storageManager.getBufferCache(serviceCtx);
    IFileMapProvider fileMapManager = storageManager.getFileMapProvider(serviceCtx);
    ILSMMergePolicy mergePolicy = mergePolicyFactory.createMergePolicy(mergePolicyProperties, serviceCtx);
    ILSMIOOperationScheduler ioScheduler = ioSchedulerProvider.getIoScheduler(serviceCtx);
    if (isPartitioned) {
        return InvertedIndexUtils.createPartitionedLSMInvertedIndex(ioManager, virtualBufferCaches, fileMapManager, typeTraits, cmpFactories, tokenTypeTraits, tokenCmpFactories, tokenizerFactory, bufferCache, file.getAbsolutePath(), bloomFilterFalsePositiveRate, mergePolicy, opTrackerProvider.getOperationTracker(serviceCtx), ioScheduler, ioOpCallbackFactory.createIoOpCallback(), invertedIndexFields, filterTypeTraits, filterCmpFactories, filterFields, filterFieldsForNonBulkLoadOps, invertedIndexFieldsForNonBulkLoadOps, durable, metadataPageManagerFactory);
    } else {
        return InvertedIndexUtils.createLSMInvertedIndex(ioManager, virtualBufferCaches, fileMapManager, typeTraits, cmpFactories, tokenTypeTraits, tokenCmpFactories, tokenizerFactory, bufferCache, file.getAbsolutePath(), bloomFilterFalsePositiveRate, mergePolicy, opTrackerProvider.getOperationTracker(serviceCtx), ioScheduler, ioOpCallbackFactory.createIoOpCallback(), invertedIndexFields, filterTypeTraits, filterCmpFactories, filterFields, filterFieldsForNonBulkLoadOps, invertedIndexFieldsForNonBulkLoadOps, durable, metadataPageManagerFactory);
    }
}
Also used : IFileMapProvider(org.apache.hyracks.storage.common.file.IFileMapProvider) ILSMIOOperationScheduler(org.apache.hyracks.storage.am.lsm.common.api.ILSMIOOperationScheduler) IVirtualBufferCache(org.apache.hyracks.storage.am.lsm.common.api.IVirtualBufferCache) FileReference(org.apache.hyracks.api.io.FileReference) IIOManager(org.apache.hyracks.api.io.IIOManager) ILSMMergePolicy(org.apache.hyracks.storage.am.lsm.common.api.ILSMMergePolicy) IBufferCache(org.apache.hyracks.storage.common.buffercache.IBufferCache)

Example 3 with IVirtualBufferCache

use of org.apache.hyracks.storage.am.lsm.common.api.IVirtualBufferCache in project asterixdb by apache.

the class LSMRTreeLocalResource method createInstance.

@Override
public IIndex createInstance(INCServiceContext ncServiceCtx) throws HyracksDataException {
    IIOManager ioManager = ncServiceCtx.getIoManager();
    FileReference fileRef = ioManager.resolve(path);
    List<IVirtualBufferCache> virtualBufferCaches = vbcProvider.getVirtualBufferCaches(ncServiceCtx, fileRef);
    return LSMRTreeUtils.createLSMTree(ioManager, virtualBufferCaches, fileRef, storageManager.getBufferCache(ncServiceCtx), storageManager.getFileMapProvider(ncServiceCtx), typeTraits, cmpFactories, btreeCmpFactories, valueProviderFactories, rtreePolicyType, bloomFilterFalsePositiveRate, mergePolicyFactory.createMergePolicy(mergePolicyProperties, ncServiceCtx), opTrackerProvider.getOperationTracker(ncServiceCtx), ioSchedulerProvider.getIoScheduler(ncServiceCtx), ioOpCallbackFactory.createIoOpCallback(), linearizeCmpFactory, rtreeFields, buddyBTreeFields, filterTypeTraits, filterCmpFactories, filterFields, durable, isPointMBR, metadataPageManagerFactory);
}
Also used : IVirtualBufferCache(org.apache.hyracks.storage.am.lsm.common.api.IVirtualBufferCache) FileReference(org.apache.hyracks.api.io.FileReference) IIOManager(org.apache.hyracks.api.io.IIOManager)

Example 4 with IVirtualBufferCache

use of org.apache.hyracks.storage.am.lsm.common.api.IVirtualBufferCache in project asterixdb by apache.

the class LSMRTreeWithAntiMatterLocalResource method createInstance.

@Override
public ILSMIndex createInstance(INCServiceContext serviceCtx) throws HyracksDataException {
    IIOManager ioManager = serviceCtx.getIoManager();
    FileReference file = ioManager.resolve(path);
    List<IVirtualBufferCache> virtualBufferCaches = vbcProvider.getVirtualBufferCaches(serviceCtx, file);
    return LSMRTreeUtils.createLSMTreeWithAntiMatterTuples(ioManager, virtualBufferCaches, file, storageManager.getBufferCache(serviceCtx), storageManager.getFileMapProvider(serviceCtx), typeTraits, cmpFactories, btreeComparatorFactories, valueProviderFactories, rtreePolicyType, mergePolicyFactory.createMergePolicy(mergePolicyProperties, serviceCtx), opTrackerProvider.getOperationTracker(serviceCtx), ioSchedulerProvider.getIoScheduler(serviceCtx), ioOpCallbackFactory.createIoOpCallback(), linearizeCmpFactory, rtreeFields, filterTypeTraits, filterCmpFactories, filterFields, true, isPointMBR, metadataPageManagerFactory);
}
Also used : IVirtualBufferCache(org.apache.hyracks.storage.am.lsm.common.api.IVirtualBufferCache) FileReference(org.apache.hyracks.api.io.FileReference) IIOManager(org.apache.hyracks.api.io.IIOManager)

Example 5 with IVirtualBufferCache

use of org.apache.hyracks.storage.am.lsm.common.api.IVirtualBufferCache in project asterixdb by apache.

the class LSMRTreeTestHarness method setUp.

public void setUp() throws HyracksDataException {
    ioManager = TestStorageManagerComponentHolder.getIOManager();
    ioDeviceId = 0;
    onDiskDir = ioManager.getIODevices().get(ioDeviceId).getMount() + sep + "lsm_rtree_" + simpleDateFormat.format(new Date()) + sep;
    file = ioManager.resolveAbsolutePath(onDiskDir);
    ctx = TestUtils.create(getHyracksFrameSize());
    TestStorageManagerComponentHolder.init(diskPageSize, diskNumPages, diskMaxOpenFiles);
    diskBufferCache = TestStorageManagerComponentHolder.getBufferCache(ctx.getJobletContext().getServiceContext());
    diskFileMapProvider = TestStorageManagerComponentHolder.getFileMapProvider();
    virtualBufferCaches = new ArrayList<>();
    for (int i = 0; i < numMutableComponents; i++) {
        IVirtualBufferCache virtualBufferCache = new VirtualBufferCache(new HeapBufferAllocator(), memPageSize, memNumPages / numMutableComponents);
        virtualBufferCaches.add(virtualBufferCache);
    }
    rnd.setSeed(RANDOM_SEED);
}
Also used : HeapBufferAllocator(org.apache.hyracks.storage.common.buffercache.HeapBufferAllocator) VirtualBufferCache(org.apache.hyracks.storage.am.lsm.common.impls.VirtualBufferCache) IVirtualBufferCache(org.apache.hyracks.storage.am.lsm.common.api.IVirtualBufferCache) IVirtualBufferCache(org.apache.hyracks.storage.am.lsm.common.api.IVirtualBufferCache) Date(java.util.Date)

Aggregations

IVirtualBufferCache (org.apache.hyracks.storage.am.lsm.common.api.IVirtualBufferCache)9 VirtualBufferCache (org.apache.hyracks.storage.am.lsm.common.impls.VirtualBufferCache)5 FileReference (org.apache.hyracks.api.io.FileReference)4 IIOManager (org.apache.hyracks.api.io.IIOManager)4 HeapBufferAllocator (org.apache.hyracks.storage.common.buffercache.HeapBufferAllocator)4 Date (java.util.Date)3 ArrayList (java.util.ArrayList)2 MultitenantVirtualBufferCache (org.apache.hyracks.storage.am.lsm.common.impls.MultitenantVirtualBufferCache)2 ILSMIOOperationScheduler (org.apache.hyracks.storage.am.lsm.common.api.ILSMIOOperationScheduler)1 ILSMMergePolicy (org.apache.hyracks.storage.am.lsm.common.api.ILSMMergePolicy)1 IBufferCache (org.apache.hyracks.storage.common.buffercache.IBufferCache)1 ResourceHeapBufferAllocator (org.apache.hyracks.storage.common.buffercache.ResourceHeapBufferAllocator)1 IFileMapProvider (org.apache.hyracks.storage.common.file.IFileMapProvider)1