Example usage for org.apache.hadoop.hdfs.util LightWeightLinkedSet LightWeightLinkedSet

List of usage examples for org.apache.hadoop.hdfs.util LightWeightLinkedSet LightWeightLinkedSet

Introduction

In this page you can find the example usage for org.apache.hadoop.hdfs.util LightWeightLinkedSet LightWeightLinkedSet.

Prototype

public LightWeightLinkedSet() 

Source Link

Usage

From source file:io.hops.metadata.blockmanagement.ExcessReplicasMap.java

License:Apache License

public LightWeightLinkedSet<Block> get(String dn) throws IOException {
    Collection<ExcessReplica> excessReplicas = getExcessReplicas(datanodeManager.getDatanode(dn).getSId());
    if (excessReplicas == null) {
        return null;
    }/*from  w w w. j av a2s  .  c  o  m*/
    LightWeightLinkedSet<Block> excessBlocks = new LightWeightLinkedSet<Block>();
    for (ExcessReplica er : excessReplicas) {
        //FIXME: [M] might need to get the blockinfo from the db, but for now we don't need it
        excessBlocks.add(new Block(er.getBlockId()));
    }
    return excessBlocks;
}