public LocatedBlocks() { // array of blocks with prioritized locations fileLength = 0; blocks = null; underConstruction = false; lastLocatedBlock = null; isLastBlockComplete = false; fileEncryptionInfo = null; }
public LocatedBlocks(long flength, bool isUnderConstuction, IList <LocatedBlock> blks , LocatedBlock lastBlock, bool isLastBlockCompleted, FileEncryptionInfo feInfo) { fileLength = flength; blocks = blks; underConstruction = isUnderConstuction; this.lastLocatedBlock = lastBlock; this.isLastBlockComplete = isLastBlockCompleted; this.fileEncryptionInfo = feInfo; }
/// <summary>Find block containing specified offset.</summary> /// <returns>block if found, or null otherwise.</returns> public virtual int FindBlock(long offset) { // create fake block of size 0 as a key LocatedBlock key = new LocatedBlock(new ExtendedBlock(), new DatanodeInfo[0], 0L, false); key.SetStartOffset(offset); key.GetBlock().SetNumBytes(1); IComparer <LocatedBlock> comp = new _IComparer_126(); // Returns 0 iff a is inside b or b is inside a // one of the blocks is inside the other // a's left bound is to the left of the b's return(Sharpen.Collections.BinarySearch(blocks, key, comp)); }
public LastBlockWithStatus(LocatedBlock lastBlock, HdfsFileStatus fileStatus) { this.lastBlock = lastBlock; this.fileStatus = fileStatus; }