INodeFile extends INodeWithAdditionalFields implements BlockCollection { List<BlockInfoContiguous> concatBlocks(INodeFile[] inodes) throws StorageException, TransactionContextException { List<BlockInfoContiguous> oldBlks = new ArrayList<>(); for (INodeFile srcInode : inodes) { for (BlockInfoContiguous block : srcInode.getBlocks()) { BlockInfoContiguous copy = BlockInfoContiguous.cloneBlock(block); oldBlks.add(copy); addBlock(block); block.setBlockCollection(this); } } recomputeFileSize(); return oldBlks; } INodeFile(long id, PermissionStatus permissions, BlockInfoContiguous[] blklist,
      short replication, long modificationTime, long atime,
      long preferredBlockSize, byte storagePolicyID);  INodeFile(long id, PermissionStatus permissions, BlockInfoContiguous[] blklist,
      short replication, long modificationTime, long atime,
      long preferredBlockSize, byte storagePolicyID, boolean inTree);  INodeFile(long id, PermissionStatus permissions, long header,
      long modificationTime, long atime, boolean isFileStoredInDB, byte storagepolicy, boolean inTree);  INodeFile(INodeFile other); static INodeFile valueOf(INode inode, String path
      ); static INodeFile valueOf(INode inode, String path, boolean acceptNull); @Override final boolean isFile(); @Override final INodeFile asFile(); final FileUnderConstructionFeature getFileUnderConstructionFeature(); @Override // BlockCollection boolean isUnderConstruction(); @Override short getBlockReplication(); @Override byte getStoragePolicyID(); @Override long getPreferredBlockSize(); @Override BlockInfoContiguous getBlock(int index); @Override BlockInfoContiguous[] getBlocks(); void storeFileDataInDB(byte[] data); byte[] getFileDataInDB(); void deleteFileDataStoredInDB(); void setBlock(int idx, BlockInfoContiguous blk); @Override void destroyAndCollectBlocks(BlockStoragePolicySuite bsps,
      BlocksMapUpdateInfo collectedBlocks, final List<INode> removedINodes); @Override String getName(); @Override final ContentSummaryComputationContext computeContentSummary(
      final ContentSummaryComputationContext summary); final long computeFileSizeNotIncludingLastUcBlock(); long computeFileSize(); final long computeFileSize(boolean includesLastUcBlock,
      boolean usePreferredBlockSize4LastUcBlock); final long storagespaceConsumed(); final long storagespaceConsumedNoReplication(); @Override BlockInfoContiguous getLastBlock(); @Override int numBlocks(); INodeFile toUnderConstruction(String clientName, String clientMachine); INodeFile toCompleteFile(long mtime); @Override BlockInfoContiguousUnderConstruction setLastBlock(
      BlockInfoContiguous lastBlock, DatanodeStorageInfo[] locations); void removeBlock(BlockInfoContiguous block); BlockInfoContiguous findMaxBlk(); int getGenerationStamp(); void setGenerationStampNoPersistence(int generationStamp); int nextGenerationStamp(); long getSize(); boolean isFileStoredInDB(); void setFileStoredInDB(boolean isFileStoredInDB); void setFileStoredInDBNoPersistence(boolean isFileStoredInDB); void setSizeNoPersistence(long size); void setSize(long size); void recomputeFileSize(); @Override INode cloneInode(); long collectBlocksBeyondMax(final long max,
      final BlocksMapUpdateInfo collectedBlocks);  }
@Test @Ignore public void testConcatBlocks() throws IOException { INodeFile origFile = createINodeFiles(1, "origfile")[0]; assertEquals("Number of blocks didn't match", origFile.numBlocks(), 1L); INodeFile[] appendFiles = createINodeFiles(4, "appendfile"); origFile.concatBlocks(appendFiles); assertEquals("Number of blocks didn't match", origFile.numBlocks(), 5L); }