Skip to content
Permalink
Browse files
HBASE-23314 Make HBaseObjectStoreSemantics FilterFileSystem (#11)
Signed-off-by: Andrew Putell <apurtell@apache.org>
Signed-off-by: Wellington Chevreuil <wchevreuil@apache.org>
  • Loading branch information
liuml07 authored and wchevreuil committed Nov 19, 2019
1 parent 0a130df commit 3386c7ecb7e4d81385b8fc794174d9496415a5f6
Showing 1 changed file with 2 additions and 58 deletions.
@@ -35,6 +35,7 @@
import org.apache.hadoop.fs.FileChecksum;
import org.apache.hadoop.fs.FileStatus;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.FilterFileSystem;
import org.apache.hadoop.fs.FsServerDefaults;
import org.apache.hadoop.fs.FsStatus;
import org.apache.hadoop.fs.LocatedFileStatus;
@@ -93,12 +94,10 @@
*/
@InterfaceAudience.LimitedPrivate(HBaseInterfaceAudience.CONFIG)
@InterfaceStability.Unstable
public class HBaseObjectStoreSemantics extends FileSystem {
public class HBaseObjectStoreSemantics extends FilterFileSystem {
private static final Logger LOG =
LoggerFactory.getLogger(HBaseObjectStoreSemantics.class);

private FileSystem fs;

private TreeLockManager sync;

public void initialize(URI name, Configuration conf) throws IOException {
@@ -131,10 +130,6 @@ public String getScheme() {
return fs.getScheme();
}

public URI getUri() {
return fs.getUri();
}

@Override
public String getCanonicalServiceName() {
return fs.getCanonicalServiceName();
@@ -145,10 +140,6 @@ public String getName() {
return fs.getName();
}

public Path makeQualified(Path path) {
return fs.makeQualified(path);
}

public BlockLocation[] getFileBlockLocations(FileStatus file,
long start, long len) throws IOException {
try (AutoLock l = sync.lock(file.getPath())) {
@@ -163,19 +154,6 @@ public BlockLocation[] getFileBlockLocations(Path p,
}
}

@Deprecated
public FsServerDefaults getServerDefaults() throws IOException {
return fs.getServerDefaults();
}

public FsServerDefaults getServerDefaults(Path p) throws IOException {
return fs.getServerDefaults(p);
}

public Path resolvePath(final Path p) throws IOException {
return fs.resolvePath(p);
}

public FSDataInputStream open(Path f, int bufferSize)
throws IOException {
try (AutoLock l = sync.lock(f)) {
@@ -616,18 +594,6 @@ public RemoteIterator<LocatedFileStatus> listFiles(
}
}

public Path getHomeDirectory() {
return fs.getHomeDirectory();
}

public void setWorkingDirectory(Path newDir) {
fs.setWorkingDirectory(newDir);
}

public Path getWorkingDirectory() {
return fs.getWorkingDirectory();
}

public boolean mkdirs(Path f) throws IOException {
// TODO this has implications for the parent dirs too
try (AutoLock l = sync.lock(f)) {
@@ -731,35 +697,13 @@ public void close() throws IOException {
sync.close();
}

public long getUsed() throws IOException {
return fs.getUsed();
}

@Deprecated
public long getBlockSize(Path f) throws IOException {
try (AutoLock l = sync.lock(f)) {
return fs.getBlockSize(f);
}
}

@Deprecated
public long getDefaultBlockSize() {
return fs.getDefaultBlockSize();
}

public long getDefaultBlockSize(Path f) {
return fs.getDefaultBlockSize(f);
}

@Deprecated
public short getDefaultReplication() {
return fs.getDefaultReplication();
}

public short getDefaultReplication(Path path) {
return fs.getDefaultReplication(path);
}

public FileStatus getFileStatus(Path f) throws IOException {
try (AutoLock l = sync.lock(f)) {
return fs.getFileStatus(f);

0 comments on commit 3386c7e

Please sign in to comment.