use of org.apache.carbondata.core.datastore.block.BlockIndex in project carbondata by apache.
the class BlockIndexStore method loadBlock.
private AbstractIndex loadBlock(TableBlockUniqueIdentifier tableBlockUniqueIdentifier) throws IOException {
AbstractIndex tableBlock = new BlockIndex();
BlockInfo blockInfo = new BlockInfo(tableBlockUniqueIdentifier.getTableBlockInfo());
String lruCacheKey = getLruCacheKey(tableBlockUniqueIdentifier.getAbsoluteTableIdentifier(), blockInfo);
checkAndLoadTableBlocks(tableBlock, tableBlockUniqueIdentifier, lruCacheKey);
// finally remove the lock object from block info lock as once block is loaded
// it will not come inside this if condition
blockInfoLock.remove(blockInfo);
return tableBlock;
}
use of org.apache.carbondata.core.datastore.block.BlockIndex in project carbondata by apache.
the class BlockIndexStore method getIfPresent.
/**
* method returns the B-Tree meta
*
* @param tableBlockUniqueIdentifier Unique table block info
* @return
*/
@Override
public AbstractIndex getIfPresent(TableBlockUniqueIdentifier tableBlockUniqueIdentifier) {
BlockInfo blockInfo = new BlockInfo(tableBlockUniqueIdentifier.getTableBlockInfo());
BlockIndex cacheable = (BlockIndex) lruCache.get(getLruCacheKey(tableBlockUniqueIdentifier.getAbsoluteTableIdentifier(), blockInfo));
if (null != cacheable) {
cacheable.incrementAccessCount();
}
return cacheable;
}
Aggregations