File tree Expand file tree Collapse file tree 4 files changed +36
-6
lines changed
src/main/java/ldbc/snb/datagen Expand file tree Collapse file tree 4 files changed +36
-6
lines changed Original file line number Diff line number Diff line change @@ -162,19 +162,19 @@ public int runGenerateJob(Configuration conf) throws Exception {
162
162
List <String > forumStreamsFileNames = new ArrayList <String >();
163
163
for ( int i = 0 ; i < DatagenParams .numThreads ; ++i ) {
164
164
int numPartitions = conf .getInt ("ldbc.snb.datagen.serializer.numUpdatePartitions" , 1 );
165
- if ( i < numBlocks ) {
165
+ // if( i < numBlocks ) {
166
166
for (int j = 0 ; j < numPartitions ; ++j ) {
167
167
personStreamsFileNames .add (DatagenParams .hadoopDir + "/temp_updateStream_person_" + i + "_" + j );
168
168
if ( conf .getBoolean ("ldbc.snb.datagen.generator.activity" , false )) {
169
169
forumStreamsFileNames .add (DatagenParams .hadoopDir + "/temp_updateStream_forum_" + i + "_" + j );
170
170
}
171
171
}
172
- } else {
172
+ /* } else {
173
173
for (int j = 0; j < numPartitions; ++j) {
174
174
fs.delete(new Path(DatagenParams.hadoopDir + "/temp_updateStream_person_" + i + "_" + j), true);
175
175
fs.delete(new Path(DatagenParams.hadoopDir + "/temp_updateStream_forum_" + i + "_" + j), true);
176
176
}
177
- }
177
+ } */
178
178
}
179
179
HadoopUpdateStreamSorterAndSerializer updateSorterAndSerializer = new HadoopUpdateStreamSorterAndSerializer (conf );
180
180
updateSorterAndSerializer .run (personStreamsFileNames , "person" );
Original file line number Diff line number Diff line change 13
13
*/
14
14
public class Person implements Writable {
15
15
16
+ public static interface PersonSimilarity {
17
+ public double Similarity (Person personA , Person personB );
18
+ }
19
+
16
20
public static class PersonSummary implements Writable {
17
21
private long accountId_ ;
18
22
private long creationDate_ ;
@@ -462,10 +466,9 @@ public void write(DataOutput arg0) throws IOException {
462
466
arg0 .writeLong (classYear_ );
463
467
}
464
468
469
+ public static PersonSimilarity personSimilarity ;
470
+
465
471
public static float Similarity (Person personA , Person personB ) {
466
- int zorderA = Dictionaries .places .getZorderID (personA .countryId ());
467
- int zorderB = Dictionaries .places .getZorderID (personB .countryId ());
468
- return 1.0f - (Math .abs (zorderA - zorderB ) / 256.0f );
469
472
}
470
473
471
474
}
Original file line number Diff line number Diff line change
1
+ package ldbc .snb .datagen .objects .similarity ;
2
+
3
+ import ldbc .snb .datagen .dictionary .Dictionaries ;
4
+ import ldbc .snb .datagen .objects .Person ;
5
+
6
+ /**
7
+ * Created by aprat on 22/01/16.
8
+ */
9
+ public class GeoDistanceSimilarity implements Person .PersonSimilarity {
10
+ public double Similarity (Person personA , Person personB ) {
11
+ int zorderA = Dictionaries .places .getZorderID (personA .countryId ());
12
+ int zorderB = Dictionaries .places .getZorderID (personB .countryId ());
13
+ return 1.0f - (Math .abs (zorderA - zorderB ) / 256.0f );
14
+ }
15
+ }
Original file line number Diff line number Diff line change
1
+ package ldbc .snb .datagen .objects .similarity ;
2
+
3
+ import ldbc .snb .datagen .objects .Person ;
4
+
5
+ /**
6
+ * Created by aprat on 22/01/16.
7
+ */
8
+ public class InterestsSimilarity implements Person .PersonSimilarity {
9
+ public double Similarity (Person personA , Person personB ) {
10
+ return 0 ;
11
+ }
12
+ }
You can’t perform that action at this time.
0 commit comments