1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package org.apache.hadoop.hbase.wal;
19
20 import java.io.FileNotFoundException;
21 import java.io.IOException;
22 import java.net.URI;
23
24 import org.apache.hadoop.fs.FSDataInputStream;
25 import org.apache.hadoop.fs.FSDataOutputStream;
26 import org.apache.hadoop.fs.FileStatus;
27 import org.apache.hadoop.fs.FileSystem;
28 import org.apache.hadoop.fs.Path;
29 import org.apache.hadoop.fs.permission.FsPermission;
30 import org.apache.hadoop.util.Progressable;
31
32
33
34
35
36
37
38 public class FileSystemProxy extends FileSystem {
39 private final FileSystem real;
40
41 public FileSystemProxy(FileSystem real) {
42 this.real = real;
43 }
44
45 @Override
46 public FSDataInputStream open(Path p) throws IOException {
47 return real.open(p);
48 }
49
50 @Override
51 public URI getUri() {
52 return real.getUri();
53 }
54
55 @Override
56 public FSDataInputStream open(Path f, int bufferSize) throws IOException {
57 return real.open(f, bufferSize);
58 }
59
60 @Override
61 public FSDataOutputStream create(Path f, FsPermission permission, boolean overwrite,
62 int bufferSize, short replication, long blockSize, Progressable progress) throws IOException {
63 return real.create(f, permission, overwrite, bufferSize, replication, blockSize, progress);
64 }
65
66 @Override
67 public FSDataOutputStream append(Path f, int bufferSize, Progressable progress)
68 throws IOException {
69 return real.append(f, bufferSize, progress);
70 }
71
72 @Override
73 public boolean rename(Path src, Path dst) throws IOException {
74 return real.rename(src, dst);
75 }
76
77 @Override
78 public boolean delete(Path f, boolean recursive) throws IOException {
79 return real.delete(f, recursive);
80 }
81
82 @Override
83 public FileStatus[] listStatus(Path f) throws FileNotFoundException, IOException {
84 return real.listStatus(f);
85 }
86
87 @Override
88 public void setWorkingDirectory(Path new_dir) {
89 real.setWorkingDirectory(new_dir);
90 }
91
92 @Override
93 public Path getWorkingDirectory() {
94 return real.getWorkingDirectory();
95 }
96
97 @Override
98 public boolean mkdirs(Path f, FsPermission permission) throws IOException {
99 return real.mkdirs(f, permission);
100 }
101
102 @Override
103 public FileStatus getFileStatus(Path f) throws IOException {
104 return real.getFileStatus(f);
105 }
106 }