use of org.apache.hyracks.storage.am.lsm.common.impls.MultitenantVirtualBufferCache 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);
}
use of org.apache.hyracks.storage.am.lsm.common.impls.MultitenantVirtualBufferCache 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;
}
Aggregations