Updated Branches: refs/heads/master 90feb4ce1 -> 018e520e7
ACCUMULO-1643 Remove warnings introduced by updated dependency Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/018e520e Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/018e520e Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/018e520e Branch: refs/heads/master Commit: 018e520e771d1ea126001d2303c89d15c719cff3 Parents: 90feb4c Author: Christopher Tubbs <[email protected]> Authored: Fri Sep 6 16:24:58 2013 -0400 Committer: Christopher Tubbs <[email protected]> Committed: Fri Sep 6 16:24:58 2013 -0400 ---------------------------------------------------------------------- .../accumulo/server/fs/VolumeManagerImpl.java | 88 +++++------ .../accumulo/server/trace/TraceFileSystem.java | 146 ++++++++++--------- 2 files changed, 119 insertions(+), 115 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/accumulo/blob/018e520e/server/src/main/java/org/apache/accumulo/server/fs/VolumeManagerImpl.java ---------------------------------------------------------------------- diff --git a/server/src/main/java/org/apache/accumulo/server/fs/VolumeManagerImpl.java b/server/src/main/java/org/apache/accumulo/server/fs/VolumeManagerImpl.java index 4313ca4..d6a34f6 100644 --- a/server/src/main/java/org/apache/accumulo/server/fs/VolumeManagerImpl.java +++ b/server/src/main/java/org/apache/accumulo/server/fs/VolumeManagerImpl.java @@ -52,28 +52,29 @@ import org.apache.hadoop.util.Progressable; import org.apache.log4j.Logger; public class VolumeManagerImpl implements VolumeManager { - + private static final Logger log = Logger.getLogger(VolumeManagerImpl.class); - - Map<String, ? extends FileSystem> volumes; + + Map<String,? extends FileSystem> volumes; String defaultVolume; AccumuloConfiguration conf; VolumeChooser chooser; - - protected VolumeManagerImpl(Map<String, ? extends FileSystem> volumes, String defaultVolume, AccumuloConfiguration conf) { + + protected VolumeManagerImpl(Map<String,? extends FileSystem> volumes, String defaultVolume, AccumuloConfiguration conf) { this.volumes = volumes; this.defaultVolume = defaultVolume; this.conf = conf; ensureSyncIsEnabled(); try { - chooser = (VolumeChooser)this.getClass().getClassLoader().loadClass(conf.get(Property.GENERAL_VOLUME_CHOOSER)).newInstance(); + chooser = (VolumeChooser) this.getClass().getClassLoader().loadClass(conf.get(Property.GENERAL_VOLUME_CHOOSER)).newInstance(); } catch (Exception e) { throw new RuntimeException(e); } } - + public static org.apache.accumulo.server.fs.VolumeManager getLocal() throws IOException { - return new VolumeManagerImpl(Collections.singletonMap("", FileSystem.getLocal(CachedConfiguration.getInstance())), "", DefaultConfiguration.getDefaultConfiguration()); + return new VolumeManagerImpl(Collections.singletonMap("", FileSystem.getLocal(CachedConfiguration.getInstance())), "", + DefaultConfiguration.getDefaultConfiguration()); } @Override @@ -90,7 +91,7 @@ public class VolumeManagerImpl implements VolumeManager { throw ex; } } - + @Override public boolean closePossiblyOpenFile(Path path) throws IOException { FileSystem fs = getFileSystemByPath(path); @@ -100,7 +101,7 @@ public class VolumeManagerImpl implements VolumeManager { return dfs.recoverLease(path); } catch (FileNotFoundException ex) { throw ex; - } + } } else if (fs instanceof LocalFileSystem) { // ignore } else { @@ -110,23 +111,23 @@ public class VolumeManagerImpl implements VolumeManager { log.info("Recovered lease on " + path.toString() + " using append"); return true; } - + @Override public FSDataOutputStream create(Path path) throws IOException { FileSystem fs = getFileSystemByPath(path); return fs.create(path); } - + @Override public FSDataOutputStream create(Path path, boolean overwrite) throws IOException { FileSystem fs = getFileSystemByPath(path); return fs.create(path, overwrite); } - + private static long correctBlockSize(Configuration conf, long blockSize) { if (blockSize <= 0) blockSize = conf.getLong("dfs.block.size", 67108864); - + int checkSum = conf.getInt("io.bytes.per.checksum", 512); blockSize -= blockSize % checkSum; blockSize = Math.max(blockSize, checkSum); @@ -138,7 +139,6 @@ public class VolumeManagerImpl implements VolumeManager { bufferSize = conf.getInt("io.file.buffer.size", 4096); return bufferSize; } - @Override public FSDataOutputStream create(Path path, boolean overwrite, int bufferSize, short replication, long blockSize) throws IOException { @@ -154,26 +154,27 @@ public class VolumeManagerImpl implements VolumeManager { FileSystem fs = getFileSystemByPath(path); return fs.createNewFile(path); } + @Override public FSDataOutputStream createSyncable(Path logPath, int bufferSize, short replication, long blockSize) throws IOException { FileSystem fs = getFileSystemByPath(logPath); blockSize = correctBlockSize(fs.getConf(), blockSize); bufferSize = correctBufferSize(fs.getConf(), bufferSize); try { - // This... - // EnumSet<CreateFlag> set = EnumSet.of(CreateFlag.SYNC_BLOCK, CreateFlag.CREATE); - // return fs.create(logPath, FsPermission.getDefault(), set, buffersize, replication, blockSize, null); + // This... + // EnumSet<CreateFlag> set = EnumSet.of(CreateFlag.SYNC_BLOCK, CreateFlag.CREATE); + // return fs.create(logPath, FsPermission.getDefault(), set, buffersize, replication, blockSize, null); // Becomes this: Class<?> createFlags = Class.forName("org.apache.hadoop.fs.CreateFlag"); List<Enum<?>> flags = new ArrayList<Enum<?>>(); if (createFlags.isEnum()) { for (Object constant : createFlags.getEnumConstants()) { if (constant.toString().equals("SYNC_BLOCK")) { - flags.add((Enum<?>)constant); + flags.add((Enum<?>) constant); log.debug("Found synch enum " + constant); } if (constant.toString().equals("CREATE")) { - flags.add((Enum<?>)constant); + flags.add((Enum<?>) constant); log.debug("Found CREATE enum " + constant); } } @@ -182,7 +183,7 @@ public class VolumeManagerImpl implements VolumeManager { log.debug("CreateFlag set: " + set); Method create = fs.getClass().getMethod("create", Path.class, FsPermission.class, EnumSet.class, Integer.TYPE, Short.TYPE, Long.TYPE, Progressable.class); log.debug("creating " + logPath + " with SYNCH_BLOCK flag"); - return (FSDataOutputStream)create.invoke(fs, logPath, FsPermission.getDefault(), set, bufferSize, replication, blockSize, null); + return (FSDataOutputStream) create.invoke(fs, logPath, FsPermission.getDefault(), set, bufferSize, replication, blockSize, null); } catch (ClassNotFoundException ex) { // Expected in hadoop 1.0 return fs.create(logPath, true, bufferSize, replication, blockSize); @@ -193,7 +194,7 @@ public class VolumeManagerImpl implements VolumeManager { } @Override - public boolean delete(Path path) throws IOException{ + public boolean delete(Path path) throws IOException { return getFileSystemByPath(path).delete(path, false); } @@ -232,7 +233,7 @@ public class VolumeManagerImpl implements VolumeManager { } } } - + } @Override @@ -247,26 +248,25 @@ public class VolumeManagerImpl implements VolumeManager { @Override public FileSystem getFileSystemByPath(Path path) { - if (path.toString().contains(":")) - { + if (path.toString().contains(":")) { try { return path.getFileSystem(CachedConfiguration.getInstance()); } catch (IOException ex) { throw new RuntimeException(ex); } } - + return volumes.get(defaultVolume); } @Override - public Map<String, ? extends FileSystem> getFileSystems() { + public Map<String,? extends FileSystem> getFileSystems() { return volumes; } @Override public FileStatus[] listStatus(Path path) throws IOException { - return getFileSystemByPath(path).listStatus(path); + return getFileSystemByPath(path).listStatus(path); } @Override @@ -280,7 +280,7 @@ public class VolumeManagerImpl implements VolumeManager { } @Override - public boolean rename(Path path, Path newPath)throws IOException { + public boolean rename(Path path, Path newPath) throws IOException { FileSystem source = getFileSystemByPath(path); FileSystem dest = getFileSystemByPath(newPath); if (source != dest) { @@ -290,7 +290,7 @@ public class VolumeManagerImpl implements VolumeManager { } @Override - public boolean moveToTrash(Path path) throws IOException{ + public boolean moveToTrash(Path path) throws IOException { FileSystem fs = getFileSystemByPath(path); Trash trash = new Trash(fs, fs.getConf()); return trash.moveToTrash(path); @@ -298,7 +298,9 @@ public class VolumeManagerImpl implements VolumeManager { @Override public short getDefaultReplication(Path path) { - return getFileSystemByPath(path).getDefaultReplication(); + @SuppressWarnings("deprecation") + short rep = getFileSystemByPath(path).getDefaultReplication(); + return rep; } @Override @@ -310,11 +312,11 @@ public class VolumeManagerImpl implements VolumeManager { AccumuloConfiguration conf = ServerConfiguration.getSystemConfiguration(HdfsZooInstance.getInstance()); return get(conf); } - + static private final String DEFAULT = ""; public static VolumeManager get(AccumuloConfiguration conf) throws IOException { - Map<String, FileSystem> fileSystems = new HashMap<String, FileSystem>(); + Map<String,FileSystem> fileSystems = new HashMap<String,FileSystem>(); Configuration hadoopConf = CachedConfiguration.getInstance(); fileSystems.put(DEFAULT, FileSystem.get(hadoopConf)); String ns = ServerConfiguration.getSiteConfiguration().get(Property.INSTANCE_VOLUMES); @@ -335,7 +337,7 @@ public class VolumeManagerImpl implements VolumeManager { for (FileSystem fs : getFileSystems().values()) { if (!(fs instanceof DistributedFileSystem)) continue; - DistributedFileSystem dfs = (DistributedFileSystem)fs; + DistributedFileSystem dfs = (DistributedFileSystem) fs; // So this: if (!dfs.setSafeMode(SafeModeAction.SAFEMODE_GET)) // Becomes this: Class<?> safeModeAction; @@ -380,16 +382,16 @@ public class VolumeManagerImpl implements VolumeManager { public FileStatus[] globStatus(Path pathPattern) throws IOException { return getFileSystemByPath(pathPattern).globStatus(pathPattern); } - + @Override public Path getFullPath(Key key) { - + String relPath = key.getColumnQualifierData().toString(); if (relPath.contains(":")) return new Path(relPath); - - byte [] tableId = KeyExtent.tableOfMetadataRow(key.getRow()); - + + byte[] tableId = KeyExtent.tableOfMetadataRow(key.getRow()); + if (relPath.startsWith("../")) relPath = relPath.substring(2); else @@ -413,9 +415,9 @@ public class VolumeManagerImpl implements VolumeManager { @Override public String newPathOnSameVolume(String sourceDir, String suffix) { for (String fs : getFileSystems().keySet()) { - if (sourceDir.startsWith(fs)) { - return fs + "/" + suffix; - } + if (sourceDir.startsWith(fs)) { + return fs + "/" + suffix; + } } return null; } @@ -425,7 +427,7 @@ public class VolumeManagerImpl implements VolumeManager { if (fileName.contains(":")) return new Path(fileName); // TODO: ACCUMULO-118 - // How do we want it to work? Find it somewhere? or find it in the default file system? + // How do we want it to work? Find it somewhere? or find it in the default file system? // old-style name, on one of many possible "root" paths: if (fileName.startsWith("../")) fileName = fileName.substring(2); http://git-wip-us.apache.org/repos/asf/accumulo/blob/018e520e/server/src/main/java/org/apache/accumulo/server/trace/TraceFileSystem.java ---------------------------------------------------------------------- diff --git a/server/src/main/java/org/apache/accumulo/server/trace/TraceFileSystem.java b/server/src/main/java/org/apache/accumulo/server/trace/TraceFileSystem.java index c532c18..71cc562 100644 --- a/server/src/main/java/org/apache/accumulo/server/trace/TraceFileSystem.java +++ b/server/src/main/java/org/apache/accumulo/server/trace/TraceFileSystem.java @@ -38,7 +38,7 @@ import org.apache.hadoop.util.Progressable; // If FileSystem was an interface, we could use a Proxy, but it's not, so we have to override everything manually public class TraceFileSystem extends FileSystem { - + @Override public void setConf(Configuration conf) { Span span = Trace.start("setConf"); @@ -51,7 +51,7 @@ public class TraceFileSystem extends FileSystem { span.stop(); } } - + @Override public Configuration getConf() { Span span = Trace.start("getConf"); @@ -61,7 +61,7 @@ public class TraceFileSystem extends FileSystem { span.stop(); } } - + @Override public BlockLocation[] getFileBlockLocations(FileStatus file, long start, long len) throws IOException { Span span = Trace.start("getFileBlockLocations"); @@ -71,7 +71,7 @@ public class TraceFileSystem extends FileSystem { span.stop(); } } - + @Override public FSDataInputStream open(Path f) throws IOException { Span span = Trace.start("open"); @@ -83,7 +83,7 @@ public class TraceFileSystem extends FileSystem { span.stop(); } } - + @Override public FSDataOutputStream create(Path f) throws IOException { Span span = Trace.start("create"); @@ -95,7 +95,7 @@ public class TraceFileSystem extends FileSystem { span.stop(); } } - + @Override public FSDataOutputStream create(Path f, boolean overwrite) throws IOException { Span span = Trace.start("create"); @@ -107,20 +107,20 @@ public class TraceFileSystem extends FileSystem { span.stop(); } } - + @Override public FSDataOutputStream create(Path f, Progressable progress) throws IOException { Span span = Trace.start("create"); if (Trace.isTracing()) span.data("path", f.toString()); try { - + return impl.create(f, progress); } finally { span.stop(); } } - + @Override public FSDataOutputStream create(Path f, short replication) throws IOException { Span span = Trace.start("create"); @@ -132,7 +132,7 @@ public class TraceFileSystem extends FileSystem { span.stop(); } } - + @Override public FSDataOutputStream create(Path f, short replication, Progressable progress) throws IOException { Span span = Trace.start("create"); @@ -144,7 +144,7 @@ public class TraceFileSystem extends FileSystem { span.stop(); } } - + @Override public FSDataOutputStream create(Path f, boolean overwrite, int bufferSize) throws IOException { Span span = Trace.start("create"); @@ -156,7 +156,7 @@ public class TraceFileSystem extends FileSystem { span.stop(); } } - + @Override public FSDataOutputStream create(Path f, boolean overwrite, int bufferSize, Progressable progress) throws IOException { Span span = Trace.start("create"); @@ -168,7 +168,7 @@ public class TraceFileSystem extends FileSystem { span.stop(); } } - + @Override public FSDataOutputStream create(Path f, boolean overwrite, int bufferSize, short replication, long blockSize) throws IOException { Span span = Trace.start("create"); @@ -180,7 +180,7 @@ public class TraceFileSystem extends FileSystem { span.stop(); } } - + @Override public FSDataOutputStream create(Path f, boolean overwrite, int bufferSize, short replication, long blockSize, Progressable progress) throws IOException { Span span = Trace.start("create"); @@ -192,7 +192,7 @@ public class TraceFileSystem extends FileSystem { span.stop(); } } - + @Override public boolean createNewFile(Path f) throws IOException { Span span = Trace.start("createNewFile"); @@ -204,7 +204,7 @@ public class TraceFileSystem extends FileSystem { span.stop(); } } - + @Override public FSDataOutputStream append(Path f) throws IOException { Span span = Trace.start("append"); @@ -216,7 +216,7 @@ public class TraceFileSystem extends FileSystem { span.stop(); } } - + @Override public FSDataOutputStream append(Path f, int bufferSize) throws IOException { Span span = Trace.start("append"); @@ -228,7 +228,7 @@ public class TraceFileSystem extends FileSystem { span.stop(); } } - + @Deprecated @Override public short getReplication(Path src) throws IOException { @@ -241,7 +241,7 @@ public class TraceFileSystem extends FileSystem { span.stop(); } } - + @Override public boolean setReplication(Path src, short replication) throws IOException { Span span = Trace.start("setReplication"); @@ -253,7 +253,7 @@ public class TraceFileSystem extends FileSystem { span.stop(); } } - + @Override public boolean exists(Path f) throws IOException { Span span = Trace.start("exists"); @@ -265,7 +265,7 @@ public class TraceFileSystem extends FileSystem { span.stop(); } } - + @Deprecated @Override public boolean isDirectory(Path f) throws IOException { @@ -278,7 +278,7 @@ public class TraceFileSystem extends FileSystem { span.stop(); } } - + @Override public boolean isFile(Path f) throws IOException { Span span = Trace.start("isFile"); @@ -290,7 +290,7 @@ public class TraceFileSystem extends FileSystem { span.stop(); } } - + @SuppressWarnings("deprecation") @Override public long getLength(Path f) throws IOException { @@ -303,7 +303,7 @@ public class TraceFileSystem extends FileSystem { span.stop(); } } - + @Override public ContentSummary getContentSummary(Path f) throws IOException { Span span = Trace.start("getContentSummary"); @@ -315,7 +315,7 @@ public class TraceFileSystem extends FileSystem { span.stop(); } } - + @Override public FileStatus[] listStatus(Path f, PathFilter filter) throws IOException { Span span = Trace.start("listStatus"); @@ -327,7 +327,7 @@ public class TraceFileSystem extends FileSystem { span.stop(); } } - + @Override public FileStatus[] listStatus(Path[] files) throws IOException { Span span = Trace.start("listStatus"); @@ -337,7 +337,7 @@ public class TraceFileSystem extends FileSystem { span.stop(); } } - + @Override public FileStatus[] listStatus(Path[] files, PathFilter filter) throws IOException { Span span = Trace.start("listStatus"); @@ -347,7 +347,7 @@ public class TraceFileSystem extends FileSystem { span.stop(); } } - + @Override public FileStatus[] globStatus(Path pathPattern) throws IOException { Span span = Trace.start("globStatus"); @@ -359,7 +359,7 @@ public class TraceFileSystem extends FileSystem { span.stop(); } } - + @Override public FileStatus[] globStatus(Path pathPattern, PathFilter filter) throws IOException { Span span = Trace.start("globStatus"); @@ -371,7 +371,7 @@ public class TraceFileSystem extends FileSystem { span.stop(); } } - + @Override public Path getHomeDirectory() { Span span = Trace.start("getHomeDirectory"); @@ -381,7 +381,7 @@ public class TraceFileSystem extends FileSystem { span.stop(); } } - + @Override public boolean mkdirs(Path f) throws IOException { Span span = Trace.start("mkdirs"); @@ -393,7 +393,7 @@ public class TraceFileSystem extends FileSystem { span.stop(); } } - + @Override public void copyFromLocalFile(Path src, Path dst) throws IOException { Span span = Trace.start("copyFromLocalFile"); @@ -407,7 +407,7 @@ public class TraceFileSystem extends FileSystem { span.stop(); } } - + @Override public void moveFromLocalFile(Path[] srcs, Path dst) throws IOException { Span span = Trace.start("moveFromLocalFile"); @@ -420,7 +420,7 @@ public class TraceFileSystem extends FileSystem { span.stop(); } } - + @Override public void moveFromLocalFile(Path src, Path dst) throws IOException { Span span = Trace.start("moveFromLocalFile"); @@ -434,7 +434,7 @@ public class TraceFileSystem extends FileSystem { span.stop(); } } - + @Override public void copyFromLocalFile(boolean delSrc, Path src, Path dst) throws IOException { Span span = Trace.start("copyFromLocalFile"); @@ -448,7 +448,7 @@ public class TraceFileSystem extends FileSystem { span.stop(); } } - + @Override public void copyFromLocalFile(boolean delSrc, boolean overwrite, Path[] srcs, Path dst) throws IOException { Span span = Trace.start("copyFromLocalFile"); @@ -461,7 +461,7 @@ public class TraceFileSystem extends FileSystem { span.stop(); } } - + @Override public void copyFromLocalFile(boolean delSrc, boolean overwrite, Path src, Path dst) throws IOException { Span span = Trace.start("copyFromLocalFile"); @@ -475,7 +475,7 @@ public class TraceFileSystem extends FileSystem { span.stop(); } } - + @Override public void copyToLocalFile(Path src, Path dst) throws IOException { Span span = Trace.start("copyFromLocalFile"); @@ -489,7 +489,7 @@ public class TraceFileSystem extends FileSystem { span.stop(); } } - + @Override public void moveToLocalFile(Path src, Path dst) throws IOException { Span span = Trace.start("moveToLocalFile"); @@ -503,7 +503,7 @@ public class TraceFileSystem extends FileSystem { span.stop(); } } - + @Override public void copyToLocalFile(boolean delSrc, Path src, Path dst) throws IOException { Span span = Trace.start("copyToLocalFile"); @@ -517,7 +517,7 @@ public class TraceFileSystem extends FileSystem { span.stop(); } } - + @Override public Path startLocalOutput(Path fsOutputFile, Path tmpLocalFile) throws IOException { Span span = Trace.start("startLocalOutput"); @@ -531,7 +531,7 @@ public class TraceFileSystem extends FileSystem { span.stop(); } } - + @Override public void completeLocalOutput(Path fsOutputFile, Path tmpLocalFile) throws IOException { Span span = Trace.start("completeLocalOutput"); @@ -545,7 +545,7 @@ public class TraceFileSystem extends FileSystem { span.stop(); } } - + @Override public void close() throws IOException { Span span = Trace.start("close"); @@ -555,7 +555,7 @@ public class TraceFileSystem extends FileSystem { span.stop(); } } - + @Override public long getUsed() throws IOException { Span span = Trace.start("getUsed"); @@ -565,7 +565,7 @@ public class TraceFileSystem extends FileSystem { span.stop(); } } - + @SuppressWarnings("deprecation") @Override public long getBlockSize(Path f) throws IOException { @@ -579,7 +579,8 @@ public class TraceFileSystem extends FileSystem { span.stop(); } } - + + @Deprecated @Override public long getDefaultBlockSize() { Span span = Trace.start("getDefaultBlockSize"); @@ -589,7 +590,8 @@ public class TraceFileSystem extends FileSystem { span.stop(); } } - + + @Deprecated @Override public short getDefaultReplication() { Span span = Trace.start("getDefaultReplication"); @@ -599,7 +601,7 @@ public class TraceFileSystem extends FileSystem { span.stop(); } } - + @Override public FileChecksum getFileChecksum(Path f) throws IOException { Span span = Trace.start("getFileChecksum"); @@ -612,7 +614,7 @@ public class TraceFileSystem extends FileSystem { span.stop(); } } - + @Override public void setVerifyChecksum(boolean verifyChecksum) { Span span = Trace.start("setVerifyChecksum"); @@ -622,7 +624,7 @@ public class TraceFileSystem extends FileSystem { span.stop(); } } - + @Override public void setPermission(Path p, FsPermission permission) throws IOException { Span span = Trace.start("setPermission"); @@ -635,7 +637,7 @@ public class TraceFileSystem extends FileSystem { span.stop(); } } - + @Override public void setOwner(Path p, String username, String groupname) throws IOException { Span span = Trace.start("setOwner"); @@ -644,14 +646,14 @@ public class TraceFileSystem extends FileSystem { span.data("user", username); span.data("group", groupname); } - + try { impl.setOwner(p, username, groupname); } finally { span.stop(); } } - + @Override public void setTimes(Path p, long mtime, long atime) throws IOException { Span span = Trace.start("setTimes"); @@ -661,18 +663,18 @@ public class TraceFileSystem extends FileSystem { span.stop(); } } - + final FileSystem impl; - + TraceFileSystem(FileSystem impl) { ArgumentChecker.notNull(impl); this.impl = impl; } - + public FileSystem getImplementation() { return impl; } - + @Override public URI getUri() { Span span = Trace.start("getUri"); @@ -682,7 +684,7 @@ public class TraceFileSystem extends FileSystem { span.stop(); } } - + @Override public FSDataInputStream open(Path f, int bufferSize) throws IOException { Span span = Trace.start("open"); @@ -692,7 +694,7 @@ public class TraceFileSystem extends FileSystem { span.stop(); } } - + @Override public FSDataOutputStream create(Path f, FsPermission permission, boolean overwrite, int bufferSize, short replication, long blockSize, Progressable progress) throws IOException { @@ -703,7 +705,7 @@ public class TraceFileSystem extends FileSystem { span.stop(); } } - + @Override public void initialize(URI name, Configuration conf) throws IOException { Span span = Trace.start("initialize"); @@ -713,7 +715,7 @@ public class TraceFileSystem extends FileSystem { span.stop(); } } - + @Override public FSDataOutputStream append(Path f, int bufferSize, Progressable progress) throws IOException { Span span = Trace.start("append"); @@ -723,7 +725,7 @@ public class TraceFileSystem extends FileSystem { span.stop(); } } - + @Override public boolean rename(Path src, Path dst) throws IOException { Span span = Trace.start("rename"); @@ -733,7 +735,7 @@ public class TraceFileSystem extends FileSystem { span.stop(); } } - + @SuppressWarnings("deprecation") @Override public boolean delete(Path f) throws IOException { @@ -744,7 +746,7 @@ public class TraceFileSystem extends FileSystem { span.stop(); } } - + @Override public boolean delete(Path f, boolean recursive) throws IOException { Span span = Trace.start("delete"); @@ -754,7 +756,7 @@ public class TraceFileSystem extends FileSystem { span.stop(); } } - + @Override public FileStatus[] listStatus(Path f) throws IOException { Span span = Trace.start("listStatus"); @@ -764,7 +766,7 @@ public class TraceFileSystem extends FileSystem { span.stop(); } } - + @Override public void setWorkingDirectory(Path new_dir) { Span span = Trace.start("setWorkingDirectory"); @@ -774,7 +776,7 @@ public class TraceFileSystem extends FileSystem { span.stop(); } } - + @Override public Path getWorkingDirectory() { Span span = Trace.start("getWorkingDirectory"); @@ -784,7 +786,7 @@ public class TraceFileSystem extends FileSystem { span.stop(); } } - + @Override public boolean mkdirs(Path f, FsPermission permission) throws IOException { Span span = Trace.start("mkdirs"); @@ -794,7 +796,7 @@ public class TraceFileSystem extends FileSystem { span.stop(); } } - + @Override public FileStatus getFileStatus(Path f) throws IOException { Span span = Trace.start("getFileStatus"); @@ -804,13 +806,13 @@ public class TraceFileSystem extends FileSystem { span.stop(); } } - + public static FileSystem wrap(FileSystem fileSystem) { return new TraceFileSystem(fileSystem); } - + public static FileSystem getAndWrap(Configuration conf) throws IOException { return wrap(FileSystem.get(conf)); } - + }
