Пример #1
0
 public LocatedBlock(ExtendedBlock b, DatanodeStorageInfo[] storages, long startOffset
                     , bool corrupt)
     : this(b, DatanodeStorageInfo.ToDatanodeInfos(storages), DatanodeStorageInfo.ToStorageIDs
                (storages), DatanodeStorageInfo.ToStorageTypes(storages), startOffset, corrupt,
            EmptyLocs)
 {
 }
Пример #2
0
 /// <summary>Create BlockCommand for transferring blocks to another datanode</summary>
 /// <param name="blocktargetlist">blocks to be transferred</param>
 public BlockCommand(int action, string poolId, IList <DatanodeDescriptor.BlockTargetPair
                                                       > blocktargetlist)
     : base(action)
 {
     this.poolId        = poolId;
     blocks             = new Block[blocktargetlist.Count];
     targets            = new DatanodeInfo[blocks.Length][];
     targetStorageTypes = new StorageType[blocks.Length][];
     targetStorageIDs   = new string[blocks.Length][];
     for (int i = 0; i < blocks.Length; i++)
     {
         DatanodeDescriptor.BlockTargetPair p = blocktargetlist[i];
         blocks[i]             = p.block;
         targets[i]            = DatanodeStorageInfo.ToDatanodeInfos(p.targets);
         targetStorageTypes[i] = DatanodeStorageInfo.ToStorageTypes(p.targets);
         targetStorageIDs[i]   = DatanodeStorageInfo.ToStorageIDs(p.targets);
     }
 }