Skip to content

Commit

Permalink
fix NPE in IndexGeneratorJob (apache#4371)
Browse files Browse the repository at this point in the history
* fix NPE in IndexGeneratorJob

* address review comment

* review comments
  • Loading branch information
himanshug authored and b-slim committed Jun 7, 2017
1 parent 2d15215 commit 4ace65a
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ public int getPartition(BytesWritable bytesWritable, Writable value, int numPart
final ByteBuffer bytes = ByteBuffer.wrap(bytesWritable.getBytes());
bytes.position(4); // Skip length added by SortableBytes
int shardNum = bytes.getInt();
if (config.get("mapred.job.tracker").equals("local")) {
if ("local".equals(config.get("mapreduce.jobtracker.address")) || "local".equals(config.get("mapred.job.tracker"))) {
return shardNum % numPartitions;
} else {
if (shardNum >= numPartitions) {
Expand Down

0 comments on commit 4ace65a

Please sign in to comment.