Search in sources :

Example 6 with IVirtualBufferCache

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

the class LSMInvertedIndexTestHarness method setUp.

public void setUp() throws HyracksDataException {
    ioManager = TestStorageManagerComponentHolder.getIOManager();
    ioDeviceId = 0;
    onDiskDir = ioManager.getIODevices().get(ioDeviceId).getMount() + sep + "lsm_invertedindex_" + simpleDateFormat.format(new Date()) + sep;
    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 MultitenantVirtualBufferCache(new VirtualBufferCache(new HeapBufferAllocator(), memPageSize, memNumPages / numMutableComponents));
        virtualBufferCaches.add(virtualBufferCache);
        virtualBufferCache.open();
    }
    rnd.setSeed(RANDOM_SEED);
    invIndexFileRef = ioManager.resolveAbsolutePath(onDiskDir + invIndexFileName);
}
Also used : HeapBufferAllocator(org.apache.hyracks.storage.common.buffercache.HeapBufferAllocator) MultitenantVirtualBufferCache(org.apache.hyracks.storage.am.lsm.common.impls.MultitenantVirtualBufferCache) VirtualBufferCache(org.apache.hyracks.storage.am.lsm.common.impls.VirtualBufferCache) MultitenantVirtualBufferCache(org.apache.hyracks.storage.am.lsm.common.impls.MultitenantVirtualBufferCache) IVirtualBufferCache(org.apache.hyracks.storage.am.lsm.common.api.IVirtualBufferCache) IVirtualBufferCache(org.apache.hyracks.storage.am.lsm.common.api.IVirtualBufferCache) Date(java.util.Date)

Example 7 with IVirtualBufferCache

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

the class LSMBTreeLocalResource method createInstance.

@Override
public ILSMIndex createInstance(INCServiceContext serviceCtx) throws HyracksDataException {
    IIOManager ioManager = serviceCtx.getIoManager();
    FileReference file = ioManager.resolve(path);
    List<IVirtualBufferCache> vbcs = vbcProvider.getVirtualBufferCaches(serviceCtx, file);
    return LSMBTreeUtil.createLSMTree(ioManager, vbcs, file, storageManager.getBufferCache(serviceCtx), storageManager.getFileMapProvider(serviceCtx), typeTraits, cmpFactories, bloomFilterKeyFields, bloomFilterFalsePositiveRate, mergePolicyFactory.createMergePolicy(mergePolicyProperties, serviceCtx), opTrackerProvider.getOperationTracker(serviceCtx), ioSchedulerProvider.getIoScheduler(serviceCtx), ioOpCallbackFactory.createIoOpCallback(), isPrimary, filterTypeTraits, filterCmpFactories, btreeFields, filterFields, durable, 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 8 with IVirtualBufferCache

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

the class LSMBTreeTestHarness method setUp.

public void setUp() throws HyracksDataException {
    ioManager = TestStorageManagerComponentHolder.getIOManager();
    ioDeviceId = 0;
    onDiskDir = ioManager.getIODevices().get(ioDeviceId).getMount() + sep + "lsm_btree_" + simpleDateFormat.format(new Date()) + sep;
    ctx = TestUtils.create(getHyracksFrameSize());
    TestStorageManagerComponentHolder.init(diskPageSize, diskNumPages, diskMaxOpenFiles);
    file = ioManager.resolveAbsolutePath(onDiskDir);
    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)

Example 9 with IVirtualBufferCache

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

the class DatasetVirtualBufferCaches method initializeVirtualBufferCaches.

public List<IVirtualBufferCache> initializeVirtualBufferCaches(IResourceMemoryManager memoryManager, int ioDeviceNum) {
    int numPages = datasetID < firstAvilableUserDatasetID ? storageProperties.getMetadataMemoryComponentNumPages() : storageProperties.getMemoryComponentNumPages();
    List<IVirtualBufferCache> vbcs = new ArrayList<>();
    for (int i = 0; i < storageProperties.getMemoryComponentsNum(); i++) {
        MultitenantVirtualBufferCache vbc = new MultitenantVirtualBufferCache(new VirtualBufferCache(new ResourceHeapBufferAllocator(memoryManager, Integer.toString(datasetID)), storageProperties.getMemoryComponentPageSize(), numPages / storageProperties.getMemoryComponentsNum() / numPartitions));
        vbcs.add(vbc);
    }
    ioDeviceVirtualBufferCaches.put(ioDeviceNum, vbcs);
    return vbcs;
}
Also used : MultitenantVirtualBufferCache(org.apache.hyracks.storage.am.lsm.common.impls.MultitenantVirtualBufferCache) IVirtualBufferCache(org.apache.hyracks.storage.am.lsm.common.api.IVirtualBufferCache) VirtualBufferCache(org.apache.hyracks.storage.am.lsm.common.impls.VirtualBufferCache) MultitenantVirtualBufferCache(org.apache.hyracks.storage.am.lsm.common.impls.MultitenantVirtualBufferCache) IVirtualBufferCache(org.apache.hyracks.storage.am.lsm.common.api.IVirtualBufferCache) ArrayList(java.util.ArrayList) ResourceHeapBufferAllocator(org.apache.hyracks.storage.common.buffercache.ResourceHeapBufferAllocator)

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