|
@@ -48,8 +48,11 @@ import org.apache.hadoop.fs.FileSystem;
|
|
|
import org.apache.hadoop.fs.FileSystemLinkResolver;
|
|
|
import org.apache.hadoop.fs.FsServerDefaults;
|
|
|
import org.apache.hadoop.fs.FsStatus;
|
|
|
+import org.apache.hadoop.fs.GlobalStorageStatistics;
|
|
|
+import org.apache.hadoop.fs.GlobalStorageStatistics.StorageStatisticsProvider;
|
|
|
import org.apache.hadoop.fs.LocatedFileStatus;
|
|
|
import org.apache.hadoop.fs.Options;
|
|
|
+import org.apache.hadoop.fs.StorageStatistics;
|
|
|
import org.apache.hadoop.fs.XAttrSetFlag;
|
|
|
import org.apache.hadoop.fs.Options.ChecksumOpt;
|
|
|
import org.apache.hadoop.fs.Path;
|
|
@@ -67,6 +70,7 @@ import org.apache.hadoop.fs.StorageType;
|
|
|
import org.apache.hadoop.hdfs.client.HdfsClientConfigKeys;
|
|
|
import org.apache.hadoop.hdfs.client.HdfsDataOutputStream;
|
|
|
import org.apache.hadoop.hdfs.client.impl.CorruptFileBlockIterator;
|
|
|
+import org.apache.hadoop.hdfs.DFSOpsCountStatistics.OpType;
|
|
|
import org.apache.hadoop.hdfs.protocol.BlockStoragePolicy;
|
|
|
import org.apache.hadoop.hdfs.protocol.CacheDirectiveEntry;
|
|
|
import org.apache.hadoop.hdfs.protocol.CacheDirectiveInfo;
|
|
@@ -96,7 +100,6 @@ import org.apache.hadoop.crypto.key.KeyProviderDelegationTokenExtension;
|
|
|
import com.google.common.annotations.VisibleForTesting;
|
|
|
import com.google.common.base.Preconditions;
|
|
|
|
|
|
-
|
|
|
/****************************************************************
|
|
|
* Implementation of the abstract FileSystem for the DFS system.
|
|
|
* This object is the way end-user code interacts with a Hadoop
|
|
@@ -114,6 +117,8 @@ public class DistributedFileSystem extends FileSystem {
|
|
|
DFSClient dfs;
|
|
|
private boolean verifyChecksum = true;
|
|
|
|
|
|
+ private DFSOpsCountStatistics storageStatistics;
|
|
|
+
|
|
|
static{
|
|
|
HdfsConfiguration.init();
|
|
|
}
|
|
@@ -151,6 +156,15 @@ public class DistributedFileSystem extends FileSystem {
|
|
|
this.dfs = new DFSClient(uri, conf, statistics);
|
|
|
this.uri = URI.create(uri.getScheme()+"://"+uri.getAuthority());
|
|
|
this.workingDir = getHomeDirectory();
|
|
|
+
|
|
|
+ storageStatistics = (DFSOpsCountStatistics) GlobalStorageStatistics.INSTANCE
|
|
|
+ .put(DFSOpsCountStatistics.NAME,
|
|
|
+ new StorageStatisticsProvider() {
|
|
|
+ @Override
|
|
|
+ public StorageStatistics provide() {
|
|
|
+ return new DFSOpsCountStatistics();
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -215,6 +229,7 @@ public class DistributedFileSystem extends FileSystem {
|
|
|
public BlockLocation[] getFileBlockLocations(Path p,
|
|
|
final long start, final long len) throws IOException {
|
|
|
statistics.incrementReadOps(1);
|
|
|
+ storageStatistics.incrementOpCounter(OpType.GET_FILE_BLOCK_LOCATIONS);
|
|
|
final Path absF = fixRelativePart(p);
|
|
|
return new FileSystemLinkResolver<BlockLocation[]>() {
|
|
|
@Override
|
|
@@ -301,6 +316,7 @@ public class DistributedFileSystem extends FileSystem {
|
|
|
public FSDataInputStream open(Path f, final int bufferSize)
|
|
|
throws IOException {
|
|
|
statistics.incrementReadOps(1);
|
|
|
+ storageStatistics.incrementOpCounter(OpType.OPEN);
|
|
|
Path absF = fixRelativePart(f);
|
|
|
return new FileSystemLinkResolver<FSDataInputStream>() {
|
|
|
@Override
|
|
@@ -337,6 +353,7 @@ public class DistributedFileSystem extends FileSystem {
|
|
|
public FSDataOutputStream append(Path f, final EnumSet<CreateFlag> flag,
|
|
|
final int bufferSize, final Progressable progress) throws IOException {
|
|
|
statistics.incrementWriteOps(1);
|
|
|
+ storageStatistics.incrementOpCounter(OpType.APPEND);
|
|
|
Path absF = fixRelativePart(f);
|
|
|
return new FileSystemLinkResolver<FSDataOutputStream>() {
|
|
|
@Override
|
|
@@ -369,6 +386,7 @@ public class DistributedFileSystem extends FileSystem {
|
|
|
final int bufferSize, final Progressable progress,
|
|
|
final InetSocketAddress[] favoredNodes) throws IOException {
|
|
|
statistics.incrementWriteOps(1);
|
|
|
+ storageStatistics.incrementOpCounter(OpType.APPEND);
|
|
|
Path absF = fixRelativePart(f);
|
|
|
return new FileSystemLinkResolver<FSDataOutputStream>() {
|
|
|
@Override
|
|
@@ -412,6 +430,7 @@ public class DistributedFileSystem extends FileSystem {
|
|
|
final Progressable progress, final InetSocketAddress[] favoredNodes)
|
|
|
throws IOException {
|
|
|
statistics.incrementWriteOps(1);
|
|
|
+ storageStatistics.incrementOpCounter(OpType.CREATE);
|
|
|
Path absF = fixRelativePart(f);
|
|
|
return new FileSystemLinkResolver<HdfsDataOutputStream>() {
|
|
|
@Override
|
|
@@ -445,6 +464,7 @@ public class DistributedFileSystem extends FileSystem {
|
|
|
final Progressable progress, final ChecksumOpt checksumOpt)
|
|
|
throws IOException {
|
|
|
statistics.incrementWriteOps(1);
|
|
|
+ storageStatistics.incrementOpCounter(OpType.CREATE);
|
|
|
Path absF = fixRelativePart(f);
|
|
|
return new FileSystemLinkResolver<FSDataOutputStream>() {
|
|
|
@Override
|
|
@@ -469,6 +489,7 @@ public class DistributedFileSystem extends FileSystem {
|
|
|
short replication, long blockSize, Progressable progress,
|
|
|
ChecksumOpt checksumOpt) throws IOException {
|
|
|
statistics.incrementWriteOps(1);
|
|
|
+ storageStatistics.incrementOpCounter(OpType.PRIMITIVE_CREATE);
|
|
|
final DFSOutputStream dfsos = dfs.primitiveCreate(
|
|
|
getPathName(fixRelativePart(f)),
|
|
|
absolutePermission, flag, true, replication, blockSize,
|
|
@@ -485,6 +506,7 @@ public class DistributedFileSystem extends FileSystem {
|
|
|
final int bufferSize, final short replication, final long blockSize,
|
|
|
final Progressable progress) throws IOException {
|
|
|
statistics.incrementWriteOps(1);
|
|
|
+ storageStatistics.incrementOpCounter(OpType.CREATE_NON_RECURSIVE);
|
|
|
if (flag.contains(CreateFlag.OVERWRITE)) {
|
|
|
flag.add(CreateFlag.CREATE);
|
|
|
}
|
|
@@ -510,6 +532,7 @@ public class DistributedFileSystem extends FileSystem {
|
|
|
public boolean setReplication(Path src, final short replication)
|
|
|
throws IOException {
|
|
|
statistics.incrementWriteOps(1);
|
|
|
+ storageStatistics.incrementOpCounter(OpType.SET_REPLICATION);
|
|
|
Path absF = fixRelativePart(src);
|
|
|
return new FileSystemLinkResolver<Boolean>() {
|
|
|
@Override
|
|
@@ -534,6 +557,7 @@ public class DistributedFileSystem extends FileSystem {
|
|
|
public void setStoragePolicy(final Path src, final String policyName)
|
|
|
throws IOException {
|
|
|
statistics.incrementWriteOps(1);
|
|
|
+ storageStatistics.incrementOpCounter(OpType.SET_STORAGE_POLICY);
|
|
|
Path absF = fixRelativePart(src);
|
|
|
new FileSystemLinkResolver<Void>() {
|
|
|
@Override
|
|
@@ -554,6 +578,7 @@ public class DistributedFileSystem extends FileSystem {
|
|
|
public void unsetStoragePolicy(final Path src)
|
|
|
throws IOException {
|
|
|
statistics.incrementWriteOps(1);
|
|
|
+ storageStatistics.incrementOpCounter(OpType.UNSET_STORAGE_POLICY);
|
|
|
Path absF = fixRelativePart(src);
|
|
|
new FileSystemLinkResolver<Void>() {
|
|
|
@Override
|
|
@@ -578,6 +603,7 @@ public class DistributedFileSystem extends FileSystem {
|
|
|
@Override
|
|
|
public BlockStoragePolicySpi getStoragePolicy(Path path) throws IOException {
|
|
|
statistics.incrementReadOps(1);
|
|
|
+ storageStatistics.incrementOpCounter(OpType.GET_STORAGE_POLICY);
|
|
|
Path absF = fixRelativePart(path);
|
|
|
|
|
|
return new FileSystemLinkResolver<BlockStoragePolicySpi>() {
|
|
@@ -608,6 +634,7 @@ public class DistributedFileSystem extends FileSystem {
|
|
|
*/
|
|
|
public long getBytesWithFutureGenerationStamps() throws IOException {
|
|
|
statistics.incrementReadOps(1);
|
|
|
+ storageStatistics.incrementOpCounter(OpType.GET_BYTES_WITH_FUTURE_GS);
|
|
|
return dfs.getBytesInFutureBlocks();
|
|
|
}
|
|
|
|
|
@@ -618,6 +645,7 @@ public class DistributedFileSystem extends FileSystem {
|
|
|
@Deprecated
|
|
|
public BlockStoragePolicy[] getStoragePolicies() throws IOException {
|
|
|
statistics.incrementReadOps(1);
|
|
|
+ storageStatistics.incrementOpCounter(OpType.GET_STORAGE_POLICIES);
|
|
|
return dfs.getStoragePolicies();
|
|
|
}
|
|
|
|
|
@@ -632,6 +660,7 @@ public class DistributedFileSystem extends FileSystem {
|
|
|
@Override
|
|
|
public void concat(Path trg, Path [] psrcs) throws IOException {
|
|
|
statistics.incrementWriteOps(1);
|
|
|
+ storageStatistics.incrementOpCounter(OpType.CONCAT);
|
|
|
// Make target absolute
|
|
|
Path absF = fixRelativePart(trg);
|
|
|
// Make all srcs absolute
|
|
@@ -676,6 +705,7 @@ public class DistributedFileSystem extends FileSystem {
|
|
|
@Override
|
|
|
public boolean rename(Path src, Path dst) throws IOException {
|
|
|
statistics.incrementWriteOps(1);
|
|
|
+ storageStatistics.incrementOpCounter(OpType.RENAME);
|
|
|
|
|
|
final Path absSrc = fixRelativePart(src);
|
|
|
final Path absDst = fixRelativePart(dst);
|
|
@@ -710,6 +740,7 @@ public class DistributedFileSystem extends FileSystem {
|
|
|
public void rename(Path src, Path dst, final Options.Rename... options)
|
|
|
throws IOException {
|
|
|
statistics.incrementWriteOps(1);
|
|
|
+ storageStatistics.incrementOpCounter(OpType.RENAME);
|
|
|
final Path absSrc = fixRelativePart(src);
|
|
|
final Path absDst = fixRelativePart(dst);
|
|
|
// Try the rename without resolving first
|
|
@@ -738,6 +769,7 @@ public class DistributedFileSystem extends FileSystem {
|
|
|
@Override
|
|
|
public boolean truncate(Path f, final long newLength) throws IOException {
|
|
|
statistics.incrementWriteOps(1);
|
|
|
+ storageStatistics.incrementOpCounter(OpType.TRUNCATE);
|
|
|
Path absF = fixRelativePart(f);
|
|
|
return new FileSystemLinkResolver<Boolean>() {
|
|
|
@Override
|
|
@@ -755,6 +787,7 @@ public class DistributedFileSystem extends FileSystem {
|
|
|
@Override
|
|
|
public boolean delete(Path f, final boolean recursive) throws IOException {
|
|
|
statistics.incrementWriteOps(1);
|
|
|
+ storageStatistics.incrementOpCounter(OpType.DELETE);
|
|
|
Path absF = fixRelativePart(f);
|
|
|
return new FileSystemLinkResolver<Boolean>() {
|
|
|
@Override
|
|
@@ -772,6 +805,7 @@ public class DistributedFileSystem extends FileSystem {
|
|
|
@Override
|
|
|
public ContentSummary getContentSummary(Path f) throws IOException {
|
|
|
statistics.incrementReadOps(1);
|
|
|
+ storageStatistics.incrementOpCounter(OpType.GET_CONTENT_SUMMARY);
|
|
|
Path absF = fixRelativePart(f);
|
|
|
return new FileSystemLinkResolver<ContentSummary>() {
|
|
|
@Override
|
|
@@ -789,6 +823,7 @@ public class DistributedFileSystem extends FileSystem {
|
|
|
@Override
|
|
|
public QuotaUsage getQuotaUsage(Path f) throws IOException {
|
|
|
statistics.incrementReadOps(1);
|
|
|
+ storageStatistics.incrementOpCounter(OpType.GET_QUOTA_USAGE);
|
|
|
Path absF = fixRelativePart(f);
|
|
|
return new FileSystemLinkResolver<QuotaUsage>() {
|
|
|
@Override
|
|
@@ -873,6 +908,7 @@ public class DistributedFileSystem extends FileSystem {
|
|
|
stats[i] = partialListing[i].makeQualified(getUri(), p);
|
|
|
}
|
|
|
statistics.incrementReadOps(1);
|
|
|
+ storageStatistics.incrementOpCounter(OpType.LIST_STATUS);
|
|
|
return stats;
|
|
|
}
|
|
|
|
|
@@ -887,6 +923,7 @@ public class DistributedFileSystem extends FileSystem {
|
|
|
listing.add(fileStatus.makeQualified(getUri(), p));
|
|
|
}
|
|
|
statistics.incrementLargeReadOps(1);
|
|
|
+ storageStatistics.incrementOpCounter(OpType.LIST_STATUS);
|
|
|
|
|
|
// now fetch more entries
|
|
|
do {
|
|
@@ -901,6 +938,7 @@ public class DistributedFileSystem extends FileSystem {
|
|
|
listing.add(fileStatus.makeQualified(getUri(), p));
|
|
|
}
|
|
|
statistics.incrementLargeReadOps(1);
|
|
|
+ storageStatistics.incrementOpCounter(OpType.LIST_STATUS);
|
|
|
} while (thisListing.hasMore());
|
|
|
|
|
|
return listing.toArray(new FileStatus[listing.size()]);
|
|
@@ -1014,6 +1052,7 @@ public class DistributedFileSystem extends FileSystem {
|
|
|
thisListing = dfs.listPaths(src, HdfsFileStatus.EMPTY_NAME,
|
|
|
needLocation);
|
|
|
statistics.incrementReadOps(1);
|
|
|
+ storageStatistics.incrementOpCounter(OpType.LIST_LOCATED_STATUS);
|
|
|
if (thisListing == null) { // the directory does not exist
|
|
|
throw new FileNotFoundException("File " + p + " does not exist.");
|
|
|
}
|
|
@@ -1109,6 +1148,7 @@ public class DistributedFileSystem extends FileSystem {
|
|
|
private boolean mkdirsInternal(Path f, final FsPermission permission,
|
|
|
final boolean createParent) throws IOException {
|
|
|
statistics.incrementWriteOps(1);
|
|
|
+ storageStatistics.incrementOpCounter(OpType.MKDIRS);
|
|
|
Path absF = fixRelativePart(f);
|
|
|
return new FileSystemLinkResolver<Boolean>() {
|
|
|
@Override
|
|
@@ -1135,6 +1175,7 @@ public class DistributedFileSystem extends FileSystem {
|
|
|
protected boolean primitiveMkdir(Path f, FsPermission absolutePermission)
|
|
|
throws IOException {
|
|
|
statistics.incrementWriteOps(1);
|
|
|
+ storageStatistics.incrementOpCounter(OpType.PRIMITIVE_MKDIR);
|
|
|
return dfs.primitiveMkdir(getPathName(f), absolutePermission);
|
|
|
}
|
|
|
|
|
@@ -1180,6 +1221,7 @@ public class DistributedFileSystem extends FileSystem {
|
|
|
@Override
|
|
|
public FsStatus getStatus(Path p) throws IOException {
|
|
|
statistics.incrementReadOps(1);
|
|
|
+ storageStatistics.incrementOpCounter(OpType.GET_STATUS);
|
|
|
return dfs.getDiskStatus();
|
|
|
}
|
|
|
|
|
@@ -1387,6 +1429,7 @@ public class DistributedFileSystem extends FileSystem {
|
|
|
@Override
|
|
|
public FileStatus getFileStatus(Path f) throws IOException {
|
|
|
statistics.incrementReadOps(1);
|
|
|
+ storageStatistics.incrementOpCounter(OpType.GET_FILE_STATUS);
|
|
|
Path absF = fixRelativePart(f);
|
|
|
return new FileSystemLinkResolver<FileStatus>() {
|
|
|
@Override
|
|
@@ -1414,6 +1457,7 @@ public class DistributedFileSystem extends FileSystem {
|
|
|
throw new UnsupportedOperationException("Symlinks not supported");
|
|
|
}
|
|
|
statistics.incrementWriteOps(1);
|
|
|
+ storageStatistics.incrementOpCounter(OpType.CREATE_SYM_LINK);
|
|
|
final Path absF = fixRelativePart(link);
|
|
|
new FileSystemLinkResolver<Void>() {
|
|
|
@Override
|
|
@@ -1437,6 +1481,7 @@ public class DistributedFileSystem extends FileSystem {
|
|
|
@Override
|
|
|
public FileStatus getFileLinkStatus(final Path f) throws IOException {
|
|
|
statistics.incrementReadOps(1);
|
|
|
+ storageStatistics.incrementOpCounter(OpType.GET_FILE_LINK_STATUS);
|
|
|
final Path absF = fixRelativePart(f);
|
|
|
FileStatus status = new FileSystemLinkResolver<FileStatus>() {
|
|
|
@Override
|
|
@@ -1466,6 +1511,7 @@ public class DistributedFileSystem extends FileSystem {
|
|
|
@Override
|
|
|
public Path getLinkTarget(final Path f) throws IOException {
|
|
|
statistics.incrementReadOps(1);
|
|
|
+ storageStatistics.incrementOpCounter(OpType.GET_LINK_TARGET);
|
|
|
final Path absF = fixRelativePart(f);
|
|
|
return new FileSystemLinkResolver<Path>() {
|
|
|
@Override
|
|
@@ -1487,6 +1533,7 @@ public class DistributedFileSystem extends FileSystem {
|
|
|
@Override
|
|
|
protected Path resolveLink(Path f) throws IOException {
|
|
|
statistics.incrementReadOps(1);
|
|
|
+ storageStatistics.incrementOpCounter(OpType.RESOLVE_LINK);
|
|
|
String target = dfs.getLinkTarget(getPathName(fixRelativePart(f)));
|
|
|
if (target == null) {
|
|
|
throw new FileNotFoundException("File does not exist: " + f.toString());
|
|
@@ -1497,6 +1544,7 @@ public class DistributedFileSystem extends FileSystem {
|
|
|
@Override
|
|
|
public FileChecksum getFileChecksum(Path f) throws IOException {
|
|
|
statistics.incrementReadOps(1);
|
|
|
+ storageStatistics.incrementOpCounter(OpType.GET_FILE_CHECKSUM);
|
|
|
Path absF = fixRelativePart(f);
|
|
|
return new FileSystemLinkResolver<FileChecksum>() {
|
|
|
@Override
|
|
@@ -1516,6 +1564,7 @@ public class DistributedFileSystem extends FileSystem {
|
|
|
public FileChecksum getFileChecksum(Path f, final long length)
|
|
|
throws IOException {
|
|
|
statistics.incrementReadOps(1);
|
|
|
+ storageStatistics.incrementOpCounter(OpType.GET_FILE_CHECKSUM);
|
|
|
Path absF = fixRelativePart(f);
|
|
|
return new FileSystemLinkResolver<FileChecksum>() {
|
|
|
@Override
|
|
@@ -1541,6 +1590,7 @@ public class DistributedFileSystem extends FileSystem {
|
|
|
public void setPermission(Path p, final FsPermission permission
|
|
|
) throws IOException {
|
|
|
statistics.incrementWriteOps(1);
|
|
|
+ storageStatistics.incrementOpCounter(OpType.SET_PERMISSION);
|
|
|
Path absF = fixRelativePart(p);
|
|
|
new FileSystemLinkResolver<Void>() {
|
|
|
@Override
|
|
@@ -1565,6 +1615,7 @@ public class DistributedFileSystem extends FileSystem {
|
|
|
throw new IOException("username == null && groupname == null");
|
|
|
}
|
|
|
statistics.incrementWriteOps(1);
|
|
|
+ storageStatistics.incrementOpCounter(OpType.SET_OWNER);
|
|
|
Path absF = fixRelativePart(p);
|
|
|
new FileSystemLinkResolver<Void>() {
|
|
|
@Override
|
|
@@ -1586,6 +1637,7 @@ public class DistributedFileSystem extends FileSystem {
|
|
|
public void setTimes(Path p, final long mtime, final long atime)
|
|
|
throws IOException {
|
|
|
statistics.incrementWriteOps(1);
|
|
|
+ storageStatistics.incrementOpCounter(OpType.SET_TIMES);
|
|
|
Path absF = fixRelativePart(p);
|
|
|
new FileSystemLinkResolver<Void>() {
|
|
|
@Override
|
|
@@ -1663,6 +1715,8 @@ public class DistributedFileSystem extends FileSystem {
|
|
|
|
|
|
/** @see HdfsAdmin#allowSnapshot(Path) */
|
|
|
public void allowSnapshot(final Path path) throws IOException {
|
|
|
+ statistics.incrementWriteOps(1);
|
|
|
+ storageStatistics.incrementOpCounter(OpType.ALLOW_SNAPSHOT);
|
|
|
Path absF = fixRelativePart(path);
|
|
|
new FileSystemLinkResolver<Void>() {
|
|
|
@Override
|
|
@@ -1689,6 +1743,8 @@ public class DistributedFileSystem extends FileSystem {
|
|
|
|
|
|
/** @see HdfsAdmin#disallowSnapshot(Path) */
|
|
|
public void disallowSnapshot(final Path path) throws IOException {
|
|
|
+ statistics.incrementWriteOps(1);
|
|
|
+ storageStatistics.incrementOpCounter(OpType.DISALLOW_SNAPSHOT);
|
|
|
Path absF = fixRelativePart(path);
|
|
|
new FileSystemLinkResolver<Void>() {
|
|
|
@Override
|
|
@@ -1716,6 +1772,8 @@ public class DistributedFileSystem extends FileSystem {
|
|
|
@Override
|
|
|
public Path createSnapshot(final Path path, final String snapshotName)
|
|
|
throws IOException {
|
|
|
+ statistics.incrementWriteOps(1);
|
|
|
+ storageStatistics.incrementOpCounter(OpType.CREATE_SNAPSHOT);
|
|
|
Path absF = fixRelativePart(path);
|
|
|
return new FileSystemLinkResolver<Path>() {
|
|
|
@Override
|
|
@@ -1741,6 +1799,8 @@ public class DistributedFileSystem extends FileSystem {
|
|
|
@Override
|
|
|
public void renameSnapshot(final Path path, final String snapshotOldName,
|
|
|
final String snapshotNewName) throws IOException {
|
|
|
+ statistics.incrementWriteOps(1);
|
|
|
+ storageStatistics.incrementOpCounter(OpType.RENAME_SNAPSHOT);
|
|
|
Path absF = fixRelativePart(path);
|
|
|
new FileSystemLinkResolver<Void>() {
|
|
|
@Override
|
|
@@ -1777,6 +1837,8 @@ public class DistributedFileSystem extends FileSystem {
|
|
|
@Override
|
|
|
public void deleteSnapshot(final Path snapshotDir, final String snapshotName)
|
|
|
throws IOException {
|
|
|
+ statistics.incrementWriteOps(1);
|
|
|
+ storageStatistics.incrementOpCounter(OpType.DELETE_SNAPSHOT);
|
|
|
Path absF = fixRelativePart(snapshotDir);
|
|
|
new FileSystemLinkResolver<Void>() {
|
|
|
@Override
|
|
@@ -2024,6 +2086,8 @@ public class DistributedFileSystem extends FileSystem {
|
|
|
@Override
|
|
|
public void modifyAclEntries(Path path, final List<AclEntry> aclSpec)
|
|
|
throws IOException {
|
|
|
+ statistics.incrementWriteOps(1);
|
|
|
+ storageStatistics.incrementOpCounter(OpType.MODIFY_ACL_ENTRIES);
|
|
|
Path absF = fixRelativePart(path);
|
|
|
new FileSystemLinkResolver<Void>() {
|
|
|
@Override
|
|
@@ -2046,6 +2110,8 @@ public class DistributedFileSystem extends FileSystem {
|
|
|
@Override
|
|
|
public void removeAclEntries(Path path, final List<AclEntry> aclSpec)
|
|
|
throws IOException {
|
|
|
+ statistics.incrementWriteOps(1);
|
|
|
+ storageStatistics.incrementOpCounter(OpType.REMOVE_ACL_ENTRIES);
|
|
|
Path absF = fixRelativePart(path);
|
|
|
new FileSystemLinkResolver<Void>() {
|
|
|
@Override
|
|
@@ -2067,6 +2133,8 @@ public class DistributedFileSystem extends FileSystem {
|
|
|
*/
|
|
|
@Override
|
|
|
public void removeDefaultAcl(Path path) throws IOException {
|
|
|
+ statistics.incrementWriteOps(1);
|
|
|
+ storageStatistics.incrementOpCounter(OpType.REMOVE_DEFAULT_ACL);
|
|
|
final Path absF = fixRelativePart(path);
|
|
|
new FileSystemLinkResolver<Void>() {
|
|
|
@Override
|
|
@@ -2087,6 +2155,8 @@ public class DistributedFileSystem extends FileSystem {
|
|
|
*/
|
|
|
@Override
|
|
|
public void removeAcl(Path path) throws IOException {
|
|
|
+ statistics.incrementWriteOps(1);
|
|
|
+ storageStatistics.incrementOpCounter(OpType.REMOVE_ACL);
|
|
|
final Path absF = fixRelativePart(path);
|
|
|
new FileSystemLinkResolver<Void>() {
|
|
|
@Override
|
|
@@ -2108,6 +2178,8 @@ public class DistributedFileSystem extends FileSystem {
|
|
|
@Override
|
|
|
public void setAcl(Path path, final List<AclEntry> aclSpec)
|
|
|
throws IOException {
|
|
|
+ statistics.incrementWriteOps(1);
|
|
|
+ storageStatistics.incrementOpCounter(OpType.SET_ACL);
|
|
|
Path absF = fixRelativePart(path);
|
|
|
new FileSystemLinkResolver<Void>() {
|
|
|
@Override
|
|
@@ -2206,6 +2278,8 @@ public class DistributedFileSystem extends FileSystem {
|
|
|
@Override
|
|
|
public void setXAttr(Path path, final String name, final byte[] value,
|
|
|
final EnumSet<XAttrSetFlag> flag) throws IOException {
|
|
|
+ statistics.incrementWriteOps(1);
|
|
|
+ storageStatistics.incrementOpCounter(OpType.SET_XATTR);
|
|
|
Path absF = fixRelativePart(path);
|
|
|
new FileSystemLinkResolver<Void>() {
|
|
|
|
|
@@ -2225,6 +2299,8 @@ public class DistributedFileSystem extends FileSystem {
|
|
|
|
|
|
@Override
|
|
|
public byte[] getXAttr(Path path, final String name) throws IOException {
|
|
|
+ statistics.incrementReadOps(1);
|
|
|
+ storageStatistics.incrementOpCounter(OpType.GET_XATTR);
|
|
|
final Path absF = fixRelativePart(path);
|
|
|
return new FileSystemLinkResolver<byte[]>() {
|
|
|
@Override
|
|
@@ -2290,6 +2366,8 @@ public class DistributedFileSystem extends FileSystem {
|
|
|
|
|
|
@Override
|
|
|
public void removeXAttr(Path path, final String name) throws IOException {
|
|
|
+ statistics.incrementWriteOps(1);
|
|
|
+ storageStatistics.incrementOpCounter(OpType.REMOVE_XATTR);
|
|
|
Path absF = fixRelativePart(path);
|
|
|
new FileSystemLinkResolver<Void>() {
|
|
|
@Override
|
|
@@ -2446,4 +2524,5 @@ public class DistributedFileSystem extends FileSystem {
|
|
|
Statistics getFsStatistics() {
|
|
|
return statistics;
|
|
|
}
|
|
|
+
|
|
|
}
|