@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()); }
public final short getFileReplication(int snapshot) { if (snapshot != CURRENT_STATE_ID) { return getSnapshotINode(snapshot).getFileReplication(); } return HeaderFormat.getReplication(header); }
INodeFile extends INodeWithAdditionalFields implements INodeFileAttributes, BlockCollection { public final short getFileReplication(int snapshot) { if (snapshot != CURRENT_STATE_ID) { return getSnapshotINode(snapshot).getFileReplication(); } return HeaderFormat.getReplication(header); } }
INodeFile extends INodeWithAdditionalFields implements INodeFileAttributes, BlockCollection { public final short getFileReplication(int 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, BlockInfoContiguous[] blklist, short replication,
            long preferredBlockSize);   INodeFile(long id, byte[] name, PermissionStatus permissions, long mtime,
      long atime, BlockInfoContiguous[] blklist, short replication,
      long preferredBlockSize, byte storagePolicyID);  INodeFile(INodeFile that);  INodeFile(INodeFile that, FileDiffList diffs); }
INodeFile extends INodeWithAdditionalFields implements INodeFileAttributes, BlockCollection { public final short getFileReplication(int 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, BlockInfoContiguous[] blklist, short replication,
            long preferredBlockSize);   INodeFile(long id, byte[] name, PermissionStatus permissions, long mtime,
      long atime, BlockInfoContiguous[] blklist, short replication,
      long preferredBlockSize, byte storagePolicyID);  INodeFile(INodeFile that);  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(); @Override boolean metadataEquals(INodeFileAttributes other); final FileUnderConstructionFeature getFileUnderConstructionFeature(); @Override // BlockCollection boolean isUnderConstruction(); INodeFile toCompleteFile(long mtime); @Override // BlockCollection void setBlock(int index, BlockInfoContiguous blk); @Override // BlockCollection, the file should be under construction BlockInfoContiguousUnderConstruction setLastBlock(
      BlockInfoContiguous lastBlock, DatanodeStorageInfo[] locations); FileWithSnapshotFeature addSnapshotFeature(FileDiffList diffs); final FileWithSnapshotFeature getFileWithSnapshotFeature(); final boolean isWithSnapshot(); @Override String toDetailString(); @Override INodeFileAttributes getSnapshotINode(final int snapshotId); @Override void recordModification(final int latestSnapshotId); void recordModification(final int latestSnapshotId, boolean withBlocks); FileDiffList getDiffs(); final short getFileReplication(int snapshot); @Override // INodeFileAttributes final short getFileReplication(); @Override // BlockCollection short getBlockReplication(); final void setFileReplication(short replication); final INodeFile setFileReplication(short replication,
      int latestSnapshotId); @Override long getPreferredBlockSize(); @Override byte getLocalStoragePolicyID(); @Override byte getStoragePolicyID(); final void setStoragePolicyID(byte storagePolicyId,
      int latestSnapshotId); @Override long getHeaderLong(); @Override BlockInfoContiguous[] getBlocks(); BlockInfoContiguous[] getBlocks(int snapshot); void setBlocks(BlockInfoContiguous[] blocks); @Override QuotaCounts cleanSubtree(BlockStoragePolicySuite bsps, final int snapshot,
                                  int priorSnapshotId,
      final BlocksMapUpdateInfo collectedBlocks,
      final List<INode> removedINodes); @Override void destroyAndCollectBlocks(BlockStoragePolicySuite bsps,
      BlocksMapUpdateInfo collectedBlocks, final List<INode> removedINodes); @Override String getName(); @Override final QuotaCounts computeQuotaUsage(
      BlockStoragePolicySuite bsps, byte blockStoragePolicyId,
      QuotaCounts counts, boolean useCache,
      int lastSnapshotId); @Override final ContentSummaryComputationContext computeContentSummary(
      final ContentSummaryComputationContext summary); final long computeFileSize(); final long computeFileSize(int snapshotId); final long computeFileSizeNotIncludingLastUcBlock(); final long computeFileSize(boolean includesLastUcBlock,
      boolean usePreferredBlockSize4LastUcBlock); final long storagespaceConsumed(); final long storagespaceConsumedNoReplication(); final long storagespaceConsumed(int lastSnapshotId); final short getReplication(int lastSnapshotId); final long storagespaceConsumedNoReplication(int lastSnapshotId); @Override BlockInfoContiguous getLastBlock(); @Override int numBlocks(); @VisibleForTesting @Override void dumpTreeRecursively(PrintWriter out, StringBuilder prefix,
      final int snapshotId); long collectBlocksBeyondMax(final long max,
      final BlocksMapUpdateInfo collectedBlocks); void collectBlocksBeyondSnapshot(BlockInfoContiguous[] snapshotBlocks,
                                          BlocksMapUpdateInfo collectedBlocks); }
INodeFile extends INodeWithAdditionalFields implements INodeFileAttributes, BlockCollection { public final short getFileReplication(int 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, BlockInfoContiguous[] blklist, short replication,
            long preferredBlockSize);   INodeFile(long id, byte[] name, PermissionStatus permissions, long mtime,
      long atime, BlockInfoContiguous[] blklist, short replication,
      long preferredBlockSize, byte storagePolicyID);  INodeFile(INodeFile that);  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(); @Override boolean metadataEquals(INodeFileAttributes other); final FileUnderConstructionFeature getFileUnderConstructionFeature(); @Override // BlockCollection boolean isUnderConstruction(); INodeFile toCompleteFile(long mtime); @Override // BlockCollection void setBlock(int index, BlockInfoContiguous blk); @Override // BlockCollection, the file should be under construction BlockInfoContiguousUnderConstruction setLastBlock(
      BlockInfoContiguous lastBlock, DatanodeStorageInfo[] locations); FileWithSnapshotFeature addSnapshotFeature(FileDiffList diffs); final FileWithSnapshotFeature getFileWithSnapshotFeature(); final boolean isWithSnapshot(); @Override String toDetailString(); @Override INodeFileAttributes getSnapshotINode(final int snapshotId); @Override void recordModification(final int latestSnapshotId); void recordModification(final int latestSnapshotId, boolean withBlocks); FileDiffList getDiffs(); final short getFileReplication(int snapshot); @Override // INodeFileAttributes final short getFileReplication(); @Override // BlockCollection short getBlockReplication(); final void setFileReplication(short replication); final INodeFile setFileReplication(short replication,
      int latestSnapshotId); @Override long getPreferredBlockSize(); @Override byte getLocalStoragePolicyID(); @Override byte getStoragePolicyID(); final void setStoragePolicyID(byte storagePolicyId,
      int latestSnapshotId); @Override long getHeaderLong(); @Override BlockInfoContiguous[] getBlocks(); BlockInfoContiguous[] getBlocks(int snapshot); void setBlocks(BlockInfoContiguous[] blocks); @Override QuotaCounts cleanSubtree(BlockStoragePolicySuite bsps, final int snapshot,
                                  int priorSnapshotId,
      final BlocksMapUpdateInfo collectedBlocks,
      final List<INode> removedINodes); @Override void destroyAndCollectBlocks(BlockStoragePolicySuite bsps,
      BlocksMapUpdateInfo collectedBlocks, final List<INode> removedINodes); @Override String getName(); @Override final QuotaCounts computeQuotaUsage(
      BlockStoragePolicySuite bsps, byte blockStoragePolicyId,
      QuotaCounts counts, boolean useCache,
      int lastSnapshotId); @Override final ContentSummaryComputationContext computeContentSummary(
      final ContentSummaryComputationContext summary); final long computeFileSize(); final long computeFileSize(int snapshotId); final long computeFileSizeNotIncludingLastUcBlock(); final long computeFileSize(boolean includesLastUcBlock,
      boolean usePreferredBlockSize4LastUcBlock); final long storagespaceConsumed(); final long storagespaceConsumedNoReplication(); final long storagespaceConsumed(int lastSnapshotId); final short getReplication(int lastSnapshotId); final long storagespaceConsumedNoReplication(int lastSnapshotId); @Override BlockInfoContiguous getLastBlock(); @Override int numBlocks(); @VisibleForTesting @Override void dumpTreeRecursively(PrintWriter out, StringBuilder prefix,
      final int snapshotId); long collectBlocksBeyondMax(final long max,
      final BlocksMapUpdateInfo collectedBlocks); void collectBlocksBeyondSnapshot(BlockInfoContiguous[] snapshotBlocks,
                                          BlocksMapUpdateInfo collectedBlocks);  }