Skip to content

Commit 7206f5d

Browse files
authored
Added CompositeMergeForeign family of serializers (#61)
* Added CompositeMergeForeign family of serializers
1 parent 020e839 commit 7206f5d

File tree

4 files changed

+410
-0
lines changed

4 files changed

+410
-0
lines changed

params-composite-foreign-key.ini

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
ldbc.snb.datagen.generator.scaleFactor:snb.interactive.1
2+
3+
ldbc.snb.datagen.serializer.personSerializer:ldbc.snb.datagen.serializer.snb.interactive.CSVCompositeMergeForeignPersonSerializer
4+
ldbc.snb.datagen.serializer.invariantSerializer:ldbc.snb.datagen.serializer.snb.interactive.CSVCompositeMergeForeignInvariantSerializer
5+
ldbc.snb.datagen.serializer.personActivitySerializer:ldbc.snb.datagen.serializer.snb.interactive.CSVCompositeMergeForeignPersonActivitySerializer
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
/*
2+
Copyright (c) 2013 LDBC
3+
Linked Data Benchmark Council (http://www.ldbcouncil.org)
4+
5+
This file is part of ldbc_snb_datagen.
6+
7+
ldbc_snb_datagen 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_snb_datagen 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_snb_datagen. 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+
package ldbc.snb.datagen.serializer.snb.interactive;
37+
38+
import ldbc.snb.datagen.objects.Organization;
39+
import ldbc.snb.datagen.objects.Place;
40+
import ldbc.snb.datagen.objects.Tag;
41+
import ldbc.snb.datagen.objects.TagClass;
42+
import ldbc.snb.datagen.serializer.InvariantSerializer;
43+
import org.apache.hadoop.conf.Configuration;
44+
45+
import java.io.IOException;
46+
47+
/**
48+
* Created by aprat on 17/02/15.
49+
*/
50+
public class CSVCompositeMergeForeignInvariantSerializer extends InvariantSerializer {
51+
52+
private CSVMergeForeignInvariantSerializer invariantSerializer = new CSVMergeForeignInvariantSerializer();
53+
54+
@Override
55+
public void initialize(Configuration conf, int reducerId) throws IOException {
56+
invariantSerializer.initialize(conf, reducerId);
57+
}
58+
59+
@Override
60+
public void close() {
61+
invariantSerializer.close();
62+
}
63+
64+
@Override
65+
protected void serialize(final Place place) {
66+
invariantSerializer.serialize(place);
67+
}
68+
69+
@Override
70+
protected void serialize(final Organization organization) {
71+
invariantSerializer.serialize(organization);
72+
}
73+
74+
@Override
75+
protected void serialize(final TagClass tagClass) {
76+
invariantSerializer.serialize(tagClass);
77+
}
78+
79+
@Override
80+
protected void serialize(final Tag tag) {
81+
invariantSerializer.serialize(tag);
82+
}
83+
84+
@Override
85+
public void reset() {
86+
// Intentionally left empty
87+
88+
}
89+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
/*
2+
Copyright (c) 2013 LDBC
3+
Linked Data Benchmark Council (http://www.ldbcouncil.org)
4+
5+
This file is part of ldbc_snb_datagen.
6+
7+
ldbc_snb_datagen 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_snb_datagen 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_snb_datagen. 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+
package ldbc.snb.datagen.serializer.snb.interactive;
37+
38+
import ldbc.snb.datagen.objects.*;
39+
import ldbc.snb.datagen.serializer.PersonActivitySerializer;
40+
import org.apache.hadoop.conf.Configuration;
41+
42+
import java.io.IOException;
43+
44+
/**
45+
* Created by aprat on 17/02/15.
46+
*/
47+
public class CSVCompositeMergeForeignPersonActivitySerializer extends PersonActivitySerializer {
48+
49+
private CSVMergeForeignPersonActivitySerializer activitySerializer = new CSVMergeForeignPersonActivitySerializer();
50+
51+
@Override
52+
public void initialize(Configuration conf, int reducerId) throws IOException {
53+
activitySerializer.initialize(conf, reducerId);
54+
}
55+
56+
@Override
57+
public void close() {
58+
activitySerializer.close();
59+
}
60+
61+
@Override
62+
protected void serialize(final Forum forum) {
63+
activitySerializer.serialize(forum);
64+
}
65+
66+
@Override
67+
protected void serialize(final Post post) {
68+
activitySerializer.serialize(post);
69+
}
70+
71+
@Override
72+
protected void serialize(final Comment comment) {
73+
activitySerializer.serialize(comment);
74+
}
75+
76+
@Override
77+
protected void serialize(final Photo photo) {
78+
activitySerializer.serialize(photo);
79+
}
80+
81+
@Override
82+
protected void serialize(final ForumMembership membership) {
83+
activitySerializer.serialize(membership);
84+
}
85+
86+
@Override
87+
protected void serialize(final Like like) {
88+
activitySerializer.serialize(like);
89+
}
90+
91+
@Override
92+
public void reset() {
93+
// Intentionally left empty
94+
}
95+
}

0 commit comments

Comments
 (0)