Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Turtle, Graphalytics, and old SNB-related code #161

Merged
merged 4 commits into from
Apr 26, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,4 @@ datagen_output/

# configuration file
params.ini
dependency-reduced-pom.xml
104 changes: 0 additions & 104 deletions graphalytics-generate-old.sh

This file was deleted.

5 changes: 0 additions & 5 deletions params-graphalytics.ini

This file was deleted.

63 changes: 0 additions & 63 deletions snb-generate-old.sh

This file was deleted.

1 change: 0 additions & 1 deletion src/main/java/ldbc/snb/datagen/DatagenMode.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,5 @@
public enum DatagenMode {
INTERACTIVE,
BI,
GRAPHALYTICS,
RAW_DATA
}
34 changes: 0 additions & 34 deletions src/main/java/ldbc/snb/datagen/DatagenParams.java
Original file line number Diff line number Diff line change
Expand Up @@ -329,12 +329,6 @@ public static void readConf(LdbcConfiguration conf) {
dateFormat = conf.get("generator.StringDate.dateFormat");
endYear = startYear + numYears;

if (conf.get("ldbc.snb.datagen.generator.gscale") != null) {
double scale = conf.getDouble("ldbc.snb.datagen.generator.gscale", 6.0);
DegreeDistribution degreeDistribution = getDegreeDistribution();
degreeDistribution.initialize(conf);
numPersons = findNumPersonsFromGraphalyticsScale(degreeDistribution, scale);
}
System.out.println(" ... Datagen Mode " + datagenMode);
System.out.println(" ... Num Persons " + numPersons);
System.out.println(" ... Start Year " + startYear);
Expand All @@ -357,9 +351,6 @@ public static DatagenMode getDatagenMode() {
case "bi":
mode = BI;
break;
case "graphalytics":
mode = GRAPHALYTICS;
break;
case "rawdata":
mode = RAW_DATA;
break;
Expand All @@ -375,31 +366,6 @@ private static double scale(long numPersons, double mean) {
return Math.log10(mean * numPersons / 2 + numPersons);
}

private static long findNumPersonsFromGraphalyticsScale(DegreeDistribution distribution, double scale) {

long numPersonsMin = 1000000;
while (scale(numPersonsMin, distribution.mean(numPersonsMin)) > scale)
numPersonsMin /= 2;

long numPersonsMax = 1000000;
while (scale(numPersonsMax, distribution.mean(numPersonsMax)) < scale)
numPersonsMax *= 2;

long currentNumPersons = (numPersonsMax - numPersonsMin) / 2 + numPersonsMin;
double currentScale = scale(currentNumPersons, distribution.mean(currentNumPersons));
while (Math.abs(currentScale - scale) / scale > 0.001) {
if (currentScale < scale)
numPersonsMin = currentNumPersons;
else
numPersonsMax = currentNumPersons;

currentNumPersons = (numPersonsMax - numPersonsMin) / 2 + numPersonsMin;
currentScale = scale(currentNumPersons, distribution.mean(currentNumPersons));
System.out.println(numPersonsMin + " " + numPersonsMax + " " + currentNumPersons + " " + currentScale);
}
return currentNumPersons;
}

//TODO: add remaining degree distributions
public static DegreeDistribution getDegreeDistribution() {

Expand Down
18 changes: 8 additions & 10 deletions src/main/java/ldbc/snb/datagen/hadoop/LdbcDatagen.java
Original file line number Diff line number Diff line change
Expand Up @@ -114,16 +114,14 @@ private void copyToLocal(FileSystem fs, String pathString) throws Exception {

private long personActivityJob(String hadoopPrefix, Configuration conf, FileSystem fs) throws Exception {
long startPersonActivity = System.currentTimeMillis();
if (DatagenParams.getDatagenMode() != GRAPHALYTICS) {
printProgress("Generating and serializing person activity");
HadoopPersonActivityGenerator activityGenerator = new HadoopPersonActivityGenerator(conf);
activityGenerator.run(hadoopPrefix + "/mergedPersons");
for (int i = 0; i < HadoopConfiguration.getNumThreads(conf); ++i) {
if (i < (int) Math.ceil(DatagenParams.numPersons / (double) DatagenParams.blockSize)) { // i<number of blocks
copyToLocal(fs, HadoopConfiguration.getHadoopDir(conf) + "/m" + i + "personFactors.txt");
copyToLocal(fs, HadoopConfiguration.getHadoopDir(conf) + "/m" + i + "activityFactors.txt");
copyToLocal(fs, HadoopConfiguration.getHadoopDir(conf) + "/m0friendList" + i + ".csv");
}
printProgress("Generating and serializing person activity");
HadoopPersonActivityGenerator activityGenerator = new HadoopPersonActivityGenerator(conf);
activityGenerator.run(hadoopPrefix + "/mergedPersons");
for (int i = 0; i < HadoopConfiguration.getNumThreads(conf); ++i) {
if (i < (int) Math.ceil(DatagenParams.numPersons / (double) DatagenParams.blockSize)) { // i<number of blocks
copyToLocal(fs, HadoopConfiguration.getHadoopDir(conf) + "/m" + i + "personFactors.txt");
copyToLocal(fs, HadoopConfiguration.getHadoopDir(conf) + "/m" + i + "activityFactors.txt");
copyToLocal(fs, HadoopConfiguration.getHadoopDir(conf) + "/m0friendList" + i + ".csv");
}
}
return (System.currentTimeMillis() - startPersonActivity);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public void reduce(BlockKey key, Iterable<Person> valueSet, Context context) thr

for (Person p : valueSet) {

if (DatagenParams.getDatagenMode() == DatagenMode.RAW_DATA || DatagenParams.getDatagenMode() == DatagenMode.GRAPHALYTICS) {
if (DatagenParams.getDatagenMode() == DatagenMode.RAW_DATA) {
dynamicPersonSerializer.export(p);
for (Knows k : p.getKnows()) {
dynamicPersonSerializer.export(p, k);
Expand Down
Loading