Skip to content

Commit

Permalink
HBASE-24086 Disable output stream capability enforcement when running…
Browse files Browse the repository at this point in the history
… in standalone mode
  • Loading branch information
ndimiduk committed Apr 2, 2020
1 parent b2c9a06 commit 3451bf8
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -350,11 +350,18 @@ public static void setWALRootDir(final Configuration c, final Path root) {
public static FileSystem getWALFileSystem(final Configuration c) throws IOException {
Path p = getWALRootDir(c);
FileSystem fs = p.getFileSystem(c);
// hadoop-core does fs caching, so need to propogate this if set
// hadoop-core does fs caching, so need to propagate this if set
String enforceStreamCapability = c.get(UNSAFE_STREAM_CAPABILITY_ENFORCE);
if (enforceStreamCapability != null) {
fs.getConf().set(UNSAFE_STREAM_CAPABILITY_ENFORCE, enforceStreamCapability);
}
if (!c.getBoolean(HConstants.CLUSTER_DISTRIBUTED, false)) {
// running in standalone mode, assume RawLocalFileSystem does not support
// required capabilities `HSYNC` and `HFLUSH`, so disable enforcement.
LOG.warn("Cannot enforce durability guarantees while running in"
+ " standalone mode ({}={}).", HConstants.CLUSTER_DISTRIBUTED, false);
fs.getConf().setBoolean(UNSAFE_STREAM_CAPABILITY_ENFORCE, false);
}
return fs;
}

Expand Down

0 comments on commit 3451bf8

Please sign in to comment.