mirror of https://github.com/apache/druid.git
fix NPE in IndexGeneratorJob (#4371)
* fix NPE in IndexGeneratorJob * address review comment * review comments
This commit is contained in:
parent
2d15215cd0
commit
4ace65a2af
|
@ -454,7 +454,7 @@ public class IndexGeneratorJob implements Jobby
|
||||||
final ByteBuffer bytes = ByteBuffer.wrap(bytesWritable.getBytes());
|
final ByteBuffer bytes = ByteBuffer.wrap(bytesWritable.getBytes());
|
||||||
bytes.position(4); // Skip length added by SortableBytes
|
bytes.position(4); // Skip length added by SortableBytes
|
||||||
int shardNum = bytes.getInt();
|
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;
|
return shardNum % numPartitions;
|
||||||
} else {
|
} else {
|
||||||
if (shardNum >= numPartitions) {
|
if (shardNum >= numPartitions) {
|
||||||
|
|
Loading…
Reference in New Issue