Skip to content
This repository has been archived by the owner on Oct 30, 2023. It is now read-only.

Addition of Apache Gora and Rexster modules #9

Open
wants to merge 2 commits into
base: release-1.0
Choose a base branch
from
Open
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
12 changes: 12 additions & 0 deletions giraph-gora/conf/edge.avsc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"type": "record",
"name": "GEdge",
"namespace": "org.apache.giraph.gora.generated",
"fields" : [
{"name": "edgeId", "type": "string"},
{"name": "edgeWeight", "type": "float"},
{"name": "vertexInId", "type": "string"},
{"name": "vertexOutId", "type": "string"},
{"name": "label", "type": "string"}
]
}
42 changes: 42 additions & 0 deletions giraph-gora/conf/gora-cassandra-mapping.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="UTF-8"?>

<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

<gora-orm>

<keyspace name="graphGiraph" host="localhost" cluster="Test Cluster">
<family name="vertices"/>
</keyspace>

<class name="org.apache.giraph.io.gora.generated.GVertex" keyClass="java.lang.String" keyspace="graphGiraph">
<field name="vertexId" family="vertices" qualifier="vertexId"/>
<field name="value" family="vertices" qualifier="value"/>
<field name="edges" family="vertices" qualifier="edges"/>
</class>

<keyspace name="graphGiraphResults" host="localhost" cluster="Test Cluster">
<family name="vertices"/>
</keyspace>

<class name="org.apache.giraph.io.gora.generated.GVertexResult" keyClass="java.lang.String" keyspace="graphGiraphResults">
<field name="vertexId" family="vertices" qualifier="vertexId"/>
<field name="value" family="vertices" qualifier="value"/>
<field name="edges" family="vertices" qualifier="edges"/>
</class>

</gora-orm>
63 changes: 63 additions & 0 deletions giraph-gora/conf/gora-hbase-mapping.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
<?xml version="1.0" encoding="UTF-8"?>

<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

<gora-orm>

<table name="graphGiraph">
<family name="vertices"/>
</table>

<class name="org.apache.giraph.io.gora.generated.GVertex" keyClass="java.lang.String" table="graphGiraph">
<field name="vertexId" family="vertices" qualifier="vertexId"/>
<field name="value" family="vertices" qualifier="value"/>
<field name="edges" family="vertices" qualifier="edges"/>
</class>

<table name="graphGiraphResults">
<family name="vertices"/>
</table>

<class name="org.apache.giraph.io.gora.generated.GVertexResult" keyClass="java.lang.String" table="graphGiraphResults">
<field name="vertexId" family="vertices" qualifier="vertexId"/>
<field name="value" family="vertices" qualifier="value"/>
<field name="edges" family="vertices" qualifier="edges"/>
</class>

<table name="graphGiraphEdges">
<family name="edges"/>
</table>
<class name="org.apache.giraph.io.gora.generated.GEdge" keyClass="java.lang.String" table="graphGiraphEdges">
<field name="edgeId" family="edges" qualifier="edgeId"/>
<field name="edgeWeight" family="edges" qualifier="edgeWeight"/>
<field name="label" family="edges" qualifier="label"/>
<field name="vertexInId" family="edges" qualifier="vertexInId"/>
<field name="vertexOutId" family="edges" qualifier="vertexOutId"/>
</class>

<table name="graphGiraphResultEdges">
<family name="edges"/>
</table>
<class name="org.apache.giraph.io.gora.generated.GEdgeResult" keyClass="java.lang.String" table="graphGiraphResultEdges">
<field name="edgeId" family="edges" qualifier="edgeId"/>
<field name="edgeWeight" family="edges" qualifier="edgeWeight"/>
<field name="label" family="edges" qualifier="label"/>
<field name="vertexInId" family="edges" qualifier="vertexInId"/>
<field name="vertexOutId" family="edges" qualifier="vertexOutId"/>
</class>
</gora-orm>
29 changes: 29 additions & 0 deletions giraph-gora/conf/gora.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# FOR HBASE DATASTORE
gora.datastore.default=org.apache.gora.hbase.store.HBaseStore

# FOR CASSANDRA DATASTORE
#gora.datastore.default=org.apache.gora.cassandra.CassandraStore

# FOR DYNAMO DATASTORE
#gora.datastore.default=org.apache.gora.dynamodb.store.DynamoDBStore
#gora.datastore.autocreateschema=true

#preferred.schema.name=person
#gora.dynamodb.client=sync
#gora.dynamodb.consistent.reads=true
#gora.dynamodb.endpoint=http://dynamodb.us-east-1.amazonaws.com/
18 changes: 18 additions & 0 deletions giraph-gora/conf/vertex.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"type": "record",
"name": "Vertex",
"namespace": "org.apache.giraph.gora.generated",
"fields" : [
{"name": "vertexId", "type": "long"},
{"name": "value", "type": "float"},
{"name": "edges", "type": {"type":"array", "items": {
"name": "Edge",
"type": "record",
"namespace": "org.apache.giraph.gora.generated",
"fields": [
{"name": "vertexId", "type": "long"},
{"name": "edgeValue", "type": "float"}
]
}}}
]
}
4 changes: 4 additions & 0 deletions giraph-gora/conf/zoo.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
tickTime=20000
dataDir=/var/zookeeper
clientPort=2181
maxClientCnxns=300
31 changes: 31 additions & 0 deletions giraph-gora/executeCompile.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#! /bin/bash
mvn clean compile package -DskipTests
cp conf/gora-cassandra-mapping.xml target/.
cp conf/gora-hbase-mapping.xml target/.
cp conf/gora.properties target/.
cp conf/zoo.cfg target/.

#/Users/keshann/Documents/workspace/workspaceGiraph/giraph/giraph-gora/conf/zoo.cfg

###################################
echo "[INFO] Initializing classpath"
###################################
export HADOOP_CLASSPATH=/Users/keshann/Documents/workspace/workspaceGiraph/giraph2/giraph-examples/target/giraph-examples-1.1.0-SNAPSHOT-for-hadoop-0.20.203.0-jar-with-dependencies.jar:/Users/keshann/Documents/workspace/workspaceGiraph/giraph2/giraph-gora/target/giraph-gora-1.1.0-SNAPSHOT-jar-with-dependencies.jar:/Users/keshann/Documents/workspace/workspaceGiraph/gora-trunk99/gora-hbase/lib/*


###################################
echo "[INFO] Cleaning up"
###################################
/Users/keshann/Documents/Apache/Hadoop/hadoop-0.20.203.0/bin/hadoop fs -rmr shortestPathsOutputGraph

###################################
echo "[INFO] Executing Hadoop"
###################################
#/Users/keshann/Documents/Apache/Hadoop/hadoop-0.20.203.0/bin/hadoop jar /Users/keshann/Documents/workspace/workspaceGiraph/giraph/giraph-examples/target/giraph-examples-1.1.0-SNAPSHOT-for-hadoop-0.20.203.0-jar-with-dependencies.jar org.apache.giraph.GiraphRunner -files /Users/keshann/Documents/workspace/workspaceGiraph/giraph/giraph-gora/target/gora-cassandra-mapping.xml,/Users/keshann/Documents/workspace/workspaceGiraph/giraph/giraph-gora/target/gora.properties,/Users/keshann/Documents/Apache/HBase/hbase-0.90.4/conf/hbase-site.xml,/Users/keshann/Documents/workspace/workspaceGiraph/giraph/giraph-gora/target/gora-hbase-mapping.xml -Dgiraph.metrics.enable=true -Dio.serializations=org.apache.hadoop.io.serializer.WritableSerialization,org.apache.hadoop.io.serializer.JavaSerialization -Dgiraph.gora.datastore.class=org.apache.gora.hbase.store.HBaseStore -Dgiraph.gora.key.class=java.lang.String -Dgiraph.gora.persistent.class=org.apache.giraph.io.gora.generated.GVertex -Dgiraph.gora.start.key=1 -Dgiraph.gora.end.key=101 -Dgiraph.gora.keys.factory.class=org.apache.giraph.io.gora.utils.DefaultKeyFactory -Dgiraph.gora.output.datastore.class=org.apache.gora.hbase.store.HBaseStore -Dgiraph.gora.output.key.class=java.lang.String -Dgiraph.gora.output.persistent.class=org.apache.giraph.io.gora.generated.GVertex -libjars /Users/keshann/Documents/workspace/workspaceGiraph/giraph/giraph-gora/target/giraph-gora-1.1.0-SNAPSHOT-jar-with-dependencies.jar,/Users/keshann/Documents/workspace/workspaceGiraph/gora-trunk99/gora-hbase/target/gora-hbase-0.3.jar,/Users/keshann/Documents/workspace/workspaceGiraph/gora-trunk99/gora-hbase/lib/hbase-0.90.4.jar org.apache.giraph.examples.SimpleShortestPathsComputation -vif org.apache.giraph.io.gora.GoraGVertexVertexInputFormat -vof org.apache.giraph.io.gora.GoraGVertexVertexOutputFormat -op shortestPathsOutputGraph -w 1

/Users/keshann/Documents/Apache/Hadoop/hadoop-0.20.203.0/bin/hadoop jar /Users/keshann/Documents/workspace/workspaceGiraph/giraph2/giraph-examples/target/giraph-examples-1.1.0-SNAPSHOT-for-hadoop-0.20.203.0-jar-with-dependencies.jar org.apache.giraph.GiraphRunner -files /Users/keshann/Documents/workspace/workspaceGiraph/gora-trunk99/gora-hbase/lib/jackson-core-asl-1.6.9.jar,/Users/keshann/Documents/workspace/workspaceGiraph/gora-trunk99/gora-hbase/lib/jackson-jaxrs-1.5.5.jar,/Users/keshann/Documents/workspace/workspaceGiraph/gora-trunk99/gora-hbase/lib/jackson-mapper-asl-1.6.9.jar,/Users/keshann/Documents/workspace/workspaceGiraph/gora-trunk99/gora-hbase/lib/jackson-xc-1.5.5.jar,/Users/keshann/Documents/workspace/workspaceGiraph/giraph2/giraph-gora/target/gora-cassandra-mapping.xml,/Users/keshann/Documents/workspace/workspaceGiraph/giraph2/giraph-gora/target/gora.properties,/Users/keshann/Documents/Apache/HBase/hbase-0.90.4/conf/hbase-site.xml,/Users/keshann/Documents/workspace/workspaceGiraph/giraph2/giraph-gora/target/gora-hbase-mapping.xml -Dgiraph.metrics.enable=true -Dio.serializations=org.apache.hadoop.io.serializer.WritableSerialization,org.apache.hadoop.io.serializer.JavaSerialization -Dgiraph.gora.datastore.class=org.apache.gora.hbase.store.HBaseStore -Dgiraph.gora.key.class=java.lang.String -Dgiraph.gora.persistent.class=org.apache.giraph.io.gora.generated.GVertex -Dgiraph.gora.keys.factory.class=org.apache.giraph.io.gora.utils.DefaultKeyFactory -Dgiraph.gora.output.datastore.class=org.apache.gora.hbase.store.HBaseStore -Dgiraph.gora.output.key.class=java.lang.String -Dgiraph.gora.output.persistent.class=org.apache.giraph.io.gora.generated.GVertexResult -libjars /Users/keshann/Documents/workspace/workspaceGiraph/giraph2/giraph-gora/target/giraph-gora-1.1.0-SNAPSHOT-jar-with-dependencies.jar,/Users/keshann/Documents/workspace/workspaceGiraph/gora-trunk99/gora-hbase/target/gora-hbase-0.3.jar,/Users/keshann/Documents/workspace/workspaceGiraph/gora-trunk99/gora-hbase/lib/hbase-0.90.4.jar org.apache.giraph.examples.SimpleShortestPathsComputation -vif org.apache.giraph.io.gora.GoraGVertexVertexInputFormat -vof org.apache.giraph.io.gora.GoraGVertexVertexOutputFormat -op shortestPathsOutputGraph -w 1

###################################
#echo "[INFO] Cleaning up"
###################################
#./Users/keshann/Documents/Apache/Hadoop/hadoop-0.20.203.0/bin/hadoop fs -rmr shortestPathsOutputGraph
130 changes: 130 additions & 0 deletions giraph-gora/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.apache.giraph</groupId>
<artifactId>giraph-parent</artifactId>
<version>1.1.0-SNAPSHOT</version>
</parent>
<artifactId>giraph-gora</artifactId>
<packaging>jar</packaging>

<name>Apache Giraph Gora I/O</name>
<url>http://gora.apache.org/giraph-gora/</url>
<description>Giraph Gora input/output classes</description>

<properties>
<top.dir>${project.basedir}/..</top.dir>
</properties>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<configuration>
<siteDirectory>${project.basedir}/src/site</siteDirectory>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.6</version>
<configuration>
<systemProperties>
<property>
<name>prop.jarLocation</name>
<value>${top.dir}/giraph-core/target/giraph-${project.version}-${forHadoop}-jar-with-dependencies.jar</value>
</property>
</systemProperties>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
</plugin>
</plugins>
</build>

<dependencies>
<!-- compile dependencies. sorted lexicographically. -->
<dependency>
<groupId>commons-cli</groupId>
<artifactId>commons-cli</artifactId>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
</dependency>
<dependency>
<groupId>org.apache.giraph</groupId>
<artifactId>giraph-core</artifactId>
</dependency>
<dependency>
<groupId>org.apache.giraph</groupId>
<artifactId>giraph-core</artifactId>
<type>test-jar</type>
</dependency>
<dependency>
<groupId>org.apache.gora</groupId>
<artifactId>gora-core</artifactId>
</dependency>
<dependency>
<groupId>org.apache.gora</groupId>
<artifactId>gora-hbase</artifactId>
<version>0.3</version>
</dependency>
<dependency>
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
<version>2.9.1</version>
</dependency>
<dependency>
<groupId>xalan</groupId>
<artifactId>xalan</artifactId>
<version>2.7.1</version>
</dependency>
<!-- test dependencies. sorted lexicographically. -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</project>
39 changes: 39 additions & 0 deletions giraph-gora/src/main/assembly/compile.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
<id>jar-with-dependencies</id>
<formats>
<format>jar</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>

<dependencySets>
<dependencySet>
<useProjectArtifact>true</useProjectArtifact>
<outputDirectory>/</outputDirectory>
<unpackOptions>
<excludes>
<exclude>META-INF/LICENSE</exclude>
</excludes>
</unpackOptions>
<unpack>true</unpack>
<scope>runtime</scope>
</dependencySet>
</dependencySets>
</assembly>
Loading