use of org.apache.hyracks.storage.am.lsm.common.impls.VirtualBufferCache in project asterixdb by apache.
the class InMemoryBTreeRunner method init.
protected void init(int pageSize, int numPages, ITypeTraits[] typeTraits, IBinaryComparatorFactory[] cmpFactories) throws HyracksDataException {
bufferCache = new VirtualBufferCache(new HeapBufferAllocator(), pageSize, numPages);
TypeAwareTupleWriterFactory tupleWriterFactory = new TypeAwareTupleWriterFactory(typeTraits);
ITreeIndexFrameFactory leafFrameFactory = new BTreeNSMLeafFrameFactory(tupleWriterFactory);
ITreeIndexFrameFactory interiorFrameFactory = new BTreeNSMInteriorFrameFactory(tupleWriterFactory);
IPageManager freePageManager = new VirtualFreePageManager(bufferCache);
btree = new BTree(bufferCache, new TransientFileMapManager(), freePageManager, interiorFrameFactory, leafFrameFactory, cmpFactories, typeTraits.length, file);
}
use of org.apache.hyracks.storage.am.lsm.common.impls.VirtualBufferCache 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;
}
use of org.apache.hyracks.storage.am.lsm.common.impls.VirtualBufferCache 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.VirtualBufferCache in project asterixdb by apache.
the class VirtualBufferCacheTest method test01.
/**
* Pins NUM_PAGES randomly distributed across NUM_FILES and checks that each
* set of cached pages pinned on behalf of a file are disjoint from all other sets of
* cached pages pinned on behalf of other files.
* Additionally, the test perform the same test when pinning over soft cap (NUM_PAGES)
* of pages.
*/
@Test
public void test01() throws Exception {
TestStorageManagerComponentHolder.init(PAGE_SIZE, NUM_PAGES, NUM_FILES);
ioManager = TestStorageManagerComponentHolder.getIOManager();
ICacheMemoryAllocator allocator = new HeapBufferAllocator();
vbc = new VirtualBufferCache(allocator, PAGE_SIZE, NUM_PAGES);
vbc.open();
createFiles();
kPins(NUM_PAGES);
assertTrue(pagesDisjointed());
kPins(NUM_OVERPIN);
assertTrue(pagesDisjointed());
deleteFiles();
vbc.close();
}
use of org.apache.hyracks.storage.am.lsm.common.impls.VirtualBufferCache 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);
}
Aggregations