public boolean isUnderConstructionBlock ( Block block ) { if ( ! isUnderConstruction ( ) ) { return false ; } LocatedBlock lastBlock = this . get ( this . locatedBlockCount ( ) - 1 ) ; // There are potential inconsistency when counting the size of the // last block, but fileLength is not likely to be under-estimated // the size, unless the last block size is 0. if ( ( this . fileLength <= lastBlock . getStartOffset ( ) + lastBlock . getBlockSize ( ) ) && lastBlock . getBlock ( ) . equals ( block ) ) { return true ; } return false ; }
Determine whether the input block is the block under - construction for the file . If the current file is not under - construction always false is returned .