Skip to content

Commit 07e1b1a

Browse files
committed
Address Enis' review comments
1 parent 8b9e258 commit 07e1b1a

File tree

2 files changed

+6
-19
lines changed

2 files changed

+6
-19
lines changed

hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/WALPlayer.java

+5-7
Original file line numberDiff line numberDiff line change
@@ -293,13 +293,11 @@ public Job createSubmittableJob(String[] args)
293293
// No reducers.
294294
job.setNumReduceTasks(0);
295295
}
296-
String codecCls = WALCellCodec.getNonDefaultWALCellCodecClass(conf);
297-
if (codecCls != null) {
298-
try {
299-
TableMapReduceUtil.addDependencyJars(conf, Class.forName(codecCls));
300-
} catch (Exception e) {
301-
throw new IOException("Cannot determine wal codec class " + codecCls, e);
302-
}
296+
String codecCls = WALCellCodec.getWALCellCodecClass(conf);
297+
try {
298+
TableMapReduceUtil.addDependencyJars(conf, Class.forName(codecCls));
299+
} catch (Exception e) {
300+
throw new IOException("Cannot determine wal codec class " + codecCls, e);
303301
}
304302
return job;
305303
}

hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/WALCellCodec.java

+1-12
Original file line numberDiff line numberDiff line change
@@ -82,21 +82,10 @@ public WALCellCodec(Configuration conf, CompressionContext compression) {
8282
this.compression = compression;
8383
}
8484

85-
static String getWALCellCodecClass(Configuration conf) {
85+
public static String getWALCellCodecClass(Configuration conf) {
8686
return conf.get(WAL_CELL_CODEC_CLASS_KEY, WALCellCodec.class.getName());
8787
}
8888

89-
/**
90-
* Retrieves custom WAL codec class name
91-
* @param conf the Configuration from which WAL codec class is to be retrieved
92-
* @return name of custom WAL codec class. If default codec is specified, return null
93-
*/
94-
public static String getNonDefaultWALCellCodecClass(Configuration conf) {
95-
String defaultCodec = WALCellCodec.class.getName();
96-
String codec = conf.get(WAL_CELL_CODEC_CLASS_KEY, defaultCodec);
97-
return !defaultCodec.equals(codec) ? codec : null;
98-
}
99-
10089
/**
10190
* Create and setup a {@link WALCellCodec} from the {@code cellCodecClsName} and
10291
* CompressionContext, if {@code cellCodecClsName} is specified.

0 commit comments

Comments
 (0)