@Test public void testWriteChecksumPassthru() { FileSystem mockFs = mock(FileSystem.class); FileSystem fs = new FilterFileSystem(mockFs); fs.setWriteChecksum(false); verify(mockFs).setWriteChecksum(eq(false)); reset(mockFs); fs.setWriteChecksum(true); verify(mockFs).setWriteChecksum(eq(true)); }
@Override public void setWriteChecksum(boolean writeChecksum) { fs.setWriteChecksum(writeChecksum); }
FilterFileSystem extends FileSystem { @Override public void setWriteChecksum(boolean writeChecksum) { fs.setWriteChecksum(writeChecksum); } }
FilterFileSystem extends FileSystem { @Override public void setWriteChecksum(boolean writeChecksum) { fs.setWriteChecksum(writeChecksum); } FilterFileSystem();  FilterFileSystem(FileSystem fs); }
FilterFileSystem extends FileSystem { @Override public void setWriteChecksum(boolean writeChecksum) { fs.setWriteChecksum(writeChecksum); } FilterFileSystem();  FilterFileSystem(FileSystem fs); FileSystem getRawFileSystem(); @Override void initialize(URI name, Configuration conf); @Override URI getUri(); @Override Path makeQualified(Path path); @Override BlockLocation[] getFileBlockLocations(FileStatus file, long start,
    long len); @Override Path resolvePath(final Path p); @Override FSDataInputStream open(Path f, int bufferSize); @Override FSDataOutputStream append(Path f, int bufferSize,
      Progressable progress); @Override void concat(Path f, Path[] psrcs); @Override FSDataOutputStream create(Path f, FsPermission permission,
      boolean overwrite, int bufferSize, short replication, long blockSize,
      Progressable progress); @Override FSDataOutputStream create(Path f,
        FsPermission permission,
        EnumSet<CreateFlag> flags,
        int bufferSize,
        short replication,
        long blockSize,
        Progressable progress,
        ChecksumOpt checksumOpt); @Override @Deprecated FSDataOutputStream createNonRecursive(Path f, FsPermission permission,
      EnumSet<CreateFlag> flags, int bufferSize, short replication, long blockSize,
      Progressable progress); @Override boolean setReplication(Path src, short replication); @Override boolean rename(Path src, Path dst); @Override boolean delete(Path f, boolean recursive); @Override FileStatus[] listStatus(Path f); @Override RemoteIterator<Path> listCorruptFileBlocks(Path path); @Override RemoteIterator<LocatedFileStatus> listLocatedStatus(Path f); @Override Path getHomeDirectory(); @Override void setWorkingDirectory(Path newDir); @Override Path getWorkingDirectory(); @Override FsStatus getStatus(Path p); @Override boolean mkdirs(Path f, FsPermission permission); @Override void copyFromLocalFile(boolean delSrc, Path src, Path dst); @Override void copyFromLocalFile(boolean delSrc, boolean overwrite, 
                                Path[] srcs, Path dst); @Override void copyFromLocalFile(boolean delSrc, boolean overwrite, 
                                Path src, Path dst); @Override void copyToLocalFile(boolean delSrc, Path src, Path dst); @Override Path startLocalOutput(Path fsOutputFile, Path tmpLocalFile); @Override void completeLocalOutput(Path fsOutputFile, Path tmpLocalFile); @Override long getUsed(); @Override long getDefaultBlockSize(); @Override short getDefaultReplication(); @Override FsServerDefaults getServerDefaults(); @Override long getDefaultBlockSize(Path f); @Override short getDefaultReplication(Path f); @Override FsServerDefaults getServerDefaults(Path f); @Override FileStatus getFileStatus(Path f); @Override void access(Path path, FsAction mode); void createSymlink(final Path target, final Path link,
      final boolean createParent); FileStatus getFileLinkStatus(final Path f); boolean supportsSymlinks(); Path getLinkTarget(Path f); @Override FileChecksum getFileChecksum(Path f); @Override FileChecksum getFileChecksum(Path f, long length); @Override void setVerifyChecksum(boolean verifyChecksum); @Override void setWriteChecksum(boolean writeChecksum); @Override Configuration getConf(); @Override void close(); @Override void setOwner(Path p, String username, String groupname
      ); @Override void setTimes(Path p, long mtime, long atime
      ); @Override void setPermission(Path p, FsPermission permission
      ); @Override // FileSystem FileSystem[] getChildFileSystems(); @Override // FileSystem Path createSnapshot(Path path, String snapshotName); @Override // FileSystem void renameSnapshot(Path path, String snapshotOldName,
      String snapshotNewName); @Override // FileSystem void deleteSnapshot(Path path, String snapshotName); @Override void modifyAclEntries(Path path, List<AclEntry> aclSpec); @Override void removeAclEntries(Path path, List<AclEntry> aclSpec); @Override void removeDefaultAcl(Path path); @Override void removeAcl(Path path); @Override void setAcl(Path path, List<AclEntry> aclSpec); @Override AclStatus getAclStatus(Path path); @Override void setXAttr(Path path, String name, byte[] value); @Override void setXAttr(Path path, String name, byte[] value,
      EnumSet<XAttrSetFlag> flag); @Override byte[] getXAttr(Path path, String name); @Override Map<String, byte[]> getXAttrs(Path path); @Override Map<String, byte[]> getXAttrs(Path path, List<String> names); @Override List<String> listXAttrs(Path path); @Override void removeXAttr(Path path, String name); }
FilterFileSystem extends FileSystem { @Override public void setWriteChecksum(boolean writeChecksum) { fs.setWriteChecksum(writeChecksum); } FilterFileSystem();  FilterFileSystem(FileSystem fs); FileSystem getRawFileSystem(); @Override void initialize(URI name, Configuration conf); @Override URI getUri(); @Override Path makeQualified(Path path); @Override BlockLocation[] getFileBlockLocations(FileStatus file, long start,
    long len); @Override Path resolvePath(final Path p); @Override FSDataInputStream open(Path f, int bufferSize); @Override FSDataOutputStream append(Path f, int bufferSize,
      Progressable progress); @Override void concat(Path f, Path[] psrcs); @Override FSDataOutputStream create(Path f, FsPermission permission,
      boolean overwrite, int bufferSize, short replication, long blockSize,
      Progressable progress); @Override FSDataOutputStream create(Path f,
        FsPermission permission,
        EnumSet<CreateFlag> flags,
        int bufferSize,
        short replication,
        long blockSize,
        Progressable progress,
        ChecksumOpt checksumOpt); @Override @Deprecated FSDataOutputStream createNonRecursive(Path f, FsPermission permission,
      EnumSet<CreateFlag> flags, int bufferSize, short replication, long blockSize,
      Progressable progress); @Override boolean setReplication(Path src, short replication); @Override boolean rename(Path src, Path dst); @Override boolean delete(Path f, boolean recursive); @Override FileStatus[] listStatus(Path f); @Override RemoteIterator<Path> listCorruptFileBlocks(Path path); @Override RemoteIterator<LocatedFileStatus> listLocatedStatus(Path f); @Override Path getHomeDirectory(); @Override void setWorkingDirectory(Path newDir); @Override Path getWorkingDirectory(); @Override FsStatus getStatus(Path p); @Override boolean mkdirs(Path f, FsPermission permission); @Override void copyFromLocalFile(boolean delSrc, Path src, Path dst); @Override void copyFromLocalFile(boolean delSrc, boolean overwrite, 
                                Path[] srcs, Path dst); @Override void copyFromLocalFile(boolean delSrc, boolean overwrite, 
                                Path src, Path dst); @Override void copyToLocalFile(boolean delSrc, Path src, Path dst); @Override Path startLocalOutput(Path fsOutputFile, Path tmpLocalFile); @Override void completeLocalOutput(Path fsOutputFile, Path tmpLocalFile); @Override long getUsed(); @Override long getDefaultBlockSize(); @Override short getDefaultReplication(); @Override FsServerDefaults getServerDefaults(); @Override long getDefaultBlockSize(Path f); @Override short getDefaultReplication(Path f); @Override FsServerDefaults getServerDefaults(Path f); @Override FileStatus getFileStatus(Path f); @Override void access(Path path, FsAction mode); void createSymlink(final Path target, final Path link,
      final boolean createParent); FileStatus getFileLinkStatus(final Path f); boolean supportsSymlinks(); Path getLinkTarget(Path f); @Override FileChecksum getFileChecksum(Path f); @Override FileChecksum getFileChecksum(Path f, long length); @Override void setVerifyChecksum(boolean verifyChecksum); @Override void setWriteChecksum(boolean writeChecksum); @Override Configuration getConf(); @Override void close(); @Override void setOwner(Path p, String username, String groupname
      ); @Override void setTimes(Path p, long mtime, long atime
      ); @Override void setPermission(Path p, FsPermission permission
      ); @Override // FileSystem FileSystem[] getChildFileSystems(); @Override // FileSystem Path createSnapshot(Path path, String snapshotName); @Override // FileSystem void renameSnapshot(Path path, String snapshotOldName,
      String snapshotNewName); @Override // FileSystem void deleteSnapshot(Path path, String snapshotName); @Override void modifyAclEntries(Path path, List<AclEntry> aclSpec); @Override void removeAclEntries(Path path, List<AclEntry> aclSpec); @Override void removeDefaultAcl(Path path); @Override void removeAcl(Path path); @Override void setAcl(Path path, List<AclEntry> aclSpec); @Override AclStatus getAclStatus(Path path); @Override void setXAttr(Path path, String name, byte[] value); @Override void setXAttr(Path path, String name, byte[] value,
      EnumSet<XAttrSetFlag> flag); @Override byte[] getXAttr(Path path, String name); @Override Map<String, byte[]> getXAttrs(Path path); @Override Map<String, byte[]> getXAttrs(Path path, List<String> names); @Override List<String> listXAttrs(Path path); @Override void removeXAttr(Path path, String name);  }