Skip to content

Commit cd0f974

Browse files
committed
Fixed bug when generating update streams with more than one thread
1 parent e011b51 commit cd0f974

File tree

1 file changed

+16
-13
lines changed

1 file changed

+16
-13
lines changed

src/main/java/ldbc/socialnet/dbgen/generator/MRGenerateUsers.java

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -601,19 +601,22 @@ public int runGenerateJob(Configuration conf) throws Exception {
601601
if(conf.getBoolean("updateStreams",false)) {
602602
Properties properties = new Properties();
603603
properties.load(fs.open(new Path(conf.get("outputDir") + "/social_network/updateStream_" + i + "_" + j + "_person.properties")));
604-
Long auxMin = Long.parseLong(properties.getProperty("min_write_event_start_time"));
605-
min = auxMin < min ? auxMin : min;
606-
Long auxMax = Long.parseLong(properties.getProperty("max_write_event_start_time"));
607-
max = auxMax > max ? auxMax : max;
608-
numEvents += Long.parseLong(properties.getProperty("num_events"));
609-
610-
properties.load(fs.open(new Path(conf.get("outputDir") + "/social_network/updateStream_" + i + "_" + j + "_forum.properties")));
611-
612-
auxMin = Long.parseLong(properties.getProperty("min_write_event_start_time"));
613-
min = auxMin < min ? auxMin : min;
614-
auxMax = Long.parseLong(properties.getProperty("max_write_event_start_time"));
615-
max = auxMax > max ? auxMax : max;
616-
numEvents += Long.parseLong(properties.getProperty("num_events"));
604+
if( properties.getProperty("min_write_event_start_time") != null ) {
605+
Long auxMin = Long.parseLong(properties.getProperty("min_write_event_start_time"));
606+
min = auxMin < min ? auxMin : min;
607+
Long auxMax = Long.parseLong(properties.getProperty("max_write_event_start_time"));
608+
max = auxMax > max ? auxMax : max;
609+
numEvents += Long.parseLong(properties.getProperty("num_events"));
610+
}
611+
612+
if( properties.getProperty("min_write_event_start_time") != null ) {
613+
properties.load(fs.open(new Path(conf.get("outputDir") + "/social_network/updateStream_" + i + "_" + j + "_forum.properties")));
614+
Long auxMin = Long.parseLong(properties.getProperty("min_write_event_start_time"));
615+
min = auxMin < min ? auxMin : min;
616+
Long auxMax = Long.parseLong(properties.getProperty("max_write_event_start_time"));
617+
max = auxMax > max ? auxMax : max;
618+
numEvents += Long.parseLong(properties.getProperty("num_events"));
619+
}
617620

618621
fs.delete(new Path(conf.get("outputDir") + "/social_network/updateStream_" + i + "_" + j + "_person.properties"),true);
619622
fs.delete(new Path(conf.get("outputDir") + "/social_network/updateStream_" + i + "_" + j + "_forum.properties"),true);

0 commit comments

Comments
 (0)