Skip to content

Commit 749c234

Browse files
committed
Removed unnecessary tests (legacy code)
1 parent 8bb7054 commit 749c234

File tree

4 files changed

+118
-843
lines changed

4 files changed

+118
-843
lines changed
Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
/*
2+
* Copyright (c) 2013 LDBC
3+
* Linked Data Benchmark Council (http://ldbc.eu)
4+
*
5+
* This file is part of ldbc_socialnet_dbgen.
6+
*
7+
* ldbc_socialnet_dbgen is free software: you can redistribute it and/or modify
8+
* it under the terms of the GNU General Public License as published by
9+
* the Free Software Foundation, either version 3 of the License, or
10+
* (at your option) any later version.
11+
*
12+
* ldbc_socialnet_dbgen is distributed in the hope that it will be useful,
13+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+
* GNU General Public License for more details.
16+
*
17+
* You should have received a copy of the GNU General Public License
18+
* along with ldbc_socialnet_dbgen. If not, see <http://www.gnu.org/licenses/>.
19+
*
20+
* Copyright (C) 2011 OpenLink Software <[email protected]>
21+
* All Rights Reserved.
22+
*
23+
* This program is free software; you can redistribute it and/or modify
24+
* it under the terms of the GNU General Public License as published by
25+
* the Free Software Foundation; only Version 2 of the License dated
26+
* June 1991.
27+
*
28+
* This program is distributed in the hope that it will be useful,
29+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
30+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
31+
* GNU General Public License for more details.
32+
*
33+
* You should have received a copy of the GNU General Public License
34+
* along with this program; if not, write to the Free Software
35+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
36+
*/
37+
38+
39+
package ldbc.snb.datagen.serializer.graphalytics;
40+
41+
import ldbc.snb.datagen.objects.Knows;
42+
import ldbc.snb.datagen.objects.Person;
43+
import ldbc.snb.datagen.objects.StudyAt;
44+
import ldbc.snb.datagen.objects.WorkAt;
45+
import ldbc.snb.datagen.serializer.HDFSCSVWriter;
46+
import ldbc.snb.datagen.serializer.PersonSerializer;
47+
import org.apache.hadoop.conf.Configuration;
48+
49+
import java.util.ArrayList;
50+
51+
public class CSVPersonSerializer extends PersonSerializer {
52+
53+
private HDFSCSVWriter [] writers;
54+
private String separator_ = " ";
55+
56+
private enum FileNames {
57+
PERSON_KNOWS_PERSON("person_knows_person");
58+
59+
private final String name;
60+
61+
private FileNames( String name ) {
62+
this.name = name;
63+
}
64+
public String toString() {
65+
return name;
66+
}
67+
}
68+
69+
public CSVPersonSerializer() {
70+
}
71+
72+
public void initialize(Configuration conf, int reducerId) {
73+
int numFiles = FileNames.values().length;
74+
writers = new HDFSCSVWriter[numFiles];
75+
for( int i = 0; i < numFiles; ++i) {
76+
writers[i] = new HDFSCSVWriter(conf.get("ldbc.snb.datagen.serializer.socialNetworkDir"), FileNames.values()[i].toString()+"_"+reducerId,conf.getInt("ldbc.snb.datagen.numPartitions",1),conf.getBoolean("ldbc.snb.datagen.serializer.compressed",false),"|", conf.getBoolean("ldbc.snb.datagen.serializer.endlineSeparator",false));
77+
}
78+
79+
ArrayList<String> arguments = new ArrayList<String>();
80+
arguments.clear();
81+
arguments.add("Person.id");
82+
arguments.add("Person.id");
83+
writers[FileNames.PERSON_KNOWS_PERSON.ordinal()].writeEntry(arguments);
84+
85+
}
86+
87+
@Override
88+
public void close() {
89+
int numFiles = FileNames.values().length;
90+
for(int i = 0; i < numFiles; ++i) {
91+
writers[i].close();
92+
}
93+
}
94+
95+
@Override
96+
protected void serialize(final Person p) {
97+
98+
}
99+
100+
@Override
101+
protected void serialize(final StudyAt studyAt) {
102+
}
103+
104+
@Override
105+
protected void serialize(final WorkAt workAt) {
106+
}
107+
108+
protected void serialize(final Person p, Knows knows) {
109+
ArrayList<String> arguments = new ArrayList<String>();
110+
arguments.add(Long.toString(p.accountId()));
111+
arguments.add(Long.toString(knows.to().accountId()));
112+
writers[FileNames.PERSON_KNOWS_PERSON.ordinal()].writeEntry(arguments);
113+
}
114+
115+
public void reset() {
116+
117+
}
118+
}

src/test/java/ldbc/snb/datagen/test/BTERTest.java

Lines changed: 0 additions & 250 deletions
This file was deleted.

0 commit comments

Comments
 (0)