Skip to content

Commit 049de9c

Browse files
committed
Fixed bug with update stream generation for num threads greater than 1
1 parent cd0f974 commit 049de9c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
import ldbc.socialnet.dbgen.util.*;
4747

4848
import org.apache.hadoop.conf.Configuration;
49+
import org.apache.hadoop.fs.FSDataInputStream;
4950
import org.apache.hadoop.fs.FSDataOutputStream;
5051
import org.apache.hadoop.fs.FileSystem;
5152
import org.apache.hadoop.fs.Path;
@@ -600,7 +601,8 @@ public int runGenerateJob(Configuration conf) throws Exception {
600601

601602
if(conf.getBoolean("updateStreams",false)) {
602603
Properties properties = new Properties();
603-
properties.load(fs.open(new Path(conf.get("outputDir") + "/social_network/updateStream_" + i + "_" + j + "_person.properties")));
604+
FSDataInputStream file = fs.open(new Path(conf.get("outputDir") + "/social_network/updateStream_" + i + "_" + j + "_person.properties"));
605+
properties.load(file);
604606
if( properties.getProperty("min_write_event_start_time") != null ) {
605607
Long auxMin = Long.parseLong(properties.getProperty("min_write_event_start_time"));
606608
min = auxMin < min ? auxMin : min;
@@ -617,7 +619,7 @@ public int runGenerateJob(Configuration conf) throws Exception {
617619
max = auxMax > max ? auxMax : max;
618620
numEvents += Long.parseLong(properties.getProperty("num_events"));
619621
}
620-
622+
file.close();
621623
fs.delete(new Path(conf.get("outputDir") + "/social_network/updateStream_" + i + "_" + j + "_person.properties"),true);
622624
fs.delete(new Path(conf.get("outputDir") + "/social_network/updateStream_" + i + "_" + j + "_forum.properties"),true);
623625
}

0 commit comments

Comments
 (0)