use of org.apache.hyracks.storage.am.bloomfilter.impls.BloomFilter in project asterixdb by apache.
the class ExternalBTreeWithBuddy method activate.
@Override
public void activate() throws HyracksDataException {
if (isActive) {
throw new HyracksDataException("Failed to activate the index since it is already activated.");
}
if (diskComponents.size() == 0 && secondDiskComponents.size() == 0) {
//First time activation
List<LSMComponentFileReferences> validFileReferences;
validFileReferences = fileManager.cleanupAndGetValidFiles();
for (LSMComponentFileReferences lsmComonentFileReference : validFileReferences) {
LSMBTreeWithBuddyDiskComponent component;
component = createDiskComponent(componentFactory, lsmComonentFileReference.getInsertIndexFileReference(), lsmComonentFileReference.getDeleteIndexFileReference(), lsmComonentFileReference.getBloomFilterFileReference(), false);
diskComponents.add(component);
secondDiskComponents.add(component);
}
((ExternalIndexHarness) getLsmHarness()).indexFirstTimeActivated();
} else {
// components. It should also maintain the version pointer
for (ILSMComponent c : diskComponents) {
LSMBTreeWithBuddyDiskComponent component = (LSMBTreeWithBuddyDiskComponent) c;
BTree btree = component.getBTree();
BTree buddyBtree = component.getBuddyBTree();
BloomFilter bloomFilter = component.getBloomFilter();
btree.activate();
buddyBtree.activate();
bloomFilter.activate();
}
for (ILSMComponent c : secondDiskComponents) {
// Only activate non shared components
if (!diskComponents.contains(c)) {
LSMBTreeWithBuddyDiskComponent component = (LSMBTreeWithBuddyDiskComponent) c;
BTree btree = component.getBTree();
BTree buddyBtree = component.getBuddyBTree();
BloomFilter bloomFilter = component.getBloomFilter();
btree.activate();
buddyBtree.activate();
bloomFilter.activate();
}
}
}
isActive = true;
}
use of org.apache.hyracks.storage.am.bloomfilter.impls.BloomFilter in project asterixdb by apache.
the class ExternalBTree method activate.
@Override
public synchronized void activate() throws HyracksDataException {
if (isActive) {
throw new HyracksDataException("Failed to activate the index since it is already activated.");
}
if (diskComponents.size() == 0 && secondDiskComponents.size() == 0) {
//First time activation
List<LSMComponentFileReferences> validFileReferences;
validFileReferences = fileManager.cleanupAndGetValidFiles();
for (LSMComponentFileReferences lsmComonentFileReference : validFileReferences) {
LSMBTreeDiskComponent component;
component = createDiskComponent(componentFactory, lsmComonentFileReference.getInsertIndexFileReference(), lsmComonentFileReference.getBloomFilterFileReference(), false);
diskComponents.add(component);
secondDiskComponents.add(component);
}
getLsmHarness().indexFirstTimeActivated();
} else {
// This index has been opened before
for (ILSMComponent c : diskComponents) {
LSMBTreeDiskComponent component = (LSMBTreeDiskComponent) c;
BTree btree = component.getBTree();
BloomFilter bloomFilter = component.getBloomFilter();
btree.activate();
bloomFilter.activate();
}
for (ILSMComponent c : secondDiskComponents) {
// Only activate non shared components
if (!diskComponents.contains(c)) {
LSMBTreeDiskComponent component = (LSMBTreeDiskComponent) c;
BTree btree = component.getBTree();
BloomFilter bloomFilter = component.getBloomFilter();
btree.activate();
bloomFilter.activate();
}
}
}
isActive = true;
}
use of org.apache.hyracks.storage.am.bloomfilter.impls.BloomFilter in project asterixdb by apache.
the class ExternalBTreeWithBuddy method deactivateDiskComponent.
@Override
protected void deactivateDiskComponent(ILSMDiskComponent c) throws HyracksDataException {
LSMBTreeWithBuddyDiskComponent component = (LSMBTreeWithBuddyDiskComponent) c;
BTree btree = component.getBTree();
BTree buddyBtree = component.getBuddyBTree();
BloomFilter bloomFilter = component.getBloomFilter();
btree.deactivateCloseHandle();
buddyBtree.deactivateCloseHandle();
bloomFilter.deactivate();
}
use of org.apache.hyracks.storage.am.bloomfilter.impls.BloomFilter in project asterixdb by apache.
the class ExternalRTree method deactivate.
@Override
public void deactivate(boolean flushOnExit) throws HyracksDataException {
if (!isActive) {
throw new HyracksDataException("Failed to deactivate the index since it is already deactivated.");
}
if (flushOnExit) {
BlockingIOOperationCallbackWrapper cb = new BlockingIOOperationCallbackWrapper(ioOpCallback);
cb.afterFinalize(LSMOperationType.FLUSH, null);
}
for (ILSMComponent c : diskComponents) {
LSMRTreeDiskComponent component = (LSMRTreeDiskComponent) c;
RTree rtree = component.getRTree();
BTree btree = component.getBTree();
BloomFilter bloomFilter = component.getBloomFilter();
rtree.deactivateCloseHandle();
btree.deactivateCloseHandle();
bloomFilter.deactivate();
}
for (ILSMComponent c : secondDiskComponents) {
// Only deactivate non shared components
if (!diskComponents.contains(c)) {
LSMRTreeDiskComponent component = (LSMRTreeDiskComponent) c;
RTree rtree = component.getRTree();
BTree btree = component.getBTree();
BloomFilter bloomFilter = component.getBloomFilter();
rtree.deactivateCloseHandle();
btree.deactivateCloseHandle();
bloomFilter.deactivate();
}
}
isActive = false;
}
Aggregations