Search in sources :

Example 1 with ResourceHeapBufferAllocator

use of org.apache.hyracks.storage.common.buffercache.ResourceHeapBufferAllocator 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

ArrayList (java.util.ArrayList)1 IVirtualBufferCache (org.apache.hyracks.storage.am.lsm.common.api.IVirtualBufferCache)1 MultitenantVirtualBufferCache (org.apache.hyracks.storage.am.lsm.common.impls.MultitenantVirtualBufferCache)1 VirtualBufferCache (org.apache.hyracks.storage.am.lsm.common.impls.VirtualBufferCache)1 ResourceHeapBufferAllocator (org.apache.hyracks.storage.common.buffercache.ResourceHeapBufferAllocator)1