INodeFile extends INodeWithAdditionalFields implements INodeFileAttributes, BlockCollection { public final short getFileReplication(long snapshot) { if (snapshot != CURRENT_STATE_ID) { return getSnapshotINode(snapshot).getFileReplication(); } return HeaderFormat.getReplication(header); } INodeFile(long id, byte[] name, PermissionStatus permissions, long mtime,
      long atime, BlockInfo[] blklist, short replication,
      long preferredBlockSize);  INodeFile(INodeFile that);  INodeFile(INodeFile that, long sid);  INodeFile(INodeFile that, FileDiffList diffs); 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(); INodeFile toCompleteFile(long mtime); @Override // BlockCollection void setBlock(int index, BlockInfo blk); @Override // BlockCollection, the file should be under construction BlockInfoUnderConstruction setLastBlock(BlockInfo lastBlock,
      DatanodeStorageInfo[] locations); @Override // BlockCollection, the file should be under construction BlockInfoUnderConstruction setBlockToUC(int bIndex,
      DatanodeStorageInfo[] locations); FileWithSnapshotFeature addSnapshotFeature(FileDiffList diffs); final FileWithSnapshotFeature getFileWithSnapshotFeature(); final boolean isWithSnapshot(); @Override String toDetailString(); @Override INodeFileAttributes getSnapshotINode(final long snapshotId); @Override INodeFile recordModification(final long latestSnapshotId); FileDiffList getDiffs(); final short getFileReplication(long snapshot); @Override // INodeFileAttributes final short getFileReplication(); @Override // BlockCollection short getBlockReplication(); final void setFileReplication(short replication); final INodeFile setFileReplication(short replication,
      long latestSnapshotId, final INodeMap inodeMap); @Override long getPreferredBlockSize(); @Override long getHeaderLong(); @Override BlockInfo[] getBlocks(); void setBlocks(BlockInfo[] blocks); @Override Quota.Counts cleanSubtree(final long snapshot, long priorSnapshotId,
      final BlocksMapUpdateInfo collectedBlocks,
      final List<INode> removedINodes, final boolean countDiffChange); @Override void destroyAndCollectBlocks(BlocksMapUpdateInfo collectedBlocks,
      final List<INode> removedINodes); @Override String getName(); @Override final Quota.Counts computeQuotaUsage(Quota.Counts counts,
      boolean useCache, long lastSnapshotId); @Override final ContentSummaryComputationContext computeContentSummary(
      final ContentSummaryComputationContext summary); final long computeFileSize(); final long computeFileSize(long snapshotId); final long computeFileSizeNotIncludingLastUcBlock(); final long computeFileSize(boolean includesLastUcBlock,
      boolean usePreferredBlockSize4LastUcBlock); final long diskspaceConsumed(); final long diskspaceConsumed(long lastSnapshotId); @Override BlockInfo getLastBlock(); @Override int numBlocks(); @VisibleForTesting @Override void dumpTreeRecursively(PrintWriter out, StringBuilder prefix,
      final long snapshotId);  }
@Test public void testReplication () { replication = 3; preferredBlockSize = 128*1024*1024; INodeFile inf = createINodeFile(replication, preferredBlockSize); assertEquals("True has to be returned in this case", replication, inf.getFileReplication()); }