Example usage for org.apache.hadoop.hdfs.protocol DatanodeID getDatanodeUuid

List of usage examples for org.apache.hadoop.hdfs.protocol DatanodeID getDatanodeUuid

Introduction

In this page you can find the example usage for org.apache.hadoop.hdfs.protocol DatanodeID getDatanodeUuid.

Prototype

public String getDatanodeUuid() 

Source Link

Usage

From source file:io.hops.transaction.context.CachedBlockContext.java

License:Apache License

private List<CachedBlock> findBatch(CachedBlock.Finder bFinder, Object[] params)
        throws TransactionContextException, StorageException {
    List<CachedBlock> result = null;
    final long[] blockIds = (long[]) params[0];
    final long[] inodeIds = (long[]) params[1];
    final DatanodeID datanodeId = (DatanodeID) params[2];
    aboutToAccessStorage(bFinder, params);
    result = dataAccess.findByIds(blockIds, inodeIds, datanodeId.getDatanodeUuid());
    miss(bFinder, result, "BlockIds", Arrays.toString(blockIds), "InodeIds", Arrays.toString(inodeIds),
            "datanodeId", datanodeId);
    for (CachedBlock block : result) {
        gotFromDB(block);/*from  w w w.j  av  a 2  s. co m*/
    }
    for (int i = 0; i < blockIds.length; i++) {
        BlockPK.CachedBlockPK pk = new BlockPK.CachedBlockPK(blockIds[i], inodeIds[i],
                datanodeId.getDatanodeUuid());
        if (!contains(pk)) {
            gotFromDB(pk, (CachedBlock) null);
        }
    }
    return result;
}

From source file:io.hops.transaction.context.CachedBlockContext.java

License:Apache License

private List<CachedBlock> findByDatanodeId(CachedBlock.Finder iFinder, Object[] params)
        throws StorageCallPreventedException, StorageException {
    final DatanodeID datanodeId = (DatanodeID) params[0];
    List<CachedBlock> results = null;
    if (containsByDatanode(datanodeId.getDatanodeUuid())) {
        results = getByDatanode(datanodeId.getDatanodeUuid());
        hit(iFinder, results, "datanodeId", datanodeId);
    } else {/*from  w  w w.ja  va  2s .co  m*/
        aboutToAccessStorage(iFinder, params);
        results = dataAccess.findCachedBlockByDatanodeId(datanodeId.getDatanodeUuid());
        gotFromDB(new BlockPK.CachedBlockPK(datanodeId.getDatanodeUuid()), results);
        miss(iFinder, results, "datanodeId", datanodeId);
    }
    return results;
}