You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@giraph.apache.org by di...@apache.org on 2020/05/08 22:25:48 UTC
[giraph] branch trunk updated: GIRAPH-1237
This is an automated email from the ASF dual-hosted git repository.
dionysios pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/giraph.git
The following commit(s) were added to refs/heads/trunk by this push:
new ce0e4f3 GIRAPH-1237
ce0e4f3 is described below
commit ce0e4f3553cf328f552ee2951112ce99e0c0f9ec
Author: Dionysios Logothetis <dl...@gmail.com>
AuthorDate: Fri May 8 15:25:30 2020 -0700
GIRAPH-1237
closes #123
---
giraph-rexster/giraph-kibble/pom.xml | 114 -----
.../giraph-kibble/src/assembly/distribution.xml | 51 --
.../giraph-kibble/src/assembly/standalone.xml | 41 --
.../giraph-kibble/src/main/assembly/compile.xml | 39 --
.../giraph/rexster/kibble/GiraphExtension.java | 381 ---------------
.../apache/giraph/rexster/kibble/IteratorEdge.java | 66 ---
.../giraph/rexster/kibble/IteratorVertex.java | 65 ---
...om.tinkerpop.rexster.extension.RexsterExtension | 1 -
giraph-rexster/giraph-rexster-io/pom.xml | 181 -------
.../src/main/assembly/compile.xml | 39 --
.../rexster/conf/GiraphRexsterConstants.java | 144 ------
.../apache/giraph/rexster/conf/package-info.java | 21 -
.../giraph/rexster/io/RexsterEdgeInputFormat.java | 205 --------
.../giraph/rexster/io/RexsterEdgeOutputFormat.java | 257 ----------
.../giraph/rexster/io/RexsterInputSplit.java | 112 -----
.../rexster/io/RexsterVertexInputFormat.java | 213 ---------
.../rexster/io/RexsterVertexOutputFormat.java | 382 ---------------
.../RexsterLongDoubleDoubleEdgeOutputFormat.java | 68 ---
.../RexsterLongDoubleDoubleVertexInputFormat.java | 81 ----
.../RexsterLongDoubleDoubleVertexOutputFormat.java | 75 ---
.../formats/RexsterLongDoubleEdgeInputFormat.java | 91 ----
.../RexsterLongDoubleFloatEdgeOutputFormat.java | 69 ---
.../RexsterLongDoubleFloatVertexInputFormat.java | 83 ----
.../RexsterLongDoubleFloatVertexOutputFormat.java | 76 ---
.../formats/RexsterLongFloatEdgeInputFormat.java | 91 ----
.../giraph/rexster/io/formats/package-info.java | 21 -
.../org/apache/giraph/rexster/io/package-info.java | 21 -
.../apache/giraph/rexster/utils/RexsterUtils.java | 486 -------------------
.../apache/giraph/rexster/utils/package-info.java | 21 -
.../TestRexsterLongDoubleFloatIOFormat.java | 532 ---------------------
.../rexster/io/formats/emptyneodb-output.json | 5 -
.../rexster/io/formats/emptyorientdb-output.json | 5 -
.../rexster/io/formats/emptytgdb-output.json | 5 -
.../giraph/rexster/io/formats/neodb-output.json | 5 -
.../giraph/rexster/io/formats/orientdb-output.json | 5 -
.../apache/giraph/rexster/io/formats/rexster.xml | 155 ------
.../giraph/rexster/io/formats/tgdb-output.json | 5 -
giraph-rexster/pom.xml | 41 --
pom.xml | 92 +---
39 files changed, 7 insertions(+), 4338 deletions(-)
diff --git a/giraph-rexster/giraph-kibble/pom.xml b/giraph-rexster/giraph-kibble/pom.xml
deleted file mode 100644
index 534112a..0000000
--- a/giraph-rexster/giraph-kibble/pom.xml
+++ /dev/null
@@ -1,114 +0,0 @@
-<!--
-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/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.giraph</groupId>
- <artifactId>giraph-rexster</artifactId>
- <version>1.3.0-SNAPSHOT</version>
- </parent>
-
- <artifactId>giraph-kibble</artifactId>
- <url>http://giraph.apache.org/giraph-rexster/</url>
- <name>Apache Giraph Rexster Kibble</name>
- <description>Rexster Kibble for Rexster I/O</description>
-
- <properties>
- <top.dir>${project.basedir}/../..</top.dir>
- </properties>
-
- <build>
- <directory>${project.basedir}/target</directory>
- <finalName>${project.artifactId}-${project.version}</finalName>
- <resources>
- <resource>
- <directory>${project.basedir}/src/main/resources
- </directory>
- </resource>
- </resources>
- <testResources>
- <testResource>
- <directory>${project.basedir}/src/test/resources
- </directory>
- </testResource>
- </testResources>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-assembly-plugin</artifactId>
- <executions>
- <execution>
- <id>build-fat-jar</id>
- <phase>none</phase>
- <goals>
- <goal>single</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jar-plugin</artifactId>
- <executions>
- <execution>
- <id>default-jar</id>
- <phase>test</phase>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-javadoc-plugin</artifactId>
- </plugin>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>findbugs-maven-plugin</artifactId>
- </plugin>
- </plugins>
- </build>
-
- <dependencies>
- <dependency>
- <groupId>com.tinkerpop.blueprints</groupId>
- <artifactId>blueprints-core</artifactId>
- </dependency>
- <dependency>
- <groupId>com.tinkerpop.rexster</groupId>
- <artifactId>rexster-core</artifactId>
- </dependency>
- <dependency>
- <groupId>com.sun.jersey</groupId>
- <artifactId>jersey-core</artifactId>
- <version>1.17</version>
- </dependency>
- <dependency>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- <version>1.2.17</version>
- </dependency>
- <dependency>
- <groupId>org.codehaus.jettison</groupId>
- <artifactId>jettison</artifactId>
- <version>1.3.3</version>
- </dependency>
- </dependencies>
-</project>
diff --git a/giraph-rexster/giraph-kibble/src/assembly/distribution.xml b/giraph-rexster/giraph-kibble/src/assembly/distribution.xml
deleted file mode 100644
index 413e79b..0000000
--- a/giraph-rexster/giraph-kibble/src/assembly/distribution.xml
+++ /dev/null
@@ -1,51 +0,0 @@
-<!--
-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>
- <id>distribution</id>
- <formats>
- <format>zip</format>
- </formats>
- <fileSets>
- <fileSet>
- <directory>src</directory>
- </fileSet>
- <fileSet>
- <directory>target/apidocs</directory>
- </fileSet>
- <fileSet>
- <directory>target/site</directory>
- </fileSet>
- <fileSet>
- <directory>target</directory>
- <includes>
- <include>giraph-kibble-*.jar</include>
- </includes>
- </fileSet>
- </fileSets>
- <files>
- <file>
- <source>pom.xml</source>
- <outputDirectory>src</outputDirectory>
- </file>
- <file>
- <outputDirectory>/</outputDirectory>
- </file>
- </files>
-</assembly>
diff --git a/giraph-rexster/giraph-kibble/src/assembly/standalone.xml b/giraph-rexster/giraph-kibble/src/assembly/standalone.xml
deleted file mode 100644
index d46cd46..0000000
--- a/giraph-rexster/giraph-kibble/src/assembly/standalone.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-<!--
-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>
- <id>standalone</id>
- <formats>
- <format>jar</format>
- </formats>
- <includeBaseDirectory>false</includeBaseDirectory>
-
- <fileSets>
- <fileSet>
- <directory>target/classes</directory>
- <outputDirectory>/</outputDirectory>
- </fileSet>
- </fileSets>
-
- <dependencySets>
- <dependencySet>
- <outputDirectory>/</outputDirectory>
- <unpack>true</unpack>
- <scope>runtime</scope>
- </dependencySet>
- </dependencySets>
-</assembly>
diff --git a/giraph-rexster/giraph-kibble/src/main/assembly/compile.xml b/giraph-rexster/giraph-kibble/src/main/assembly/compile.xml
deleted file mode 100644
index b2e620f..0000000
--- a/giraph-rexster/giraph-kibble/src/main/assembly/compile.xml
+++ /dev/null
@@ -1,39 +0,0 @@
-<!--
- 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>
diff --git a/giraph-rexster/giraph-kibble/src/main/java/org/apache/giraph/rexster/kibble/GiraphExtension.java b/giraph-rexster/giraph-kibble/src/main/java/org/apache/giraph/rexster/kibble/GiraphExtension.java
deleted file mode 100644
index a5348af..0000000
--- a/giraph-rexster/giraph-kibble/src/main/java/org/apache/giraph/rexster/kibble/GiraphExtension.java
+++ /dev/null
@@ -1,381 +0,0 @@
-/*
- * 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.
- */
-
-package org.apache.giraph.rexster.kibble;
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-import javax.ws.rs.core.Response;
-
-import org.apache.log4j.Logger;
-import org.codehaus.jettison.json.JSONArray;
-import org.codehaus.jettison.json.JSONObject;
-
-import com.tinkerpop.blueprints.Edge;
-import com.tinkerpop.blueprints.Element;
-import com.tinkerpop.blueprints.Graph;
-import com.tinkerpop.blueprints.TransactionalGraph;
-import com.tinkerpop.blueprints.Vertex;
-import com.tinkerpop.rexster.RexsterResourceContext;
-import com.tinkerpop.rexster.Tokens;
-import com.tinkerpop.rexster.extension.AbstractRexsterExtension;
-import com.tinkerpop.rexster.extension.ExtensionApi;
-import com.tinkerpop.rexster.extension.ExtensionDefinition;
-import com.tinkerpop.rexster.extension.ExtensionDescriptor;
-import com.tinkerpop.rexster.extension.ExtensionMethod;
-import com.tinkerpop.rexster.extension.ExtensionNaming;
-import com.tinkerpop.rexster.extension.ExtensionPoint;
-import com.tinkerpop.rexster.extension.ExtensionResponse;
-import com.tinkerpop.rexster.extension.HttpMethod;
-import com.tinkerpop.rexster.extension.RexsterContext;
-import com.tinkerpop.rexster.util.ElementHelper;
-import com.tinkerpop.rexster.util.RequestObjectHelper;
-
-/**
- * This extension allows batch/transactional operations on a graph.
- */
-@SuppressWarnings("rawtypes")
-@ExtensionNaming(namespace = GiraphExtension.EXTENSION_NAMESPACE,
- name = GiraphExtension.EXTENSION_NAME)
-public class GiraphExtension extends AbstractRexsterExtension {
- public static final String EXTENSION_NAMESPACE = "tp";
- public static final String EXTENSION_NAME = "giraph";
- public static final String TX_KEY = "tx";
- public static final String VLABEL_KEY = "vlabel";
- public static final String DELAY_KEY = "delay";
- public static final String RETRY_KEY = "retry";
- /* element types */
- private static final int VERTEX = 0;
- private static final int EDGE = 1;
- /* max time that will be waited for retry before giving up (msec.) */
- private static final Logger logger = Logger.getLogger(GiraphExtension.class);
- private int backoffRetry = 0;
- private int backoffDelay = 0;
- private String vlabel = null;
- private String lastInVId = "";
- private Vertex lastInV = null;
-
- @ExtensionDefinition(extensionPoint = ExtensionPoint.GRAPH,
- method = HttpMethod.GET,
- path = "vertices")
- @ExtensionDescriptor(description = "get vertices.",
- api = {
- @ExtensionApi(parameterName = Tokens.REXSTER + "." + Tokens.OFFSET_START,
- description = "start offset."),
- @ExtensionApi(parameterName = Tokens.REXSTER + "." + Tokens.OFFSET_END,
- description = "end offset.")
- })
- public ExtensionResponse getVertices(
- @RexsterContext final RexsterResourceContext context,
- @RexsterContext final Graph graph) {
-
- long start =
- RequestObjectHelper.getStartOffset(context.getRequestObject());
- long end =
- RequestObjectHelper.getEndOffset(context.getRequestObject());
-
- try {
- Iterable<Vertex> vertices = graph.getVertices();
- return ExtensionResponse.ok(new IteratorVertex(vertices.iterator(),
- start, end));
- } catch (Exception mqe) {
- logger.error(mqe);
- return ExtensionResponse.error("Error retrieving vertices.",
- generateErrorJson());
- }
- }
-
- @ExtensionDefinition(extensionPoint = ExtensionPoint.GRAPH,
- method = HttpMethod.GET,
- path = "edges")
- @ExtensionDescriptor(description = "get edges.",
- api = {
- @ExtensionApi(parameterName = Tokens.REXSTER + "." + Tokens.OFFSET_START,
- description = "start offset."),
- @ExtensionApi(parameterName = Tokens.REXSTER + "." + Tokens.OFFSET_END,
- description = "end offset.")
- })
- public ExtensionResponse getEdges(
- @RexsterContext final RexsterResourceContext context,
- @RexsterContext final Graph graph) {
-
- long start =
- RequestObjectHelper.getStartOffset(context.getRequestObject());
- long end =
- RequestObjectHelper.getEndOffset(context.getRequestObject());
-
- try {
- Iterable<Edge> edges = graph.getEdges();
- return ExtensionResponse.ok(new IteratorEdge(edges.iterator(),
- start, end));
- } catch (Exception mqe) {
- logger.error(mqe);
- return ExtensionResponse.error("Error retrieving edges.",
- generateErrorJson());
- }
- }
-
- @ExtensionDefinition(
- extensionPoint = ExtensionPoint.GRAPH,
- method = HttpMethod.DELETE,
- autoCommitTransaction = true)
- @ExtensionDescriptor(description = "delete the graph content.")
- public ExtensionResponse delete(
- @RexsterContext RexsterResourceContext context,
- @RexsterContext Graph graph) {
-
- /* delete all the content of the graph (all edges and vertices) */
- Iterable<Vertex> vertices = graph.getVertices();
- Iterator<Vertex> it = vertices.iterator();
- while(it.hasNext()) {
- Vertex current = it.next();
- graph.removeVertex(current);
- }
-
- Map<String, Object> resultMap = new HashMap<String, Object>();
- resultMap.put(Tokens.SUCCESS, true);
- return ExtensionResponse.ok(new JSONObject(resultMap));
- }
-
- @ExtensionDefinition(
- extensionPoint = ExtensionPoint.GRAPH,
- method = HttpMethod.POST,
- path = "vertices",
- autoCommitTransaction = false)
- @ExtensionDescriptor(description = "add vertices to the graph.")
- public ExtensionResponse postVertices(
- @RexsterContext RexsterResourceContext context,
- @RexsterContext Graph graph) {
-
- ExtensionResponse response = handlePost(graph, context, VERTEX);
-
- if (graph instanceof TransactionalGraph) {
- TransactionalGraph tgraph = (TransactionalGraph) graph;
- tgraph.commit();
- }
-
- return response;
- }
-
- @ExtensionDefinition(
- extensionPoint = ExtensionPoint.GRAPH,
- method = HttpMethod.POST,
- path = "edges",
- autoCommitTransaction = false)
- @ExtensionDescriptor(description = "add edges to the graph.")
- public ExtensionResponse postEdges(
- @RexsterContext RexsterResourceContext context,
- @RexsterContext Graph graph) {
-
- return handlePost(graph, context, EDGE);
- }
-
- public ExtensionResponse handlePost(Graph graph,
- RexsterResourceContext context, int type) {
-
- JSONObject tx = context.getRequestObject();
- if (tx == null) {
- ExtensionMethod extMethod = context.getExtensionMethod();
- return ExtensionResponse.error("no transaction JSON posted", null,
- Response.Status.BAD_REQUEST.getStatusCode(), null,
- generateErrorJson(extMethod.getExtensionApiAsJson()));
- }
-
- try {
- vlabel = tx.getString(VLABEL_KEY);
- if (tx.has(DELAY_KEY)) {
- backoffDelay = tx.getInt(DELAY_KEY);
- }
- if (tx.has(RETRY_KEY)) {
- backoffRetry = tx.getInt(RETRY_KEY);
- }
- JSONArray array = tx.optJSONArray(TX_KEY);
-
- for (int i = 0; i < array.length(); i++) {
- JSONObject element = array.optJSONObject(i);
- createElement(element, graph, type);
- }
-
- Map<String, Object> resultMap = new HashMap<String, Object>();
- resultMap.put(Tokens.SUCCESS, true);
- resultMap.put("txProcessed", array.length());
-
- return ExtensionResponse.ok(new JSONObject(resultMap));
-
- } catch (IllegalArgumentException iae) {
- logger.error(iae);
- ExtensionMethod extMethod = context.getExtensionMethod();
- return ExtensionResponse.error(iae.getMessage(), null,
- Response.Status.BAD_REQUEST.getStatusCode(), null,
- generateErrorJson(extMethod.getExtensionApiAsJson()));
- } catch (Exception ex) {
- logger.error(ex);
- return ExtensionResponse.error("Error executing transaction: " +
- ex.getMessage(), generateErrorJson());
- }
- }
-
- private void createElement(JSONObject element, Graph graph, int type)
- throws Exception {
-
- switch (type) {
- case VERTEX:
- String id = element.optString(vlabel);
- Vertex vertex = getVertex(graph, id);
- if (vertex != null) {
- throw new Exception("Vertex with id " + id + " already exists.");
- }
- vertex = graph.addVertex(null);
- vertex.setProperty(vlabel, id);
-
- accumulateAttributes(vertex, element);
- break;
- case EDGE:
- String inV = getProperty(element, Tokens._IN_V, null);
- String outV = getProperty(element, Tokens._OUT_V, null);
- String label = getProperty(element, Tokens._LABEL, "none");
-
- if (outV == null || inV == null || outV.isEmpty() || inV.isEmpty()) {
- throw new IllegalArgumentException("an edge must specify a "
- + Tokens._IN_V + " and " + Tokens._OUT_V);
- }
-
- // there is no edge but the in/out vertex params and label are present
- // so validate that the vertexes are present before creating the edge
- addEdge(graph, element, outV, inV, label);
- break;
- default:
- throw new Exception("Element type unknown.");
- }
- }
-
- private void addEdge(Graph graph, JSONObject element, String outV,
- String inV, String label) throws Exception {
-
- Edge edge;
- Exception prevException = new
- RuntimeException("Exception initialized when trying commit.");
- int retryCount = 0;
-
- while (retryCount <= backoffRetry) {
- // The first time the attempt is made to save the edge, no back off is
- // needed and so the thread is not put to sleep. Differently, afterwards
- // if needed the delay is exponentially (but randomly) put to sleep.
- if (retryCount > 0) {
- try {
- double delay = backoffDelay * Math.pow(2, retryCount);
- Thread.sleep((long) delay);
- } catch (InterruptedException ie) {
- /* nothing to do */
- }
- }
- retryCount += 1;
-
- Vertex in = getInputVertex(graph, inV);
- Vertex out = getVertex(graph, outV);
- if (out == null || in == null) {
- throw new Exception("the " + Tokens._IN_V + " or " +
- Tokens._OUT_V + " vertices could not be found.");
- }
-
- edge = graph.addEdge(null, out, in, label);
- accumulateAttributes(edge, element);
- if (graph instanceof TransactionalGraph) {
- TransactionalGraph tgraph = (TransactionalGraph) graph;
- try {
- tgraph.commit();
- return;
- } catch (Exception e) {
- tgraph.rollback();
- logger.warn("Exception thrown while saving edge: " + e.toString());
- logger.warn("retry: " + retryCount);
- /* need to work out the Exceptions to handle?! */
- prevException = e;
- }
- } else {
- return;
- }
- }
-
- throw new RuntimeException(prevException);
- }
-
- private void accumulateAttributes(Element element, JSONObject obj)
- throws Exception {
-
- Iterator keys = obj.keys();
- while (keys.hasNext()) {
- String key = keys.next().toString();
- if (!key.startsWith(Tokens.UNDERSCORE)) {
- element.setProperty(key,
- ElementHelper.getTypedPropertyValue(obj.getString(key)));
- }
- }
- }
-
- /**
- * Utility function to get a property from the JSON object with the specified
- * label as a String value.
- *
- * @param element JSON object
- * @param label label of the element to retrieve
- * @param defaultValue set to a value != null if a default value is needed
- * @return value of the associated label or null
- */
- private String getProperty(JSONObject element, String label,
- String defaultValue) {
-
- String value = null;
- Object tmp = element.opt(label);
- if (tmp != null) {
- value = tmp.toString();
- }
- if (value == null) {
- value = defaultValue;
- }
- return value;
- }
-
- private Vertex getInputVertex(Graph graph, String inV) {
- Vertex in = null;
- if (inV.equals(lastInVId)) {
- in = lastInV;
- } else {
- lastInVId = inV;
- in = getVertex(graph, inV);
- lastInV = in;
- }
- return in;
- }
-
- private Vertex getVertex(Graph graph, String v) {
- Vertex vertex;
- Iterable<Vertex> vertexes = graph.getVertices(vlabel, v);
- Iterator<Vertex> itvertex = vertexes.iterator();
- if (!itvertex.hasNext()) {
- return null;
- }
- vertex = itvertex.next();
- if (itvertex.hasNext()) {
- return null;
- }
- return vertex;
- }
-}
diff --git a/giraph-rexster/giraph-kibble/src/main/java/org/apache/giraph/rexster/kibble/IteratorEdge.java b/giraph-rexster/giraph-kibble/src/main/java/org/apache/giraph/rexster/kibble/IteratorEdge.java
deleted file mode 100644
index e8a325d..0000000
--- a/giraph-rexster/giraph-kibble/src/main/java/org/apache/giraph/rexster/kibble/IteratorEdge.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * 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.
- */
-
-package org.apache.giraph.rexster.kibble;
-
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-
-import com.tinkerpop.blueprints.Edge;
-import com.tinkerpop.blueprints.Element;
-
-class IteratorEdge implements Iterator<Element> {
- private Iterator<Edge> edges = null;
- private long start;
- private long end;
- private long counter;
-
- public IteratorEdge(Iterator<Edge> edges, long start, long end) {
- this.edges = edges;
- this.start = start;
- this.end = end;
- this.counter = 0;
- }
-
- @Override
- public boolean hasNext() {
- if (counter >= this.end) {
- return false;
- }
- return edges.hasNext();
- }
-
- @Override
- public Element next() {
- while (counter < this.start) {
- edges.next();
- counter += 1;
- }
-
- if (counter >= this.start && counter < this.end) {
- counter += 1;
- return edges.next();
- }
-
- throw new NoSuchElementException();
- }
-
- @Override
- public void remove() {
- }
-}
diff --git a/giraph-rexster/giraph-kibble/src/main/java/org/apache/giraph/rexster/kibble/IteratorVertex.java b/giraph-rexster/giraph-kibble/src/main/java/org/apache/giraph/rexster/kibble/IteratorVertex.java
deleted file mode 100644
index 3332f48..0000000
--- a/giraph-rexster/giraph-kibble/src/main/java/org/apache/giraph/rexster/kibble/IteratorVertex.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * 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.
- */
-
-package org.apache.giraph.rexster.kibble;
-
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-
-import com.tinkerpop.blueprints.Element;
-import com.tinkerpop.blueprints.Vertex;
-
-class IteratorVertex implements Iterator<Element> {
- private Iterator<Vertex> vertices = null;
- private long start;
- private long end;
- private long counter;
-
- public IteratorVertex(Iterator<Vertex> vertices, long start, long end) {
- this.vertices = vertices;
- this.start = start;
- this.end = end;
- this.counter = 0;
- }
-
- @Override
- public boolean hasNext() {
- if (counter >= this.end) {
- return false;
- }
- return vertices.hasNext();
- }
-
- @Override
- public Element next() {
- while (counter < this.start) {
- vertices.next();
- counter++;
- }
-
- if (counter >= this.start && counter < this.end) {
- return vertices.next();
- }
-
- throw new NoSuchElementException();
- }
-
- @Override
- public void remove() {
- }
-}
diff --git a/giraph-rexster/giraph-kibble/src/main/resources/META-INF/services/com.tinkerpop.rexster.extension.RexsterExtension b/giraph-rexster/giraph-kibble/src/main/resources/META-INF/services/com.tinkerpop.rexster.extension.RexsterExtension
deleted file mode 100644
index 76ef348..0000000
--- a/giraph-rexster/giraph-kibble/src/main/resources/META-INF/services/com.tinkerpop.rexster.extension.RexsterExtension
+++ /dev/null
@@ -1 +0,0 @@
-org.apache.giraph.rexster.kibble.GiraphExtension
diff --git a/giraph-rexster/giraph-rexster-io/pom.xml b/giraph-rexster/giraph-rexster-io/pom.xml
deleted file mode 100644
index baee852..0000000
--- a/giraph-rexster/giraph-rexster-io/pom.xml
+++ /dev/null
@@ -1,181 +0,0 @@
-<!--
-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-rexster</artifactId>
- <version>1.3.0-SNAPSHOT</version>
- </parent>
- <artifactId>giraph-rexster-io</artifactId>
- <packaging>jar</packaging>
-
- <name>Apache Giraph Rexster I/O Formats</name>
- <url>http://giraph.apache.org/giraph-rexster/</url>
- <description>Giraph Rexster input/output classes</description>
-
- <properties>
- <top.dir>${project.basedir}/../..</top.dir>
- </properties>
-
- <build>
- <testResources>
- <testResource>
- <directory>${project.basedir}/src/test/resources</directory>
- </testResource>
- </testResources>
- <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-codec</groupId>
- <artifactId>commons-codec</artifactId>
- </dependency>
- <dependency>
- <groupId>commons-configuration</groupId>
- <artifactId>commons-configuration</artifactId>
- </dependency>
- <dependency>
- <groupId>commons-io</groupId>
- <artifactId>commons-io</artifactId>
- </dependency>
- <dependency>
- <groupId>com.google.guava</groupId>
- <artifactId>guava</artifactId>
- </dependency>
- <dependency>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.giraph</groupId>
- <artifactId>giraph-core</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.zookeeper</groupId>
- <artifactId>zookeeper</artifactId>
- </dependency>
- <dependency>
- <groupId>org.codehaus.jettison</groupId>
- <artifactId>jettison</artifactId>
- <version>1.3.3</version>
- </dependency>
- <dependency>
- <groupId>org.json</groupId>
- <artifactId>json</artifactId>
- </dependency>
-
- <!-- runtime dependency -->
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- <scope>runtime</scope>
- </dependency>
-
- <!-- test dependencies. sorted lexicographically. -->
- <dependency>
- <groupId>com.tinkerpop.blueprints</groupId>
- <artifactId>blueprints-core</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>com.tinkerpop.rexster</groupId>
- <artifactId>rexster-core</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>com.tinkerpop.rexster</groupId>
- <artifactId>rexster-protocol</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>com.tinkerpop.rexster</groupId>
- <artifactId>rexster-server</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>com.tinkerpop.blueprints</groupId>
- <artifactId>blueprints-orient-graph</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>com.tinkerpop.blueprints</groupId>
- <artifactId>blueprints-neo4j-graph</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.giraph</groupId>
- <artifactId>giraph-kibble</artifactId>
- <version>${project.version}</version>
- <scope>system</scope>
- <systemPath>${top.dir}/giraph-rexster/giraph-kibble/target/giraph-kibble-${project.version}.jar</systemPath>
- </dependency>
- </dependencies>
-</project>
diff --git a/giraph-rexster/giraph-rexster-io/src/main/assembly/compile.xml b/giraph-rexster/giraph-rexster-io/src/main/assembly/compile.xml
deleted file mode 100644
index fcaffa6..0000000
--- a/giraph-rexster/giraph-rexster-io/src/main/assembly/compile.xml
+++ /dev/null
@@ -1,39 +0,0 @@
-<!--
- 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>
diff --git a/giraph-rexster/giraph-rexster-io/src/main/java/org/apache/giraph/rexster/conf/GiraphRexsterConstants.java b/giraph-rexster/giraph-rexster-io/src/main/java/org/apache/giraph/rexster/conf/GiraphRexsterConstants.java
deleted file mode 100644
index b4c6a83..0000000
--- a/giraph-rexster/giraph-rexster-io/src/main/java/org/apache/giraph/rexster/conf/GiraphRexsterConstants.java
+++ /dev/null
@@ -1,144 +0,0 @@
-/*
- * 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.
- */
-
-package org.apache.giraph.rexster.conf;
-
-import org.apache.giraph.conf.StrConfOption;
-import org.apache.giraph.conf.IntConfOption;
-import org.apache.giraph.conf.BooleanConfOption;
-
-/**
- * Constants used all over Giraph for configuration specific for Rexster
- * REST API.
- */
-// CHECKSTYLE: stop InterfaceIsTypeCheck
-public interface GiraphRexsterConstants {
- // ------------ GENERAL CONFIGURATIONS
- /** Rexster hostname which provides the REST API. */
- StrConfOption GIRAPH_REXSTER_HOSTNAME =
- new StrConfOption("giraph.rexster.hostname", null,
- "Rexster hostname which provides the REST API. " +
- "- required");
- /** Rexster port where to contact the REST API. */
- IntConfOption GIRAPH_REXSTER_PORT =
- new IntConfOption("giraph.rexster.port", 8182,
- "Rexster port where to contact the REST API.");
- /** Rexster flag to set the connection over SSL instaed of clear-text. */
- BooleanConfOption GIRAPH_REXSTER_USES_SSL =
- new BooleanConfOption("giraph.rexster.ssl", false,
- "Rexster flag to set the connection over SSL " +
- "instaed of clear-text.");
- /** Rexster username to access the REST API. */
- StrConfOption GIRAPH_REXSTER_USERNAME =
- new StrConfOption("giraph.rexster.username", "",
- "Rexster username to access the REST API.");
- /** Rexster password to access the REST API. */
- StrConfOption GIRAPH_REXSTER_PASSWORD =
- new StrConfOption("giraph.rexster.password", "",
- "Rexster password to access the REST API.");
-
- // ------------ INPUT FORMAT CONFIGURATIONS
- /** Rexster input graph. */
- StrConfOption GIRAPH_REXSTER_INPUT_GRAPH =
- new StrConfOption("giraph.rexster.input.graph", "graphdb",
- "Rexster input graph.");
- /** Rexster number of estimated vertexes in the graph to be loaded. */
- IntConfOption GIRAPH_REXSTER_V_ESTIMATE =
- new IntConfOption("giraph.rexster.input.vertex", 1000,
- "Rexster number of estimated vertexes in the " +
- "graph to be loaded.");
- /** Rexster number of estimated edges in the graph to be loaded. */
- IntConfOption GIRAPH_REXSTER_E_ESTIMATE =
- new IntConfOption("giraph.rexster.input.edges", 1000,
- "Rexster number of estimated vertex in the " +
- "graph to be loaded.");
- /** If the database is Gremlin enabled, the script will be used to retrieve
- the vertexes from the Rexster exposed database. */
- StrConfOption GIRAPH_REXSTER_GREMLIN_V_SCRIPT =
- new StrConfOption("giraph.rexster.input.vertex.gremlinScript", "",
- "If the database is Gremlin enabled, the script will " +
- "be used to retrieve the vertexes from the Rexster " +
- "exposed database.");
- /** If the database is Gremlin enabled, the script will be used to retrieve
- the edges from the Rexster exposed database. */
- StrConfOption GIRAPH_REXSTER_GREMLIN_E_SCRIPT =
- new StrConfOption("giraph.rexster.input.edges.gremlinScript", "",
- "If the database is Gremlin enabled, the script will " +
- "be used to retrieve the edges from the Rexster " +
- "exposed database.");
-
- // ------------ OUTPUT FORMAT CONFIGURATIONS
- /** Rexster output graph. */
- StrConfOption GIRAPH_REXSTER_OUTPUT_GRAPH =
- new StrConfOption("giraph.rexster.output.graph", "graphdb",
- "Rexster output graph.");
- /** Rexster Vertex ID label for the JSON format. */
- StrConfOption GIRAPH_REXSTER_VLABEL =
- new StrConfOption("giraph.rexster.output.vlabel", "_vid",
- "Rexster Vertex ID label for the JSON format.");
- /**
- * Rexster back-off delay in milliseconds which is multiplied to an
- * exponentially increasing counter. Needed to deal with deadlocks and
- * consistency raised by the graph database.
- **/
- IntConfOption GIRAPH_REXSTER_BACKOFF_DELAY =
- new IntConfOption("giraph.rexster.output.backoffDelay", 5,
- "Rexster back-off delay in milliseconds which is " +
- "multiplied to an exponentially increasing counter. " +
- "Needed to deal with deadlocks and consistency raised " +
- "by the graph database.");
- /**
- * Rexster back-off number of retries in case of failures.
- * Needed to deal with deadlocks and consistency raised by the
- * graphdatabase.
- **/
- IntConfOption GIRAPH_REXSTER_BACKOFF_RETRY =
- new IntConfOption("giraph.rexster.output.backoffRetry", 20,
- "Rexster back-off number of retries in case of " +
- "failures. Needed to deal with deadlocks and " +
- "consistency raised by the graph database.");
- /**
- * Rexster output format wait timeout (seconds). This is used to wake up
- * the thread to call progress very x seconds if not progress from the
- * ZooKeeper is detected.
- */
- IntConfOption GIRAPH_REXSTER_OUTPUT_WAIT_TIMEOUT =
- new IntConfOption("giraph.rexster.output.timeout", 10,
- "Rexster output format wait timeout (seconds). This is " +
- "used to wake up the thread to call progress very x " +
- "seconds if not progress from the ZooKeeper is " +
- "detected.");
- /**
- * Rexster Output format transaction size. This parameter defines how many
- * vertices are sent for each transaction.
- */
- IntConfOption GIRAPH_REXSTER_OUTPUT_V_TXSIZE =
- new IntConfOption("giraph.rexster.output.vertex.txsize", 1000,
- "Rexster Output format transaction size. This parameter" +
- "defines how many vertexes are sent for each " +
- "transaction.");
- /**
- * Rexster Output format transaction size. This parameter defines how many
- * edges are sent for each transaction.
- */
- IntConfOption GIRAPH_REXSTER_OUTPUT_E_TXSIZE =
- new IntConfOption("giraph.rexster.output.edge.txsize", 1000,
- "Rexster Output format transaction size. This parameter" +
- "defines how many edges are sent for each " +
- "transaction.");
-}
diff --git a/giraph-rexster/giraph-rexster-io/src/main/java/org/apache/giraph/rexster/conf/package-info.java b/giraph-rexster/giraph-rexster-io/src/main/java/org/apache/giraph/rexster/conf/package-info.java
deleted file mode 100644
index b4917bc..0000000
--- a/giraph-rexster/giraph-rexster-io/src/main/java/org/apache/giraph/rexster/conf/package-info.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * 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.
- */
-/**
- * Package of configuration information for Rexster in Giraph.
- */
-package org.apache.giraph.rexster.conf;
diff --git a/giraph-rexster/giraph-rexster-io/src/main/java/org/apache/giraph/rexster/io/RexsterEdgeInputFormat.java b/giraph-rexster/giraph-rexster-io/src/main/java/org/apache/giraph/rexster/io/RexsterEdgeInputFormat.java
deleted file mode 100644
index b21a4e2..0000000
--- a/giraph-rexster/giraph-rexster-io/src/main/java/org/apache/giraph/rexster/io/RexsterEdgeInputFormat.java
+++ /dev/null
@@ -1,205 +0,0 @@
-/*
- * 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.
- */
-
-package org.apache.giraph.rexster.io;
-
-import static org.apache.giraph.rexster.conf.GiraphRexsterConstants.GIRAPH_REXSTER_E_ESTIMATE;
-import static org.apache.giraph.rexster.conf.GiraphRexsterConstants.GIRAPH_REXSTER_HOSTNAME;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.util.List;
-
-import org.apache.giraph.conf.GiraphConfiguration;
-import org.apache.giraph.edge.Edge;
-import org.apache.giraph.io.EdgeInputFormat;
-import org.apache.giraph.io.EdgeReader;
-import org.apache.giraph.rexster.utils.RexsterUtils;
-import org.apache.hadoop.conf.Configuration;
-import org.apache.hadoop.io.Writable;
-import org.apache.hadoop.io.WritableComparable;
-import org.apache.hadoop.mapreduce.InputSplit;
-import org.apache.hadoop.mapreduce.JobContext;
-import org.apache.hadoop.mapreduce.TaskAttemptContext;
-import org.apache.log4j.Logger;
-import org.json.JSONException;
-import org.json.JSONObject;
-import org.json.JSONTokener;
-
-/**
- * Abstract class that users should subclass to use their own Rexster based
- * vertex input format. This class was inspired by the Rexster Input format
- * available in Faunus authored by Stephen Mallette.
- * @param <I> Vertex id
- * @param <E> Edge data
- */
-@SuppressWarnings("rawtypes")
-public abstract class RexsterEdgeInputFormat<I extends WritableComparable,
- E extends Writable> extends EdgeInputFormat<I, E> {
-
- /** Class logger. */
- private static final Logger LOG =
- Logger.getLogger(RexsterEdgeInputFormat.class);
-
- /**
- * @param conf configuration parameters
- */
- public void checkInputSpecs(Configuration conf) {
- GiraphConfiguration gconf = new GiraphConfiguration(conf);
- String msg = "Rexster InputFormat usage requires both Edge and Vertex " +
- "InputFormat's.";
-
- /* check for Vertex InputFormat since both are required by Rexster */
- if (!gconf.hasVertexInputFormat()) {
- LOG.error(msg);
- throw new RuntimeException(msg);
- }
-
- String endpoint = GIRAPH_REXSTER_HOSTNAME.get(conf);
- if (endpoint == null) {
- throw new RuntimeException(GIRAPH_REXSTER_HOSTNAME.getKey() +
- " is a mandatory parameter.");
- }
- }
-
- @Override
- public List<InputSplit> getSplits(JobContext context, int minSplitCountHint)
- throws IOException, InterruptedException {
-
- return RexsterUtils.getSplits(context,
- GIRAPH_REXSTER_E_ESTIMATE.get(getConf()));
- }
-
- @Override
- public abstract RexsterEdgeReader createEdgeReader(InputSplit split,
- TaskAttemptContext context) throws IOException;
-
- /**
- * Abstract class to be implemented by the user based on their specific
- * vertex input. Easiest to ignore the key value separator and only use
- * key instead.
- */
- protected abstract class RexsterEdgeReader extends EdgeReader<I, E> {
-
- /** Input stream from the HTTP connection to the REST endpoint */
- private BufferedReader rexsterBufferedStream;
- /** JSON parser/tokenizer object */
- private JSONTokener tokener;
- /** start index of the Rexster paging */
- private long splitStart;
- /** end index of the Rexster paging */
- private long splitEnd;
- /** number of iterated items */
- private long itemsIterated = 0;
- /** current edge obtained from Rexster */
- private Edge<I, E> edge;
- /** first call to the nextEdge fuction */
- private boolean isFirstEdge;
-
- @Override
- public void initialize(InputSplit inputSplit, TaskAttemptContext context)
- throws IOException, InterruptedException {
-
- RexsterInputSplit rexsterInputSplit = (RexsterInputSplit) inputSplit;
- splitEnd = rexsterInputSplit.getEnd();
- splitStart = rexsterInputSplit.getStart();
-
- rexsterBufferedStream =
- RexsterUtils.Edge.openInputStream(getConf(), splitStart, splitEnd);
- tokener = RexsterUtils.parseJSONEnvelope(rexsterBufferedStream);
- isFirstEdge = true;
- }
-
- @Override
- public void close() throws IOException {
- rexsterBufferedStream.close();
- }
-
- @Override
- public float getProgress() throws IOException, InterruptedException {
- final float estimated = GIRAPH_REXSTER_E_ESTIMATE.get(getConf());
-
- if (this.splitStart == this.splitEnd) {
- return 0.0f;
- } else {
- /* assuming you got the estimate right this progress should be
- pretty close; */
- return Math.min(1.0f, this.itemsIterated / (float) estimated);
- }
- }
-
- @Override
- public Edge<I, E> getCurrentEdge()
- throws IOException, InterruptedException {
-
- return edge;
- }
-
- @Override
- public boolean nextEdge() throws IOException, InterruptedException {
- try {
- /* if the tokener was not set, no objects are in fact available */
- if (this.tokener == null) {
- return false;
- }
-
- char c;
- if (isFirstEdge) {
- c = this.tokener.nextClean();
-
- isFirstEdge = false;
- if (c == RexsterUtils.END_ARRAY) {
- return false;
- }
- tokener.back();
- }
-
- JSONObject obj = new JSONObject(this.tokener);
- edge = parseEdge(obj);
- LOG.info(edge);
-
- c = tokener.nextClean();
- if (c == RexsterUtils.ARRAY_SEPARATOR) {
- itemsIterated += 1;
- return true;
- } else if (c == RexsterUtils.END_ARRAY) {
- return false;
- } else {
- LOG.error(String.format("Expected a '%c' at the end of the array",
- RexsterUtils.END_ARRAY));
- throw new InterruptedException();
- }
- } catch (JSONException e) {
- throw new InterruptedException(e.toString());
- }
- }
-
- /**
- * Parser for a single edge JSON object
- *
- * @param jsonEdge edge represented as JSON object
- * @return The edge object associated with the JSON object
- */
- protected abstract Edge<I, E> parseEdge(JSONObject jsonEdge)
- throws JSONException;
-
- @Override
- public abstract I getCurrentSourceId()
- throws IOException, InterruptedException;
- }
-}
diff --git a/giraph-rexster/giraph-rexster-io/src/main/java/org/apache/giraph/rexster/io/RexsterEdgeOutputFormat.java b/giraph-rexster/giraph-rexster-io/src/main/java/org/apache/giraph/rexster/io/RexsterEdgeOutputFormat.java
deleted file mode 100644
index ca4e861..0000000
--- a/giraph-rexster/giraph-rexster-io/src/main/java/org/apache/giraph/rexster/io/RexsterEdgeOutputFormat.java
+++ /dev/null
@@ -1,257 +0,0 @@
-/*
- * 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.
- */
-
-package org.apache.giraph.rexster.io;
-
-import static org.apache.giraph.rexster.conf.GiraphRexsterConstants.GIRAPH_REXSTER_OUTPUT_E_TXSIZE;
-import static org.apache.giraph.rexster.conf.GiraphRexsterConstants.GIRAPH_REXSTER_VLABEL;
-import static org.apache.giraph.rexster.conf.GiraphRexsterConstants.GIRAPH_REXSTER_HOSTNAME;
-import static org.apache.giraph.rexster.conf.GiraphRexsterConstants.GIRAPH_REXSTER_BACKOFF_DELAY;
-import static org.apache.giraph.rexster.conf.GiraphRexsterConstants.GIRAPH_REXSTER_BACKOFF_RETRY;
-
-import java.io.BufferedWriter;
-import java.io.IOException;
-import java.io.OutputStreamWriter;
-import java.net.HttpURLConnection;
-import java.nio.charset.Charset;
-
-import org.apache.giraph.conf.GiraphConfiguration;
-import org.apache.giraph.edge.Edge;
-import org.apache.giraph.io.EdgeOutputFormat;
-import org.apache.giraph.io.EdgeWriter;
-import org.apache.giraph.rexster.utils.RexsterUtils;
-import org.apache.hadoop.io.Writable;
-import org.apache.hadoop.io.WritableComparable;
-import org.apache.hadoop.mapreduce.JobContext;
-import org.apache.hadoop.mapreduce.OutputCommitter;
-import org.apache.hadoop.mapreduce.TaskAttemptContext;
-import org.apache.log4j.Logger;
-import org.json.JSONException;
-import org.json.JSONObject;
-
-/**
- * Abstract class that users should subclass to use their own Rexster based
- * edge output format.
- *
- * @param <I>
- * @param <V>
- * @param <E>
- */
-@SuppressWarnings("rawtypes")
-public class RexsterEdgeOutputFormat<I extends WritableComparable,
- V extends Writable, E extends Writable>
- extends EdgeOutputFormat<I, V, E> {
-
- /** Class logger. */
- private static final Logger LOG =
- Logger.getLogger(RexsterEdgeOutputFormat.class);
-
- @Override
- public RexsterEdgeWriter
- createEdgeWriter(TaskAttemptContext context)
- throws IOException, InterruptedException {
-
- return new RexsterEdgeWriter();
- }
-
- @Override
- public void checkOutputSpecs(JobContext context)
- throws IOException, InterruptedException {
- GiraphConfiguration gconf =
- new GiraphConfiguration(context.getConfiguration());
- String msg = "Rexster OutputFormat usage requires both Edge and " +
- "Vertex OutputFormat's.";
-
- if (!gconf.hasVertexOutputFormat()) {
- LOG.error(msg);
- throw new InterruptedException(msg);
- }
-
- String endpoint = GIRAPH_REXSTER_HOSTNAME.get(gconf);
- if (endpoint == null) {
- throw new InterruptedException(GIRAPH_REXSTER_HOSTNAME.getKey() +
- " is a mandatory parameter.");
- }
- }
-
- @Override
- public OutputCommitter getOutputCommitter(TaskAttemptContext context)
- throws IOException, InterruptedException {
-
- return new NullOutputCommitter();
- }
-
- /**
- * Empty output commiter for hadoop.
- */
- private static class NullOutputCommitter extends OutputCommitter {
- @Override
- public void abortTask(TaskAttemptContext taskContext) { }
-
- @Override
- public void cleanupJob(JobContext jobContext) { }
-
- @Override
- public void commitTask(TaskAttemptContext taskContext) { }
-
- @Override
- public boolean needsTaskCommit(TaskAttemptContext taskContext) {
- return false;
- }
-
- @Override
- public void setupJob(JobContext jobContext) { }
-
- @Override
- public void setupTask(TaskAttemptContext taskContext) { }
- }
-
- /**
- * Abstract class to be implemented by the user based on their specific
- * vertex/edges output. Easiest to ignore the key value separator and only
- * use key instead.
- */
- protected class RexsterEdgeWriter extends EdgeWriter<I, V, E> {
- /** array key that points to the edges and vertices */
- private static final String JSON_ARRAY_KEY = "tx";
- /** Connection to the HTTP REST endpoint */
- private HttpURLConnection rexsterConn;
- /** Output stream from the HTTP connection to the REST endpoint */
- private BufferedWriter rexsterBufferedStream;
- /** attribute used to keep the state of the element array status */
- private boolean isFirstElement = true;
- /** number of vertices before starting a new connection */
- private int txsize;
- /** number of vertexes of vertices sent */
- private int txcounter = 0;
- /** label of the vertex id field */
- private String vlabel;
- /** Back-off time delay in milliseconds */
- private int backoffDelay = 0;
- /** Back-off number of attempts */
- private int backoffRetry = 0;
-
- @Override
- public void initialize(TaskAttemptContext context) throws IOException,
- InterruptedException {
-
- txsize = GIRAPH_REXSTER_OUTPUT_E_TXSIZE.get(getConf());
- vlabel = GIRAPH_REXSTER_VLABEL.get(getConf());
- backoffDelay = GIRAPH_REXSTER_BACKOFF_DELAY.get(getConf());
- backoffRetry = GIRAPH_REXSTER_BACKOFF_RETRY.get(getConf());
- startConnection();
- }
-
- @Override
- public void close(TaskAttemptContext context)
- throws IOException, InterruptedException {
-
- stopConnection();
- }
-
- @Override
- public void writeEdge(I srcId, V srcValue, Edge<I, E> edge)
- throws IOException, InterruptedException {
-
- if (txcounter == txsize) {
- txcounter = 0;
- isFirstElement = true;
- stopConnection();
- startConnection();
- }
-
- try {
- JSONObject jsonEdge;
- String suffix;
-
- /* extract the JSON object of the vertex */
- jsonEdge = getEdge(srcId, srcValue, edge);
- /* determine the suffix to add the object into the JSON array */
- if (isFirstElement) {
- isFirstElement = false;
- suffix = "";
- } else {
- suffix = ",";
- }
- rexsterBufferedStream.write(suffix + jsonEdge);
- txcounter += 1;
-
- } catch (JSONException e) {
- throw new InterruptedException("Error writing the edge: " +
- e.getMessage());
- }
- }
-
- /**
- * Start a new connection with the Rexster REST endpoint.
- */
- private void startConnection() throws IOException, InterruptedException {
- rexsterConn = RexsterUtils.Edge.openOutputConnection(getConf());
- rexsterBufferedStream = new BufferedWriter(
- new OutputStreamWriter(rexsterConn.getOutputStream(),
- Charset.forName("UTF-8")));
- /* open the JSON container: is an object containing an array of
- elements */
- rexsterBufferedStream.write("{ ");
- rexsterBufferedStream.write("\"vlabel\" : \"" + vlabel + "\",");
- rexsterBufferedStream.write("\"delay\" : \"" + backoffDelay + "\",");
- rexsterBufferedStream.write("\"retry\" : \"" + backoffRetry + "\",");
- rexsterBufferedStream.write("\"" + JSON_ARRAY_KEY + "\"");
- rexsterBufferedStream.write(" : [ ");
- }
-
- /**
- * Stop a new connection with the Rexster REST endpoint. By default the
- * JDK manages keep-alive so no particular code is sent in place for this
- * aim.
- */
- private void stopConnection() throws IOException, InterruptedException {
- /* close the JSON container */
- rexsterBufferedStream.write(" ] }");
- rexsterBufferedStream.flush();
- rexsterBufferedStream.close();
-
- /* check the response and in case of error signal the unsuccessful state
- via exception */
- RexsterUtils.Edge.handleResponse(rexsterConn);
- }
-
- /**
- * Each edge needs to be transformed into a JSON object to be sent to the
- * batch interface of Rexster.
- *
- * @param srcId source vertex ID of the edge
- * @param srcValue source vertex value of the edge
- * @param edge edge to be transformed in JSON
- * @return JSON representation of the edge
- */
- protected JSONObject getEdge(I srcId, V srcValue, Edge<I, E> edge)
- throws JSONException {
-
- String outId = srcId.toString();
- String inId = edge.getTargetVertexId().toString();
- String value = edge.getValue().toString();
- JSONObject jsonEdge = new JSONObject();
- jsonEdge.accumulate("_outV", outId);
- jsonEdge.accumulate("_inV", inId);
- jsonEdge.accumulate("value", value);
-
- return jsonEdge;
- }
- }
-}
diff --git a/giraph-rexster/giraph-rexster-io/src/main/java/org/apache/giraph/rexster/io/RexsterInputSplit.java b/giraph-rexster/giraph-rexster-io/src/main/java/org/apache/giraph/rexster/io/RexsterInputSplit.java
deleted file mode 100644
index b6da8de..0000000
--- a/giraph-rexster/giraph-rexster-io/src/main/java/org/apache/giraph/rexster/io/RexsterInputSplit.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * 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.
- */
-
-package org.apache.giraph.rexster.io;
-
-import org.apache.hadoop.io.Writable;
-import org.apache.hadoop.mapreduce.InputSplit;
-
-import java.io.DataInput;
-import java.io.DataOutput;
-import java.io.IOException;
-
-/**
- * A InputSplit that spans a set of vertices. This code is taken from the
- * Faunus project and was originally authored by Stephen Mallette.
- */
-public class RexsterInputSplit extends InputSplit implements Writable {
- /** End index for the Rexster paging */
- private long end = 0;
- /** Start index for the Rexster paging */
- private long start = 0;
-
- /**
- * Default constructor.
- */
- public RexsterInputSplit() {
- }
-
- /**
- * Overloaded constructor
- * @param start start of the paging provided by Rexster
- * @param end end of the paging provided by Rexster
- */
- public RexsterInputSplit(long start, long end) {
- this.start = start;
- this.end = end;
- }
-
- /**
- * Stub function returning empty list of locations
- * @return String[] array of locations
- * @throws IOException
- */
- public String[] getLocations() {
- return new String[]{};
- }
-
- /**
- * Get the start of the paging.
- * @return long start of the paging
- */
- public long getStart() {
- return start;
- }
-
- /**
- * Get the end of the paging.
- * @return long end of the paging
- */
- public long getEnd() {
- return end;
- }
-
- /**
- * Get the length of the paging
- * @return long length of the page
- */
- public long getLength() {
- return end - start;
- }
-
- /**
- *
- * @param input data input from where to unserialize
- * @throws IOException
- */
- public void readFields(DataInput input) throws IOException {
- start = input.readLong();
- end = input.readLong();
- }
-
- /**
- *
- * @param output data output where to serialize
- * @throws IOException
- */
- public void write(DataOutput output) throws IOException {
- output.writeLong(start);
- output.writeLong(end);
- }
-
- @Override
- public String toString() {
- return String.format("Split at [%s to %s]", this.start,
- this.end == Long.MAX_VALUE ? "END" : this.end - 1);
- }
-}
diff --git a/giraph-rexster/giraph-rexster-io/src/main/java/org/apache/giraph/rexster/io/RexsterVertexInputFormat.java b/giraph-rexster/giraph-rexster-io/src/main/java/org/apache/giraph/rexster/io/RexsterVertexInputFormat.java
deleted file mode 100644
index bee22f5..0000000
--- a/giraph-rexster/giraph-rexster-io/src/main/java/org/apache/giraph/rexster/io/RexsterVertexInputFormat.java
+++ /dev/null
@@ -1,213 +0,0 @@
-/*
- * 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.
- */
-
-package org.apache.giraph.rexster.io;
-
-import static org.apache.giraph.rexster.conf.GiraphRexsterConstants.GIRAPH_REXSTER_V_ESTIMATE;
-import static org.apache.giraph.rexster.conf.GiraphRexsterConstants.GIRAPH_REXSTER_HOSTNAME;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.util.List;
-
-import org.apache.giraph.conf.GiraphConfiguration;
-import org.apache.giraph.graph.Vertex;
-import org.apache.giraph.io.VertexInputFormat;
-import org.apache.giraph.io.VertexReader;
-import org.apache.giraph.rexster.utils.RexsterUtils;
-import org.apache.hadoop.conf.Configuration;
-import org.apache.hadoop.io.Writable;
-import org.apache.hadoop.io.WritableComparable;
-import org.apache.hadoop.mapreduce.InputSplit;
-import org.apache.hadoop.mapreduce.JobContext;
-import org.apache.hadoop.mapreduce.TaskAttemptContext;
-import org.apache.log4j.Logger;
-import org.json.JSONException;
-import org.json.JSONObject;
-import org.json.JSONTokener;
-
-/**
- * Abstract class that users should subclass to use their own Rexster based
- * vertex input format. This class was inspired by the Rexster Input format
- * available in Faunus authored by Stephen Mallette.
- *
- * @param <I>
- * @param <V>
- * @param <E>
- */
-@SuppressWarnings("rawtypes")
-public abstract class RexsterVertexInputFormat<I extends WritableComparable,
- V extends Writable, E extends Writable>
- extends VertexInputFormat<I, V, E> {
-
- /** Class logger. */
- private static final Logger LOG =
- Logger.getLogger(RexsterVertexInputFormat.class);
-
- /**
- * @param conf configuration parameters
- */
- public void checkInputSpecs(Configuration conf) {
- GiraphConfiguration gconf = new GiraphConfiguration(conf);
-
- if (!gconf.hasEdgeInputFormat()) {
- String err = "Rexster Input I/O requires " +
- "both Vertex- and EdgeInputFormat.";
- LOG.error(err);
- throw new RuntimeException(err);
- }
-
- String endpoint = GIRAPH_REXSTER_HOSTNAME.get(conf);
- if (endpoint == null) {
- throw new RuntimeException(GIRAPH_REXSTER_HOSTNAME.getKey() +
- " is a mandatory parameter.");
- }
- }
-
- /**
- * Create a vertex reader for a given split. Guaranteed to have been
- * configured with setConf() prior to use. The framework will also call
- * {@link VertexReader#initialize(InputSplit, TaskAttemptContext)} before
- * the split is used.
- *
- * @param split the split to be read
- * @param context the information about the task
- * @return a new record reader
- * @throws IOException
- */
- public abstract RexsterVertexReader createVertexReader(InputSplit split,
- TaskAttemptContext context) throws IOException;
-
- @Override
- public List<InputSplit> getSplits(JobContext context, int minSplitCountHint)
- throws IOException, InterruptedException {
-
- return RexsterUtils.getSplits(context,
- GIRAPH_REXSTER_V_ESTIMATE.get(getConf()));
- }
-
- /**
- * Abstract class to be implemented by the user based on their specific
- * vertex input. Easiest to ignore the key value separator and only use
- * key instead.
- */
- protected abstract class RexsterVertexReader extends VertexReader<I, V, E> {
-
- /** Input stream from the HTTP connection to the REST endpoint */
- private BufferedReader rexsterBufferedStream;
- /** JSON parser/tokenizer object */
- private JSONTokener tokener;
- /** start index of the Rexster paging */
- private long splitStart;
- /** end index of the Rexster paging */
- private long splitEnd;
- /** index to access the iterated vertices */
- private long itemsIterated = 0;
- /** current vertex */
- private Vertex<I, V, E> vertex;
- /** first call to the nextVertex fuction */
- private boolean isFirstVertex;
-
- @Override
- public void initialize(InputSplit inputSplit, TaskAttemptContext context)
- throws IOException, InterruptedException {
-
- RexsterInputSplit rexsterInputSplit = (RexsterInputSplit) inputSplit;
- splitEnd = rexsterInputSplit.getEnd();
- splitStart = rexsterInputSplit.getStart();
- rexsterBufferedStream = RexsterUtils.Vertex.openInputStream(getConf(),
- splitStart, splitEnd);
- tokener = RexsterUtils.parseJSONEnvelope(rexsterBufferedStream);
- isFirstVertex = true;
- }
-
- @Override
- public boolean nextVertex() throws IOException, InterruptedException {
- try {
- /* if the tokener was not set, no object is in fact available */
- if (this.tokener == null) {
- return false;
- }
-
- char c;
- if (isFirstVertex) {
- isFirstVertex = false;
-
- c = this.tokener.nextClean();
- if (c == RexsterUtils.END_ARRAY) {
- return false;
- }
- tokener.back();
- }
-
- JSONObject obj = new JSONObject(this.tokener);
- this.vertex = parseVertex(obj);
-
- c = this.tokener.nextClean();
- if (c == RexsterUtils.ARRAY_SEPARATOR) {
- itemsIterated += 1;
- return true;
- } else if (c == RexsterUtils.END_ARRAY) {
- return false;
- } else {
- LOG.error(String.format("Expected a '%c' at the end of the array",
- RexsterUtils.END_ARRAY));
- throw new InterruptedException(
- String.format("Expected a '%c' at the end of the array",
- RexsterUtils.END_ARRAY));
- }
- } catch (JSONException e) {
- throw new InterruptedException(e.toString());
- }
- }
-
- @Override
- public void close() throws IOException {
- this.rexsterBufferedStream.close();
- }
-
- @Override
- public float getProgress() throws IOException, InterruptedException {
- float vestimated = GIRAPH_REXSTER_V_ESTIMATE.get(getConf());
-
- if (this.splitStart == this.splitEnd) {
- return 0.0f;
- } else {
- // assuming you got the estimate right this progress should be
- // pretty close;
- return Math.min(1.0f, this.itemsIterated / (float) vestimated);
- }
- }
-
- @Override
- public Vertex<I, V, E> getCurrentVertex()
- throws IOException, InterruptedException {
-
- return this.vertex;
- }
-
- /**
- * Parser for a single vertex JSON object
- *
- * @param jsonVertex vertex represented as JSON object
- * @return The vertex object represented by the JSON object
- */
- protected abstract Vertex<I, V, E> parseVertex(JSONObject jsonVertex)
- throws JSONException;
- }
-}
diff --git a/giraph-rexster/giraph-rexster-io/src/main/java/org/apache/giraph/rexster/io/RexsterVertexOutputFormat.java b/giraph-rexster/giraph-rexster-io/src/main/java/org/apache/giraph/rexster/io/RexsterVertexOutputFormat.java
deleted file mode 100644
index 0e8d83e..0000000
--- a/giraph-rexster/giraph-rexster-io/src/main/java/org/apache/giraph/rexster/io/RexsterVertexOutputFormat.java
+++ /dev/null
@@ -1,382 +0,0 @@
-/*
- * 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.
- */
-
-package org.apache.giraph.rexster.io;
-
-import static org.apache.giraph.rexster.conf.GiraphRexsterConstants.GIRAPH_REXSTER_OUTPUT_V_TXSIZE;
-import static org.apache.giraph.rexster.conf.GiraphRexsterConstants.GIRAPH_REXSTER_OUTPUT_WAIT_TIMEOUT;
-import static org.apache.giraph.rexster.conf.GiraphRexsterConstants.GIRAPH_REXSTER_VLABEL;
-import static org.apache.giraph.rexster.conf.GiraphRexsterConstants.GIRAPH_REXSTER_HOSTNAME;
-
-import java.io.BufferedWriter;
-import java.io.IOException;
-import java.io.OutputStreamWriter;
-import java.net.HttpURLConnection;
-import java.nio.charset.Charset;
-import java.util.List;
-
-import org.apache.giraph.bsp.BspService;
-import org.apache.giraph.conf.GiraphConfiguration;
-import org.apache.giraph.conf.ImmutableClassesGiraphConfiguration;
-import org.apache.giraph.graph.Vertex;
-import org.apache.giraph.io.VertexOutputFormat;
-import org.apache.giraph.io.VertexWriter;
-import org.apache.giraph.rexster.utils.RexsterUtils;
-import org.apache.giraph.zk.ZooKeeperExt;
-import org.apache.giraph.zk.ZooKeeperManager;
-import org.apache.hadoop.io.Writable;
-import org.apache.hadoop.io.WritableComparable;
-import org.apache.hadoop.mapreduce.JobContext;
-import org.apache.hadoop.mapreduce.OutputCommitter;
-import org.apache.hadoop.mapreduce.TaskAttemptContext;
-import org.apache.log4j.Logger;
-import org.apache.zookeeper.CreateMode;
-import org.apache.zookeeper.KeeperException;
-import org.apache.zookeeper.WatchedEvent;
-import org.apache.zookeeper.Watcher;
-import org.apache.zookeeper.Watcher.Event.EventType;
-import org.apache.zookeeper.ZooDefs.Ids;
-import org.json.JSONException;
-import org.json.JSONObject;
-
-/**
- * Abstract class that users should subclass to use their own Rexster based
- * vertex onput format.
- *
- * @param <I>
- * @param <V>
- * @param <E>
- */
-@SuppressWarnings("rawtypes")
-public class RexsterVertexOutputFormat<I extends WritableComparable,
- V extends Writable, E extends Writable>
- extends VertexOutputFormat<I, V, E> {
-
- /** Class logger. */
- private static final Logger LOG =
- Logger.getLogger(RexsterVertexOutputFormat.class);
-
- @Override
- public RexsterVertexWriter
- createVertexWriter(TaskAttemptContext context)
- throws IOException, InterruptedException {
-
- return new RexsterVertexWriter();
- }
-
- @Override
- public void checkOutputSpecs(JobContext context)
- throws IOException, InterruptedException {
- GiraphConfiguration gconf =
- new GiraphConfiguration(context.getConfiguration());
- String msg = "Rexster OutputFormat usage requires both Edge and Vertex " +
- "OutputFormat's.";
-
- if (!gconf.hasEdgeOutputFormat()) {
- LOG.error(msg);
- throw new InterruptedException(msg);
- }
-
- String endpoint = GIRAPH_REXSTER_HOSTNAME.get(gconf);
- if (endpoint == null) {
- throw new InterruptedException(GIRAPH_REXSTER_HOSTNAME.getKey() +
- " is a mandatory parameter.");
- }
- }
-
- @Override
- public OutputCommitter getOutputCommitter(TaskAttemptContext context)
- throws IOException, InterruptedException {
-
- return new NullOutputCommitter();
- }
-
- /**
- * Empty output commiter for hadoop.
- */
- private static class NullOutputCommitter extends OutputCommitter {
- @Override
- public void abortTask(TaskAttemptContext taskContext) { }
-
- @Override
- public void cleanupJob(JobContext jobContext) { }
-
- @Override
- public void commitTask(TaskAttemptContext taskContext) { }
-
- @Override
- public boolean needsTaskCommit(TaskAttemptContext taskContext) {
- return false;
- }
-
- @Override
- public void setupJob(JobContext jobContext) { }
-
- @Override
- public void setupTask(TaskAttemptContext taskContext) { }
- }
-
- /**
- * Abstract class to be implemented by the user based on their specific
- * vertex/edges output. Easiest to ignore the key value separator and only
- * use key instead.
- */
- protected class RexsterVertexWriter extends VertexWriter<I, V, E>
- implements Watcher {
- /** barrier path */
- private static final String BARRIER_PATH = "/_rexsterBarrier";
- /** array key that points to the edges and vertices */
- private static final String JSON_ARRAY_KEY = "tx";
- /** Connection to the HTTP REST endpoint */
- private HttpURLConnection rexsterConn;
- /** Output stream from the HTTP connection to the REST endpoint */
- private BufferedWriter rexsterBufferedStream;
- /** attribute used to keep the state of the element array status */
- private boolean isFirstElement = true;
- /** ZooKeeper client object */
- private ZooKeeperExt zk = null;
- /** lock for management of the barrier */
- private final Object lock = new Object();
- /** number of vertices before starting a new connection */
- private int txsize;
- /** number of vertexes of vertices sent */
- private int txcounter = 0;
- /** label of the vertex id field */
- private String vlabel;
- /** vertex id */
- private I vertexId;
-
- @Override
- public void initialize(TaskAttemptContext context)
- throws IOException, InterruptedException {
- ImmutableClassesGiraphConfiguration conf = getConf();
-
- vlabel = GIRAPH_REXSTER_VLABEL.get(conf);
- txsize = GIRAPH_REXSTER_OUTPUT_V_TXSIZE.get(conf);
- startConnection();
-
- /* set the barrier */
- zk = new ZooKeeperExt(conf.getZookeeperList(),
- conf.getZooKeeperSessionTimeout(), conf.getZookeeperOpsMaxAttempts(),
- conf.getZookeeperOpsRetryWaitMsecs(), this, context);
- }
-
- @Override
- public void close(TaskAttemptContext context)
- throws IOException, InterruptedException {
- /* close connection */
- stopConnection();
-
- /* deal with the barrier */
- String id = context.getTaskAttemptID().toString();
- String zkBasePath = ZooKeeperManager.getBasePath(getConf()) +
- BspService.BASE_DIR + "/" +
- getConf().getJobId();
- prepareBarrier(zkBasePath);
- enterBarrier(zkBasePath, id);
- checkBarrier(zkBasePath, context);
- }
-
- @Override
- public void writeVertex(Vertex<I, V, E> vertex)
- throws IOException, InterruptedException {
-
- if (txcounter == txsize) {
- txcounter = 0;
- isFirstElement = true;
- stopConnection();
- startConnection();
- }
-
- try {
- /* extract the JSON object of the vertex */
- JSONObject jsonVertex = getVertex(vertex);
- jsonVertex.accumulate("_type", "vertex");
- jsonVertex.accumulate(vlabel, getVertexId().toString());
- String suffix = ",";
- if (isFirstElement) {
- isFirstElement = false;
- suffix = "";
- }
- rexsterBufferedStream.write(suffix + jsonVertex);
- txcounter += 1;
-
- } catch (JSONException e) {
- throw new InterruptedException("Error writing the vertex: " +
- e.getMessage());
- }
- }
-
- @Override
- public void process(WatchedEvent event) {
- EventType type = event.getType();
-
- if (type == EventType.NodeChildrenChanged) {
- if (LOG.isDebugEnabled()) {
- LOG.debug("signal: number of children changed.");
- }
- synchronized (lock) {
- lock.notify();
- }
- }
- }
-
- /**
- * Prepare the root node if needed to create the root Rexster barrier znode
- *
- * @param zkBasePath base path for zookeeper
- * @throws InterruptedException
- */
- private void prepareBarrier(String zkBasePath)
- throws InterruptedException {
- try {
- zk.createExt(zkBasePath + BARRIER_PATH, null, Ids.OPEN_ACL_UNSAFE,
- CreateMode.PERSISTENT, false);
- } catch (KeeperException.NodeExistsException nee) {
- if (LOG.isInfoEnabled()) {
- LOG.info("rexster barrier znode already exists.");
- }
- } catch (KeeperException ke) {
- throw new InterruptedException("RexsterVertexOutputFormat: " +
- "error while creating the barrier: " + ke.getMessage());
- }
- }
-
- /**
- * Enter the Rexster barrier
- *
- * @param zkBasePath base path for zookeeper
- * @param id value id used for the znode
- * @throws InterruptedException
- */
- private void enterBarrier(String zkBasePath, String id)
- throws InterruptedException {
- try {
- zk.createExt(zkBasePath + BARRIER_PATH + "/" + id, null,
- Ids.OPEN_ACL_UNSAFE, CreateMode.EPHEMERAL, false);
- } catch (KeeperException.NodeExistsException nee) {
- if (LOG.isInfoEnabled()) {
- LOG.info("rexster barrier znode already exists.");
- }
- } catch (KeeperException ke) {
- throw new InterruptedException("RexsterVertexOutputFormat: " +
- "error while creating the barrier: " + ke.getMessage());
- }
- }
-
- /**
- * Check the Rexster barrier to verify whether all the vertices have been
- * saved. If so, the barrier can be left and it is possible to save the
- * edges.
- *
- * @param zkBasePath base path for zookeeper
- * @param context task attempt context
- * @throws InterruptedException
- */
- private void checkBarrier(String zkBasePath,
- TaskAttemptContext context) throws InterruptedException {
- long workersNum = getConf().getMapTasks() - 1;
- int timeout = GIRAPH_REXSTER_OUTPUT_WAIT_TIMEOUT.get(getConf());
-
- try {
- String barrierPath = zkBasePath + BARRIER_PATH;
- while (true) {
- List<String> list =
- zk.getChildrenExt(barrierPath, true, false, false);
-
- if (list.size() < workersNum) {
- synchronized (lock) {
- lock.wait(timeout);
- }
- context.progress();
- } else {
- return;
- }
- }
- } catch (KeeperException ke) {
- throw new InterruptedException("Error while checking the barrier:" +
- ke.getMessage());
- }
- }
-
- /**
- * Start a new connection with the Rexster REST endpoint.
- */
- private void startConnection() throws IOException, InterruptedException {
- rexsterConn = RexsterUtils.Vertex.openOutputConnection(getConf());
- rexsterBufferedStream = new BufferedWriter(
- new OutputStreamWriter(rexsterConn.getOutputStream(),
- Charset.forName("UTF-8")));
- /* open the JSON container: is an object containing an array of
- elements */
- rexsterBufferedStream.write("{ ");
- rexsterBufferedStream.write("\"vlabel\" : \"" + vlabel + "\",");
- rexsterBufferedStream.write("\"" + JSON_ARRAY_KEY + "\"");
- rexsterBufferedStream.write(" : [ ");
- }
-
- /**
- * Stop a new connection with the Rexster REST endpoint. By default the
- * JDK manages keep-alive so no particular code is sent in place for this
- * aim.
- */
- private void stopConnection() throws IOException, InterruptedException {
- /* close the JSON container */
- rexsterBufferedStream.write(" ] }");
- rexsterBufferedStream.flush();
- rexsterBufferedStream.close();
-
- /* check the response and in case of error signal the unsuccessful state
- via exception */
- RexsterUtils.Vertex.handleResponse(rexsterConn);
- }
-
- /**
- * Each vertex needs to be transformed into a JSON object to be sent to the
- * batch interface of Rexster. This function does NOT need to implement any
- * edge transformation since RexsterVertexWriter#getEdge is
- * intended for such a task.
- *
- * @param vertex vertex to be transformed into JSON
- * @return JSON representation of the vertex
- */
- protected JSONObject getVertex(Vertex<I, V, E> vertex)
- throws JSONException {
-
- vertexId = vertex.getId();
-
- String value = vertex.getValue().toString();
- JSONObject jsonVertex = new JSONObject();
- jsonVertex.accumulate("value", value);
-
- return jsonVertex;
- }
-
- /**
- * For compatibility reasons, the id of the vertex needs to be accumulated
- * in the vertex object using the defined vlabel, hence we provide a
- * different function to get the vertex id to keep this compatibility
- * management indipendent from the user implementation.
- *
- * @return vertex id object
- */
- protected I getVertexId() {
- return vertexId;
- }
- }
-}
diff --git a/giraph-rexster/giraph-rexster-io/src/main/java/org/apache/giraph/rexster/io/formats/RexsterLongDoubleDoubleEdgeOutputFormat.java b/giraph-rexster/giraph-rexster-io/src/main/java/org/apache/giraph/rexster/io/formats/RexsterLongDoubleDoubleEdgeOutputFormat.java
deleted file mode 100644
index 80911ff..0000000
--- a/giraph-rexster/giraph-rexster-io/src/main/java/org/apache/giraph/rexster/io/formats/RexsterLongDoubleDoubleEdgeOutputFormat.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * 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.
- */
-
-package org.apache.giraph.rexster.io.formats;
-
-import java.io.IOException;
-
-import org.apache.giraph.edge.Edge;
-import org.apache.giraph.rexster.io.RexsterEdgeOutputFormat;
-import org.apache.hadoop.io.DoubleWritable;
-import org.apache.hadoop.io.LongWritable;
-import org.apache.hadoop.mapreduce.TaskAttemptContext;
-import org.json.JSONException;
-import org.json.JSONObject;
-
-/**
- * Rexster Edge Output Format for Long ID's, Double Vertex values and
- * Double edge values.
- */
-public class RexsterLongDoubleDoubleEdgeOutputFormat
- extends RexsterEdgeOutputFormat<LongWritable, DoubleWritable,
- DoubleWritable> {
-
- @Override
- public RexsterEdgeWriter createEdgeWriter(
- TaskAttemptContext context) throws IOException,
- InterruptedException {
-
- return new RexsterLongDoubleDoubleEdgeWriter();
- }
-
- /**
- * Rexster edge writer.
- */
- protected class RexsterLongDoubleDoubleEdgeWriter
- extends RexsterEdgeWriter {
-
- @Override
- protected JSONObject getEdge(LongWritable srcId, DoubleWritable srcValue,
- Edge<LongWritable, DoubleWritable> edge) throws JSONException {
-
- long outId = srcId.get();
- long inId = edge.getTargetVertexId().get();
- double value = edge.getValue().get();
- JSONObject jsonEdge = new JSONObject();
- jsonEdge.accumulate("_outV", outId);
- jsonEdge.accumulate("_inV", inId);
- jsonEdge.accumulate("value", value);
-
- return jsonEdge;
- }
- }
-}
diff --git a/giraph-rexster/giraph-rexster-io/src/main/java/org/apache/giraph/rexster/io/formats/RexsterLongDoubleDoubleVertexInputFormat.java b/giraph-rexster/giraph-rexster-io/src/main/java/org/apache/giraph/rexster/io/formats/RexsterLongDoubleDoubleVertexInputFormat.java
deleted file mode 100644
index 7aa643a..0000000
--- a/giraph-rexster/giraph-rexster-io/src/main/java/org/apache/giraph/rexster/io/formats/RexsterLongDoubleDoubleVertexInputFormat.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * 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.
- */
-
-package org.apache.giraph.rexster.io.formats;
-
-import java.io.IOException;
-
-import org.apache.giraph.graph.Vertex;
-import org.apache.giraph.rexster.io.RexsterVertexInputFormat;
-import org.apache.hadoop.io.DoubleWritable;
-import org.apache.hadoop.io.LongWritable;
-import org.apache.hadoop.mapreduce.InputSplit;
-import org.apache.hadoop.mapreduce.TaskAttemptContext;
-import org.json.JSONException;
-import org.json.JSONObject;
-
-/**
- * Rexster Edge Input Format for Long vertex ID's and Double edge values
- */
-public class RexsterLongDoubleDoubleVertexInputFormat
- extends RexsterVertexInputFormat<LongWritable, DoubleWritable,
- DoubleWritable> {
-
- @Override
- public RexsterVertexReader createVertexReader(
- InputSplit split, TaskAttemptContext context) throws IOException {
-
- return new RexsterLongDoubleDoubleVertexReader();
- }
-
- /**
- * Rexster vertex reader
- */
- protected class RexsterLongDoubleDoubleVertexReader
- extends RexsterVertexReader {
-
- @Override
- protected Vertex<LongWritable, DoubleWritable, DoubleWritable> parseVertex(
- JSONObject jsonVertex) throws JSONException {
-
- /* create the actual vertex */
- Vertex<LongWritable, DoubleWritable, DoubleWritable> vertex =
- getConf().createVertex();
-
- Long id;
- try {
- id = jsonVertex.getLong("_id");
- } catch (JSONException ex) {
- /* OrientDB compatibility; try to transform it as long */
- String idString = jsonVertex.getString("_id");
- String[] splits = idString.split(":");
- id = Long.parseLong(splits[1]);
- }
-
- Double value;
- try {
- value = jsonVertex.getDouble("value");
- } catch (JSONException ex) {
- /* OrientDB compatibility; try to transform it as long */
- value = new Double(0);
- }
- vertex.initialize(new LongWritable(id), new DoubleWritable(value));
- return vertex;
- }
- }
-}
diff --git a/giraph-rexster/giraph-rexster-io/src/main/java/org/apache/giraph/rexster/io/formats/RexsterLongDoubleDoubleVertexOutputFormat.java b/giraph-rexster/giraph-rexster-io/src/main/java/org/apache/giraph/rexster/io/formats/RexsterLongDoubleDoubleVertexOutputFormat.java
deleted file mode 100644
index a1a6cc5..0000000
--- a/giraph-rexster/giraph-rexster-io/src/main/java/org/apache/giraph/rexster/io/formats/RexsterLongDoubleDoubleVertexOutputFormat.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * 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.
- */
-
-package org.apache.giraph.rexster.io.formats;
-
-import java.io.IOException;
-
-import org.apache.giraph.graph.Vertex;
-import org.apache.giraph.rexster.io.RexsterVertexOutputFormat;
-import org.apache.hadoop.io.DoubleWritable;
-import org.apache.hadoop.io.LongWritable;
-import org.apache.hadoop.mapreduce.TaskAttemptContext;
-import org.json.JSONException;
-import org.json.JSONObject;
-
-/**
- * Rexster Vertex Output Format for Long ID's, Double Vertex values and
- * Double edge values.
- */
-public class RexsterLongDoubleDoubleVertexOutputFormat
- extends RexsterVertexOutputFormat<LongWritable, DoubleWritable,
- DoubleWritable> {
-
- @Override
- public RexsterVertexWriter createVertexWriter(
- TaskAttemptContext context) throws IOException,
- InterruptedException {
-
- return new RexsterLongDoubleDoubleVertexWriter();
- }
-
- /**
- * Rexster vertex writer.
- */
- protected class RexsterLongDoubleDoubleVertexWriter
- extends RexsterVertexWriter {
-
- /** current vertex ID */
- private LongWritable vertexId;
-
- @Override
- protected JSONObject getVertex(
- Vertex<LongWritable, DoubleWritable, DoubleWritable> vertex)
- throws JSONException {
-
- vertexId = vertex.getId();
-
- double value = vertex.getValue().get();
- JSONObject jsonVertex = new JSONObject();
- jsonVertex.accumulate("value", value);
-
- return jsonVertex;
- }
-
- @Override
- protected LongWritable getVertexId() {
- return vertexId;
- }
- }
-}
diff --git a/giraph-rexster/giraph-rexster-io/src/main/java/org/apache/giraph/rexster/io/formats/RexsterLongDoubleEdgeInputFormat.java b/giraph-rexster/giraph-rexster-io/src/main/java/org/apache/giraph/rexster/io/formats/RexsterLongDoubleEdgeInputFormat.java
deleted file mode 100644
index 9974c28..0000000
--- a/giraph-rexster/giraph-rexster-io/src/main/java/org/apache/giraph/rexster/io/formats/RexsterLongDoubleEdgeInputFormat.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * 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.
- */
-
-package org.apache.giraph.rexster.io.formats;
-
-import java.io.IOException;
-
-import org.apache.giraph.edge.Edge;
-import org.apache.giraph.edge.EdgeFactory;
-import org.apache.giraph.rexster.io.RexsterEdgeInputFormat;
-import org.apache.hadoop.io.LongWritable;
-import org.apache.hadoop.io.DoubleWritable;
-import org.apache.hadoop.mapreduce.InputSplit;
-import org.apache.hadoop.mapreduce.TaskAttemptContext;
-import org.json.JSONException;
-import org.json.JSONObject;
-
-/**
- * Rexster Edge Input Format for Long vertex ID's and Double edge values
- */
-public class RexsterLongDoubleEdgeInputFormat
- extends RexsterEdgeInputFormat<LongWritable, DoubleWritable> {
-
- @Override
- public RexsterEdgeReader createEdgeReader(
- InputSplit split, TaskAttemptContext context) throws IOException {
-
- return new RexsterLongDoubleEdgeReader();
- }
-
- /**
- * Rexster edge reader
- */
- protected class RexsterLongDoubleEdgeReader extends RexsterEdgeReader {
-
- /** source vertex of the edge */
- private LongWritable sourceId;
-
- @Override
- public LongWritable getCurrentSourceId()
- throws IOException, InterruptedException {
-
- return this.sourceId;
- }
-
- @Override
- protected Edge<LongWritable, DoubleWritable> parseEdge(JSONObject jsonEdge)
- throws JSONException {
-
- Long value = jsonEdge.getLong("value");
- Long dest;
- try {
- dest = jsonEdge.getLong("_outV");
- } catch (JSONException ex) {
- /* OrientDB compatibility; try to transform it as long */
- String idString = jsonEdge.getString("_outV");
- String[] splits = idString.split(":");
- dest = Long.parseLong(splits[1]);
- }
- Edge<LongWritable, DoubleWritable> edge =
- EdgeFactory.create(new LongWritable(dest), new DoubleWritable(value));
-
- Long sid;
- try {
- sid = jsonEdge.getLong("_inV");
- } catch (JSONException ex) {
- /* OrientDB compatibility; try to transform it as long */
- String sidString = jsonEdge.getString("_inV");
- String[] splits = sidString.split(":");
- sid = Long.parseLong(splits[1]);
- }
- this.sourceId = new LongWritable(sid);
- return edge;
- }
- }
-}
diff --git a/giraph-rexster/giraph-rexster-io/src/main/java/org/apache/giraph/rexster/io/formats/RexsterLongDoubleFloatEdgeOutputFormat.java b/giraph-rexster/giraph-rexster-io/src/main/java/org/apache/giraph/rexster/io/formats/RexsterLongDoubleFloatEdgeOutputFormat.java
deleted file mode 100644
index 3637837..0000000
--- a/giraph-rexster/giraph-rexster-io/src/main/java/org/apache/giraph/rexster/io/formats/RexsterLongDoubleFloatEdgeOutputFormat.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * 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.
- */
-
-package org.apache.giraph.rexster.io.formats;
-
-import java.io.IOException;
-
-import org.apache.giraph.edge.Edge;
-import org.apache.giraph.rexster.io.RexsterEdgeOutputFormat;
-import org.apache.hadoop.io.DoubleWritable;
-import org.apache.hadoop.io.FloatWritable;
-import org.apache.hadoop.io.LongWritable;
-import org.apache.hadoop.mapreduce.TaskAttemptContext;
-import org.json.JSONException;
-import org.json.JSONObject;
-
-/**
- * Rexster Edge Output Format for Long ID's, Double Vertex values and
- * Float edge values.
- */
-public class RexsterLongDoubleFloatEdgeOutputFormat
- extends RexsterEdgeOutputFormat<LongWritable, DoubleWritable,
- FloatWritable> {
-
- @Override
- public RexsterEdgeWriter createEdgeWriter(
- TaskAttemptContext context) throws IOException,
- InterruptedException {
-
- return new RexsterLongDoubleFloatEdgeWriter();
- }
-
- /**
- * Rexster edge writer.
- */
- protected class RexsterLongDoubleFloatEdgeWriter
- extends RexsterEdgeWriter {
-
- @Override
- protected JSONObject getEdge(LongWritable srcId, DoubleWritable srcValue,
- Edge<LongWritable, FloatWritable> edge) throws JSONException {
-
- long outId = srcId.get();
- long inId = edge.getTargetVertexId().get();
- float value = edge.getValue().get();
- JSONObject jsonEdge = new JSONObject();
- jsonEdge.accumulate("_outV", outId);
- jsonEdge.accumulate("_inV", inId);
- jsonEdge.accumulate("value", value);
-
- return jsonEdge;
- }
- }
-}
diff --git a/giraph-rexster/giraph-rexster-io/src/main/java/org/apache/giraph/rexster/io/formats/RexsterLongDoubleFloatVertexInputFormat.java b/giraph-rexster/giraph-rexster-io/src/main/java/org/apache/giraph/rexster/io/formats/RexsterLongDoubleFloatVertexInputFormat.java
deleted file mode 100644
index cbd78ce..0000000
--- a/giraph-rexster/giraph-rexster-io/src/main/java/org/apache/giraph/rexster/io/formats/RexsterLongDoubleFloatVertexInputFormat.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * 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.
- */
-
-package org.apache.giraph.rexster.io.formats;
-
-import java.io.IOException;
-
-import org.apache.giraph.graph.Vertex;
-import org.apache.giraph.rexster.io.RexsterVertexInputFormat;
-import org.apache.hadoop.io.DoubleWritable;
-import org.apache.hadoop.io.FloatWritable;
-import org.apache.hadoop.io.LongWritable;
-import org.apache.hadoop.mapreduce.InputSplit;
-import org.apache.hadoop.mapreduce.TaskAttemptContext;
-import org.json.JSONException;
-import org.json.JSONObject;
-
-/**
- * Rexster Edge Input Format for Long vertex ID's and Float edge values
- */
-public class RexsterLongDoubleFloatVertexInputFormat
- extends RexsterVertexInputFormat<LongWritable, DoubleWritable,
- FloatWritable> {
-
- @Override
- public RexsterVertexReader createVertexReader(
- InputSplit split, TaskAttemptContext context) throws IOException {
-
- return new RexsterLongDoubleFloatVertexReader();
- }
-
- /**
- * Rexster vertex reader
- */
- protected class RexsterLongDoubleFloatVertexReader
- extends RexsterVertexReader {
-
- @Override
- protected Vertex<LongWritable, DoubleWritable, FloatWritable> parseVertex(
- JSONObject jsonVertex) throws JSONException {
-
- /* create the actual vertex */
- Vertex<LongWritable, DoubleWritable, FloatWritable> vertex =
- getConf().createVertex();
-
- Long id;
- try {
- id = jsonVertex.getLong("_id");
- } catch (JSONException ex) {
- /* OrientDB compatibility; try to transform it as long */
- String idString = jsonVertex.getString("_id");
- String[] splits = idString.split(":");
- id = Long.parseLong(splits[1]);
- }
-
- Double value;
- try {
- value = jsonVertex.getDouble("value");
- } catch (JSONException ex) {
- /* OrientDB compatibility; try to transform it as long */
- value = new Double(0);
- }
-
- vertex.initialize(new LongWritable(id), new DoubleWritable(value));
- return vertex;
- }
- }
-}
diff --git a/giraph-rexster/giraph-rexster-io/src/main/java/org/apache/giraph/rexster/io/formats/RexsterLongDoubleFloatVertexOutputFormat.java b/giraph-rexster/giraph-rexster-io/src/main/java/org/apache/giraph/rexster/io/formats/RexsterLongDoubleFloatVertexOutputFormat.java
deleted file mode 100644
index 2210887..0000000
--- a/giraph-rexster/giraph-rexster-io/src/main/java/org/apache/giraph/rexster/io/formats/RexsterLongDoubleFloatVertexOutputFormat.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * 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.
- */
-
-package org.apache.giraph.rexster.io.formats;
-
-import java.io.IOException;
-
-import org.apache.giraph.graph.Vertex;
-import org.apache.giraph.rexster.io.RexsterVertexOutputFormat;
-import org.apache.hadoop.io.DoubleWritable;
-import org.apache.hadoop.io.FloatWritable;
-import org.apache.hadoop.io.LongWritable;
-import org.apache.hadoop.mapreduce.TaskAttemptContext;
-import org.json.JSONException;
-import org.json.JSONObject;
-
-/**
- * Rexster Vertex Output Format for Long ID's, Double Vertex values and
- * Float edge values.
- */
-public class RexsterLongDoubleFloatVertexOutputFormat
- extends RexsterVertexOutputFormat<LongWritable, DoubleWritable,
- FloatWritable> {
-
- @Override
- public RexsterVertexWriter createVertexWriter(
- TaskAttemptContext context) throws IOException,
- InterruptedException {
-
- return new RexsterLongDoubleFloatVertexWriter();
- }
-
- /**
- * Rexster vertex writer.
- */
- protected class RexsterLongDoubleFloatVertexWriter
- extends RexsterVertexWriter {
-
- /** current vertex ID */
- private LongWritable vertexId;
-
- @Override
- protected JSONObject getVertex(
- Vertex<LongWritable, DoubleWritable, FloatWritable> vertex)
- throws JSONException {
-
- vertexId = vertex.getId();
-
- double value = vertex.getValue().get();
- JSONObject jsonVertex = new JSONObject();
- jsonVertex.accumulate("value", value);
-
- return jsonVertex;
- }
-
- @Override
- protected LongWritable getVertexId() {
- return vertexId;
- }
- }
-}
diff --git a/giraph-rexster/giraph-rexster-io/src/main/java/org/apache/giraph/rexster/io/formats/RexsterLongFloatEdgeInputFormat.java b/giraph-rexster/giraph-rexster-io/src/main/java/org/apache/giraph/rexster/io/formats/RexsterLongFloatEdgeInputFormat.java
deleted file mode 100644
index 3b13922..0000000
--- a/giraph-rexster/giraph-rexster-io/src/main/java/org/apache/giraph/rexster/io/formats/RexsterLongFloatEdgeInputFormat.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * 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.
- */
-
-package org.apache.giraph.rexster.io.formats;
-
-import java.io.IOException;
-
-import org.apache.giraph.edge.Edge;
-import org.apache.giraph.edge.EdgeFactory;
-import org.apache.giraph.rexster.io.RexsterEdgeInputFormat;
-import org.apache.hadoop.io.FloatWritable;
-import org.apache.hadoop.io.LongWritable;
-import org.apache.hadoop.mapreduce.InputSplit;
-import org.apache.hadoop.mapreduce.TaskAttemptContext;
-import org.json.JSONException;
-import org.json.JSONObject;
-
-/**
- * Rexster Edge Input Format for Long vertex ID's and Float edge values
- */
-public class RexsterLongFloatEdgeInputFormat
- extends RexsterEdgeInputFormat<LongWritable, FloatWritable> {
-
- @Override
- public RexsterEdgeReader createEdgeReader(
- InputSplit split, TaskAttemptContext context) throws IOException {
-
- return new RexsterLongFloatEdgeReader();
- }
-
- /**
- * Rexster edge reader
- */
- protected class RexsterLongFloatEdgeReader extends RexsterEdgeReader {
-
- /** source vertex of the edge */
- private LongWritable sourceId;
-
- @Override
- public LongWritable getCurrentSourceId()
- throws IOException, InterruptedException {
-
- return this.sourceId;
- }
-
- @Override
- protected Edge<LongWritable, FloatWritable> parseEdge(JSONObject jsonEdge)
- throws JSONException {
-
- Long value = jsonEdge.getLong("value");
- Long dest;
- try {
- dest = jsonEdge.getLong("_outV");
- } catch (JSONException ex) {
- /* OrientDB compatibility; try to transform it as long */
- String idString = jsonEdge.getString("_outV");
- String[] splits = idString.split(":");
- dest = Long.parseLong(splits[1]);
- }
- Edge<LongWritable, FloatWritable> edge =
- EdgeFactory.create(new LongWritable(dest), new FloatWritable(value));
-
- Long sid;
- try {
- sid = jsonEdge.getLong("_inV");
- } catch (JSONException ex) {
- /* OrientDB compatibility; try to transform it as long */
- String sidString = jsonEdge.getString("_inV");
- String[] splits = sidString.split(":");
- sid = Long.parseLong(splits[1]);
- }
- this.sourceId = new LongWritable(sid);
- return edge;
- }
- }
-}
diff --git a/giraph-rexster/giraph-rexster-io/src/main/java/org/apache/giraph/rexster/io/formats/package-info.java b/giraph-rexster/giraph-rexster-io/src/main/java/org/apache/giraph/rexster/io/formats/package-info.java
deleted file mode 100644
index b5ae44f..0000000
--- a/giraph-rexster/giraph-rexster-io/src/main/java/org/apache/giraph/rexster/io/formats/package-info.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * 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.
- */
-/**
- * Package of reusable Input/Output formats for Rexster in Giraph.
- */
-package org.apache.giraph.rexster.io.formats;
diff --git a/giraph-rexster/giraph-rexster-io/src/main/java/org/apache/giraph/rexster/io/package-info.java b/giraph-rexster/giraph-rexster-io/src/main/java/org/apache/giraph/rexster/io/package-info.java
deleted file mode 100644
index bbd5a7f..0000000
--- a/giraph-rexster/giraph-rexster-io/src/main/java/org/apache/giraph/rexster/io/package-info.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * 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.
- */
-/**
- * Package of reusable Input/Output formats for Rexster in Giraph.
- */
-package org.apache.giraph.rexster.io;
diff --git a/giraph-rexster/giraph-rexster-io/src/main/java/org/apache/giraph/rexster/utils/RexsterUtils.java b/giraph-rexster/giraph-rexster-io/src/main/java/org/apache/giraph/rexster/utils/RexsterUtils.java
deleted file mode 100644
index a3d6a96..0000000
--- a/giraph-rexster/giraph-rexster-io/src/main/java/org/apache/giraph/rexster/utils/RexsterUtils.java
+++ /dev/null
@@ -1,486 +0,0 @@
-/*
- * 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.
- */
-
-package org.apache.giraph.rexster.utils;
-
-import static org.apache.giraph.rexster.conf.GiraphRexsterConstants.GIRAPH_REXSTER_GREMLIN_E_SCRIPT;
-import static org.apache.giraph.rexster.conf.GiraphRexsterConstants.GIRAPH_REXSTER_GREMLIN_V_SCRIPT;
-import static org.apache.giraph.rexster.conf.GiraphRexsterConstants.GIRAPH_REXSTER_HOSTNAME;
-import static org.apache.giraph.rexster.conf.GiraphRexsterConstants.GIRAPH_REXSTER_INPUT_GRAPH;
-import static org.apache.giraph.rexster.conf.GiraphRexsterConstants.GIRAPH_REXSTER_OUTPUT_GRAPH;
-import static org.apache.giraph.rexster.conf.GiraphRexsterConstants.GIRAPH_REXSTER_PASSWORD;
-import static org.apache.giraph.rexster.conf.GiraphRexsterConstants.GIRAPH_REXSTER_PORT;
-import static org.apache.giraph.rexster.conf.GiraphRexsterConstants.GIRAPH_REXSTER_USERNAME;
-import static org.apache.giraph.rexster.conf.GiraphRexsterConstants.GIRAPH_REXSTER_USES_SSL;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.net.HttpURLConnection;
-import java.net.URL;
-import java.nio.charset.Charset;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.commons.codec.binary.Base64;
-import org.apache.giraph.conf.ImmutableClassesGiraphConfiguration;
-import org.apache.giraph.rexster.io.RexsterInputSplit;
-import org.apache.hadoop.mapreduce.InputSplit;
-import org.apache.hadoop.mapreduce.JobContext;
-import org.apache.log4j.Logger;
-import org.json.JSONException;
-import org.json.JSONObject;
-import org.json.JSONTokener;
-
-/**
- * Utility functions for the Rexster REST interface
- */
-@SuppressWarnings("rawtypes")
-public abstract class RexsterUtils {
- /** start object symbol for JSON */
- public static final char KEY_VALUE_SEPARATOR = ':';
- /** start object symbol for JSON */
- public static final char START_OBJECT = '{';
- /** end object symbol for JSON */
- public static final char END_OBJECT = '}';
- /** start array symbol for JSON */
- public static final char START_ARRAY = '[';
- /** end array symbol for JSON */
- public static final char END_ARRAY = ']';
- /** array elements separator symbol for JSON */
- public static final char ARRAY_SEPARATOR = ',';
- /** Class logger. */
- private static final Logger LOG = Logger.getLogger(RexsterUtils.class);
-
- /**
- * The default constructor is set to be private by default so that the
- * class is not instantiated.
- */
- private RexsterUtils() { /* private constructor */ }
-
- /**
- * Parse all the vertices from the JSON retreived from Rexster. Inspired
- * by the implementation of the JSONObject class.
- *
- * @param br buffer over the HTTP response content
- * @return JSONTokener tokener over the HTTP JSON. Null in case the results
- * array is empty.
- */
- public static JSONTokener parseJSONEnvelope(BufferedReader br)
- throws InterruptedException {
-
- JSONTokener tokener = null;
-
- try {
- tokener = new JSONTokener(br);
- /* check that the JSON is well-formed by starting with a '{' */
- if (tokener.nextClean() != START_OBJECT) {
- LOG.error(String.format("A JSONObject text must begin with '%c'",
- START_OBJECT));
- }
-
- /* loop on the whole array */
- char c = '\0';
- String key = null;
- for (;;) {
- c = tokener.nextClean();
- switch (c) {
- case 0:
- LOG.error(String.format("A JSONObject text must end with '%c'",
- END_OBJECT));
- break;
- case END_OBJECT:
- return tokener;
- default:
- tokener.back();
- key = tokener.nextValue().toString();
- }
-
- c = tokener.nextClean();
-
- if (c != KEY_VALUE_SEPARATOR) {
- LOG.error(String.format("Expected a %c after a key", c));
- }
-
- if (key != null && !key.equals("results")) {
- tokener.nextValue();
- } else {
- /* starting array */
- c = tokener.nextClean();
- if (c != START_ARRAY) {
- LOG.error("'results' is expected to be an array");
- }
-
- /* check if the array is emty. If so, return null to signal that
- no objects are available in the array, otherwise return the
- tokener. */
- c = tokener.nextClean();
- if (c == END_ARRAY) {
- return null;
- } else {
- tokener.back();
- return tokener;
- }
- }
-
- switch (tokener.nextClean()) {
- case ';':
- case ',':
- if (tokener.nextClean() == '}') {
- return tokener;
- }
- tokener.back();
- break;
- case '}':
- return tokener;
- default:
- LOG.error("Expected a ',' or '}'");
- }
- }
-
- } catch (JSONException e) {
- LOG.error("Unable to parse the JSON with the vertices.\n" +
- e.getMessage());
- throw new InterruptedException(e.toString());
- }
- }
-
- /**
- * Splitter used by both Vertex and Edge Input Format.
- *
- * @param context The job context
- * @param estimation Number of estimated objects
- * @return splits to be generated to read the input
- */
- public static List<InputSplit> getSplits(JobContext context,
- long estimation) throws IOException, InterruptedException {
-
- int chunks = context.getConfiguration().getInt("mapred.map.tasks", 1);
- long chunkSize = estimation / chunks;
- List<InputSplit> splits = new ArrayList<InputSplit>();
-
- if (LOG.isDebugEnabled()) {
- LOG.debug(String.format("Estimated objects: %d", estimation));
- LOG.debug(String.format("Number of chunks: %d", chunks));
- }
-
- for (int i = 0; i < chunks; ++i) {
- long start = i * chunkSize;
- long end =
- ((i + 1) == chunks) ? Long.MAX_VALUE : (i * chunkSize) + chunkSize;
- RexsterInputSplit split = new RexsterInputSplit(start, end);
- splits.add(split);
-
- if (LOG.isDebugEnabled()) {
- LOG.debug(String.format("Chunk: start %d; end %d;", start, end));
- LOG.debug(String.format("Chunk: size %d;", chunkSize));
- LOG.debug(split);
- }
- }
-
- return splits;
- }
-
- /**
- * Opens an HTTP connection to the specified Rexster server.
- *
- * @param conf giraph configuration
- * @param start start index of the Rexster page split
- * @param end end index of the Rexster page split
- * @param type stream type (vertices or edges) needed for the
- * REST Url
- * @param gremlinScript gremlin script. If set to null, will be ignored.
- * @return BufferedReader the object used to retrieve the HTTP response
- * content
- */
- // CHECKSTYLE: stop IllegalCatch
- public static BufferedReader openInputStream(
- ImmutableClassesGiraphConfiguration conf,
- long start, long end, String type, String gremlinScript)
- throws InterruptedException {
-
- String uriScriptFormat =
- "/graphs/%s/tp/gremlin?script=%s" +
- "&rexster.offset.start=%s&rexster.offset.end=%s";
- String uriFormat =
- "/graphs/%s/tp/giraph/%s/" +
- "?rexster.offset.start=%s&rexster.offset.end=%s";
- String endpoint = GIRAPH_REXSTER_HOSTNAME.get(conf);
-
- try {
- boolean isSsl = GIRAPH_REXSTER_USES_SSL.get(conf);
- int port = GIRAPH_REXSTER_PORT.get(conf);
- String graph = GIRAPH_REXSTER_INPUT_GRAPH.get(conf);
- URL url;
- if (gremlinScript != null && !gremlinScript.isEmpty()) {
- url = new URL(isSsl ? "https" : "http", endpoint, port,
- String.format(uriScriptFormat, graph, gremlinScript,
- start, end));
- } else {
- url = new URL(isSsl ? "https" : "http", endpoint, port,
- String.format(uriFormat, graph, type, start, end));
- }
-
- LOG.info(url);
-
- String username = GIRAPH_REXSTER_USERNAME.get(conf);
- String password = GIRAPH_REXSTER_PASSWORD.get(conf);
- String auth = getHTTPAuthString(username, password);
-
- HttpURLConnection connection = createConnection(url, "GET", auth);
- connection.setRequestProperty("Content-Type",
- "application/json; charset=UTF-8");
- connection.setDoInput(true);
- connection.setDoOutput(false);
- RexsterUtils.handleResponse(connection, type);
-
- InputStream is = connection.getInputStream();
- InputStreamReader isr = new InputStreamReader(is,
- Charset.forName("UTF-8"));
- return new BufferedReader(isr);
- } catch (Exception e) {
- throw new InterruptedException(e.getMessage());
- }
- }
- // CHECKSTYLE: resume IllegalCatch
-
- /**
- * Opens an HTTP connection to the specified Rexster server.
- *
- * @param conf giraph configuration
- * @param type either edge or vertex
- * @return the object used to populate the HTTP response content
- */
- // CHECKSTYLE: stop IllegalCatch
- public static HttpURLConnection openOutputConnection(
- ImmutableClassesGiraphConfiguration conf, String type)
- throws InterruptedException {
-
- String uriFormat = "/graphs/%s/tp/giraph/%s/";
- String endpoint = GIRAPH_REXSTER_HOSTNAME.get(conf);
- boolean isSsl = GIRAPH_REXSTER_USES_SSL.get(conf);
- int port = GIRAPH_REXSTER_PORT.get(conf);
- String graph = GIRAPH_REXSTER_OUTPUT_GRAPH.get(conf);
-
- try {
- URL url = new URL(isSsl ? "https" : "http", endpoint, port,
- String.format(uriFormat, graph, type));
- LOG.info(url);
-
- String username = GIRAPH_REXSTER_USERNAME.get(conf);
- String password = GIRAPH_REXSTER_PASSWORD.get(conf);
- String auth = getHTTPAuthString(username, password);
-
- HttpURLConnection connection = createConnection(url, "POST", auth);
- connection.setRequestProperty("Content-Type",
- "application/json; cherset=UTF-8");
- connection.setDoInput(true);
- connection.setDoOutput(true);
- return connection;
- } catch (Exception e) {
- throw new InterruptedException(e.getMessage());
- }
- }
- // CHECKSTYLE: resume IllegalCatch
-
- /**
- * Creates a new HTTP connection to the specified server.
- *
- * @param url URI to connec to
- * @param method method used for the HTTP request
- * @param authValue authetication value if available
- * @return a new HTTP connection
- */
- private static HttpURLConnection createConnection(final URL url,
- final String method, final String authValue) throws Exception {
-
- final HttpURLConnection connection =
- (HttpURLConnection) url.openConnection();
-
- connection.setConnectTimeout(0);
- connection.setReadTimeout(0);
- connection.setRequestMethod(method);
- if (authValue != null) {
- connection.setRequestProperty("Authorization", authValue);
- }
-
- return connection;
- }
-
- /**
- * Utility to handle the output response in case of errors.
- *
- * @param conn connection to the Rexster Interface
- * @param type type of data saved (vertices or edges)
- */
- private static void handleResponse(HttpURLConnection conn, String type)
- throws IOException, InterruptedException {
-
- if (conn.getResponseCode() != 200) {
- InputStream is = conn.getErrorStream();
- BufferedReader rd =
- new BufferedReader(new InputStreamReader(is, Charset.forName("UTF-8")));
-
- JSONObject obj = new JSONObject(rd);
- StringBuffer sb = new StringBuffer("Error occured while saving " +
- type + ";");
- String aux;
- while ((aux = rd.readLine()) != null) {
- sb.append(aux);
- }
- sb.append(obj);
-
- /*
- try {
- LOG.info("--> " + obj);
- String message = obj.getString("message");
- sb.append(" ");
- sb.append(message);
- } catch (JSONException e) {
- LOG.error("Unable to extract the error message.");
- }
- */
- rd.close();
-
- throw new InterruptedException(sb.toString());
- }
- }
-
- /**
- * Specific Rexster utility functions for vertices
- */
- public static class Vertex {
- /**
- * Empty private constructor. This class should not be instantiated.
- */
- private Vertex() { /* private constructor */ }
-
- /**
- * Opens an HTTP connection to the specified Rexster server for vertices.
- *
- * @param conf giraph configuration
- * @param start start index of the Rexster page split
- * @param end end index of the Rexster page split
- * @return BufferedReader the object used to retrieve the HTTP response
- */
- public static BufferedReader openInputStream(
- ImmutableClassesGiraphConfiguration conf, long start, long end)
- throws InterruptedException {
-
- String gremlinScript = GIRAPH_REXSTER_GREMLIN_V_SCRIPT.get(conf);
- return RexsterUtils.openInputStream(conf, start, end, "vertices",
- gremlinScript);
- }
-
- /**
- * Opens an HTTP connection to the specified Rexster server for vertices.
- *
- * @param conf giraph configuration
- * @return the object used to populate the HTTP response content
- */
- public static HttpURLConnection openOutputConnection(
- ImmutableClassesGiraphConfiguration conf)
- throws InterruptedException {
-
- return RexsterUtils.openOutputConnection(conf, "vertices");
- }
-
- /**
- * Utility to handle the output response in case of errors.
- *
- * @param conn connection to the Rexster Interface
- */
- public static void handleResponse(HttpURLConnection conn)
- throws IOException, InterruptedException {
-
- RexsterUtils.handleResponse(conn, "vertices");
- }
- }
-
- /**
- * Specific Rexster utility functions for edges
- */
- public static class Edge {
- /**
- * Empty private constructor. This class should not be instantiated.
- */
- private Edge() { /* private constructor */ }
-
- /**
- * Opens an HTTP connection to the specified Rexster server for edges.
- *
- * @param conf giraph configuration
- * @param start start index of the Rexster page split
- * @param end end index of the Rexster page split
- * @return BufferedReader the object used to retrieve the HTTP response
- */
- public static BufferedReader openInputStream(
- ImmutableClassesGiraphConfiguration conf, long start, long end)
- throws InterruptedException {
-
- String gremlinScript = GIRAPH_REXSTER_GREMLIN_E_SCRIPT.get(conf);
- return RexsterUtils.openInputStream(conf, start, end, "edges",
- gremlinScript);
- }
-
- /**
- * Opens an HTTP connection to the specified Rexster server for edges.
- *
- * @param conf giraph configuration
- * @return the object used to populate the HTTP response content
- */
- public static HttpURLConnection openOutputConnection(
- ImmutableClassesGiraphConfiguration conf)
- throws InterruptedException {
-
- return RexsterUtils.openOutputConnection(conf, "edges");
- }
-
- /**
- * Utility to handle the output response in case of errors.
- *
- * @param conn connection to the Rexster Interface
- */
- public static void handleResponse(HttpURLConnection conn)
- throws IOException, InterruptedException {
-
- RexsterUtils.handleResponse(conn, "edges");
- }
- }
-
- /**
- * Provide the Authentication string used for the HTTP connection with
- * Rexster.
- *
- * @param username username to connect to HTTP
- * @param password password to connect to HTTP
- * @return String the authentication string
- */
- private static String getHTTPAuthString(String username,
- String password) {
-
- if (username.isEmpty()) {
- return null;
- } else {
- return "Basic " +
- Base64.encodeBase64URLSafeString(
- (username + ":" + password).getBytes(Charset.forName("UTF-8")));
- }
- }
-}
diff --git a/giraph-rexster/giraph-rexster-io/src/main/java/org/apache/giraph/rexster/utils/package-info.java b/giraph-rexster/giraph-rexster-io/src/main/java/org/apache/giraph/rexster/utils/package-info.java
deleted file mode 100644
index 3f6810f..0000000
--- a/giraph-rexster/giraph-rexster-io/src/main/java/org/apache/giraph/rexster/utils/package-info.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * 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.
- */
-/**
- * Package of reusable utils for Rexster in Giraph.
- */
-package org.apache.giraph.rexster.utils;
diff --git a/giraph-rexster/giraph-rexster-io/src/test/java/org/apache/giraph/rexster/io/formats/TestRexsterLongDoubleFloatIOFormat.java b/giraph-rexster/giraph-rexster-io/src/test/java/org/apache/giraph/rexster/io/formats/TestRexsterLongDoubleFloatIOFormat.java
deleted file mode 100644
index 40f992e..0000000
--- a/giraph-rexster/giraph-rexster-io/src/test/java/org/apache/giraph/rexster/io/formats/TestRexsterLongDoubleFloatIOFormat.java
+++ /dev/null
@@ -1,532 +0,0 @@
-/*
- * 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.
- */
-
-package org.apache.giraph.rexster.io.formats;
-
-import static org.apache.giraph.rexster.conf.GiraphRexsterConstants.GIRAPH_REXSTER_GREMLIN_E_SCRIPT;
-import static org.apache.giraph.rexster.conf.GiraphRexsterConstants.GIRAPH_REXSTER_GREMLIN_V_SCRIPT;
-import static org.apache.giraph.rexster.conf.GiraphRexsterConstants.GIRAPH_REXSTER_HOSTNAME;
-import static org.apache.giraph.rexster.conf.GiraphRexsterConstants.GIRAPH_REXSTER_INPUT_GRAPH;
-import static org.apache.giraph.rexster.conf.GiraphRexsterConstants.GIRAPH_REXSTER_OUTPUT_GRAPH;
-import static org.apache.giraph.rexster.conf.GiraphRexsterConstants.GIRAPH_REXSTER_PORT;
-
-import java.io.BufferedReader;
-import java.io.DataOutputStream;
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.net.HttpURLConnection;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-
-import org.apache.commons.configuration.HierarchicalConfiguration;
-import org.apache.commons.configuration.XMLConfiguration;
-import org.apache.commons.io.FileUtils;
-import org.apache.giraph.conf.GiraphConfiguration;
-import org.apache.giraph.graph.BasicComputation;
-import org.apache.giraph.graph.Vertex;
-import org.apache.giraph.io.formats.JsonLongDoubleFloatDoubleVertexInputFormat;
-import org.apache.giraph.io.formats.JsonLongDoubleFloatDoubleVertexOutputFormat;
-import org.apache.giraph.utils.InternalVertexRunner;
-import org.apache.hadoop.io.DoubleWritable;
-import org.apache.hadoop.io.FloatWritable;
-import org.apache.hadoop.io.LongWritable;
-import org.codehaus.jettison.json.JSONArray;
-import org.codehaus.jettison.json.JSONException;
-import org.codehaus.jettison.json.JSONObject;
-import org.junit.AfterClass;
-import org.junit.Assert;
-import org.junit.BeforeClass;
-import org.junit.Ignore;
-import org.junit.Test;
-
-import com.google.common.base.Charsets;
-import com.google.common.io.Files;
-import com.tinkerpop.rexster.Tokens;
-import com.tinkerpop.rexster.protocol.EngineController;
-import com.tinkerpop.rexster.server.HttpRexsterServer;
-import com.tinkerpop.rexster.server.RexsterApplication;
-import com.tinkerpop.rexster.server.RexsterServer;
-import com.tinkerpop.rexster.server.XmlRexsterApplication;
-
-/**
- * This test suit is intended to extensively test Rexster I/O Format
- * together with the Kibble for such a goal.
- *
- *
- * Note: this is a very simple test case: load data into rexster
- * and then read it using giraph. And reverse: load data using giraph
- * and then read it using rexster. The graph that is being loaded
- * is always the same, but the output we receive is actually different
- * for different underlying formats. Why? Probably because of some bugs.
- */
-public class TestRexsterLongDoubleFloatIOFormat {
- /** temporary directory */
- protected static final String TMP_DIR = "/tmp/";
- /** input JSON extension */
- protected static final String REXSTER_CONF = "rexster.xml";
- /** string databases */
- protected static final String DATABASES[] = { "tgdb", "neodb", "orientdb" };
- /** string database (empty one) */
- protected static final String EMPTYDB = "emptydb";
- /** Rexster server instance */
- protected static RexsterServer server;
-
- @BeforeClass
- public static void initialSetup() throws Exception {
- //In case there were previous runs that failed
- deleteDbs();
- startRexsterServer();
- insertDbData();
- }
-
- @AfterClass
- static public void finalTearDown() throws Exception {
- stopRexsterServer();
- deleteDbs();
- }
-
- @Test
- public void testEmptyDbInput() throws Exception {
- testDbInput(EMPTYDB, true, false);
- }
-
- @Ignore("Fails due to maven dependecy conflicts.")
- @Test
- public void testEmptyDbInputGremlin() throws Exception {
- testDbInput(EMPTYDB, true, true);
- }
-
- @Ignore
- @Test
- public void testTgDbInput() throws Exception {
- testDbInput(DATABASES[0], false, false);
- }
-
- @Ignore("Fails due to maven dependecy conflicts.")
- @Test
- public void testTgDbInputGremlin() throws Exception {
- testDbInput(DATABASES[0], false, true);
- }
-
- @Test
- public void testNeoDbInput() throws Exception {
- testDbInput(DATABASES[1], false, false);
- }
-
- @Ignore("Fails due to maven dependecy conflicts.")
- @Test
- public void testNeoDbInputGremlin() throws Exception {
- testDbInput(DATABASES[1], false, true);
- }
-
- @Test
- public void testOrientDbInput() throws Exception {
- testDbInput(DATABASES[2], false, false);
- }
-
- @Ignore("Fails due to maven dependecy conflicts.")
- @Test
- public void testOrientDbInputGremlin() throws Exception {
- testDbInput(DATABASES[2], false, true);
- }
-
- @Ignore
- @Test
- public void testTgDbOutput() throws Exception {
- testDbOutput("empty" + DATABASES[0]);
- }
-
- @Ignore
- @Test
- public void testNeoDbOutput() throws Exception {
- testDbOutput("empty" + DATABASES[1]);
- }
-
- @Ignore
- @Test
- public void testOrientDbOutput() throws Exception {
- testDbOutput("empty" + DATABASES[2]);
- }
-
- private void testDbInput(String name, boolean isEmpty, boolean isGramlin)
- throws Exception {
- GiraphConfiguration conf = new GiraphConfiguration();
- GIRAPH_REXSTER_HOSTNAME.set(conf, "127.0.0.1");
- GIRAPH_REXSTER_PORT.set(conf, 18182);
- GIRAPH_REXSTER_INPUT_GRAPH.set(conf, name);
- if (isGramlin) {
- GIRAPH_REXSTER_GREMLIN_V_SCRIPT.set(conf, "g.V");
- GIRAPH_REXSTER_GREMLIN_E_SCRIPT.set(conf, "g.E");
- }
- conf.setComputationClass(EmptyComputation.class);
- conf.setVertexInputFormatClass(
- RexsterLongDoubleFloatVertexInputFormat.class);
- conf.setEdgeInputFormatClass(RexsterLongFloatEdgeInputFormat.class);
- conf.setVertexOutputFormatClass(
- JsonLongDoubleFloatDoubleVertexOutputFormat.class);
-
- Iterable<String> results = InternalVertexRunner.run(conf, new String[0],
- new String[0]);
-
- if (isEmpty) {
- boolean empty = false;
- if (results != null) {
- Iterator<String> it = results.iterator();
- empty = !it.hasNext();
- } else {
- empty = true;
- }
- Assert.assertTrue(empty);
- return;
- } else {
- Assert.assertNotNull(results);
- }
-
- URL url = this.getClass().getResource(name + "-output.json");
- File file = new File(url.toURI());
- ArrayList<Element> expected =
- convertIterator(Files.readLines(file,Charsets.UTF_8).iterator());
- ArrayList<Element> result = convertIterator(results.iterator());
- checkResult(expected, result);
- }
-
- private void testDbOutput(String name) throws Exception {
- GiraphConfiguration conf = new GiraphConfiguration();
- GIRAPH_REXSTER_HOSTNAME.set(conf, "127.0.0.1");
- GIRAPH_REXSTER_PORT.set(conf, 18182);
- GIRAPH_REXSTER_OUTPUT_GRAPH.set(conf, name);
- conf.setComputationClass(EmptyComputation.class);
- conf.setVertexInputFormatClass(
- JsonLongDoubleFloatDoubleVertexInputFormat.class);
- conf.setVertexOutputFormatClass(
- RexsterLongDoubleFloatVertexOutputFormat.class);
- conf.setEdgeOutputFormatClass(
- RexsterLongDoubleFloatEdgeOutputFormat.class);
-
- /* graph used for testing */
- String[] graph = new String[] {
- "[1,0,[[2,1],[4,3]]]",
- "[2,0,[[1,1],[3,2],[4,1]]]",
- "[3,0,[[2,2]]]",
- "[4,0,[[1,3],[5,4],[2,1]]]",
- "[5,0,[[3,4],[4,4]]]"
- };
-
- InternalVertexRunner.run(conf, graph);
- URL url = this.getClass().getResource(name + "-output.json");
- File file = new File(url.toURI());
- ArrayList<Element> expected =
- convertIterator(Files.readLines(file,Charsets.UTF_8).iterator());
- ArrayList<Element> result = getRexsterContent(name);
- checkResult(expected, result);
- }
-
- /**
- * Test compute method that sends each edge a notification of its parents.
- * The test set only has a 1-1 parent-to-child ratio for this unit test.
- */
- public static class EmptyComputation
- extends BasicComputation<LongWritable, DoubleWritable,
- FloatWritable, LongWritable> {
- @Override
- public void compute(
- Vertex<LongWritable, DoubleWritable, FloatWritable> vertex,
- Iterable<LongWritable> messages) throws IOException {
-
- vertex.voteToHalt();
- }
- }
-
- /**
- * Start the Rexster server by preparing the configuration file loaded via
- * the resources and setting other important parameters.
- */
- @SuppressWarnings("unchecked")
- private static void startRexsterServer() throws Exception {
- InputStream rexsterConf =
- TestRexsterLongDoubleFloatIOFormat.class.getResourceAsStream(
- REXSTER_CONF);
- XMLConfiguration properties = new XMLConfiguration();
- properties.load(rexsterConf);
- rexsterConf.close();
-
- List<HierarchicalConfiguration> graphConfigs =
- properties.configurationsAt(Tokens.REXSTER_GRAPH_PATH);
- RexsterApplication application = new XmlRexsterApplication(graphConfigs);
- server = new HttpRexsterServer(properties);
-
- int scriptEngineThreshold =
- properties.getInt("script-engine-reset-threshold",
- EngineController.RESET_NEVER);
- String scriptEngineInitFile =
- properties.getString("script-engine-init", "");
-
- /* allow scriptengines to be configured so that folks can drop in
- different gremlin flavors. */
- List<String> scriptEngineNames = properties.getList("script-engines");
-
- if (scriptEngineNames == null) {
- /* configure to default with gremlin-groovy */
- EngineController.configure(scriptEngineThreshold, scriptEngineInitFile);
- } else {
- EngineController.configure(scriptEngineThreshold, scriptEngineInitFile,
- new HashSet<String>(scriptEngineNames));
- }
- server.start(application);
- }
-
- private static void stopRexsterServer() throws Exception {
- try {
- server.stop();
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
- }
-
- private static void deleteDbs() throws Exception {
- for (int i = 0; i < DATABASES.length; ++i) {
- FileUtils.deleteDirectory(new File(TMP_DIR + DATABASES[i]));
- FileUtils.deleteDirectory(new File(TMP_DIR + "empty" + DATABASES[i]));
- }
- FileUtils.deleteDirectory(new File(TMP_DIR + EMPTYDB));
- }
-
- private static void insertDbData() throws Exception {
- for (int i = 0; i < DATABASES.length; ++i) {
- URL obj = new URL("http://127.0.0.1:18182/graphs/" + DATABASES[i] +
- "/tp/giraph/vertices");
- HttpURLConnection conn = (HttpURLConnection) obj.openConnection();
- conn.setRequestMethod("POST");
- conn.setRequestProperty("Accept", "*/*");
- conn.setRequestProperty("Content-Type",
- "application/json; charset=UTF-8");
- conn.setDoOutput(true);
- DataOutputStream wr = new DataOutputStream(conn.getOutputStream());
- /* write the JSON to be sent */
- wr.writeBytes("{ \"vlabel\":\"_vid\", \"tx\":[ ");
- wr.writeBytes("{ \"value\":0,\"_vid\":0 },");
- wr.writeBytes("{ \"value\":0,\"_vid\":1 },");
- wr.writeBytes("{ \"value\":0,\"_vid\":2 },");
- wr.writeBytes("{ \"value\":0,\"_vid\":3 },");
- wr.writeBytes("{ \"value\":0,\"_vid\":4 }");
- wr.writeBytes(" ] }");
- int responseCode = conn.getResponseCode();
- if (responseCode != 200) {
- throw new RuntimeException("Unable to insert data in " + DATABASES[i] +
- " code: " + responseCode + "\nresponse: " + conn.getResponseMessage());
- }
- BufferedReader in = new BufferedReader(
- new InputStreamReader(conn.getInputStream()));
- String inputLine;
- StringBuffer response = new StringBuffer();
- while ((inputLine = in.readLine()) != null) {
- response.append(inputLine);
- }
- in.close();
-
- obj = new URL("http://127.0.0.1:18182/graphs/" + DATABASES[i] +
- "/tp/giraph/edges");
- conn = (HttpURLConnection) obj.openConnection();
- conn.setRequestMethod("POST");
- conn.setRequestProperty("Accept", "*/*");
- conn.setRequestProperty("Content-Type",
- "application/json; charset=UTF-8");
- conn.setDoOutput(true);
- wr = new DataOutputStream(conn.getOutputStream());
- /* write the JSON to be sent */
- wr.writeBytes("{ \"vlabel\":\"_vid\", \"tx\":[ ");
- wr.writeBytes("{ \"value\": 1, \"_outV\": 0, \"_inV\": 1 },");
- wr.writeBytes("{ \"value\": 3, \"_outV\": 0, \"_inV\": 3 },");
- wr.writeBytes("{ \"value\": 1, \"_outV\": 1, \"_inV\": 0 },");
- wr.writeBytes("{ \"value\": 2, \"_outV\": 1, \"_inV\": 2 },");
- wr.writeBytes("{ \"value\": 1, \"_outV\": 1, \"_inV\": 3 },");
- wr.writeBytes("{ \"value\": 5, \"_outV\": 2, \"_inV\": 1 },");
- wr.writeBytes("{ \"value\": 4, \"_outV\": 2, \"_inV\": 4 },");
- wr.writeBytes("{ \"value\": 3, \"_outV\": 3, \"_inV\": 0 },");
- wr.writeBytes("{ \"value\": 1, \"_outV\": 3, \"_inV\": 1 },");
- wr.writeBytes("{ \"value\": 4, \"_outV\": 3, \"_inV\": 4 },");
- wr.writeBytes("{ \"value\": 4, \"_outV\": 4, \"_inV\": 3 },");
- wr.writeBytes("{ \"value\": 4, \"_outV\": 4, \"_inV\": 2 }");
- wr.writeBytes(" ] }");
- wr.flush();
- wr.close();
- responseCode = conn.getResponseCode();
- if (responseCode != 200) {
- throw new RuntimeException("Unable to insert data in " + DATABASES[i] +
- " code: " + responseCode + "\nresponse: " + conn.getResponseMessage());
- }
- in = new BufferedReader(new InputStreamReader(conn.getInputStream()));
- response = new StringBuffer();
- while ((inputLine = in.readLine()) != null) {
- response.append(inputLine);
- }
- in.close();
- }
- }
-
- private ArrayList<Element> convertIterator(Iterator<String> elementit)
- throws JSONException {
- ArrayList<Element> result = new ArrayList<Element>();
- while(elementit.hasNext()) {
- JSONArray vertex = new JSONArray(elementit.next());
- Element element = new Element(vertex.getLong(0), vertex.getLong(1));
- JSONArray edges = vertex.getJSONArray(2);
- for (int i = 0; i < edges.length(); ++i) {
- element.add(edges.getJSONArray(i).toString());
- }
- result.add(element);
- }
- return result;
- }
-
- private ArrayList<Element> getRexsterContent(String name) throws Exception {
- ArrayList<Element> result = new ArrayList<Element>();
- /* get all the vertices */
- URL url = new URL("http://127.0.0.1:18182/graphs/" + name +
- "/tp/giraph/vertices");
- HttpURLConnection conn = (HttpURLConnection) url.openConnection();
- conn.setRequestMethod("GET");
- conn.setRequestProperty("Content-Type", "application/json; charset=UTF-8");
-
- InputStream is = conn.getInputStream();
- StringBuffer json = new StringBuffer();
- BufferedReader br = new BufferedReader(new InputStreamReader(is));
- while (br.ready()) {
- json.append(br.readLine());
- }
- br.close();
- is.close();
-
- JSONObject results = new JSONObject(json.toString());
- JSONArray vertices = results.getJSONArray("results");
- for (int i = 0; i < vertices.length(); ++i) {
- JSONObject vertex = vertices.getJSONObject(i);
- long id = getId(vertex, "_id");
- result.add(new Element(id, 0));
- }
-
- /* get all the edges */
- url = new URL("http://127.0.0.1:18182/graphs/" + name + "/tp/giraph/edges");
- conn = (HttpURLConnection) url.openConnection();
- conn.setRequestMethod("GET");
- conn.setRequestProperty("Content-Type", "application/json; charset=UTF-8");
-
- is = conn.getInputStream();
- json = new StringBuffer();
- br = new BufferedReader(new InputStreamReader(is));
- while (br.ready()) {
- json.append(br.readLine());
- }
- br.close();
- is.close();
- results = new JSONObject(json.toString());
- JSONArray edges = results.getJSONArray("results");
- for (int i = 0; i < edges.length(); ++i) {
- JSONObject edge = edges.getJSONObject(i);
- long inV = getId(edge, "_inV");
- long outV = getId(edge, "_outV");
- long value = edge.getLong("value");
-
- for (int j = 0; j < result.size(); ++j) {
- Element element = result.get(j);
- if (element.id == outV) {
- element.add("[" + inV + "," + value + "]");
- }
- }
- }
- return result;
- }
-
- private long getId(JSONObject obj, String label) throws Exception {
- long id = 0;
- try {
- id = obj.getLong(label);
- } catch(JSONException e) {
- String idString = obj.getString(label);
- String[] splits = idString.split(":");
- id = Integer.parseInt(splits[1]);
- }
- return id;
- }
-
- protected void checkResult(ArrayList<Element> expected,
- ArrayList<Element> result) throws Exception {
- for (int i = 0; i < expected.size(); ++i) {
- boolean found = false;
- for (int j = 0; j < result.size(); ++j) {
- if (expected.get(i).equals(result.get(j))) {
- found = true;
- }
- }
- Assert.assertTrue("expected: " + expected + " result: " + result, found);
- }
- }
-
- protected static class Element {
- public long id;
- public long value;
- public ArrayList<String> edges;
-
- public Element(long id, long value) {
- this.id = id;
- this.value = value;
- this.edges = new ArrayList<String>();
- }
-
- public void add(String edge) {
- edges.add(edge);
- }
-
- public boolean equals(Element obj) {
- if (id != obj.id || value != obj.value) {
- return false;
- }
- for (int i = 0; i < edges.size(); ++i) {
- boolean found = false;
- for (int j = 0; j < obj.edges.size(); ++j) {
- if (edges.get(i).equals(obj.edges.get(j))) {
- found = true;
- }
- }
- if (found == false) {
- return false;
- }
- }
-
- return true;
- }
-
- public String toString() {
- StringBuffer sb = new StringBuffer();
- sb.append("id: ");
- sb.append(id);
- sb.append(" value: ");
- sb.append(value);
- sb.append(" edges: ");
- for (String element : edges) {
- sb.append(element + " ");
- }
- return sb.toString();
- }
- }
-}
diff --git a/giraph-rexster/giraph-rexster-io/src/test/resources/org/apache/giraph/rexster/io/formats/emptyneodb-output.json b/giraph-rexster/giraph-rexster-io/src/test/resources/org/apache/giraph/rexster/io/formats/emptyneodb-output.json
deleted file mode 100644
index fa9bbc7..0000000
--- a/giraph-rexster/giraph-rexster-io/src/test/resources/org/apache/giraph/rexster/io/formats/emptyneodb-output.json
+++ /dev/null
@@ -1,5 +0,0 @@
-[1,0,[[4,4],[5,4]]]
-[2,0,[[3,1],[4,2],[5,1]]]
-[3,0,[[2,1],[5,3]]]
-[4,0,[[2,2]]]
-[5,0,[[3,3],[1,4],[2,1]]]
diff --git a/giraph-rexster/giraph-rexster-io/src/test/resources/org/apache/giraph/rexster/io/formats/emptyorientdb-output.json b/giraph-rexster/giraph-rexster-io/src/test/resources/org/apache/giraph/rexster/io/formats/emptyorientdb-output.json
deleted file mode 100644
index 3475404..0000000
--- a/giraph-rexster/giraph-rexster-io/src/test/resources/org/apache/giraph/rexster/io/formats/emptyorientdb-output.json
+++ /dev/null
@@ -1,5 +0,0 @@
-[0,0,[[3,4],[4,4]]]
-[1,0,[[2,1],[3,2],[4,1]]]
-[2,0,[[1,1],[4,3]]]
-[3,0,[[1,2]]]
-[4,0,[[2,3],[0,4],[1,1]]]
diff --git a/giraph-rexster/giraph-rexster-io/src/test/resources/org/apache/giraph/rexster/io/formats/emptytgdb-output.json b/giraph-rexster/giraph-rexster-io/src/test/resources/org/apache/giraph/rexster/io/formats/emptytgdb-output.json
deleted file mode 100644
index ba2dd56..0000000
--- a/giraph-rexster/giraph-rexster-io/src/test/resources/org/apache/giraph/rexster/io/formats/emptytgdb-output.json
+++ /dev/null
@@ -1,5 +0,0 @@
-[0,0,[[3,4],[4,4]]]
-[1,0,[[4,1],[3,2],[2,1]]]
-[2,0,[[1,1],[4,3]]]
-[3,0,[[1,2]]]
-[4,0,[[2,3],[0,4],[1,1]]]
diff --git a/giraph-rexster/giraph-rexster-io/src/test/resources/org/apache/giraph/rexster/io/formats/neodb-output.json b/giraph-rexster/giraph-rexster-io/src/test/resources/org/apache/giraph/rexster/io/formats/neodb-output.json
deleted file mode 100644
index f318227..0000000
--- a/giraph-rexster/giraph-rexster-io/src/test/resources/org/apache/giraph/rexster/io/formats/neodb-output.json
+++ /dev/null
@@ -1,5 +0,0 @@
-[1,0,[[2,1],[4,3]]]
-[2,0,[[1,1],[3,5],[4,1]]]
-[3,0,[[2,2]]]
-[4,0,[[1,3],[2,1],[5,4]]]
-[5,0,[[3,4],[4,4]]]
diff --git a/giraph-rexster/giraph-rexster-io/src/test/resources/org/apache/giraph/rexster/io/formats/orientdb-output.json b/giraph-rexster/giraph-rexster-io/src/test/resources/org/apache/giraph/rexster/io/formats/orientdb-output.json
deleted file mode 100644
index c12cc3e..0000000
--- a/giraph-rexster/giraph-rexster-io/src/test/resources/org/apache/giraph/rexster/io/formats/orientdb-output.json
+++ /dev/null
@@ -1,5 +0,0 @@
-[0,0,[[1,1],[3,3]]]
-[1,0,[[0,1],[2,5],[3,1]]]
-[2,0,[[1,2]]]
-[3,0,[[0,3],[1,1],[4,4]]]
-[4,0,[[3,4],[2,4]]]
diff --git a/giraph-rexster/giraph-rexster-io/src/test/resources/org/apache/giraph/rexster/io/formats/rexster.xml b/giraph-rexster/giraph-rexster-io/src/test/resources/org/apache/giraph/rexster/io/formats/rexster.xml
deleted file mode 100644
index 9aebb89..0000000
--- a/giraph-rexster/giraph-rexster-io/src/test/resources/org/apache/giraph/rexster/io/formats/rexster.xml
+++ /dev/null
@@ -1,155 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<rexster>
- <http>
- <server-port>18182</server-port>
- <server-host>127.0.0.1</server-host>
- <base-uri>http://127.0.0.1</base-uri>
- <web-root>public</web-root>
- <character-set>UTF-8</character-set>
- <enable-jmx>false</enable-jmx>
- <enable-doghouse>false</enable-doghouse>
- <thread-pool>
- <worker>
- <core-size>8</core-size>
- <max-size>8</max-size>
- </worker>
- <kernal>
- <core-size>4</core-size>
- <max-size>4</max-size>
- </kernal>
- </thread-pool>
- <io-strategy>leader-follower</io-strategy>
- </http>
- <script-engine-reset-threshold>-1</script-engine-reset-threshold>
- <script-engine-init>data/init.groovy</script-engine-init>
- <script-engines>gremlin-groovy</script-engines>
- <graphs>
- <!-- graph that will contain data for the Input Format test -->
- <graph>
- <graph-name>orientdb</graph-name>
- <graph-type>orientgraph</graph-type>
- <graph-location>local:/tmp/orientdb</graph-location>
- <properties>
- <username>admin</username>
- <password>admin</password>
- <mvrbtree.lazyUpdates>1</mvrbtree.lazyUpdates>
- </properties>
- <extensions>
- <allows>
- <allow>tp:gremlin</allow>
- <allow>tp:giraph</allow>
- </allows>
- </extensions>
- </graph>
- <graph>
- <graph-name>neodb</graph-name>
- <graph-location>/tmp/neodb</graph-location>
- <graph-type>neo4jgraph</graph-type>
- <properties>
- <neostore.nodestore.db.mapped_memory>285M</neostore.nodestore.db.mapped_memory>
- <neostore.relationshipstore.db.mapped_memory>285M</neostore.relationshipstore.db.mapped_memory>
- <neostore.propertystore.db.mapped_memory>100M</neostore.propertystore.db.mapped_memory>
- <neostore.propertystore.db.strings.mapped_memory>100M</neostore.propertystore.db.strings.mapped_memory>
- <neostore.propertystore.db.arrays.mapped_memory>10M</neostore.propertystore.db.arrays.mapped_memory>
- <neostore.propertystore.db.index.mapped_memory>10M</neostore.propertystore.db.index.mapped_memory>
- <neostore.propertystore.db.index.keys.mapped_memory>10M</neostore.propertystore.db.index.keys.mapped_memory>
- <use_adaptive_cache>YES</use_adaptive_cache>
- <adaptive_cache_heap_ratio>0.77</adaptive_cache_heap_ratio>
- <adaptive_cache_manager_decrease_ratio>1.15</adaptive_cache_manager_decrease_ratio>
- <adaptive_cache_manager_increase_ratio>1.1</adaptive_cache_manager_increase_ratio>
- <adaptive_cache_worker_sleep_time>3000</adaptive_cache_worker_sleep_time>
- <min_node_cache_size>0</min_node_cache_size>
- <min_relationship_cache_size>0</min_relationship_cache_size>
- <max_node_cache_size>1500</max_node_cache_size>
- <max_relationship_cache_size>3500</max_relationship_cache_size>
- </properties>
- <extensions>
- <allows>
- <allow>tp:gremlin</allow>
- <allow>tp:giraph</allow>
- </allows>
- </extensions>
- </graph>
- <graph>
- <graph-name>tgdb</graph-name>
- <graph-location>/tmp/tgdb</graph-location>
- <graph-type>tinkergraph</graph-type>
- <extensions>
- <allows>
- <allow>tp:gremlin</allow>
- <allow>tp:giraph</allow>
- </allows>
- </extensions>
- </graph>
-
- <!-- graph that will be used for testing -->
- <graph>
- <graph-name>emptyorientdb</graph-name>
- <graph-type>orientgraph</graph-type>
- <graph-location>local:/tmp/emptyorientdb</graph-location>
- <properties>
- <username>admin</username>
- <password>admin</password>
- <mvrbtree.lazyUpdates>"fuffa"</mvrbtree.lazyUpdates>
- </properties>
- <extensions>
- <allows>
- <allow>tp:gremlin</allow>
- <allow>tp:giraph</allow>
- </allows>
- </extensions>
- </graph>
- <graph>
- <graph-name>emptyneodb</graph-name>
- <graph-location>/tmp/emptyneodb</graph-location>
- <graph-type>neo4jgraph</graph-type>
- <properties>
- <neostore.nodestore.db.mapped_memory>285M</neostore.nodestore.db.mapped_memory>
- <neostore.relationshipstore.db.mapped_memory>285M</neostore.relationshipstore.db.mapped_memory>
- <neostore.propertystore.db.mapped_memory>100M</neostore.propertystore.db.mapped_memory>
- <neostore.propertystore.db.strings.mapped_memory>100M</neostore.propertystore.db.strings.mapped_memory>
- <neostore.propertystore.db.arrays.mapped_memory>10M</neostore.propertystore.db.arrays.mapped_memory>
- <neostore.propertystore.db.index.mapped_memory>10M</neostore.propertystore.db.index.mapped_memory>
- <neostore.propertystore.db.index.keys.mapped_memory>10M</neostore.propertystore.db.index.keys.mapped_memory>
- <use_adaptive_cache>YES</use_adaptive_cache>
- <adaptive_cache_heap_ratio>0.77</adaptive_cache_heap_ratio>
- <adaptive_cache_manager_decrease_ratio>1.15</adaptive_cache_manager_decrease_ratio>
- <adaptive_cache_manager_increase_ratio>1.1</adaptive_cache_manager_increase_ratio>
- <adaptive_cache_worker_sleep_time>3000</adaptive_cache_worker_sleep_time>
- <min_node_cache_size>0</min_node_cache_size>
- <min_relationship_cache_size>0</min_relationship_cache_size>
- <max_node_cache_size>1500</max_node_cache_size>
- <max_relationship_cache_size>3500</max_relationship_cache_size>
- </properties>
- <extensions>
- <allows>
- <allow>tp:gremlin</allow>
- <allow>tp:giraph</allow>
- </allows>
- </extensions>
- </graph>
- <graph>
- <graph-name>emptytgdb</graph-name>
- <graph-location>/tmp/emptytgdb</graph-location>
- <graph-type>tinkergraph</graph-type>
- <extensions>
- <allows>
- <allow>tp:gremlin</allow>
- <allow>tp:giraph</allow>
- </allows>
- </extensions>
- </graph>
- <!-- empty database which is used to test for empty input -->
- <graph>
- <graph-name>emptydb</graph-name>
- <graph-location>/tmp/emptydb</graph-location>
- <graph-type>tinkergraph</graph-type>
- <extensions>
- <allows>
- <allow>tp:gremlin</allow>
- <allow>tp:giraph</allow>
- </allows>
- </extensions>
- </graph>
- </graphs>
-</rexster>
diff --git a/giraph-rexster/giraph-rexster-io/src/test/resources/org/apache/giraph/rexster/io/formats/tgdb-output.json b/giraph-rexster/giraph-rexster-io/src/test/resources/org/apache/giraph/rexster/io/formats/tgdb-output.json
deleted file mode 100644
index f4e61f3..0000000
--- a/giraph-rexster/giraph-rexster-io/src/test/resources/org/apache/giraph/rexster/io/formats/tgdb-output.json
+++ /dev/null
@@ -1,5 +0,0 @@
-[0,0,[[1,1]]]
-[1,0,[[2,5],[0,1],[3,1]]]
-[2,0,[[4,4],[1,2]]]
-[3,0,[[0,3],[4,4],[1,1]]]
-[4,0,[[3,4],[2,4]]]
diff --git a/giraph-rexster/pom.xml b/giraph-rexster/pom.xml
deleted file mode 100644
index bd99da0..0000000
--- a/giraph-rexster/pom.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-<!--
-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.3.0-SNAPSHOT</version>
- </parent>
-
- <artifactId>giraph-rexster</artifactId>
- <packaging>pom</packaging>
- <name>Apache Giraph Rexster I/O</name>
- <url>http://giraph.apache.org/giraph-rexster/</url>
- <description>Giraph Rexster I/O classes and kibble</description>
-
- <modules>
- <module>giraph-kibble</module>
- <module>giraph-rexster-io</module>
- </modules>
-</project>
diff --git a/pom.xml b/pom.xml
index b959bc8..8a92238 100644
--- a/pom.xml
+++ b/pom.xml
@@ -776,8 +776,12 @@ under the License.
<!-- test resources (for Giraph on YARN profile) -->
<exclude>**/test/resources/**</exclude>
<!-- Gora configs -->
+<<<<<<< HEAD
<!-- Rexster resource -->
<exclude>giraph-rexster/giraph-kibble/src/main/resources/META-INF/services/com.tinkerpop.rexster.extension.RexsterExtension</exclude>
+=======
+ <exclude>giraph-gora/conf/**</exclude>
+>>>>>>> e1f5a1f0e7c1ec25ade7efe03e25c7d86db1d5fe
<!-- site images -->
<exclude>src/site/resources/images/*.svg</exclude>
<exclude>giraph-debugger/src/main/resources/org/apache/giraph/debugger/mock/*.vm</exclude>
@@ -1366,91 +1370,6 @@ under the License.
</exclusions>
</dependency>
<dependency>
- <groupId>com.tinkerpop.rexster</groupId>
- <artifactId>rexster-core</artifactId>
- <version>${dep.tinkerpop.rexter.version}</version>
- <exclusions>
- <exclusion>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- </exclusion>
- <exclusion>
- <groupId>javax.xml.stream</groupId>
- <artifactId>stax-api</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>com.tinkerpop.rexster</groupId>
- <artifactId>rexster-protocol</artifactId>
- <version>${dep.tinkerpop.rexter.version}</version>
- <exclusions>
- <exclusion>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- </exclusion>
- <exclusion>
- <groupId>com.tinkerpop.gremlin</groupId>
- <artifactId>gremlin-groovy</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.ant</groupId>
- <artifactId>ant</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.glassfish.grizzly</groupId>
- <artifactId>grizzly-framework</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.codehaus.jackson</groupId>
- <artifactId>jackson-core-asl</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>com.tinkerpop.rexster</groupId>
- <artifactId>rexster-server</artifactId>
- <version>${dep.tinkerpop.rexter.version}</version>
- <exclusions>
- <exclusion>
- <groupId>asm</groupId>
- <artifactId>asm</artifactId>
- </exclusion>
- <exclusion>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- </exclusion>
- <exclusion>
- <groupId>com.fasterxml.jackson.core</groupId>
- <artifactId>jackson-annotations</artifactId>
- </exclusion>
- <exclusion>
- <groupId>com.fasterxml.jackson.core</groupId>
- <artifactId>jackson-databind</artifactId>
- </exclusion>
- <exclusion>
- <groupId>com.tinkerpop.gremlin</groupId>
- <artifactId>gremlin-groovy</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.codehaus.jackson</groupId>
- <artifactId>jackson-core-asl</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.glassfish.grizzly</groupId>
- <artifactId>grizzly-framework</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.glassfish.grizzly</groupId>
- <artifactId>grizzly-portunif</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.glassfish.grizzly</groupId>
- <artifactId>grizzly-rcm</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
<groupId>commons-cli</groupId>
<artifactId>commons-cli</artifactId>
<version>${dep.commons-cli.version}</version>
@@ -1611,6 +1530,7 @@ under the License.
</dependency>
<dependency>
<groupId>org.apache.giraph</groupId>
+<<<<<<< HEAD
<artifactId>giraph-rexster-io</artifactId>
<version>${project.version}</version>
</dependency>
@@ -1622,6 +1542,8 @@ under the License.
<dependency>
<<<<<<< HEAD
<groupId>org.apache.giraph</groupId>
+=======
+>>>>>>> e1f5a1f0e7c1ec25ade7efe03e25c7d86db1d5fe
<artifactId>giraph-gora</artifactId>
<version>${project.version}</version>
</dependency>