You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@giraph.apache.org by rv...@apache.org on 2014/10/20 05:02:06 UTC
[1/4] git commit: updated refs/heads/trunk to 7c61dcf
Repository: giraph
Updated Branches:
refs/heads/trunk f43f45009 -> 7c61dcf4a
Update Giraph-Gora documentation and make it available from giraph.a.o
Project: http://git-wip-us.apache.org/repos/asf/giraph/repo
Commit: http://git-wip-us.apache.org/repos/asf/giraph/commit/46d7d901
Tree: http://git-wip-us.apache.org/repos/asf/giraph/tree/46d7d901
Diff: http://git-wip-us.apache.org/repos/asf/giraph/diff/46d7d901
Branch: refs/heads/trunk
Commit: 46d7d901e35e83e4b95f95edda3217d08fb5b690
Parents: f43f450
Author: Lewis John McGibbney <le...@jpl.nasa.gov>
Authored: Sat Oct 11 18:30:36 2014 -0700
Committer: Roman Shaposhnik <rv...@apache.org>
Committed: Sun Oct 19 16:51:13 2014 -0700
----------------------------------------------------------------------
src/site/site.xml | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/giraph/blob/46d7d901/src/site/site.xml
----------------------------------------------------------------------
diff --git a/src/site/site.xml b/src/site/site.xml
index de649e0..8fd1490 100644
--- a/src/site/site.xml
+++ b/src/site/site.xml
@@ -94,11 +94,10 @@
<item name="Out-of-core" href="ooc.html"/>
<item name="Implementation" href="implementation.html"/>
<item name="Page Rank Example" href="pagerank.html"/>
- <item name="Input/Output in Giraph" href="io.html">
- <item name="Hive" href="hive.html"/>
- <item name="Gora" href="gora.html"/>
- <item name="Rexster I/O" href="rexster.html"/>
- </item>
+ <item name="Input/Output in Giraph" href="io.html"/>
+ <item name="Hive I/O" href="hive.html"/>
+ <item name="Gora I/O" href="gora.html"/>
+ <item name="Rexster I/O" href="rexster.html"/>
</item>
<item name="How to generate patches?" href="generating_patches.html" />
<item name="How to build this site?" href="build_site.html" />
[3/4] GIRAPH-946. Upgrade to Gora 0.5 (Renato Javier MarroquĂn Mogrovejo via rvs)
Posted by rv...@apache.org.
http://git-wip-us.apache.org/repos/asf/giraph/blob/7c61dcf4/giraph-gora/src/main/java/org/apache/giraph/io/gora/generated/GVertex.java
----------------------------------------------------------------------
diff --git a/giraph-gora/src/main/java/org/apache/giraph/io/gora/generated/GVertex.java b/giraph-gora/src/main/java/org/apache/giraph/io/gora/generated/GVertex.java
index efd7b95..81b7c9a 100644
--- a/giraph-gora/src/main/java/org/apache/giraph/io/gora/generated/GVertex.java
+++ b/giraph-gora/src/main/java/org/apache/giraph/io/gora/generated/GVertex.java
@@ -15,67 +15,59 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.apache.giraph.io.gora.generated;
-import java.util.Map;
-
-import org.apache.avro.Schema;
-import org.apache.avro.AvroRuntimeException;
-import org.apache.avro.util.Utf8;
-import org.apache.gora.persistency.StateManager;
-import org.apache.gora.persistency.StatefulHashMap;
-import org.apache.gora.persistency.impl.PersistentBase;
-import org.apache.gora.persistency.impl.StateManagerImpl;
-
/**
- * Example class for defining a Giraph-Vertex.
+ * Example class for defining a Giraph-vertex.
*/
@SuppressWarnings("all")
-public class GVertex extends PersistentBase {
- /**
- * Schema used for the class.
- */
- public static final Schema OBJ_SCHEMA = Schema.parse(
- "{\"type\":\"record\",\"name\":\"Vertex\"," +
- "\"namespace\":\"org.apache.giraph.gora.generated\"," +
- "\"fields\":[{\"name\":\"vertexId\",\"type\":\"string\"}," +
- "{\"name\":\"value\",\"type\":\"float\"},{\"name\":\"edges\"," +
- "\"type\":{\"type\":\"map\",\"values\":\"string\"}}]}");
+public class GVertex extends org.apache.gora.persistency.impl.PersistentBase
+ implements org.apache.avro.specific.SpecificRecord,
+ org.apache.gora.persistency.Persistent {
/**
- * Field enum
+ * Schema used for the class.
*/
+ public static final org.apache.avro.Schema SCHEMAS =
+ new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\"," +
+ "\"name\":\"GVertex\"," +
+ "\"namespace\":\"org.apache.giraph.io.gora.generated\"," +
+ "\"fields\":[{\"name\":\"vertexId\",\"type\":\"string\"}," +
+ "{\"name\":\"vertexValue\",\"type\":\"float\"}," +
+ "{\"name\":\"edges\",\"type\":" +
+ "{\"type\":\"map\",\"values\":\"string\"}}]}");
+
+ /** Enum containing all data bean's fields. */
public static enum Field {
/**
- * VertexId
+ * Vertex id.
*/
VERTEX_ID(0, "vertexId"),
/**
- * Field value
+ * Vertex value.
*/
- VALUE(1, "value"),
+ VERTEX_VALUE(1, "vertexValue"),
/**
- * Edges
+ * Vertex edges.
*/
EDGES(2, "edges");
/**
- * Field index
+ * Field's index.
*/
private int index;
/**
- * Field name
+ * Field's name.
*/
private String name;
/**
- * Field constructor
- * @param index of attribute
- * @param name of attribute
+ * Field's constructor
+ * @param index field's index.
+ * @param name field's name.
*/
Field(int index, String name) {
this.index = index;
@@ -83,24 +75,24 @@ public class GVertex extends PersistentBase {
}
/**
- * Gets index
- * @return int of attribute.
+ * Gets field's index.
+ * @return int field's index.
*/
public int getIndex() {
return index;
}
/**
- * Gets name
- * @return String of name.
+ * Gets field's name.
+ * @return String field's name.
*/
public String getName() {
return name;
}
/**
- * Gets name
- * @return String of name.
+ * Gets field's attributes to string.
+ * @return String field's attributes to string.
*/
public String toString() {
return name;
@@ -111,170 +103,563 @@ public class GVertex extends PersistentBase {
* Array containing all fields/
*/
private static final String[] ALL_FIELDS = {
- "vertexId", "value", "edges"
- };
-
- static {
- PersistentBase.registerFields(GVertex.class, ALL_FIELDS);
- }
+ "vertexId", "vertexValue", "edges", };
/**
- * Vertex Id
+ * Tombstone.
*/
- private Utf8 vertexId;
+ private static final Tombstone TOMBSTONE = new Tombstone();
/**
- * Value
+ * vertexId.
*/
- private float value;
+ private java.lang.CharSequence vertexId;
/**
- * Edges
+ * vertexValue.
*/
- private Map<Utf8, Utf8> edges;
+ private float vertexValue;
/**
- * Default constructor
+ * edges.
*/
- public GVertex() {
- this(new StateManagerImpl());
- }
+ private java.util.Map<java.lang.CharSequence, java.lang.CharSequence> edges;
/**
- * Constructor
- * @param stateManager from which the object will be created.
+ * Gets the total field count.
+ * @return int field count
*/
- public GVertex(StateManager stateManager) {
- super(stateManager);
- edges = new StatefulHashMap<Utf8, Utf8>();
+ public int getFieldsCount() {
+ return GVertex.ALL_FIELDS.length;
}
/**
- * Creates a new instance
- * @param stateManager from which the object will be created.
- * @return GVertex created
+ * Gets the schema
+ * @return Schema
*/
- public GVertex newInstance(StateManager stateManager) {
- return new GVertex(stateManager);
- }
-
- /**
- * Gets the object schema
- * @return Schema of the object.
- */
- public Schema getSchema() {
- return OBJ_SCHEMA;
+ public org.apache.avro.Schema getSchema() {
+ return SCHEMAS;
}
/**
* Gets field
- * @param fieldIndex index of field to be used.
+ * @param field index field.
* @return Object from an index.
*/
- public Object get(int fieldIndex) {
- switch (fieldIndex) {
+ public java.lang.Object get(int field) {
+ switch (field) {
case 0:
return vertexId;
case 1:
- return value;
+ return vertexValue;
case 2:
return edges;
default:
- throw new AvroRuntimeException("Bad index");
+ throw new org.apache.avro.AvroRuntimeException("Bad index");
}
}
/**
* Puts a value into a field.
- * @param fieldIndex index of field used.
- * @param fieldValue value of field used.
+ * @param field index of field used.
+ * @param value value of field used.
*/
@SuppressWarnings(value = "unchecked")
- public void put(int fieldIndex, Object fieldValue) {
- if (isFieldEqual(fieldIndex, fieldValue)) {
- return;
- }
- getStateManager().setDirty(this, fieldIndex);
- switch (fieldIndex) {
+ public void put(int field, java.lang.Object value) {
+ switch (field) {
case 0:
- vertexId = (Utf8) fieldValue; break;
+ vertexId = (java.lang.CharSequence) value;
+ break;
case 1:
- value = (Float) fieldValue; break;
+ vertexValue = (java.lang.Float) value;
+ break;
case 2:
- edges = (Map<Utf8, Utf8>) fieldValue; break;
+ edges = (java.util.Map<java.lang.CharSequence, java.lang.CharSequence>)
+ ((value instanceof org.apache.gora.persistency.Dirtyable) ? value :
+ new org.apache.gora.persistency.impl.DirtyMapWrapper((java.util.Map)
+ value));
+ break;
default:
- throw new AvroRuntimeException("Bad index");
+ throw new org.apache.avro.AvroRuntimeException("Bad index");
}
}
/**
- * Gets vertexId
- * @return Utf8 vertexId
+ * Gets the value of the 'vertexId' field.
+ * @return CharSequence
+ */
+ public java.lang.CharSequence getVertexId() {
+ return vertexId;
+ }
+
+ /**
+ * Sets the value of the 'vertexId' field.
+ * @param value the value to set.
+ */
+ public void setVertexId(java.lang.CharSequence value) {
+ this.vertexId = value;
+ setDirty(0);
+ }
+
+ /**
+ * Checks the dirty status of the 'vertexId' field. A field is dirty if it
+ * represents a change that has not yet been written to the database.
+ * @param value the value to set.
+ * @return boolean
+ */
+ public boolean isVertexIdDirty(java.lang.CharSequence value) {
+ return isDirty(0);
+ }
+
+ /**
+ * Gets the value of the 'vertexValue' field.
+ * @return Float
+ */
+ public java.lang.Float getVertexValue() {
+ return vertexValue;
+ }
+
+ /**
+ * Sets the value of the 'vertexValue' field.
+ * @param value the value to set.
*/
- public Utf8 getVertexId() {
- return (Utf8) get(0);
+ public void setVertexValue(java.lang.Float value) {
+ this.vertexValue = value;
+ setDirty(1);
}
/**
- * Sets vertexId
- * @param value vertexId
+ * Checks the dirty status of the 'vertexValue' field. A field is dirty if it
+ * represents a change that has not yet been written to the database.
+ * @param value the value to set.
+ * @return boolean
*/
- public void setVertexId(Utf8 value) {
- put(0, value);
+ public boolean isVertexValueDirty(java.lang.Float value) {
+ return isDirty(1);
}
/**
- * Gets value
- * @return String of value.
+ * Gets the value of the 'edges' field.
+ * @return java.util.Map
*/
- public float getValue() {
- return (Float) get(1);
+ public java.util.Map<java.lang.CharSequence, java.lang.CharSequence>
+ getEdges() {
+ return edges;
}
/**
- * Sets value
- * @param value .
+ * Sets the value of the 'edges' field.
+ * @param value the value to set.
*/
- public void setValue(float value) {
- put(1, value);
+ public void setEdges(
+ java.util.Map<java.lang.CharSequence, java.lang.CharSequence> value) {
+ this.edges =
+ (value instanceof org.apache.gora.persistency.Dirtyable) ? value :
+ new org.apache.gora.persistency.impl.DirtyMapWrapper(value);
+ setDirty(2);
}
/**
- * Get edges.
- * @return Map of edges.
+ * Checks the dirty status of the 'edges' field. A field is dirty if it
+ * represents a change that has not yet been written to the database.
+ * @param value the value to set.
+ * @return boolean
*/
- public Map<Utf8, Utf8> getEdges() {
- return (Map<Utf8, Utf8>) get(2);
+ public boolean isEdgesDirty(
+ java.util.Map<java.lang.CharSequence, java.lang.CharSequence> value) {
+ return isDirty(2);
}
/**
- * Gets value from edge.
- * @param key Edge key.
- * @return Utf8 containing the value of edge.
+ * Creates a new GVertex RecordBuilder.
+ * @return GVertex.Builder
*/
- public Utf8 getFromEdges(Utf8 key) {
- if (edges == null) { return null; }
- return edges.get(key);
+ public static org.apache.giraph.io.gora.generated.GVertex.Builder
+ newBuilder() {
+ return new org.apache.giraph.io.gora.generated.GVertex.Builder();
}
/**
- * Puts a new edge.
- * @param key of new edge.
- * @param value of new edge.
+ * Creates a new GVertex RecordBuilder by copying an existing Builder.
+ * @param other GVertex.Builder
+ * @return GVertex.Builder
*/
- public void putToEdges(Utf8 key, Utf8 value) {
- getStateManager().setDirty(this, 2);
- edges.put(key, value);
+ public static org.apache.giraph.io.gora.generated.GVertex.Builder newBuilder(
+ org.apache.giraph.io.gora.generated.GVertex.Builder other) {
+ return new org.apache.giraph.io.gora.generated.GVertex.Builder(other);
}
/**
- * Remove from edges
- * @param key of edge to be deleted.
- * @return Utf8 containing value of deleted key.
+ * Creates a new GVertex RecordBuilder by copying
+ * an existing GVertex instance
+ * @param other GVertex
+ * @return GVertex.Builder
*/
- public Utf8 removeFromEdges(Utf8 key) {
- if (edges == null) { return null; }
- getStateManager().setDirty(this, 2);
- return edges.remove(key);
+ public static org.apache.giraph.io.gora.generated.GVertex.Builder newBuilder(
+ org.apache.giraph.io.gora.generated.GVertex other) {
+ return new org.apache.giraph.io.gora.generated.GVertex.Builder(other);
+ }
+
+ /**
+ * Makes a deep copy from a bytebuffer.
+ * @param input ByteBuffer
+ * @return ByteBuffer
+ */
+ private static java.nio.ByteBuffer deepCopyToReadOnlyBuffer(
+ java.nio.ByteBuffer input) {
+ java.nio.ByteBuffer copy = java.nio.ByteBuffer.allocate(input.capacity());
+ int position = input.position();
+ input.reset();
+ int mark = input.position();
+ int limit = input.limit();
+ input.rewind();
+ input.limit(input.capacity());
+ copy.put(input);
+ input.rewind();
+ copy.rewind();
+ input.position(mark);
+ input.mark();
+ copy.position(mark);
+ copy.mark();
+ input.position(position);
+ copy.position(position);
+ input.limit(limit);
+ copy.limit(limit);
+ return copy.asReadOnlyBuffer();
+ }
+
+ /**
+ * RecordBuilder for GVertex instances.
+ */
+ public static class Builder extends
+ org.apache.avro.specific.SpecificRecordBuilderBase<GVertex> implements
+ org.apache.avro.data.RecordBuilder<GVertex> {
+
+ /**
+ * vertexId
+ */
+ private java.lang.CharSequence vertexId;
+
+ /**
+ * vertexValue
+ */
+ private float vertexValue;
+
+ /**
+ * edges
+ */
+ private java.util.Map<java.lang.CharSequence, java.lang.CharSequence> edges;
+
+ /** Creates a new Builder */
+ private Builder() {
+ super(org.apache.giraph.io.gora.generated.GVertex.SCHEMAS);
+ }
+
+ /**
+ * Creates a Builder by copying an existing Builder.
+ * @param other GVertex
+ */
+ private Builder(org.apache.giraph.io.gora.generated.GVertex.Builder other) {
+ super(other);
+ }
+
+ /**
+ * Creates a Builder by copying an existing GVertex instance.
+ * @param other GVertex
+ */
+ // CHECKSTYLE: stop Indentation
+ private Builder(org.apache.giraph.io.gora.generated.GVertex other) {
+ super(org.apache.giraph.io.gora.generated.GVertex.SCHEMAS);
+ if (isValidValue(fields()[0], other.vertexId)) {
+ this.vertexId = (java.lang.CharSequence) data().deepCopy(
+ fields()[0].schema(), other.vertexId);
+ fieldSetFlags()[0] = true;
+ }
+ if (isValidValue(fields()[1], other.vertexValue)) {
+ this.vertexValue = (java.lang.Float) data().deepCopy(
+ fields()[1].schema(), other.vertexValue);
+ fieldSetFlags()[1] = true;
+ }
+ if (isValidValue(fields()[2], other.edges)) {
+ this.edges =
+ (java.util.Map<java.lang.CharSequence, java.lang.CharSequence>)
+ data().deepCopy(fields()[2].schema(), other.edges);
+ fieldSetFlags()[2] = true;
+ }
+ }
+ // CHECKSTYLE: resume Indentation
+
+ /**
+ * Gets the value of the 'vertexId' field.
+ * @return CharSsequence
+ */
+ public java.lang.CharSequence getVertexId() {
+ return vertexId;
+ }
+
+ /**
+ * Sets the value of the 'vertexId' field.
+ * @param value CharSequence
+ * @return GVertex.Builder
+ */
+ // CHECKSTYLE: stop Indentation
+ public org.apache.giraph.io.gora.generated.GVertex.Builder setVertexId(
+ java.lang.CharSequence value) {
+ validate(fields()[0], value);
+ this.vertexId = value;
+ fieldSetFlags()[0] = true;
+ return this;
+ }
+ // CHECKSTYLE: resume Indentation
+
+ /**
+ * Checks whether the 'vertexId' field has been set.
+ * @return boolean
+ */
+ public boolean hasVertexId() {
+ return fieldSetFlags()[0];
+ }
+
+ /**
+ * Clears the value of the 'vertexId' field
+ * @return GVertex.Builder
+ */
+ // CHECKSTYLE: stop Indentation
+ public org.apache.giraph.io.gora.generated.GVertex.Builder clearVertexId() {
+ vertexId = null;
+ fieldSetFlags()[0] = false;
+ return this;
+ }
+ // CHECKSTYLE: resume Indentation
+
+ /**
+ * Gets the value of the 'vertexValue' field
+ * @return Float
+ */
+ public java.lang.Float getVertexValue() {
+ return vertexValue;
+ }
+
+ /**
+ * Sets the value of the 'vertexValue' field.
+ * @param value float
+ * @return GVertex.Builder
+ */
+ // CHECKSTYLE: stop Indentation
+ public org.apache.giraph.io.gora.generated.GVertex.Builder setVertexValue(
+ float value) {
+ validate(fields()[1], value);
+ this.vertexValue = value;
+ fieldSetFlags()[1] = true;
+ return this;
+ }
+ // CHECKSTYLE: resume Indentation
+
+ /**
+ * Checks whether the 'vertexValue' field has been set.
+ * @return boolean
+ */
+ public boolean hasVertexValue() {
+ return fieldSetFlags()[1];
+ }
+
+ /**
+ * Clears the value of the 'vertexValue' field.
+ * @return GVertex.Builder
+ */
+ // CHECKSTYLE: stop Indentation
+ public org.apache.giraph.io.gora.generated.GVertex.Builder
+ clearVertexValue() {
+ fieldSetFlags()[1] = false;
+ return this;
+ }
+ // CHECKSTYLE: resume Indentation
+
+ /**
+ * Gets the value of the 'edges' field.
+ * @return java.util.Map
+ */
+ public java.util.Map<java.lang.CharSequence, java.lang.CharSequence>
+ getEdges() {
+ return edges;
+ }
+
+ /**
+ * Sets the value of the 'edges' field.
+ * @param value java.util.Map
+ * @return GVertex.Builder
+ */
+ // CHECKSTYLE: stop Indentation
+ public org.apache.giraph.io.gora.generated.GVertex.Builder setEdges(
+ java.util.Map<java.lang.CharSequence, java.lang.CharSequence> value) {
+ validate(fields()[2], value);
+ this.edges = value;
+ fieldSetFlags()[2] = true;
+ return this;
+ }
+ // CHECKSTYLE: resume Indentation
+
+ /**
+ * Checks whether the 'edges' field has been set.
+ * @return boolean
+ */
+ public boolean hasEdges() {
+ return fieldSetFlags()[2];
+ }
+
+ /**
+ * Clears the value of the 'edges' field.
+ * @return org.apache.giraph.io.gora.generated.GVertex.Builder
+ */
+ // CHECKSTYLE: stop Indentation
+ public org.apache.giraph.io.gora.generated.GVertex.Builder clearEdges() {
+ edges = null;
+ fieldSetFlags()[2] = false;
+ return this;
+ }
+ // CHECKSTYLE: resume Indentation
+
+ @Override
+ /**
+ * Builds a GVertex.
+ * @return GVertex
+ */
+ // CHECKSTYLE: stop IllegalCatch
+ public GVertex build() {
+ try {
+ GVertex record = new GVertex();
+ record.vertexId = fieldSetFlags()[0] ? this.vertexId :
+ (java.lang.CharSequence) defaultValue(fields()[0]);
+ record.vertexValue = fieldSetFlags()[1] ? this.vertexValue :
+ (java.lang.Float) defaultValue(fields()[1]);
+ record.edges = fieldSetFlags()[2] ? this.edges :
+ (java.util.Map<java.lang.CharSequence, java.lang.CharSequence>)
+ new org.apache.gora.persistency.impl.DirtyMapWrapper(
+ (java.util.Map) defaultValue(fields()[2]));
+ return record;
+ } catch (Exception e) {
+ throw new org.apache.avro.AvroRuntimeException(e);
+ }
+ }
+ // CHECKSTYLE: resume IllegalCatch
+ }
+
+ /**
+ * Gets tombstone
+ * @return GVertex.Tombstone
+ */
+ public GVertex.Tombstone getTombstone() {
+ return TOMBSTONE;
+ }
+
+ /**
+ * Gets a new instance
+ * @return GVertex.
+ */
+ public GVertex newInstance() {
+ return newBuilder().build();
+ }
+
+ /**
+ * Tombstone class.
+ */
+ public static final class Tombstone extends GVertex implements
+ org.apache.gora.persistency.Tombstone {
+
+ /**
+ * Default constructor.
+ */
+ private Tombstone() {
+ }
+
+ /**
+ * Gets the value of the 'vertexId' field.
+ * @return java.lang.CharSequence
+ */
+ public java.lang.CharSequence getVertexId() {
+ throw new java.lang.UnsupportedOperationException(
+ "Get is not supported on tombstones");
+ }
+
+ /**
+ * Sets the value of the 'vertexId' field.
+ * @param value the value to set.
+ */
+ public void setVertexId(java.lang.CharSequence value) {
+ throw new java.lang.UnsupportedOperationException(
+ "Set is not supported on tombstones");
+ }
+
+ /**
+ * Checks the dirty status of the 'vertexId' field. A field is dirty if it
+ * represents a change that has not yet been written to the database.
+ * @param value the value to set.
+ * @return boolean
+ */
+ public boolean isVertexIdDirty(java.lang.CharSequence value) {
+ throw new java.lang.UnsupportedOperationException(
+ "IsDirty is not supported on tombstones");
+ }
+
+ /**
+ * Gets the value of the 'vertexValue' field.
+ * @return Float
+ */
+ public java.lang.Float getVertexValue() {
+ throw new java.lang.UnsupportedOperationException(
+ "Get is not supported on tombstones");
+ }
+
+ /**
+ * Sets the value of the 'vertexValue' field.
+ * @param value the value to set.
+ */
+ public void setVertexValue(java.lang.Float value) {
+ throw new java.lang.UnsupportedOperationException(
+ "Set is not supported on tombstones");
+ }
+
+ /**
+ * Checks the dirty status of the 'vertexValue' field. A field is dirty if
+ * it represents a change that has not yet been written to the database.
+ * @param value the value to set.
+ * @return boolean
+ */
+ public boolean isVertexValueDirty(java.lang.Float value) {
+ throw new java.lang.UnsupportedOperationException(
+ "IsDirty is not supported on tombstones");
+ }
+
+ /**
+ * Gets the value of the 'edges' field.
+ * @return java.util.Map
+ */
+ public java.util.Map<java.lang.CharSequence, java.lang.CharSequence>
+ getEdges() {
+ throw new java.lang.UnsupportedOperationException(
+ "Get is not supported on tombstones");
+ }
+
+ /**
+ * Sets the value of the 'edges' field.
+ * @param value the value to set.
+ */
+ public void setEdges(
+ java.util.Map<java.lang.CharSequence, java.lang.CharSequence> value) {
+ throw new java.lang.UnsupportedOperationException(
+ "Set is not supported on tombstones");
+ }
+
+ /**
+ * Checks the dirty status of the 'edges' field. A field is dirty if it
+ * represents a change that has not yet been written to the database.
+ * @param value the value to set.
+ * @return boolean
+ */
+ public boolean isEdgesDirty(
+ java.util.Map<java.lang.CharSequence, java.lang.CharSequence> value) {
+ throw new java.lang.UnsupportedOperationException(
+ "IsDirty is not supported on tombstones");
+ }
}
}
http://git-wip-us.apache.org/repos/asf/giraph/blob/7c61dcf4/giraph-gora/src/main/java/org/apache/giraph/io/gora/generated/GVertexResult.java
----------------------------------------------------------------------
diff --git a/giraph-gora/src/main/java/org/apache/giraph/io/gora/generated/GVertexResult.java b/giraph-gora/src/main/java/org/apache/giraph/io/gora/generated/GVertexResult.java
index 2c1952d..394fb8b 100644
--- a/giraph-gora/src/main/java/org/apache/giraph/io/gora/generated/GVertexResult.java
+++ b/giraph-gora/src/main/java/org/apache/giraph/io/gora/generated/GVertexResult.java
@@ -15,67 +15,60 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.apache.giraph.io.gora.generated;
-import java.util.Map;
-
-import org.apache.avro.Schema;
-import org.apache.avro.AvroRuntimeException;
-import org.apache.avro.util.Utf8;
-import org.apache.gora.persistency.StateManager;
-import org.apache.gora.persistency.StatefulHashMap;
-import org.apache.gora.persistency.impl.PersistentBase;
-import org.apache.gora.persistency.impl.StateManagerImpl;
-
/**
- * Example class for defining a Giraph-Vertex.
+ * Example class for defining a Giraph-vertex result.
*/
@SuppressWarnings("all")
-public class GVertexResult extends PersistentBase {
- /**
- * Schema used for the class.
- */
- public static final Schema OBJ_SCHEMA = Schema.parse(
- "{\"type\":\"record\",\"name\":\"Vertex\"," +
- "\"namespace\":\"org.apache.giraph.gora.generated\"," +
- "\"fields\":[{\"name\":\"vertexId\",\"type\":\"string\"}," +
- "{\"name\":\"value\",\"type\":\"float\"},{\"name\":\"edges\"," +
- "\"type\":{\"type\":\"map\",\"values\":\"string\"}}]}");
+public class GVertexResult extends
+ org.apache.gora.persistency.impl.PersistentBase implements
+ org.apache.avro.specific.SpecificRecord,
+ org.apache.gora.persistency.Persistent {
/**
- * Field enum
+ * Schema used for the class.
*/
+ public static final org.apache.avro.Schema SCHEMAS =
+ new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\"," +
+ "\"name\":\"GVertexResult\"," +
+ "\"namespace\":\"org.apache.giraph.io.gora.generated\"," +
+ "\"fields\":[{\"name\":\"vertexId\",\"type\":\"string\"}," +
+ "{\"name\":\"vertexValue\",\"type\":\"float\"}," +
+ "{\"name\":\"edges\",\"type\":" +
+ "{\"type\":\"map\",\"values\":\"string\"}}]}");
+
+ /** Enum containing all data bean's fields. */
public static enum Field {
/**
- * VertexId
+ * Vertex id.
*/
VERTEX_ID(0, "vertexId"),
/**
- * Field value
+ * Vertex value.
*/
- VALUE(1, "value"),
+ VERTEX_VALUE(1, "vertexValue"),
/**
- * Edges
+ * Vertex edges.
*/
EDGES(2, "edges");
/**
- * Field index
+ * Field's index.
*/
private int index;
/**
- * Field name
+ * Field's name.
*/
private String name;
/**
- * Field constructor
- * @param index of attribute
- * @param name of attribute
+ * Field's constructor
+ * @param index field's index.
+ * @param name field's name.
*/
Field(int index, String name) {
this.index = index;
@@ -83,24 +76,24 @@ public class GVertexResult extends PersistentBase {
}
/**
- * Gets index
- * @return int of attribute.
+ * Gets field's index.
+ * @return int field's index.
*/
public int getIndex() {
return index;
}
/**
- * Gets name
- * @return String of name.
+ * Gets field's name.
+ * @return String field's name.
*/
public String getName() {
return name;
}
/**
- * Gets name
- * @return String of name.
+ * Gets field's attributes to string.
+ * @return String field's attributes to string.
*/
public String toString() {
return name;
@@ -111,170 +104,565 @@ public class GVertexResult extends PersistentBase {
* Array containing all fields/
*/
private static final String[] ALL_FIELDS = {
- "vertexId", "value", "edges"
- };
-
- static {
- PersistentBase.registerFields(GVertexResult.class, ALL_FIELDS);
- }
+ "vertexId", "vertexValue", "edges", };
/**
- * Vertex Id
+ * Tombstone.
*/
- private Utf8 vertexId;
+ private static final Tombstone TOMBSTONE = new Tombstone();
/**
- * Value
+ * vertexId.
*/
- private float value;
+ private java.lang.CharSequence vertexId;
/**
- * Edges
+ * vertexValue.
*/
- private Map<Utf8, Utf8> edges;
+ private float vertexValue;
/**
- * Default constructor
+ * edges.
*/
- public GVertexResult() {
- this(new StateManagerImpl());
- }
+ private java.util.Map<java.lang.CharSequence, java.lang.CharSequence> edges;
/**
- * Constructor
- * @param stateManager from which the object will be created.
+ * Gets the total field count.
+ * @return int field count
*/
- public GVertexResult(StateManager stateManager) {
- super(stateManager);
- edges = new StatefulHashMap<Utf8, Utf8>();
+ public int getFieldsCount() {
+ return GVertexResult.ALL_FIELDS.length;
}
/**
- * Creates a new instance
- * @param stateManager from which the object will be created.
- * @return GVertex created
+ * Gets the schema
+ * @return Schema
*/
- public GVertexResult newInstance(StateManager stateManager) {
- return new GVertexResult(stateManager);
- }
-
- /**
- * Gets the object schema
- * @return Schema of the object.
- */
- public Schema getSchema() {
- return OBJ_SCHEMA;
+ public org.apache.avro.Schema getSchema() {
+ return SCHEMAS;
}
/**
* Gets field
- * @param fieldIndex index of field to be used.
+ * @param field index field.
* @return Object from an index.
*/
- public Object get(int fieldIndex) {
- switch (fieldIndex) {
+ public java.lang.Object get(int field) {
+ switch (field) {
case 0:
return vertexId;
case 1:
- return value;
+ return vertexValue;
case 2:
return edges;
default:
- throw new AvroRuntimeException("Bad index");
+ throw new org.apache.avro.AvroRuntimeException("Bad index");
}
}
/**
* Puts a value into a field.
- * @param fieldIndex index of field used.
- * @param fieldValue value of field used.
+ * @param field index of field used.
+ * @param value value of field used.
*/
@SuppressWarnings(value = "unchecked")
- public void put(int fieldIndex, Object fieldValue) {
- if (isFieldEqual(fieldIndex, fieldValue)) {
- return;
- }
- getStateManager().setDirty(this, fieldIndex);
- switch (fieldIndex) {
+ public void put(int field, java.lang.Object value) {
+ switch (field) {
case 0:
- vertexId = (Utf8) fieldValue; break;
+ vertexId = (java.lang.CharSequence) value;
+ break;
case 1:
- value = (Float) fieldValue; break;
+ vertexValue = (java.lang.Float) value;
+ break;
case 2:
- edges = (Map<Utf8, Utf8>) fieldValue; break;
+ edges = (java.util.Map<java.lang.CharSequence, java.lang.CharSequence>)
+ ((value instanceof org.apache.gora.persistency.Dirtyable) ? value :
+ new org.apache.gora.persistency.impl.DirtyMapWrapper((java.util.Map)
+ value));
+ break;
default:
- throw new AvroRuntimeException("Bad index");
+ throw new org.apache.avro.AvroRuntimeException("Bad index");
}
}
/**
- * Gets vertexId
- * @return Utf8 vertexId
+ * Gets the value of the 'vertexId' field.
+ * @return CharSequence
+ */
+ public java.lang.CharSequence getVertexId() {
+ return vertexId;
+ }
+
+ /**
+ * Sets the value of the 'vertexId' field.
+ * @param value the value to set.
+ */
+ public void setVertexId(java.lang.CharSequence value) {
+ this.vertexId = value;
+ setDirty(0);
+ }
+
+ /**
+ * Checks the dirty status of the 'vertexId' field. A field is dirty if it
+ * represents a change that has not yet been written to the database.
+ * @param value the value to set.
+ * @return boolean
+ */
+ public boolean isVertexIdDirty(java.lang.CharSequence value) {
+ return isDirty(0);
+ }
+
+ /**
+ * Gets the value of the 'vertexValue' field.
+ * @return Float
+ */
+ public java.lang.Float getVertexValue() {
+ return vertexValue;
+ }
+
+ /**
+ * Sets the value of the 'vertexValue' field.
+ * @param value the value to set.
*/
- public Utf8 getVertexId() {
- return (Utf8) get(0);
+ public void setVertexValue(java.lang.Float value) {
+ this.vertexValue = value;
+ setDirty(1);
}
/**
- * Sets vertexId
- * @param value vertexId
+ * Checks the dirty status of the 'vertexValue' field. A field is dirty if it
+ * represents a change that has not yet been written to the database.
+ * @param value the value to set.
+ * @return boolean
*/
- public void setVertexId(Utf8 value) {
- put(0, value);
+ public boolean isVertexValueDirty(java.lang.Float value) {
+ return isDirty(1);
}
/**
- * Gets value
- * @return String of value.
+ * Gets the value of the 'edges' field.
+ * @return Edges
*/
- public float getValue() {
- return (Float) get(1);
+ public java.util.Map<java.lang.CharSequence, java.lang.CharSequence>
+ getEdges() {
+ return edges;
}
/**
- * Sets value
- * @param value .
+ * Sets the value of the 'edges' field.
+ * @param value the value to set.
*/
- public void setValue(float value) {
- put(1, value);
+ public void setEdges(
+ java.util.Map<java.lang.CharSequence, java.lang.CharSequence> value) {
+ this.edges = (value instanceof org.apache.gora.persistency.Dirtyable) ?
+ value : new org.apache.gora.persistency.impl.DirtyMapWrapper(value);
+ setDirty(2);
}
/**
- * Get edges.
- * @return Map of edges.
+ * Checks the dirty status of the 'edges' field. A field is dirty if it
+ * represents a change that has not yet been written to the database.
+ * @param value the value to set.
+ * @return boolean
*/
- public Map<Utf8, Utf8> getEdges() {
- return (Map<Utf8, Utf8>) get(2);
+ public boolean isEdgesDirty(
+ java.util.Map<java.lang.CharSequence, java.lang.CharSequence> value) {
+ return isDirty(2);
}
/**
- * Gets value from edge.
- * @param key Edge key.
- * @return Utf8 containing the value of edge.
+ * Creates a new GVertexResult RecordBuilder
+ * @return GVertexResult.Builder
*/
- public Utf8 getFromEdges(Utf8 key) {
- if (edges == null) { return null; }
- return edges.get(key);
+ public static org.apache.giraph.io.gora.generated.GVertexResult.Builder
+ newBuilder() {
+ return new org.apache.giraph.io.gora.generated.GVertexResult.Builder();
}
/**
- * Puts a new edge.
- * @param key of new edge.
- * @param value of new edge.
+ * Creates a new GVertexResult RecordBuilder by copying an existing Builder.
+ * @param other GVertexResult.Builder
+ * @return GVertexResult.Builder
*/
- public void putToEdges(Utf8 key, Utf8 value) {
- getStateManager().setDirty(this, 2);
- edges.put(key, value);
+ public static org.apache.giraph.io.gora.generated.GVertexResult.Builder
+ newBuilder(org.apache.giraph.io.gora.generated.GVertexResult.Builder other) {
+ return new org.apache.giraph.io.gora.generated.GVertexResult.Builder(other);
}
/**
- * Remove from edges
- * @param key of edge to be deleted.
- * @return Utf8 containing value of deleted key.
+ * Creates a new GVertexResult RecordBuilder by copying an existing
+ * GVertexResult instance
+ * @param other GVertexResult
+ * @return GVertexResult.Builder
*/
- public Utf8 removeFromEdges(Utf8 key) {
- if (edges == null) { return null; }
- getStateManager().setDirty(this, 2);
- return edges.remove(key);
+ public static org.apache.giraph.io.gora.generated.GVertexResult.Builder
+ newBuilder(org.apache.giraph.io.gora.generated.GVertexResult other) {
+ return new org.apache.giraph.io.gora.generated.GVertexResult.Builder(other);
+ }
+
+ /**
+ * Makes a deep copy from a bytebuffer.
+ * @param input ByteBuffer
+ * @return ByteBuffer
+ */
+ private static java.nio.ByteBuffer deepCopyToReadOnlyBuffer(
+ java.nio.ByteBuffer input) {
+ java.nio.ByteBuffer copy = java.nio.ByteBuffer.allocate(input.capacity());
+ int position = input.position();
+ input.reset();
+ int mark = input.position();
+ int limit = input.limit();
+ input.rewind();
+ input.limit(input.capacity());
+ copy.put(input);
+ input.rewind();
+ copy.rewind();
+ input.position(mark);
+ input.mark();
+ copy.position(mark);
+ copy.mark();
+ input.position(position);
+ copy.position(position);
+ input.limit(limit);
+ copy.limit(limit);
+ return copy.asReadOnlyBuffer();
+ }
+
+ /**
+ * RecordBuilder for GVertexResult instances.
+ */
+ public static class Builder extends
+ org.apache.avro.specific.SpecificRecordBuilderBase<GVertexResult>
+ implements org.apache.avro.data.RecordBuilder<GVertexResult> {
+
+ /**
+ * vertexId
+ */
+ private java.lang.CharSequence vertexId;
+
+ /**
+ * vertexValue
+ */
+ private float vertexValue;
+
+ /**
+ * edges
+ */
+ private java.util.Map<java.lang.CharSequence, java.lang.CharSequence> edges;
+
+ /** Creates a new Builder */
+ private Builder() {
+ super(org.apache.giraph.io.gora.generated.GVertexResult.SCHEMAS);
+ }
+
+ /**
+ * Creates a Builder by copying an existing Builder.
+ * @param other GVertexResult.Builder
+ */
+ private Builder(
+ org.apache.giraph.io.gora.generated.GVertexResult.Builder other) {
+ super(other);
+ }
+
+ /**
+ * Creates a Builder by copying an existing GVertexResult instance.
+ * @param other GVertexResult
+ */
+ // CHECKSTYLE: stop Indentation
+ private Builder(org.apache.giraph.io.gora.generated.GVertexResult other) {
+ super(org.apache.giraph.io.gora.generated.GVertexResult.SCHEMAS);
+ if (isValidValue(fields()[0], other.vertexId)) {
+ this.vertexId = (java.lang.CharSequence) data().deepCopy(
+ fields()[0].schema(), other.vertexId);
+ fieldSetFlags()[0] = true;
+ }
+ if (isValidValue(fields()[1], other.vertexValue)) {
+ this.vertexValue = (java.lang.Float) data().deepCopy(
+ fields()[1].schema(), other.vertexValue);
+ fieldSetFlags()[1] = true;
+ }
+ if (isValidValue(fields()[2], other.edges)) {
+ this.edges =
+ (java.util.Map<java.lang.CharSequence, java.lang.CharSequence>)
+ data().deepCopy(fields()[2].schema(), other.edges);
+ fieldSetFlags()[2] = true;
+ }
+ }
+ // CHECKSTYLE: resume Indentation
+
+ /**
+ * Gets the value of the 'vertexId' field.
+ * @return CharSequence
+ */
+ public java.lang.CharSequence getVertexId() {
+ return vertexId;
+ }
+
+ /**
+ * Sets the value of the 'vertexId' field.
+ * @param value CharSequence
+ * @return GVertexResult.Builder
+ */
+ // CHECKSTYLE: stop Indentation
+ public org.apache.giraph.io.gora.generated.GVertexResult.Builder
+ setVertexId(java.lang.CharSequence value) {
+ validate(fields()[0], value);
+ this.vertexId = value;
+ fieldSetFlags()[0] = true;
+ return this;
+ }
+ // CHECKSTYLE: resume Indentation
+
+ /**
+ * Checks whether the 'vertexId' field has been set.
+ * @return boolean
+ */
+ public boolean hasVertexId() {
+ return fieldSetFlags()[0];
+ }
+
+ /**
+ * Clears the value of the 'vertexId' field
+ * @return GVertexResult.Builder
+ */
+ // CHECKSTYLE: stop Indentation
+ public org.apache.giraph.io.gora.generated.GVertexResult.Builder
+ clearVertexId() {
+ vertexId = null;
+ fieldSetFlags()[0] = false;
+ return this;
+ }
+ // CHECKSTYLE: resume Indentation
+
+ /**
+ * Gets the value of the 'vertexValue' field.
+ * @return Float
+ */
+ public java.lang.Float getVertexValue() {
+ return vertexValue;
+ }
+
+ /**
+ * Sets the value of the 'vertexValue' field.
+ * @param value float
+ * @return GVertexResult.Builder
+ */
+ // CHECKSTYLE: stop Indentation
+ public org.apache.giraph.io.gora.generated.GVertexResult.Builder
+ setVertexValue(float value) {
+ validate(fields()[1], value);
+ this.vertexValue = value;
+ fieldSetFlags()[1] = true;
+ return this;
+ }
+ // CHECKSTYLE: resume Indentation
+
+ /**
+ * Checks whether the 'vertexValue' field has been set.
+ * @return boolean
+ */
+ public boolean hasVertexValue() {
+ return fieldSetFlags()[1];
+ }
+
+ /**
+ * Clears the value of the 'vertexValue' field.
+ * @return GVertexResult.Builder
+ */
+ // CHECKSTYLE: stop Indentation
+ public org.apache.giraph.io.gora.generated.GVertexResult.Builder
+ clearVertexValue() {
+ fieldSetFlags()[1] = false;
+ return this;
+ }
+ // CHECKSTYLE: resume Indentation
+
+ /**
+ * Gets the value of the 'edges' field.
+ * @return java.util.Map
+ */
+ public java.util.Map<java.lang.CharSequence, java.lang.CharSequence>
+ getEdges() {
+ return edges;
+ }
+
+ /**
+ * Sets the value of the 'edges' field
+ * @param value java.util.Map
+ * @return GVertexResult.Builder
+ */
+ // CHECKSTYLE: stop Indentation
+ public org.apache.giraph.io.gora.generated.GVertexResult.Builder setEdges(
+ java.util.Map<java.lang.CharSequence, java.lang.CharSequence> value) {
+ validate(fields()[2], value);
+ this.edges = value;
+ fieldSetFlags()[2] = true;
+ return this;
+ }
+ // CHECKSTYLE: resume Indentation
+
+ /**
+ * Checks whether the 'edges' field has been set.
+ * @return boolean
+ */
+ public boolean hasEdges() {
+ return fieldSetFlags()[2];
+ }
+
+ /**
+ * Clears the value of the 'edges' field.
+ * @return org.apache.giraph.io.gora.generated.GVertexResult.Builder
+ */
+ // CHECKSTYLE: stop Indentation
+ public org.apache.giraph.io.gora.generated.GVertexResult.Builder
+ clearEdges() {
+ edges = null;
+ fieldSetFlags()[2] = false;
+ return this;
+ }
+ // CHECKSTYLE: resume Indentation
+
+ @Override
+ /**
+ * Builds a GVertexResult.
+ * @return GVertexResult
+ */
+ // CHECKSTYLE: stop IllegalCatch
+ public GVertexResult build() {
+ try {
+ GVertexResult record = new GVertexResult();
+ record.vertexId = fieldSetFlags()[0] ? this.vertexId :
+ (java.lang.CharSequence) defaultValue(fields()[0]);
+ record.vertexValue = fieldSetFlags()[1] ? this.vertexValue :
+ (java.lang.Float) defaultValue(fields()[1]);
+ record.edges = fieldSetFlags()[2] ? this.edges :
+ (java.util.Map<java.lang.CharSequence, java.lang.CharSequence>)
+ new org.apache.gora.persistency.impl.DirtyMapWrapper(
+ (java.util.Map) defaultValue(fields()[2]));
+ return record;
+ } catch (Exception e) {
+ throw new org.apache.avro.AvroRuntimeException(e);
+ }
+ }
+ // CHECKSTYLE: resume IllegalCatch
+ }
+
+ /**
+ * Gets tombstone
+ * @return GVertex.Tombstone
+ */
+ public GVertexResult.Tombstone getTombstone() {
+ return TOMBSTONE;
+ }
+
+ /**
+ * Gets a new instance
+ * @return GVertexResult.
+ */
+ public GVertexResult newInstance() {
+ return newBuilder().build();
+ }
+
+ /**
+ * Tombstone class.
+ */
+ public static final class Tombstone extends GVertexResult implements
+ org.apache.gora.persistency.Tombstone {
+
+ /**
+ * Default constructor.
+ */
+ private Tombstone() {
+ }
+
+ /**
+ * Gets the value of the 'vertexId' field.
+ * @return java.lang.CharSequence
+ */
+ public java.lang.CharSequence getVertexId() {
+ throw new java.lang.UnsupportedOperationException(
+ "Get is not supported on tombstones");
+ }
+
+ /**
+ * Sets the value of the 'vertexId' field.
+ * @param value the value to set.
+ */
+ public void setVertexId(java.lang.CharSequence value) {
+ throw new java.lang.UnsupportedOperationException(
+ "Set is not supported on tombstones");
+ }
+
+ /**
+ * Checks the dirty status of the 'vertexId' field. A field is dirty if it
+ * represents a change that has not yet been written to the database.
+ * @param value the value to set.
+ * @return boolean
+ */
+ public boolean isVertexIdDirty(java.lang.CharSequence value) {
+ throw new java.lang.UnsupportedOperationException(
+ "IsDirty is not supported on tombstones");
+ }
+
+ /**
+ * Gets the value of the 'vertexValue' field.
+ * @return Float
+ */
+ public java.lang.Float getVertexValue() {
+ throw new java.lang.UnsupportedOperationException(
+ "Get is not supported on tombstones");
+ }
+
+ /**
+ * Sets the value of the 'vertexValue' field.
+ * @param value the value to set.
+ */
+ public void setVertexValue(java.lang.Float value) {
+ throw new java.lang.UnsupportedOperationException(
+ "Set is not supported on tombstones");
+ }
+
+ /**
+ * Checks the dirty status of the 'vertexValue' field. A field is dirty if
+ * it represents a change that has not yet been written to the database.
+ * @param value the value to set.
+ * @return boolean
+ */
+ public boolean isVertexValueDirty(java.lang.Float value) {
+ throw new java.lang.UnsupportedOperationException(
+ "IsDirty is not supported on tombstones");
+ }
+
+ /**
+ * Gets the value of the 'edges' field.
+ * @return java.util.Map
+ */
+ public java.util.Map<java.lang.CharSequence, java.lang.CharSequence>
+ getEdges() {
+ throw new java.lang.UnsupportedOperationException(
+ "Get is not supported on tombstones");
+ }
+
+ /**
+ * Sets the value of the 'edges' field.
+ * @param value the value to set.
+ */
+ public void setEdges(
+ java.util.Map<java.lang.CharSequence, java.lang.CharSequence> value) {
+ throw new java.lang.UnsupportedOperationException(
+ "Set is not supported on tombstones");
+ }
+
+ /**
+ * Checks the dirty status of the 'edges' field. A field is dirty if it
+ * represents a change that has not yet been written to the database.
+ * @param value the value to set.
+ * @return boolean
+ */
+ public boolean isEdgesDirty(
+ java.util.Map<java.lang.CharSequence, java.lang.CharSequence> value) {
+ throw new java.lang.UnsupportedOperationException(
+ "IsDirty is not supported on tombstones");
+ }
}
}
http://git-wip-us.apache.org/repos/asf/giraph/blob/7c61dcf4/giraph-gora/src/main/java/org/apache/giraph/io/gora/utils/ExtraGoraInputFormat.java
----------------------------------------------------------------------
diff --git a/giraph-gora/src/main/java/org/apache/giraph/io/gora/utils/ExtraGoraInputFormat.java b/giraph-gora/src/main/java/org/apache/giraph/io/gora/utils/ExtraGoraInputFormat.java
index e11f910..b40a361 100644
--- a/giraph-gora/src/main/java/org/apache/giraph/io/gora/utils/ExtraGoraInputFormat.java
+++ b/giraph-gora/src/main/java/org/apache/giraph/io/gora/utils/ExtraGoraInputFormat.java
@@ -28,6 +28,7 @@ import org.apache.gora.persistency.Persistent;
import org.apache.gora.persistency.impl.PersistentBase;
import org.apache.gora.query.PartitionQuery;
import org.apache.gora.query.Query;
+import org.apache.gora.query.impl.PartitionQueryImpl;
import org.apache.gora.store.DataStore;
import org.apache.gora.util.IOUtils;
import org.apache.hadoop.conf.Configuration;
@@ -83,17 +84,21 @@ public class ExtraGoraInputFormat<K, T extends PersistentBase>
return new GoraRecordReader<K, T>(partitionQuery, context);
}
+ /**
+ * Gets splits.
+ * @param context for the job.
+ * @return List<InputSplit> splits found
+ */
@Override
public List<InputSplit> getSplits(JobContext context) throws IOException,
InterruptedException {
List<PartitionQuery<K, T>> queries =
getDataStore().getPartitions(getQuery());
List<InputSplit> splits = new ArrayList<InputSplit>(queries.size());
-
for (PartitionQuery<K, T> partQuery : queries) {
+ ((PartitionQueryImpl) partQuery).setConf(context.getConfiguration());
splits.add(new GoraInputSplit(context.getConfiguration(), partQuery));
}
-
return splits;
}
http://git-wip-us.apache.org/repos/asf/giraph/blob/7c61dcf4/giraph-gora/src/main/java/org/apache/giraph/io/gora/utils/GoraUtils.java
----------------------------------------------------------------------
diff --git a/giraph-gora/src/main/java/org/apache/giraph/io/gora/utils/GoraUtils.java b/giraph-gora/src/main/java/org/apache/giraph/io/gora/utils/GoraUtils.java
index c3fc268..932e2f3 100644
--- a/giraph-gora/src/main/java/org/apache/giraph/io/gora/utils/GoraUtils.java
+++ b/giraph-gora/src/main/java/org/apache/giraph/io/gora/utils/GoraUtils.java
@@ -20,6 +20,7 @@ package org.apache.giraph.io.gora.utils;
import org.apache.gora.persistency.Persistent;
import org.apache.gora.query.Query;
import org.apache.gora.query.Result;
+import org.apache.gora.query.impl.QueryBase;
import org.apache.gora.store.DataStore;
import org.apache.gora.store.DataStoreFactory;
import org.apache.gora.util.GoraException;
@@ -36,11 +37,6 @@ public class GoraUtils {
private static Class<? extends DataStore> DATASTORECLASS;
/**
- * Attribute handling configuration for data stores.
- */
- private static Configuration CONF = new Configuration();
-
- /**
* The default constructor is set to be private by default so that the
* class is not instantiated.
*/
@@ -49,6 +45,7 @@ public class GoraUtils {
/**
* Creates a generic data store using the data store class.
* set using the class property
+ * @param conf Configuration
* @param <K> key class
* @param <T> value class
* @param keyClass key class used
@@ -58,20 +55,22 @@ public class GoraUtils {
*/
@SuppressWarnings("unchecked")
public static <K, T extends Persistent> DataStore<K, T>
- createDataStore(Class<K> keyClass, Class<T> persistentClass)
+ createDataStore(Configuration conf,
+ Class<K> keyClass, Class<T> persistentClass)
throws GoraException {
DataStoreFactory.createProps();
DataStore<K, T> dataStore =
DataStoreFactory.createDataStore((Class<? extends DataStore<K, T>>)
DATASTORECLASS,
keyClass, persistentClass,
- getConf());
+ conf);
return dataStore;
}
/**
* Creates a specific data store specified by.
+ * @param conf Configuration
* @param <K> key class
* @param <T> value class
* @param dataStoreClass Defines the type of data store used.
@@ -81,10 +80,11 @@ public class GoraUtils {
* @throws GoraException if an error occurs.
*/
public static <K, T extends Persistent> DataStore<K, T>
- createSpecificDataStore(Class<? extends DataStore> dataStoreClass,
+ createSpecificDataStore(Configuration conf,
+ Class<? extends DataStore> dataStoreClass,
Class<K> keyClass, Class<T> persistentClass) throws GoraException {
DATASTORECLASS = dataStoreClass;
- return createDataStore(keyClass, persistentClass);
+ return createDataStore(conf, keyClass, persistentClass);
}
/**
@@ -98,7 +98,7 @@ public class GoraUtils {
*/
public static <K, T extends Persistent> Result<K, T>
getRequest(DataStore<K, T> pDataStore, K pStartKey, K pEndKey) {
- Query<K, T> query = getQuery(pDataStore, pStartKey, pEndKey);
+ QueryBase query = getQuery(pDataStore, pStartKey, pEndKey);
return getRequest(pDataStore, query);
}
@@ -137,9 +137,9 @@ public class GoraUtils {
* @param <T> value class
* @return range query object.
*/
- public static <K, T extends Persistent> Query<K, T>
- getQuery(DataStore<K, T> pDataStore, K pStartKey, K pEndKey) {
- Query<K, T> query = pDataStore.newQuery();
+ public static <K, T extends Persistent> QueryBase
+ getQuery(DataStore pDataStore, K pStartKey, K pEndKey) {
+ QueryBase query = (QueryBase) pDataStore.newQuery();
query.setStartKey(pStartKey);
query.setEndKey(pEndKey);
return query;
@@ -175,20 +175,4 @@ public class GoraUtils {
query.setEndKey(null);
return query;
}
-
- /**
- * Gets the configuration object.
- * @return the configuration object.
- */
- public static Configuration getConf() {
- return CONF;
- }
-
- /**
- * Sets the configuration object.
- * @param conf to be set as the configuration object.
- */
- public static void setConf(Configuration conf) {
- CONF = conf;
- }
}
http://git-wip-us.apache.org/repos/asf/giraph/blob/7c61dcf4/giraph-gora/src/test/java/org/apache/giraph/io/gora/GoraTestEdgeInputFormat.java
----------------------------------------------------------------------
diff --git a/giraph-gora/src/test/java/org/apache/giraph/io/gora/GoraTestEdgeInputFormat.java b/giraph-gora/src/test/java/org/apache/giraph/io/gora/GoraTestEdgeInputFormat.java
index ba71ce4..c339eb0 100644
--- a/giraph-gora/src/test/java/org/apache/giraph/io/gora/GoraTestEdgeInputFormat.java
+++ b/giraph-gora/src/test/java/org/apache/giraph/io/gora/GoraTestEdgeInputFormat.java
@@ -19,10 +19,8 @@ package org.apache.giraph.io.gora;
import java.io.IOException;
-import org.apache.avro.util.Utf8;
import org.apache.giraph.edge.Edge;
import org.apache.giraph.edge.EdgeFactory;
-import org.apache.giraph.io.gora.GoraEdgeInputFormat;
import org.apache.giraph.io.gora.generated.GEdge;
import org.apache.hadoop.io.FloatWritable;
import org.apache.hadoop.io.LongWritable;
@@ -82,10 +80,10 @@ public class GoraTestEdgeInputFormat
private static GEdge createEdge(String id, String vertexInId,
String vertexOutId, String edgeLabel, float edgeWeight) {
GEdge newEdge = new GEdge();
- newEdge.setEdgeId(new Utf8(id));
- newEdge.setVertexInId(new Utf8(vertexInId));
- newEdge.setVertexOutId(new Utf8(vertexOutId));
- newEdge.setLabel(new Utf8(edgeLabel));
+ newEdge.setEdgeId(id);
+ newEdge.setVertexInId(vertexInId);
+ newEdge.setVertexOutId(vertexOutId);
+ newEdge.setLabel(edgeLabel);
newEdge.setEdgeWeight(edgeWeight);
return newEdge;
}
@@ -109,11 +107,11 @@ public class GoraTestEdgeInputFormat
Edge<LongWritable, FloatWritable> edge = null;
GEdge goraEdge = (GEdge) goraObject;
Long dest;
- Long value;
+ Float value;
dest = Long.valueOf(goraEdge.getVertexOutId().toString());
this.sourceId = new LongWritable();
this.sourceId.set(Long.valueOf(goraEdge.getVertexInId().toString()));
- value = (long) goraEdge.getEdgeWeight();
+ value = (float) goraEdge.getEdgeWeight();
edge = EdgeFactory.create(new LongWritable(dest),
new FloatWritable(value));
return edge;
http://git-wip-us.apache.org/repos/asf/giraph/blob/7c61dcf4/giraph-gora/src/test/java/org/apache/giraph/io/gora/GoraTestEdgeOutputFormat.java
----------------------------------------------------------------------
diff --git a/giraph-gora/src/test/java/org/apache/giraph/io/gora/GoraTestEdgeOutputFormat.java b/giraph-gora/src/test/java/org/apache/giraph/io/gora/GoraTestEdgeOutputFormat.java
index 0254498..f2e88c6 100644
--- a/giraph-gora/src/test/java/org/apache/giraph/io/gora/GoraTestEdgeOutputFormat.java
+++ b/giraph-gora/src/test/java/org/apache/giraph/io/gora/GoraTestEdgeOutputFormat.java
@@ -19,11 +19,8 @@ package org.apache.giraph.io.gora;
import java.io.IOException;
-import junit.framework.Assert;
-
import org.apache.avro.util.Utf8;
import org.apache.giraph.edge.Edge;
-import org.apache.giraph.io.gora.GoraEdgeOutputFormat;
import org.apache.giraph.io.gora.generated.GEdge;
import org.apache.giraph.io.gora.generated.GEdgeResult;
import org.apache.gora.persistency.Persistent;
@@ -31,6 +28,7 @@ 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.junit.Assert;
/**
* Implementation of a specific writer for a generated data bean.
@@ -63,11 +61,11 @@ public class GoraTestEdgeOutputFormat
GEdgeResult tmpGEdge = new GEdgeResult();
Utf8 keyLabel = new Utf8(srcId.toString() + "-" +
edge.getTargetVertexId().toString());
- tmpGEdge.setEdgeId(keyLabel);
+ tmpGEdge.setEdgeId(keyLabel.toString());
tmpGEdge.setEdgeWeight(edge.getValue().get());
- tmpGEdge.setVertexInId(new Utf8(srcId.toString()));
- tmpGEdge.setVertexOutId(new Utf8(edge.getTargetVertexId().toString()));
- tmpGEdge.setLabel(keyLabel);
+ tmpGEdge.setVertexInId(srcId.toString());
+ tmpGEdge.setVertexOutId(edge.getTargetVertexId().toString());
+ tmpGEdge.setLabel(keyLabel.toString());
getLogger().debug("GoraObject created: " + tmpGEdge.toString());
return tmpGEdge;
}
@@ -80,6 +78,7 @@ public class GoraTestEdgeOutputFormat
return goraKey;
}
+ @SuppressWarnings("unchecked")
@Override
public void writeEdge(LongWritable srcId, DoubleWritable srcValue,
Edge<LongWritable, FloatWritable> edge)
@@ -105,13 +104,13 @@ public class GoraTestEdgeOutputFormat
* @param edgeWeight Edge wight.
* @return GEdge created.
*/
- private GEdge createEdge(String id, String vertexInId,
+ private GEdgeResult createEdge(String id, String vertexInId,
String vertexOutId, String edgeLabel, float edgeWeight) {
- GEdge newEdge = new GEdge();
- newEdge.setEdgeId(new Utf8(id));
- newEdge.setVertexInId(new Utf8(vertexInId));
- newEdge.setVertexOutId(new Utf8(vertexOutId));
- newEdge.setLabel(new Utf8(edgeLabel));
+ GEdgeResult newEdge = new GEdgeResult();
+ newEdge.setEdgeId(id);
+ newEdge.setVertexInId(vertexInId);
+ newEdge.setVertexOutId(vertexOutId);
+ newEdge.setLabel(edgeLabel);
newEdge.setEdgeWeight(edgeWeight);
return newEdge;
}
http://git-wip-us.apache.org/repos/asf/giraph/blob/7c61dcf4/giraph-gora/src/test/java/org/apache/giraph/io/gora/GoraTestVertexInputFormat.java
----------------------------------------------------------------------
diff --git a/giraph-gora/src/test/java/org/apache/giraph/io/gora/GoraTestVertexInputFormat.java b/giraph-gora/src/test/java/org/apache/giraph/io/gora/GoraTestVertexInputFormat.java
index 7de9346..d79a8fa 100644
--- a/giraph-gora/src/test/java/org/apache/giraph/io/gora/GoraTestVertexInputFormat.java
+++ b/giraph-gora/src/test/java/org/apache/giraph/io/gora/GoraTestVertexInputFormat.java
@@ -18,11 +18,9 @@
package org.apache.giraph.io.gora;
import java.io.IOException;
-import java.util.HashMap;
import java.util.Map;
import java.util.Set;
-import org.apache.avro.util.Utf8;
import org.apache.giraph.edge.Edge;
import org.apache.giraph.edge.EdgeFactory;
import org.apache.giraph.graph.Vertex;
@@ -78,10 +76,10 @@ public class GoraTestVertexInputFormat
*/
public static GVertex createVertex(String id, Map<String, String> edges) {
GVertex newVrtx = new GVertex();
- newVrtx.setVertexId(new Utf8(id));
+ newVrtx.setVertexId(id);
if (edges != null) {
for (String edgeId : edges.keySet())
- newVrtx.putToEdges(new Utf8(edgeId), new Utf8(edges.get(edgeId)));
+ newVrtx.getEdges().put(edgeId, edges.get(edgeId));
}
return newVrtx;
}
@@ -106,11 +104,11 @@ public class GoraTestVertexInputFormat
LongWritable vrtxId = new LongWritable(
Long.parseLong(tmpGVertex.getVertexId().toString()));
- DoubleWritable vrtxValue = new DoubleWritable(tmpGVertex.getValue());
+ DoubleWritable vrtxValue = new DoubleWritable(tmpGVertex.getVertexValue());
vertex.initialize(vrtxId, vrtxValue);
if (tmpGVertex.getEdges() != null && !tmpGVertex.getEdges().isEmpty()) {
- Set<Utf8> keyIt = tmpGVertex.getEdges().keySet();
- for (Utf8 key : keyIt) {
+ Set<CharSequence> keyIt = tmpGVertex.getEdges().keySet();
+ for (CharSequence key : keyIt) {
String keyVal = key.toString();
String valVal = tmpGVertex.getEdges().get(key).toString();
Edge<LongWritable, FloatWritable> edge;
http://git-wip-us.apache.org/repos/asf/giraph/blob/7c61dcf4/giraph-gora/src/test/java/org/apache/giraph/io/gora/GoraTestVertexOutputFormat.java
----------------------------------------------------------------------
diff --git a/giraph-gora/src/test/java/org/apache/giraph/io/gora/GoraTestVertexOutputFormat.java b/giraph-gora/src/test/java/org/apache/giraph/io/gora/GoraTestVertexOutputFormat.java
index 5170d03..1cb1f14 100644
--- a/giraph-gora/src/test/java/org/apache/giraph/io/gora/GoraTestVertexOutputFormat.java
+++ b/giraph-gora/src/test/java/org/apache/giraph/io/gora/GoraTestVertexOutputFormat.java
@@ -21,9 +21,6 @@ import java.io.IOException;
import java.util.Iterator;
import java.util.Map;
-import junit.framework.Assert;
-
-import org.apache.avro.util.Utf8;
import org.apache.giraph.edge.Edge;
import org.apache.giraph.graph.Vertex;
import org.apache.giraph.io.VertexWriter;
@@ -34,6 +31,7 @@ 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.junit.Assert;
/**
* Implementation of a specific reader for a generated data bean.
@@ -64,20 +62,21 @@ public class GoraTestVertexOutputFormat
protected Persistent getGoraVertex(
Vertex<LongWritable, DoubleWritable, FloatWritable> vertex) {
GVertexResult tmpGVertex = new GVertexResult();
- tmpGVertex.setVertexId(new Utf8(vertex.getId().toString()));
- tmpGVertex.setValue(Float.parseFloat(vertex.getValue().toString()));
+ tmpGVertex.setVertexId(vertex.getId().toString());
+ tmpGVertex.setVertexValue(Float.parseFloat(vertex.getValue().toString()));
Iterator<Edge<LongWritable, FloatWritable>> it =
vertex.getEdges().iterator();
while (it.hasNext()) {
Edge<LongWritable, FloatWritable> edge = it.next();
- tmpGVertex.putToEdges(
- new Utf8(edge.getTargetVertexId().toString()),
- new Utf8(edge.getValue().toString()));
+ tmpGVertex.getEdges().put(
+ edge.getTargetVertexId().toString(),
+ edge.getValue().toString());
}
getLogger().debug("GoraObject created: " + tmpGVertex.toString());
return tmpGVertex;
}
+ @SuppressWarnings("unchecked")
@Override
public void writeVertex(
Vertex<LongWritable, DoubleWritable, FloatWritable> vertex)
@@ -94,12 +93,12 @@ public class GoraTestVertexOutputFormat
* @param edges Set of edges.
* @return GVertex created.
*/
- public GVertex createVertex(String id, Map<String, String> edges) {
- GVertex newVrtx = new GVertex();
- newVrtx.setVertexId(new Utf8(id));
+ public GVertexResult createVertex(String id, Map<String, String> edges) {
+ GVertexResult newVrtx = new GVertexResult();
+ newVrtx.setVertexId(id);
if (edges != null) {
for (String edgeId : edges.keySet())
- newVrtx.putToEdges(new Utf8(edgeId), new Utf8(edges.get(edgeId)));
+ newVrtx.getEdges().put(edgeId, edges.get(edgeId));
}
return newVrtx;
}
http://git-wip-us.apache.org/repos/asf/giraph/blob/7c61dcf4/giraph-gora/src/test/java/org/apache/giraph/io/gora/TestGoraEdgeInputFormat.java
----------------------------------------------------------------------
diff --git a/giraph-gora/src/test/java/org/apache/giraph/io/gora/TestGoraEdgeInputFormat.java b/giraph-gora/src/test/java/org/apache/giraph/io/gora/TestGoraEdgeInputFormat.java
index a01fbd3..cf2df34 100644
--- a/giraph-gora/src/test/java/org/apache/giraph/io/gora/TestGoraEdgeInputFormat.java
+++ b/giraph-gora/src/test/java/org/apache/giraph/io/gora/TestGoraEdgeInputFormat.java
@@ -60,8 +60,8 @@ public class TestGoraEdgeInputFormat {
GIRAPH_GORA_START_KEY.set(conf,"1");
GIRAPH_GORA_END_KEY.set(conf,"3");
conf.set("io.serializations",
- "org.apache.hadoop.io.serializer.WritableSerialization," +
- "org.apache.hadoop.io.serializer.JavaSerialization");
+ "org.apache.hadoop.io.serializer.JavaSerialization," +
+ "org.apache.hadoop.io.serializer.WritableSerialization");
conf.setComputationClass(EmptyComputation.class);
conf.setEdgeInputFormatClass(GoraGEdgeEdgeInputFormat.class);
results = InternalVertexRunner.run(conf, new String[0], new String[0]);
http://git-wip-us.apache.org/repos/asf/giraph/blob/7c61dcf4/giraph-gora/src/test/java/org/apache/giraph/io/gora/TestGoraEdgeOutputFormat.java
----------------------------------------------------------------------
diff --git a/giraph-gora/src/test/java/org/apache/giraph/io/gora/TestGoraEdgeOutputFormat.java b/giraph-gora/src/test/java/org/apache/giraph/io/gora/TestGoraEdgeOutputFormat.java
index c9ac38a..7de6d01 100644
--- a/giraph-gora/src/test/java/org/apache/giraph/io/gora/TestGoraEdgeOutputFormat.java
+++ b/giraph-gora/src/test/java/org/apache/giraph/io/gora/TestGoraEdgeOutputFormat.java
@@ -68,7 +68,7 @@ public class TestGoraEdgeOutputFormat {
set(conf, "org.apache.gora.memory.store.MemStore");
GIRAPH_GORA_OUTPUT_KEY_CLASS.set(conf, "java.lang.String");
GIRAPH_GORA_OUTPUT_PERSISTENT_CLASS.
- set(conf,"org.apache.giraph.io.gora.generated.GEdge");
+ set(conf,"org.apache.giraph.io.gora.generated.GEdgeResult");
conf.setEdgeOutputFormatClass(GoraTestEdgeOutputFormat.class);
results = InternalVertexRunner.run(conf, new String[0], new String[0]);
Assert.assertNotNull(results);
http://git-wip-us.apache.org/repos/asf/giraph/blob/7c61dcf4/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index e654ff3..6804de9 100644
--- a/pom.xml
+++ b/pom.xml
@@ -273,10 +273,10 @@ under the License.
<giraph.maven.dependency.plugin.skip>false</giraph.maven.dependency.plugin.skip>
<giraph.maven.duplicate.finder.skip>false</giraph.maven.duplicate.finder.skip>
- <dep.avro.version>1.3.3</dep.avro.version>
+ <dep.avro.version>1.7.6</dep.avro.version>
<dep.accumulo.version>1.4.0</dep.accumulo.version>
<dep.asm.version>3.2</dep.asm.version>
- <dep.gora.version>0.3</dep.gora.version>
+ <dep.gora.version>0.5</dep.gora.version>
<dep.airline.version>0.5</dep.airline.version>
<dep.base64.version>2.3.8</dep.base64.version>
<dep.cli-parser.version>1.1</dep.cli-parser.version>
[2/4] git commit: updated refs/heads/trunk to 7c61dcf
Posted by rv...@apache.org.
GIRAPH-947: Compilation error with hadoop 2.5.x fixed.
1. Munge symbol 'STATIC_SASL_SYMBOL' was added.
2. STATIC_SASL_SYMBOL was added to all build profiles, except hadoop_2 and hadoop_snapshot. Profile 2.1.1-SNAPSHOT is not munge-free anymore.
3. Default hadoop version of profile hadoop_2 was changed: 2.2.0 -> 2.5.0
Project: http://git-wip-us.apache.org/repos/asf/giraph/repo
Commit: http://git-wip-us.apache.org/repos/asf/giraph/commit/0bcc76de
Tree: http://git-wip-us.apache.org/repos/asf/giraph/tree/0bcc76de
Diff: http://git-wip-us.apache.org/repos/asf/giraph/diff/0bcc76de
Branch: refs/heads/trunk
Commit: 0bcc76de532636985a020ed4f41129041bffa850
Parents: 46d7d90
Author: dongjinleekr <do...@gmail.com>
Authored: Wed Sep 24 18:03:51 2014 +0900
Committer: Roman Shaposhnik <rv...@apache.org>
Committed: Sun Oct 19 16:52:45 2014 -0700
----------------------------------------------------------------------
.../giraph/comm/netty/SaslNettyClient.java | 22 ++++++++++++++++---
.../giraph/comm/netty/SaslNettyServer.java | 23 +++++++++++++++++---
pom.xml | 23 ++++++++++----------
3 files changed, 51 insertions(+), 17 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/giraph/blob/0bcc76de/giraph-core/src/main/java/org/apache/giraph/comm/netty/SaslNettyClient.java
----------------------------------------------------------------------
diff --git a/giraph-core/src/main/java/org/apache/giraph/comm/netty/SaslNettyClient.java b/giraph-core/src/main/java/org/apache/giraph/comm/netty/SaslNettyClient.java
index 840fee4..431691a 100644
--- a/giraph-core/src/main/java/org/apache/giraph/comm/netty/SaslNettyClient.java
+++ b/giraph-core/src/main/java/org/apache/giraph/comm/netty/SaslNettyClient.java
@@ -24,6 +24,9 @@ import org.apache.hadoop.mapred.JobConf;
import org.apache.hadoop.mapreduce.security.TokenCache;
import org.apache.hadoop.mapreduce.security.token.JobTokenIdentifier;
import org.apache.hadoop.security.Credentials;
+/*if_not[STATIC_SASL_SYMBOL]*/
+import org.apache.hadoop.security.SaslPropertiesResolver;
+/*end[STATIC_SASL_SYMBOL]*/
import org.apache.hadoop.security.SaslRpcServer;
import org.apache.hadoop.security.SaslRpcServer.AuthMethod;
import org.apache.hadoop.security.token.Token;
@@ -74,9 +77,22 @@ public class SaslNettyClient {
AuthMethod.DIGEST.getMechanismName() +
" client to authenticate to service at " + token.getService());
}
- saslClient = Sasl.createSaslClient(new String[] { AuthMethod.DIGEST
- .getMechanismName() }, null, null, SaslRpcServer.SASL_DEFAULT_REALM,
- SaslRpcServer.SASL_PROPS, new SaslClientCallbackHandler(token));
+ /*if[STATIC_SASL_SYMBOL]
+ saslClient =
+ Sasl.createSaslClient(
+ new String[] { AuthMethod.DIGEST.getMechanismName() }, null,
+ null, SaslRpcServer.SASL_DEFAULT_REALM, SaslRpcServer.SASL_PROPS,
+ new SaslClientCallbackHandler(token));
+ else[STATIC_SASL_SYMBOL]*/
+ SaslPropertiesResolver saslPropsResolver =
+ SaslPropertiesResolver.getInstance(new Configuration());
+ saslClient =
+ Sasl.createSaslClient(
+ new String[] { AuthMethod.DIGEST.getMechanismName() }, null,
+ null, SaslRpcServer.SASL_DEFAULT_REALM,
+ saslPropsResolver.getDefaultProperties(),
+ new SaslClientCallbackHandler(token));
+ /*end[STATIC_SASL_SYMBOL]*/
} catch (IOException e) {
LOG.error("SaslNettyClient: Could not obtain job token for Netty " +
"Client to use to authenticate with a Netty Server.");
http://git-wip-us.apache.org/repos/asf/giraph/blob/0bcc76de/giraph-core/src/main/java/org/apache/giraph/comm/netty/SaslNettyServer.java
----------------------------------------------------------------------
diff --git a/giraph-core/src/main/java/org/apache/giraph/comm/netty/SaslNettyServer.java b/giraph-core/src/main/java/org/apache/giraph/comm/netty/SaslNettyServer.java
index 9039141..a1d410f 100644
--- a/giraph-core/src/main/java/org/apache/giraph/comm/netty/SaslNettyServer.java
+++ b/giraph-core/src/main/java/org/apache/giraph/comm/netty/SaslNettyServer.java
@@ -19,12 +19,18 @@ package org.apache.giraph.comm.netty;
import org.apache.commons.net.util.Base64;
import org.apache.hadoop.classification.InterfaceStability;
+/*if_not[STATIC_SASL_SYMBOL]*/
+import org.apache.hadoop.conf.Configuration;
+/*end[STATIC_SASL_SYMBOL]*/
/*if[HADOOP_1_SECURITY]
else[HADOOP_1_SECURITY]*/
import org.apache.hadoop.ipc.StandbyException;
/*end[HADOOP_1_SECURITY]*/
import org.apache.hadoop.mapreduce.security.token.JobTokenIdentifier;
import org.apache.hadoop.mapreduce.security.token.JobTokenSecretManager;
+/*if_not[STATIC_SASL_SYMBOL]*/
+import org.apache.hadoop.security.SaslPropertiesResolver;
+/*end[STATIC_SASL_SYMBOL]*/
import org.apache.hadoop.security.SaslRpcServer;
import org.apache.log4j.Logger;
@@ -92,9 +98,20 @@ else[HADOOP_1_SECRET_MANAGER]*/
try {
SaslDigestCallbackHandler ch =
new SaslNettyServer.SaslDigestCallbackHandler(secretManager);
- saslServer = Sasl.createSaslServer(SaslNettyServer.AuthMethod.DIGEST
- .getMechanismName(), null, SaslRpcServer.SASL_DEFAULT_REALM,
- SaslRpcServer.SASL_PROPS, ch);
+ /*if[STATIC_SASL_SYMBOL]
+ saslServer =
+ Sasl.createSaslServer(
+ SaslNettyServer.AuthMethod.DIGEST.getMechanismName(), null,
+ SaslRpcServer.SASL_DEFAULT_REALM, SaslRpcServer.SASL_PROPS, ch);
+ else[STATIC_SASL_SYMBOL]*/
+ SaslPropertiesResolver saslPropsResolver =
+ SaslPropertiesResolver.getInstance(new Configuration());
+ saslServer =
+ Sasl.createSaslServer(
+ SaslNettyServer.AuthMethod.DIGEST.getMechanismName(), null,
+ SaslRpcServer.SASL_DEFAULT_REALM,
+ saslPropsResolver.getDefaultProperties(), ch);
+ /*end[STATIC_SASL_SYMBOL]*/
} catch (SaslException e) {
LOG.error("SaslNettyServer: Could not create SaslServer: " + e);
}
http://git-wip-us.apache.org/repos/asf/giraph/blob/0bcc76de/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 2e3eb63..e654ff3 100644
--- a/pom.xml
+++ b/pom.xml
@@ -930,7 +930,7 @@ under the License.
</modules>
<properties>
<hadoop.version>0.20.203.0</hadoop.version>
- <munge.symbols>HADOOP_NON_JOBCONTEXT_IS_INTERFACE,HADOOP_1_SECURITY,HADOOP_1_SECRET_MANAGER</munge.symbols>
+ <munge.symbols>HADOOP_NON_JOBCONTEXT_IS_INTERFACE,HADOOP_1_SECURITY,HADOOP_1_SECRET_MANAGER,STATIC_SASL_SYMBOL</munge.symbols>
</properties>
<dependencies>
<!-- sorted lexicographically -->
@@ -985,7 +985,7 @@ under the License.
</activation>
<properties>
<hadoop.version>1.2.1</hadoop.version>
- <munge.symbols>HADOOP_NON_JOBCONTEXT_IS_INTERFACE,HADOOP_1_SECURITY,HADOOP_1_SECRET_MANAGER</munge.symbols>
+ <munge.symbols>HADOOP_NON_JOBCONTEXT_IS_INTERFACE,HADOOP_1_SECURITY,HADOOP_1_SECRET_MANAGER,STATIC_SASL_SYMBOL</munge.symbols>
</properties>
<dependencies>
<!-- sorted lexicographically -->
@@ -1036,7 +1036,7 @@ under the License.
</modules>
<properties>
<hadoop.version>0.20.2</hadoop.version>
- <munge.symbols>HADOOP_NON_SECURE,HADOOP_NON_JOBCONTEXT_IS_INTERFACE,HADOOP_NON_COMMIT_JOB</munge.symbols>
+ <munge.symbols>HADOOP_NON_SECURE,HADOOP_NON_JOBCONTEXT_IS_INTERFACE,HADOOP_NON_COMMIT_JOB,STATIC_SASL_SYMBOL</munge.symbols>
</properties>
<dependencies>
<!-- sorted lexicographically -->
@@ -1060,7 +1060,7 @@ under the License.
</modules>
<properties>
<hadoop.version>0.20.0</hadoop.version>
- <munge.symbols>HADOOP_NON_SECURE,HADOOP_NON_JOBCONTEXT_IS_INTERFACE,HADOOP_JOB_ID_AVAILABLE</munge.symbols>
+ <munge.symbols>HADOOP_NON_SECURE,HADOOP_NON_JOBCONTEXT_IS_INTERFACE,HADOOP_JOB_ID_AVAILABLE,STATIC_SASL_SYMBOL</munge.symbols>
</properties>
<dependencies>
<!-- sorted lexicographically -->
@@ -1091,7 +1091,7 @@ under the License.
</modules>
<properties>
<hadoop.version>0.23.1</hadoop.version>
- <munge.symbols>HADOOP_1_SECRET_MANAGER</munge.symbols>
+ <munge.symbols>HADOOP_1_SECRET_MANAGER,STATIC_SASL_SYMBOL</munge.symbols>
<!-- TODO: add these checks eventually -->
<project.enforcer.skip>true</project.enforcer.skip>
<giraph.maven.dependency.plugin.skip>true</giraph.maven.dependency.plugin.skip>
@@ -1125,7 +1125,7 @@ under the License.
</modules>
<properties>
<hadoop.version>2.0.0-cdh4.1.2</hadoop.version>
- <munge.symbols>HADOOP_1_SECRET_MANAGER</munge.symbols>
+ <munge.symbols>HADOOP_1_SECRET_MANAGER,STATIC_SASL_SYMBOL</munge.symbols>
<!-- TODO: add these checks eventually -->
<project.enforcer.skip>true</project.enforcer.skip>
<giraph.maven.dependency.plugin.skip>true</giraph.maven.dependency.plugin.skip>
@@ -1191,7 +1191,7 @@ under the License.
</modules>
<properties>
<hadoop.version>SET_HADOOP_VERSION_USING_MVN_DASH_D_OPTION</hadoop.version>
- <munge.symbols>PURE_YARN</munge.symbols>
+ <munge.symbols>PURE_YARN,STATIC_SASL_SYMBOL</munge.symbols>
<!-- TODO: add these checks eventually -->
<project.enforcer.skip>true</project.enforcer.skip>
<giraph.maven.dependency.plugin.skip>true</giraph.maven.dependency.plugin.skip>
@@ -1240,9 +1240,6 @@ under the License.
</dependencies>
</profile>
- <!-- Help keep future Hadoop versions munge-free:
- All profiles below are munge-free: avoid introducing any munge
- flags on any of the following profiles. -->
<profile>
<id>2.1.1-SNAPSHOT</id>
<modules>
@@ -1250,6 +1247,7 @@ under the License.
</modules>
<properties>
<hadoop.version>2.1.1-SNAPSHOT</hadoop.version>
+ <munge.symbols>STATIC_SASL_SYMBOL</munge.symbols>
<!-- TODO: add these checks eventually -->
<project.enforcer.skip>true</project.enforcer.skip>
<giraph.maven.dependency.plugin.skip>true</giraph.maven.dependency.plugin.skip>
@@ -1284,6 +1282,9 @@ under the License.
</dependencies>
</profile>
+ <!-- Help keep future Hadoop versions munge-free:
+ All profiles below are munge-free: avoid introducing any munge
+ flags on any of the following profiles. -->
<profile>
<id>hadoop_2</id>
<modules>
@@ -1296,7 +1297,7 @@ under the License.
<module>giraph-dist</module>
</modules>
<properties>
- <hadoop.version>2.2.0</hadoop.version>
+ <hadoop.version>2.5.1</hadoop.version>
<!-- TODO: add these checks eventually -->
<project.enforcer.skip>true</project.enforcer.skip>
<giraph.maven.dependency.plugin.skip>true</giraph.maven.dependency.plugin.skip>
[4/4] git commit: updated refs/heads/trunk to 7c61dcf
Posted by rv...@apache.org.
GIRAPH-946. Upgrade to Gora 0.5 (Renato Javier MarroquĂn Mogrovejo via rvs)
Project: http://git-wip-us.apache.org/repos/asf/giraph/repo
Commit: http://git-wip-us.apache.org/repos/asf/giraph/commit/7c61dcf4
Tree: http://git-wip-us.apache.org/repos/asf/giraph/tree/7c61dcf4
Diff: http://git-wip-us.apache.org/repos/asf/giraph/diff/7c61dcf4
Branch: refs/heads/trunk
Commit: 7c61dcf4abaa422637a68839bf0d547a164375a3
Parents: 0bcc76d
Author: Roman Shaposhnik <rv...@apache.org>
Authored: Sun Oct 19 16:54:39 2014 -0700
Committer: Roman Shaposhnik <rv...@apache.org>
Committed: Sun Oct 19 16:54:39 2014 -0700
----------------------------------------------------------------------
giraph-gora/conf/edge_result.avsc | 12 +
giraph-gora/conf/vertex.avsc | 10 +
giraph-gora/conf/vertex.json | 18 -
giraph-gora/conf/vertex_result.avsc | 10 +
giraph-gora/pom.xml | 241 +++---
.../giraph/io/gora/GoraEdgeInputFormat.java | 12 +-
.../giraph/io/gora/GoraEdgeOutputFormat.java | 10 +-
.../io/gora/GoraGEdgeEdgeInputFormat.java | 9 +-
.../io/gora/GoraGEdgeEdgeOutputFormat.java | 5 +-
.../io/gora/GoraGVertexVertexInputFormat.java | 10 +-
.../io/gora/GoraGVertexVertexOutputFormat.java | 11 +-
.../giraph/io/gora/GoraVertexInputFormat.java | 14 +-
.../giraph/io/gora/GoraVertexOutputFormat.java | 8 +-
.../apache/giraph/io/gora/generated/GEdge.java | 842 +++++++++++++++---
.../giraph/io/gora/generated/GEdgeResult.java | 849 ++++++++++++++++---
.../giraph/io/gora/generated/GVertex.java | 641 +++++++++++---
.../giraph/io/gora/generated/GVertexResult.java | 644 +++++++++++---
.../io/gora/utils/ExtraGoraInputFormat.java | 9 +-
.../apache/giraph/io/gora/utils/GoraUtils.java | 42 +-
.../giraph/io/gora/GoraTestEdgeInputFormat.java | 14 +-
.../io/gora/GoraTestEdgeOutputFormat.java | 25 +-
.../io/gora/GoraTestVertexInputFormat.java | 12 +-
.../io/gora/GoraTestVertexOutputFormat.java | 23 +-
.../giraph/io/gora/TestGoraEdgeInputFormat.java | 4 +-
.../io/gora/TestGoraEdgeOutputFormat.java | 2 +-
pom.xml | 4 +-
26 files changed, 2728 insertions(+), 753 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/giraph/blob/7c61dcf4/giraph-gora/conf/edge_result.avsc
----------------------------------------------------------------------
diff --git a/giraph-gora/conf/edge_result.avsc b/giraph-gora/conf/edge_result.avsc
new file mode 100644
index 0000000..9319fa1
--- /dev/null
+++ b/giraph-gora/conf/edge_result.avsc
@@ -0,0 +1,12 @@
+{
+ "type": "record",
+ "name": "GEdgeResult",
+ "namespace": "org.apache.giraph.io.gora.generated",
+ "fields" : [
+ {"name": "edgeId", "type": "string"},
+ {"name": "edgeWeight", "type": "float"},
+ {"name": "vertexInId", "type": "string"},
+ {"name": "vertexOutId", "type": "string"},
+ {"name": "label", "type": "string"}
+ ]
+}
http://git-wip-us.apache.org/repos/asf/giraph/blob/7c61dcf4/giraph-gora/conf/vertex.avsc
----------------------------------------------------------------------
diff --git a/giraph-gora/conf/vertex.avsc b/giraph-gora/conf/vertex.avsc
new file mode 100644
index 0000000..88d4234
--- /dev/null
+++ b/giraph-gora/conf/vertex.avsc
@@ -0,0 +1,10 @@
+{
+ "type": "record",
+ "name": "GVertex",
+ "namespace": "org.apache.giraph.io.gora.generated",
+ "fields" : [
+ {"name": "vertexId", "type": "string"},
+ {"name": "vertexValue", "type": "float"},
+ {"name": "edges", "type": {"type": "map", "values": "string"}}
+ ]
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/giraph/blob/7c61dcf4/giraph-gora/conf/vertex.json
----------------------------------------------------------------------
diff --git a/giraph-gora/conf/vertex.json b/giraph-gora/conf/vertex.json
deleted file mode 100644
index 9f435fa..0000000
--- a/giraph-gora/conf/vertex.json
+++ /dev/null
@@ -1,18 +0,0 @@
-{
- "type": "record",
- "name": "Vertex",
- "namespace": "org.apache.giraph.gora.generated",
- "fields" : [
- {"name": "vertexId", "type": "long"},
- {"name": "value", "type": "float"},
- {"name": "edges", "type": {"type":"array", "items": {
- "name": "Edge",
- "type": "record",
- "namespace": "org.apache.giraph.gora.generated",
- "fields": [
- {"name": "vertexId", "type": "long"},
- {"name": "edgeValue", "type": "float"}
- ]
- }}}
- ]
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/giraph/blob/7c61dcf4/giraph-gora/conf/vertex_result.avsc
----------------------------------------------------------------------
diff --git a/giraph-gora/conf/vertex_result.avsc b/giraph-gora/conf/vertex_result.avsc
new file mode 100644
index 0000000..b594ca9
--- /dev/null
+++ b/giraph-gora/conf/vertex_result.avsc
@@ -0,0 +1,10 @@
+{
+ "type": "record",
+ "name": "GVertexResult",
+ "namespace": "org.apache.giraph.io.gora.generated",
+ "fields" : [
+ {"name": "vertexId", "type": "string"},
+ {"name": "vertexValue", "type": "float"},
+ {"name": "edges", "type": {"type": "map", "values": "string"}}
+ ]
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/giraph/blob/7c61dcf4/giraph-gora/pom.xml
----------------------------------------------------------------------
diff --git a/giraph-gora/pom.xml b/giraph-gora/pom.xml
index 38e3ab7..7f499c6 100644
--- a/giraph-gora/pom.xml
+++ b/giraph-gora/pom.xml
@@ -1,122 +1,139 @@
-<!--
-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.
--->
+<!-- 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>
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.giraph</groupId>
- <artifactId>giraph-parent</artifactId>
- <version>1.1.0-SNAPSHOT</version>
- </parent>
- <artifactId>giraph-gora</artifactId>
- <packaging>jar</packaging>
+ <parent>
+ <groupId>org.apache.giraph</groupId>
+ <artifactId>giraph-parent</artifactId>
+ <version>1.1.0-SNAPSHOT</version>
+ </parent>
+ <artifactId>giraph-gora</artifactId>
+ <packaging>jar</packaging>
- <name>Apache Giraph Gora I/O</name>
- <url>http://gora.apache.org/giraph-gora/</url>
- <description>Giraph Gora input/output classes</description>
+ <name>Apache Giraph Gora I/O</name>
+ <url>http://gora.apache.org/giraph-gora/</url>
+ <description>Giraph Gora input/output classes</description>
- <properties>
- <top.dir>${project.basedir}/..</top.dir>
- </properties>
+ <properties>
+ <top.dir>${project.basedir}/..</top.dir>
+ </properties>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-assembly-plugin</artifactId>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-checkstyle-plugin</artifactId>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jar-plugin</artifactId>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-javadoc-plugin</artifactId>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-site-plugin</artifactId>
- <configuration>
- <siteDirectory>${project.basedir}/src/site</siteDirectory>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <version>2.6</version>
- <configuration>
- <systemProperties>
- <property>
- <name>prop.jarLocation</name>
- <value>${top.dir}/giraph-core/target/giraph-${project.version}-${forHadoop}-jar-with-dependencies.jar</value>
- </property>
- </systemProperties>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>findbugs-maven-plugin</artifactId>
- </plugin>
- </plugins>
- </build>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-assembly-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-checkstyle-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-site-plugin</artifactId>
+ <configuration>
+ <siteDirectory>${project.basedir}/src/site</siteDirectory>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.6</version>
+ <configuration>
+ <systemProperties>
+ <property>
+ <name>prop.jarLocation</name>
+ <value>${top.dir}/giraph-core/target/giraph-${project.version}-${forHadoop}-jar-with-dependencies.jar</value>
+ </property>
+ </systemProperties>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>findbugs-maven-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
- <dependencies>
- <!-- compile dependencies. sorted lexicographically. -->
- <dependency>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.giraph</groupId>
- <artifactId>giraph-core</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.gora</groupId>
- <artifactId>gora-core</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.hadoop</groupId>
- <artifactId>avro</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.zookeeper</groupId>
- <artifactId>zookeeper</artifactId>
- </dependency>
+ <dependencies>
+ <!-- compile dependencies. sorted lexicographically. -->
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.giraph</groupId>
+ <artifactId>giraph-core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.gora</groupId>
+ <artifactId>gora-core</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>org.codehaus.jackson</groupId>
+ <artifactId>jackson-core-asl</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.codehaus.jackson</groupId>
+ <artifactId>jackson-mapper-asl</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.gora</groupId>
+ <artifactId>gora-shims-distribution</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.avro</groupId>
+ <artifactId>avro</artifactId>
+ <version>${dep.avro.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.codehaus.jackson</groupId>
+ <artifactId>jackson-core-asl</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.codehaus.jackson</groupId>
+ <artifactId>jackson-mapper-asl</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.zookeeper</groupId>
+ <artifactId>zookeeper</artifactId>
+ </dependency>
- <!-- runtime dependency -->
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- <scope>runtime</scope>
- </dependency>
+ <!-- runtime dependency -->
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <scope>runtime</scope>
+ </dependency>
- <!-- test dependencies. sorted lexicographically. -->
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
- </dependencies>
+ <!-- test dependencies. sorted lexicographically. -->
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
</project>
http://git-wip-us.apache.org/repos/asf/giraph/blob/7c61dcf4/giraph-gora/src/main/java/org/apache/giraph/io/gora/GoraEdgeInputFormat.java
----------------------------------------------------------------------
diff --git a/giraph-gora/src/main/java/org/apache/giraph/io/gora/GoraEdgeInputFormat.java b/giraph-gora/src/main/java/org/apache/giraph/io/gora/GoraEdgeInputFormat.java
index d0dcc32..8ef91f6 100644
--- a/giraph-gora/src/main/java/org/apache/giraph/io/gora/GoraEdgeInputFormat.java
+++ b/giraph-gora/src/main/java/org/apache/giraph/io/gora/GoraEdgeInputFormat.java
@@ -34,8 +34,8 @@ import org.apache.giraph.io.gora.utils.ExtraGoraInputFormat;
import org.apache.giraph.io.gora.utils.GoraUtils;
import org.apache.giraph.io.gora.utils.KeyFactory;
import org.apache.gora.persistency.Persistent;
-import org.apache.gora.query.Query;
import org.apache.gora.query.Result;
+import org.apache.gora.query.impl.QueryBase;
import org.apache.gora.store.DataStore;
import org.apache.gora.util.GoraException;
import org.apache.hadoop.conf.Configuration;
@@ -114,7 +114,7 @@ public abstract class GoraEdgeInputFormat
setPersistentClass((Class<? extends Persistent>) persistentClass);
setDatastoreClass((Class<? extends DataStore>) dataStoreClass);
setKeyFactoryClass(keyFactoryClass);
- setDataStore(createDataStore());
+ setDataStore(createDataStore(getConf()));
GORA_INPUT_FORMAT.setDataStore(getDataStore());
} catch (ClassNotFoundException e) {
LOG.error("Error while reading Gora Input parameters");
@@ -154,8 +154,9 @@ public abstract class GoraEdgeInputFormat
kFact.setDataStore(getDataStore());
setStartKey(kFact.buildKey(sKey));
setEndKey(kFact.buildKey(eKey));
- Query tmpQuery = GoraUtils.getQuery(
+ QueryBase tmpQuery = GoraUtils.getQuery(
getDataStore(), getStartKey(), getEndKey());
+ tmpQuery.setConf(context.getConfiguration());
GORA_INPUT_FORMAT.setQuery(tmpQuery);
List<InputSplit> splits = GORA_INPUT_FORMAT.getSplits(context);
return splits;
@@ -273,12 +274,13 @@ public abstract class GoraEdgeInputFormat
/**
* Gets the data store object initialized.
+ * @param conf Configuration
* @return DataStore created
*/
- public DataStore createDataStore() {
+ public DataStore createDataStore(Configuration conf) {
DataStore dsCreated = null;
try {
- dsCreated = GoraUtils.createSpecificDataStore(getDatastoreClass(),
+ dsCreated = GoraUtils.createSpecificDataStore(conf, getDatastoreClass(),
getKeyClass(), getPersistentClass());
} catch (GoraException e) {
LOG.error("Error creating data store.");
http://git-wip-us.apache.org/repos/asf/giraph/blob/7c61dcf4/giraph-gora/src/main/java/org/apache/giraph/io/gora/GoraEdgeOutputFormat.java
----------------------------------------------------------------------
diff --git a/giraph-gora/src/main/java/org/apache/giraph/io/gora/GoraEdgeOutputFormat.java b/giraph-gora/src/main/java/org/apache/giraph/io/gora/GoraEdgeOutputFormat.java
index be9f472..d030d70 100644
--- a/giraph-gora/src/main/java/org/apache/giraph/io/gora/GoraEdgeOutputFormat.java
+++ b/giraph-gora/src/main/java/org/apache/giraph/io/gora/GoraEdgeOutputFormat.java
@@ -30,11 +30,12 @@ import org.apache.giraph.io.gora.utils.GoraUtils;
import org.apache.gora.persistency.Persistent;
import org.apache.gora.store.DataStore;
import org.apache.gora.util.GoraException;
+import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.io.Writable;
import org.apache.hadoop.io.WritableComparable;
import org.apache.hadoop.mapreduce.JobContext;
-import org.apache.hadoop.mapreduce.TaskAttemptContext;
import org.apache.hadoop.mapreduce.OutputCommitter;
+import org.apache.hadoop.mapreduce.TaskAttemptContext;
import org.apache.log4j.Logger;
/**
@@ -83,12 +84,13 @@ public abstract class GoraEdgeOutputFormat<I extends WritableComparable,
/**
* Gets the data store object initialized.
+ * @param conf Configuration
* @return DataStore created
*/
- public DataStore createDataStore() {
+ public DataStore createDataStore(Configuration conf) {
DataStore dsCreated = null;
try {
- dsCreated = GoraUtils.createSpecificDataStore(getDatastoreClass(),
+ dsCreated = GoraUtils.createSpecificDataStore(conf, getDatastoreClass(),
getKeyClass(), getPersistentClass());
} catch (GoraException e) {
getLogger().error("Error creating data store.");
@@ -159,7 +161,7 @@ public abstract class GoraEdgeOutputFormat<I extends WritableComparable,
setKeyClass(keyClass);
setPersistentClass((Class<? extends Persistent>) persistentClass);
setDatastoreClass((Class<? extends DataStore>) dataStoreClass);
- setDataStore(createDataStore());
+ setDataStore(createDataStore(context.getConfiguration()));
if (getDataStore() != null) {
getLogger().debug("The data store has been created.");
}
http://git-wip-us.apache.org/repos/asf/giraph/blob/7c61dcf4/giraph-gora/src/main/java/org/apache/giraph/io/gora/GoraGEdgeEdgeInputFormat.java
----------------------------------------------------------------------
diff --git a/giraph-gora/src/main/java/org/apache/giraph/io/gora/GoraGEdgeEdgeInputFormat.java b/giraph-gora/src/main/java/org/apache/giraph/io/gora/GoraGEdgeEdgeInputFormat.java
index e738f36..a2a3417 100644
--- a/giraph-gora/src/main/java/org/apache/giraph/io/gora/GoraGEdgeEdgeInputFormat.java
+++ b/giraph-gora/src/main/java/org/apache/giraph/io/gora/GoraGEdgeEdgeInputFormat.java
@@ -69,14 +69,11 @@ public class GoraGEdgeEdgeInputFormat
(Object goraObject) {
Edge<LongWritable, FloatWritable> edge = null;
GEdge goraEdge = (GEdge) goraObject;
- Long dest;
- Long value;
- dest = Long.valueOf(goraEdge.getVertexOutId().toString());
this.sourceId = new LongWritable();
this.sourceId.set(Long.valueOf(goraEdge.getVertexInId().toString()));
- value = (long) goraEdge.getEdgeWeight();
- edge = EdgeFactory.create(new LongWritable(dest),
- new FloatWritable(value));
+ edge = EdgeFactory.create(
+ new LongWritable(Long.valueOf(goraEdge.getVertexOutId().toString())),
+ new FloatWritable(goraEdge.getEdgeWeight()));
return edge;
}
http://git-wip-us.apache.org/repos/asf/giraph/blob/7c61dcf4/giraph-gora/src/main/java/org/apache/giraph/io/gora/GoraGEdgeEdgeOutputFormat.java
----------------------------------------------------------------------
diff --git a/giraph-gora/src/main/java/org/apache/giraph/io/gora/GoraGEdgeEdgeOutputFormat.java b/giraph-gora/src/main/java/org/apache/giraph/io/gora/GoraGEdgeEdgeOutputFormat.java
index d350d37..82b02d0 100644
--- a/giraph-gora/src/main/java/org/apache/giraph/io/gora/GoraGEdgeEdgeOutputFormat.java
+++ b/giraph-gora/src/main/java/org/apache/giraph/io/gora/GoraGEdgeEdgeOutputFormat.java
@@ -19,7 +19,6 @@ package org.apache.giraph.io.gora;
import java.io.IOException;
-import org.apache.avro.util.Utf8;
import org.apache.giraph.edge.Edge;
import org.apache.giraph.io.gora.generated.GEdgeResult;
import org.apache.gora.persistency.Persistent;
@@ -57,9 +56,9 @@ public class GoraGEdgeEdgeOutputFormat
protected Persistent getGoraEdge(LongWritable srcId,
DoubleWritable srcValue, Edge<LongWritable, FloatWritable> edge) {
GEdgeResult tmpGEdge = new GEdgeResult();
- tmpGEdge.setEdgeId(new Utf8(srcId.toString()));
+ tmpGEdge.setEdgeId(srcId.toString());
tmpGEdge.setEdgeWeight(edge.getValue().get());
- tmpGEdge.setVertexOutId(new Utf8(edge.getTargetVertexId().toString()));
+ tmpGEdge.setVertexOutId(edge.getTargetVertexId().toString());
getLogger().debug("GoraObject created: " + tmpGEdge.toString());
return tmpGEdge;
}
http://git-wip-us.apache.org/repos/asf/giraph/blob/7c61dcf4/giraph-gora/src/main/java/org/apache/giraph/io/gora/GoraGVertexVertexInputFormat.java
----------------------------------------------------------------------
diff --git a/giraph-gora/src/main/java/org/apache/giraph/io/gora/GoraGVertexVertexInputFormat.java b/giraph-gora/src/main/java/org/apache/giraph/io/gora/GoraGVertexVertexInputFormat.java
index cb0f005..34ba7ec 100644
--- a/giraph-gora/src/main/java/org/apache/giraph/io/gora/GoraGVertexVertexInputFormat.java
+++ b/giraph-gora/src/main/java/org/apache/giraph/io/gora/GoraGVertexVertexInputFormat.java
@@ -20,7 +20,6 @@ package org.apache.giraph.io.gora;
import java.io.IOException;
import java.util.Set;
-import org.apache.avro.util.Utf8;
import org.apache.giraph.edge.Edge;
import org.apache.giraph.edge.EdgeFactory;
import org.apache.giraph.graph.Vertex;
@@ -75,12 +74,13 @@ public class GoraGVertexVertexInputFormat
GVertex tmpGVertex = (GVertex) goraObject;
LongWritable vrtxId = new LongWritable(
- Long.parseLong(tmpGVertex.getVertexId().toString()));
- DoubleWritable vrtxValue = new DoubleWritable(tmpGVertex.getValue());
+ Long.parseLong(tmpGVertex.getVertexId().toString()));
+ DoubleWritable vrtxValue = new DoubleWritable(
+ tmpGVertex.getVertexValue());
vertex.initialize(vrtxId, vrtxValue);
if (tmpGVertex.getEdges() != null && !tmpGVertex.getEdges().isEmpty()) {
- Set<Utf8> keyIt = tmpGVertex.getEdges().keySet();
- for (Utf8 key : keyIt) {
+ Set<CharSequence> keyIt = tmpGVertex.getEdges().keySet();
+ for (CharSequence key : keyIt) {
String keyVal = key.toString();
String valVal = tmpGVertex.getEdges().get(key).toString();
Edge<LongWritable, FloatWritable> edge;
http://git-wip-us.apache.org/repos/asf/giraph/blob/7c61dcf4/giraph-gora/src/main/java/org/apache/giraph/io/gora/GoraGVertexVertexOutputFormat.java
----------------------------------------------------------------------
diff --git a/giraph-gora/src/main/java/org/apache/giraph/io/gora/GoraGVertexVertexOutputFormat.java b/giraph-gora/src/main/java/org/apache/giraph/io/gora/GoraGVertexVertexOutputFormat.java
index 893e083..4a9c229 100644
--- a/giraph-gora/src/main/java/org/apache/giraph/io/gora/GoraGVertexVertexOutputFormat.java
+++ b/giraph-gora/src/main/java/org/apache/giraph/io/gora/GoraGVertexVertexOutputFormat.java
@@ -20,7 +20,6 @@ package org.apache.giraph.io.gora;
import java.io.IOException;
import java.util.Iterator;
-import org.apache.avro.util.Utf8;
import org.apache.giraph.edge.Edge;
import org.apache.giraph.graph.Vertex;
import org.apache.giraph.io.VertexWriter;
@@ -60,15 +59,15 @@ public class GoraGVertexVertexOutputFormat
protected Persistent getGoraVertex(
Vertex<LongWritable, DoubleWritable, FloatWritable> vertex) {
GVertexResult tmpGVertex = new GVertexResult();
- tmpGVertex.setVertexId(new Utf8(vertex.getId().toString()));
- tmpGVertex.setValue(Float.parseFloat(vertex.getValue().toString()));
+ tmpGVertex.setVertexId(vertex.getId().toString());
+ tmpGVertex.setVertexValue(Float.parseFloat(vertex.getValue().toString()));
Iterator<Edge<LongWritable, FloatWritable>> it =
vertex.getEdges().iterator();
while (it.hasNext()) {
Edge<LongWritable, FloatWritable> edge = it.next();
- tmpGVertex.putToEdges(
- new Utf8(edge.getTargetVertexId().toString()),
- new Utf8(edge.getValue().toString()));
+ tmpGVertex.getEdges().put(
+ edge.getTargetVertexId().toString(),
+ edge.getValue().toString());
}
return tmpGVertex;
}
http://git-wip-us.apache.org/repos/asf/giraph/blob/7c61dcf4/giraph-gora/src/main/java/org/apache/giraph/io/gora/GoraVertexInputFormat.java
----------------------------------------------------------------------
diff --git a/giraph-gora/src/main/java/org/apache/giraph/io/gora/GoraVertexInputFormat.java b/giraph-gora/src/main/java/org/apache/giraph/io/gora/GoraVertexInputFormat.java
index 9a6ad8c..ee5e7b6 100644
--- a/giraph-gora/src/main/java/org/apache/giraph/io/gora/GoraVertexInputFormat.java
+++ b/giraph-gora/src/main/java/org/apache/giraph/io/gora/GoraVertexInputFormat.java
@@ -30,12 +30,12 @@ import java.util.List;
import org.apache.giraph.graph.Vertex;
import org.apache.giraph.io.VertexInputFormat;
import org.apache.giraph.io.VertexReader;
-import org.apache.giraph.io.gora.utils.KeyFactory;
import org.apache.giraph.io.gora.utils.ExtraGoraInputFormat;
import org.apache.giraph.io.gora.utils.GoraUtils;
+import org.apache.giraph.io.gora.utils.KeyFactory;
import org.apache.gora.persistency.Persistent;
-import org.apache.gora.query.Query;
import org.apache.gora.query.Result;
+import org.apache.gora.query.impl.QueryBase;
import org.apache.gora.store.DataStore;
import org.apache.gora.util.GoraException;
import org.apache.hadoop.conf.Configuration;
@@ -115,7 +115,7 @@ public abstract class GoraVertexInputFormat<
setPersistentClass((Class<? extends Persistent>) persistentClass);
setDatastoreClass((Class<? extends DataStore>) dataStoreClass);
setKeyFactoryClass(keyFactoryClass);
- setDataStore(createDataStore());
+ setDataStore(createDataStore(conf));
GORA_INPUT_FORMAT.setDataStore(getDataStore());
} catch (ClassNotFoundException e) {
LOG.error("Error while reading Gora Input parameters");
@@ -170,8 +170,9 @@ public abstract class GoraVertexInputFormat<
setStartKey(kFact.buildKey(sKey));
setEndKey(kFact.buildKey(eKey));
}
- Query tmpQuery = GoraUtils.getQuery(
+ QueryBase tmpQuery = GoraUtils.getQuery(
getDataStore(), getStartKey(), getEndKey());
+ tmpQuery.setConf(getConf());
GORA_INPUT_FORMAT.setQuery(tmpQuery);
List<InputSplit> splits = GORA_INPUT_FORMAT.getSplits(context);
return splits;
@@ -179,12 +180,13 @@ public abstract class GoraVertexInputFormat<
/**
* Gets the data store object initialized.
+ * @param conf Configuration
* @return DataStore created
*/
- public DataStore createDataStore() {
+ public DataStore createDataStore(Configuration conf) {
DataStore dsCreated = null;
try {
- dsCreated = GoraUtils.createSpecificDataStore(getDatastoreClass(),
+ dsCreated = GoraUtils.createSpecificDataStore(conf, getDatastoreClass(),
getKeyClass(), getPersistentClass());
} catch (GoraException e) {
LOG.error("Error creating data store.");
http://git-wip-us.apache.org/repos/asf/giraph/blob/7c61dcf4/giraph-gora/src/main/java/org/apache/giraph/io/gora/GoraVertexOutputFormat.java
----------------------------------------------------------------------
diff --git a/giraph-gora/src/main/java/org/apache/giraph/io/gora/GoraVertexOutputFormat.java b/giraph-gora/src/main/java/org/apache/giraph/io/gora/GoraVertexOutputFormat.java
index 5fcc684..93143da 100644
--- a/giraph-gora/src/main/java/org/apache/giraph/io/gora/GoraVertexOutputFormat.java
+++ b/giraph-gora/src/main/java/org/apache/giraph/io/gora/GoraVertexOutputFormat.java
@@ -30,6 +30,7 @@ import org.apache.giraph.io.gora.utils.GoraUtils;
import org.apache.gora.persistency.Persistent;
import org.apache.gora.store.DataStore;
import org.apache.gora.util.GoraException;
+import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.io.Writable;
import org.apache.hadoop.io.WritableComparable;
import org.apache.hadoop.mapreduce.JobContext;
@@ -89,12 +90,13 @@ public abstract class GoraVertexOutputFormat<
/**
* Gets the data store object initialized.
+ * @param conf Configuration.
* @return DataStore created
*/
- public DataStore createDataStore() {
+ public DataStore createDataStore(Configuration conf) {
DataStore dsCreated = null;
try {
- dsCreated = GoraUtils.createSpecificDataStore(getDatastoreClass(),
+ dsCreated = GoraUtils.createSpecificDataStore(conf, getDatastoreClass(),
getKeyClass(), getPersistentClass());
} catch (GoraException e) {
getLogger().error("Error creating data store.");
@@ -166,7 +168,7 @@ public abstract class GoraVertexOutputFormat<
setKeyClass(keyClass);
setPersistentClass((Class<? extends Persistent>) persistentClass);
setDatastoreClass((Class<? extends DataStore>) dataStoreClass);
- setDataStore(createDataStore());
+ setDataStore(createDataStore(context.getConfiguration()));
if (getDataStore() != null) {
getLogger().info("The output data store has been created.");
}
http://git-wip-us.apache.org/repos/asf/giraph/blob/7c61dcf4/giraph-gora/src/main/java/org/apache/giraph/io/gora/generated/GEdge.java
----------------------------------------------------------------------
diff --git a/giraph-gora/src/main/java/org/apache/giraph/io/gora/generated/GEdge.java b/giraph-gora/src/main/java/org/apache/giraph/io/gora/generated/GEdge.java
index f6ac3f7..c8b0667 100644
--- a/giraph-gora/src/main/java/org/apache/giraph/io/gora/generated/GEdge.java
+++ b/giraph-gora/src/main/java/org/apache/giraph/io/gora/generated/GEdge.java
@@ -15,35 +15,30 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.apache.giraph.io.gora.generated;
-import org.apache.avro.Schema;
-import org.apache.avro.AvroRuntimeException;
-import org.apache.avro.util.Utf8;
-import org.apache.gora.persistency.StateManager;
-import org.apache.gora.persistency.impl.PersistentBase;
-import org.apache.gora.persistency.impl.StateManagerImpl;
-
/**
* Example class for defining a Giraph-Edge.
*/
@SuppressWarnings("all")
-public class GEdge extends PersistentBase {
- /**
- * Schema used for the class.
- */
- public static final Schema OBJ_SCHEMA = Schema.parse("{\"type\":\"record\"," +
- "\"name\":\"GEdge\",\"namespace\":\"org.apache.giraph.gora.generated\"," +
- "\"fields\":[{\"name\":\"edgeId\",\"type\":\"string\"}," +
- "{\"name\":\"edgeWeight\",\"type\":\"float\"}," +
- "{\"name\":\"vertexInId\",\"type\":\"string\"}," +
- "{\"name\":\"vertexOutId\",\"type\":\"string\"}," +
- "{\"name\":\"label\",\"type\":\"string\"}]}");
+public class GEdge extends org.apache.gora.persistency.impl.PersistentBase
+ implements org.apache.avro.specific.SpecificRecord,
+ org.apache.gora.persistency.Persistent {
/**
- * Field enum
+ * Schema used for the class.
*/
+ public static final org.apache.avro.Schema SCHEMAS =
+ new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\"," +
+ "\"name\":\"GEdge\"," +
+ "\"namespace\":\"org.apache.giraph.gora.generated\"," +
+ "\"fields\":[{\"name\":\"edgeId\",\"type\":\"string\"}," +
+ "{\"name\":\"edgeWeight\",\"type\":\"float\"}," +
+ "{\"name\":\"vertexInId\",\"type\":\"string\"}," +
+ "{\"name\":\"vertexOutId\",\"type\":\"string\"}," +
+ "{\"name\":\"label\",\"type\":\"string\"}]}");
+
+ /** Enum containing all data bean's fields. */
public static enum Field {
/**
* Edge id.
@@ -71,19 +66,19 @@ public class GEdge extends PersistentBase {
LABEL(4, "label");
/**
- * Field index
+ * Field's index.
*/
private int index;
/**
- * Field name
+ * Field's name.
*/
private String name;
/**
- * Field constructor
- * @param index of attribute
- * @param name of attribute
+ * Field's constructor
+ * @param index field's index.
+ * @param name field's name.
*/
Field(int index, String name) {
this.index = index;
@@ -91,24 +86,24 @@ public class GEdge extends PersistentBase {
}
/**
- * Gets index
- * @return int of attribute.
+ * Gets field's index.
+ * @return int field's index.
*/
public int getIndex() {
return index;
}
/**
- * Gets name
- * @return String of name.
+ * Gets field's name.
+ * @return String field's name.
*/
public String getName() {
return name;
}
/**
- * Gets name
- * @return String of name.
+ * Gets field's attributes to string.
+ * @return String field's attributes to string.
*/
public String toString() {
return name;
@@ -119,77 +114,61 @@ public class GEdge extends PersistentBase {
* Array containing all fields/
*/
private static final String[] ALL_FIELDS = {
- "edgeId", "edgeWeight", "vertexInId", "vertexOutId", "label"
- };
-
- static {
- PersistentBase.registerFields(GEdge.class, ALL_FIELDS);
- }
-
- /**
- * edgeId
- */
- private Utf8 edgeId;
+ "edgeId", "edgeWeight", "vertexInId", "vertexOutId", "label"};
/**
- * edgeWeight
+ * Tombstone.
*/
- private float edgeWeight;
+ private static final Tombstone TOMBSTONE = new Tombstone();
/**
- * vertexInId
+ * edgeId.
*/
- private Utf8 vertexInId;
+ private java.lang.CharSequence edgeId;
/**
- * vertexOutId
+ * edgeWeight.
*/
- private Utf8 vertexOutId;
+ private float edgeWeight;
/**
- * label
+ * vertexInId.
*/
- private Utf8 label;
+ private java.lang.CharSequence vertexInId;
/**
- * Default constructor.
+ * vertexOutId.
*/
- public GEdge() {
- this(new StateManagerImpl());
- }
+ private java.lang.CharSequence vertexOutId;
/**
- * Constructor
- * @param stateManager from which the object will be created.
+ * label.
*/
- public GEdge(StateManager stateManager) {
- super(stateManager);
- }
+ private java.lang.CharSequence label;
/**
- * Creates a new instance
- * @param stateManager from which the object will be created.
- * @return GEdge created
+ * Gets the total field count.
+ * @return int field count
*/
- public GEdge newInstance(StateManager stateManager) {
- return new GEdge(stateManager);
+ public int getFieldsCount() {
+ return GEdge.ALL_FIELDS.length;
}
/**
- * Gets the object schema
- * @return Schema of the object.
+ * Gets the schema
+ * @return Schema
*/
- public Schema getSchema() {
- return OBJ_SCHEMA;
+ public org.apache.avro.Schema getSchema() {
+ return SCHEMAS;
}
/**
* Gets field
- * @param fieldIndex index field.
+ * @param field index field.
* @return Object from an index.
*/
- public Object get(int fieldIndex) {
- switch (fieldIndex) {
+ public java.lang.Object get(int field) {
+ switch (field) {
case 0:
return edgeId;
case 1:
@@ -201,114 +180,725 @@ public class GEdge extends PersistentBase {
case 4:
return label;
default:
- throw new AvroRuntimeException("Bad index");
+ throw new org.apache.avro.AvroRuntimeException("Bad index");
}
}
/**
* Puts a value into a field.
- * @param fieldIndex index of field used.
- * @param fieldValue value of field used.
+ * @param field index of field used.
+ * @param value value of field used.
*/
@SuppressWarnings(value = "unchecked")
- public void put(int fieldIndex, Object fieldValue) {
- if (isFieldEqual(fieldIndex, fieldValue)) {
- return;
- }
- getStateManager().setDirty(this, fieldIndex);
- switch (fieldIndex) {
+ public void put(int field, java.lang.Object value) {
+ switch (field) {
case 0:
- edgeId = (Utf8) fieldValue; break;
+ edgeId = (java.lang.CharSequence) value;
+ break;
case 1:
- edgeWeight = (Float) fieldValue; break;
+ edgeWeight = (java.lang.Float) value;
+ break;
case 2:
- vertexInId = (Utf8) fieldValue; break;
+ vertexInId = (java.lang.CharSequence) value;
+ break;
case 3:
- vertexOutId = (Utf8) fieldValue; break;
+ vertexOutId = (java.lang.CharSequence) value;
+ break;
case 4:
- label = (Utf8) fieldValue; break;
+ label = (java.lang.CharSequence) value;
+ break;
default:
- throw new AvroRuntimeException("Bad index");
+ throw new org.apache.avro.AvroRuntimeException("Bad index");
}
}
/**
- * Gets edgeId
- * @return Utf8 edgeId
+ * Gets the value of the 'edgeId' field.
+ * @return CharSequence.
+ */
+ public java.lang.CharSequence getEdgeId() {
+ return edgeId;
+ }
+
+ /**
+ * Sets the value of the 'edgeId' field.
+ * @param value the value to set.
+ */
+ public void setEdgeId(java.lang.CharSequence value) {
+ this.edgeId = value;
+ setDirty(0);
+ }
+
+ /**
+ * Checks the dirty status of the 'edgeId' field. A field is dirty if it
+ * represents a change that has not yet been written to the database.
+ * @param value the value to set.
+ * @return boolean
+ */
+ public boolean isEdgeIdDirty(java.lang.CharSequence value) {
+ return isDirty(0);
+ }
+
+ /**
+ * Gets the value of the 'edgeWeight' field.
+ * @return Float
*/
- public Utf8 getEdgeId() {
- return (Utf8) get(0);
+ public java.lang.Float getEdgeWeight() {
+ return edgeWeight;
}
/**
- * Sets edgeId
- * @param value edgeId
+ * Sets the value of the 'edgeWeight' field.
+ * @param value the value to set.
*/
- public void setEdgeId(Utf8 value) {
- put(0, value);
+ public void setEdgeWeight(java.lang.Float value) {
+ this.edgeWeight = value;
+ setDirty(1);
}
/**
- * Gets edgeWeight
- * @return float edgeWeight
+ * Checks the dirty status of the 'edgeWeight' field. A field is dirty if it
+ * represents a change that has not yet been written to the database.
+ * @param value the value to set.
+ * @return boolean
*/
- public float getEdgeWeight() {
- return (Float) get(1);
+ public boolean isEdgeWeightDirty(java.lang.Float value) {
+ return isDirty(1);
}
/**
- * Sets edgeWeight
- * @param value edgeWeight
+ * Gets the value of the 'vertexInId' field.
+ * @return CharSequence
*/
- public void setEdgeWeight(float value) {
- put(1, value);
+ public java.lang.CharSequence getVertexInId() {
+ return vertexInId;
}
/**
- * Gets edgeVertexInId
- * @return Utf8 edgeVertexInId
+ * Sets the value of the 'vertexInId' field.
+ * @param value the value to set.
*/
- public Utf8 getVertexInId() {
- return (Utf8) get(2);
+ public void setVertexInId(java.lang.CharSequence value) {
+ this.vertexInId = value;
+ setDirty(2);
}
/**
- * Sets edgeVertexInId
- * @param value edgeVertexInId
+ * Checks the dirty status of the 'vertexInId' field. A field is dirty if it
+ * represents a change that has not yet been written to the database.
+ * @param value the value to set.
+ * @return boolean
*/
- public void setVertexInId(Utf8 value) {
- put(2, value);
+ public boolean isVertexInIdDirty(java.lang.CharSequence value) {
+ return isDirty(2);
}
/**
- * Gets edgeVertexOutId
- * @return Utf8 edgeVertexOutId
+ * Gets the value of the 'vertexOutId' field.
+ * @return CharSequence
*/
- public Utf8 getVertexOutId() {
- return (Utf8) get(3);
+ public java.lang.CharSequence getVertexOutId() {
+ return vertexOutId;
}
/**
- * Sets edgeVertexOutId
- * @param value edgeVertexOutId
+ * Sets the value of the 'vertexOutId' field.
+ * @param value the value to set.
*/
- public void setVertexOutId(Utf8 value) {
- put(3, value);
+ public void setVertexOutId(java.lang.CharSequence value) {
+ this.vertexOutId = value;
+ setDirty(3);
}
/**
- * Gets edgeLabel
- * @return Utf8 edgeLabel
+ * Checks the dirty status of the 'vertexOutId' field. A field is dirty if it
+ * represents a change that has not yet been written to the database.
+ * @param value the value to set.
+ * @return boolean
*/
- public Utf8 getLabel() {
- return (Utf8) get(4);
+ public boolean isVertexOutIdDirty(java.lang.CharSequence value) {
+ return isDirty(3);
}
/**
- * Sets edgeLabel
- * @param value edgeLabel
+ * Gets the value of the 'label' field.
+ * @return CharSequence
*/
- public void setLabel(Utf8 value) {
- put(4, value);
+ public java.lang.CharSequence getLabel() {
+ return label;
+ }
+
+ /**
+ * Sets the value of the 'label' field.
+ * @param value the value to set.
+ */
+ public void setLabel(java.lang.CharSequence value) {
+ this.label = value;
+ setDirty(4);
+ }
+
+ /**
+ * Checks the dirty status of the 'label' field. A field is dirty if it
+ * represents a change that has not yet been written to the database.
+ * @param value the value to set.
+ * @return boolean
+ */
+ public boolean isLabelDirty(java.lang.CharSequence value) {
+ return isDirty(4);
+ }
+
+ /**
+ * Creates a new GEdge RecordBuilder.
+ * @return GEdge.Builder
+ */
+ public static org.apache.giraph.io.gora.generated.GEdge.Builder newBuilder() {
+ return new org.apache.giraph.io.gora.generated.GEdge.Builder();
+ }
+
+ /**
+ * Creates a new GEdge RecordBuilder by copying an existing Builder
+ * @param other GEdge.Builder
+ * @return org.apache.giraph.io.gora.generated.GEdge.Builder
+ */
+ public static org.apache.giraph.io.gora.generated.GEdge.Builder newBuilder(
+ org.apache.giraph.io.gora.generated.GEdge.Builder other) {
+ return new org.apache.giraph.io.gora.generated.GEdge.Builder(other);
+ }
+
+ /**
+ * Creates a new GEdge RecordBuilder by copying an existing GEdge instance.
+ * @param other GEdge
+ * @return org.apache.giraph.io.gora.generated.GEdge.Builder
+ */
+ public static org.apache.giraph.io.gora.generated.GEdge.Builder newBuilder(
+ org.apache.giraph.io.gora.generated.GEdge other) {
+ return new org.apache.giraph.io.gora.generated.GEdge.Builder(other);
+ }
+
+ /**
+ * Makes a deep copy from a bytebuffer.
+ * @param input ByteBuffer
+ * @return ByteBuffer
+ */
+ private static java.nio.ByteBuffer deepCopyToReadOnlyBuffer(
+ java.nio.ByteBuffer input) {
+ java.nio.ByteBuffer copy = java.nio.ByteBuffer.allocate(input.capacity());
+ int position = input.position();
+ input.reset();
+ int mark = input.position();
+ int limit = input.limit();
+ input.rewind();
+ input.limit(input.capacity());
+ copy.put(input);
+ input.rewind();
+ copy.rewind();
+ input.position(mark);
+ input.mark();
+ copy.position(mark);
+ copy.mark();
+ input.position(position);
+ copy.position(position);
+ input.limit(limit);
+ copy.limit(limit);
+ return copy.asReadOnlyBuffer();
+ }
+
+ /**
+ * RecordBuilder for GEdge instances.
+ */
+ public static class Builder extends
+ org.apache.avro.specific.SpecificRecordBuilderBase<GEdge> implements
+ org.apache.avro.data.RecordBuilder<GEdge> {
+
+ /**
+ * edgeId.
+ */
+ private java.lang.CharSequence edgeId;
+
+ /**
+ * edgeWeight.
+ */
+ private float edgeWeight;
+
+ /**
+ * vertexInId
+ */
+ private java.lang.CharSequence vertexInId;
+
+ /**
+ * vertexOutId.
+ */
+ private java.lang.CharSequence vertexOutId;
+
+ /**
+ * label.
+ */
+ private java.lang.CharSequence label;
+
+ /**
+ * Creates a new Builder
+ */
+ private Builder() {
+ super(org.apache.giraph.io.gora.generated.GEdge.SCHEMAS);
+ }
+
+ /**
+ * Creates a Builder by copying an existing Builder.
+ * @param other GEdge.Builder
+ */
+ private Builder(org.apache.giraph.io.gora.generated.GEdge.Builder other) {
+ super(other);
+ }
+
+ /**
+ * Creates a Builder by copying an existing GEdge instance.
+ * @param other GEdge
+ */
+ // CHECKSTYLE: stop Indentation
+ private Builder(org.apache.giraph.io.gora.generated.GEdge other) {
+ super(org.apache.giraph.io.gora.generated.GEdge.SCHEMAS);
+ if (isValidValue(fields()[0], other.edgeId)) {
+ this.edgeId = (java.lang.CharSequence) data().deepCopy(
+ fields()[0].schema(), other.edgeId);
+ fieldSetFlags()[0] = true;
+ }
+ if (isValidValue(fields()[1], other.edgeWeight)) {
+ this.edgeWeight = (java.lang.Float) data().deepCopy(
+ fields()[1].schema(), other.edgeWeight);
+ fieldSetFlags()[1] = true;
+ }
+ if (isValidValue(fields()[2], other.vertexInId)) {
+ this.vertexInId = (java.lang.CharSequence) data().deepCopy(
+ fields()[2].schema(), other.vertexInId);
+ fieldSetFlags()[2] = true;
+ }
+ if (isValidValue(fields()[3], other.vertexOutId)) {
+ this.vertexOutId = (java.lang.CharSequence) data().deepCopy(
+ fields()[3].schema(), other.vertexOutId);
+ fieldSetFlags()[3] = true;
+ }
+ if (isValidValue(fields()[4], other.label)) {
+ this.label = (java.lang.CharSequence) data().deepCopy(
+ fields()[4].schema(), other.label);
+ fieldSetFlags()[4] = true;
+ }
+ }
+ // CHECKSTYLE: resume Indentation
+
+ /**
+ * Gets the value of the 'edgeId' field
+ * @return CharSequence
+ */
+ public java.lang.CharSequence getEdgeId() {
+ return edgeId;
+ }
+
+ /**
+ * Sets the value of the 'edgeId' field
+ * @param value CharSequence
+ * @return GEdge.Builder
+ */
+ // CHECKSTYLE: stop Indentation
+ public org.apache.giraph.io.gora.generated.GEdge.Builder setEdgeId(
+ java.lang.CharSequence value) {
+ validate(fields()[0], value);
+ this.edgeId = value;
+ fieldSetFlags()[0] = true;
+ return this;
+ }
+ // CHECKSTYLE: resume Indentation
+
+ /**
+ * Checks whether the 'edgeId' field has been set.
+ * @return boolean.
+ */
+ public boolean hasEdgeId() {
+ return fieldSetFlags()[0];
+ }
+
+ /**
+ * Clears the value of the 'edgeId' field.
+ * @return GEdge.Builder
+ */
+ // CHECKSTYLE: stop Indentation
+ public org.apache.giraph.io.gora.generated.GEdge.Builder clearEdgeId() {
+ edgeId = null;
+ fieldSetFlags()[0] = false;
+ return this;
+ }
+ // CHECKSTYLE: resume Indentation
+
+ /**
+ * Gets the value of the 'edgeWeight' field.
+ * @return Float
+ */
+ public java.lang.Float getEdgeWeight() {
+ return edgeWeight;
+ }
+
+ /**
+ * Sets the value of the 'edgeWeight' field
+ * @param value float
+ * @return GEdge.Builder
+ */
+ // CHECKSTYLE: stop Indentation
+ public org.apache.giraph.io.gora.generated.GEdge.Builder setEdgeWeight(
+ float value) {
+ validate(fields()[1], value);
+ this.edgeWeight = value;
+ fieldSetFlags()[1] = true;
+ return this;
+ }
+ // CHECKSTYLE: resume Indentation
+
+ /**
+ * Checks whether the 'edgeWeight' field has been set.
+ * @return boolean
+ */
+ public boolean hasEdgeWeight() {
+ return fieldSetFlags()[1];
+ }
+
+ /**
+ * Clears the value of the 'edgeWeight' field.
+ * @return GEdge.Builder
+ */
+ // CHECKSTYLE: stop Indentation
+ public org.apache.giraph.io.gora.generated.GEdge.Builder clearEdgeWeight() {
+ fieldSetFlags()[1] = false;
+ return this;
+ }
+ // CHECKSTYLE: resume Indentation
+
+ /**
+ * Gets the value of the 'vertexInId' field
+ * @return CharSequence
+ */
+ public java.lang.CharSequence getVertexInId() {
+ return vertexInId;
+ }
+
+ /**
+ * Sets the value of the 'vertexInId' field.
+ * @param value CharSequence
+ * @return value
+ */
+ // CHECKSTYLE: stop Indentation
+ public org.apache.giraph.io.gora.generated.GEdge.Builder setVertexInId(
+ java.lang.CharSequence value) {
+ validate(fields()[2], value);
+ this.vertexInId = value;
+ fieldSetFlags()[2] = true;
+ return this;
+ }
+ // CHECKSTYLE: resume Indentation
+
+ /**
+ * Checks whether the 'vertexInId' field has been set.
+ * @return boolean
+ */
+ public boolean hasVertexInId() {
+ return fieldSetFlags()[2];
+ }
+
+ /**
+ * Clears the value of the 'vertexInId' field.
+ * @return GEdge.Builder
+ */
+ // CHECKSTYLE: stop Indentation
+ public org.apache.giraph.io.gora.generated.GEdge.Builder
+ clearVertexInId() {
+ vertexInId = null;
+ fieldSetFlags()[2] = false;
+ return this;
+ }
+ // CHECKSTYLE: resume Indentation
+
+ /**
+ * Gets the value of the 'vertexOutId' field.
+ * @return java.lang.CharSequence
+ */
+ public java.lang.CharSequence getVertexOutId() {
+ return vertexOutId;
+ }
+
+ /**
+ * Sets the value of the 'vertexOutId' field.
+ * @param value CharSequence
+ * @return GEdge.Builder
+ */
+ // CHECKSTYLE: stop Indentation
+ public org.apache.giraph.io.gora.generated.GEdge.Builder setVertexOutId(
+ java.lang.CharSequence value) {
+ validate(fields()[3], value);
+ this.vertexOutId = value;
+ fieldSetFlags()[3] = true;
+ return this;
+ }
+ // CHECKSTYLE: resume Indentation
+
+ /**
+ * Checks whether the 'vertexOutId' field has been set.
+ * @return boolean
+ */
+ public boolean hasVertexOutId() {
+ return fieldSetFlags()[3];
+ }
+
+ /**
+ * Clears the value of the 'vertexOutId' field.
+ * @return GEdge.Builder
+ */
+ // CHECKSTYLE: stop Indentation
+ public org.apache.giraph.io.gora.generated.GEdge.Builder
+ clearVertexOutId() {
+ vertexOutId = null;
+ fieldSetFlags()[3] = false;
+ return this;
+ }
+ // CHECKSTYLE: resume Indentation
+
+ /**
+ * Gets the value of the 'label' field.
+ * @return CharSequence
+ */
+ public java.lang.CharSequence getLabel() {
+ return label;
+ }
+
+ /**
+ * Sets the value of the 'label' field.
+ * @param value CharSequence
+ * @return GEdge.Builder
+ */
+ // CHECKSTYLE: stop Indentation
+ public org.apache.giraph.io.gora.generated.GEdge.Builder setLabel(
+ java.lang.CharSequence value) {
+ validate(fields()[4], value);
+ this.label = value;
+ fieldSetFlags()[4] = true;
+ return this;
+ }
+ // CHECKSTYLE: resume Indentation
+
+ /**
+ * Checks whether the 'label' field has been set.
+ * @return boolean
+ */
+ public boolean hasLabel() {
+ return fieldSetFlags()[4];
+ }
+
+ /**
+ * Clears the value of the 'label' field.
+ * @return GEdge.Builder
+ */
+ // CHECKSTYLE: stop Indentation
+ public org.apache.giraph.io.gora.generated.GEdge.Builder clearLabel() {
+ label = null;
+ fieldSetFlags()[4] = false;
+ return this;
+ }
+ // CHECKSTYLE: resume Indentation
+
+ @Override
+ /**
+ * Builds a GEdge.
+ * @return GEdge
+ */
+ // CHECKSTYLE: stop IllegalCatch
+ public GEdge build() {
+ try {
+ GEdge record = new GEdge();
+ record.edgeId = fieldSetFlags()[0] ? this.edgeId :
+ (java.lang.CharSequence) defaultValue(fields()[0]);
+ record.edgeWeight = fieldSetFlags()[1] ? this.edgeWeight :
+ (java.lang.Float) defaultValue(fields()[1]);
+ record.vertexInId = fieldSetFlags()[2] ? this.vertexInId :
+ (java.lang.CharSequence) defaultValue(fields()[2]);
+ record.vertexOutId = fieldSetFlags()[3] ? this.vertexOutId :
+ (java.lang.CharSequence) defaultValue(fields()[3]);
+ record.label = fieldSetFlags()[4] ? this.label :
+ (java.lang.CharSequence) defaultValue(fields()[4]);
+ return record;
+ } catch (Exception e) {
+ throw new org.apache.avro.AvroRuntimeException(e);
+ }
+ }
+ // CHECKSTYLE: resume IllegalCatch
+ }
+
+ /**
+ * Gets a tombstone
+ * @return GEdge.Tombstone
+ */
+ public GEdge.Tombstone getTombstone() {
+ return TOMBSTONE;
+ }
+
+ /**
+ * Gets a new instance
+ * @return GEdge.
+ */
+ public GEdge newInstance() {
+ return newBuilder().build();
+ }
+
+ /**
+ * Tombstone class.
+ */
+ public static final class Tombstone extends GEdge implements
+ org.apache.gora.persistency.Tombstone {
+
+ /**
+ * Default constructor.
+ */
+ private Tombstone() {
+ }
+
+ /**
+ * Gets the value of the 'edgeId' field.
+ * @return java.lang.CharSequence
+ */
+ public java.lang.CharSequence getEdgeId() {
+ throw new java.lang.UnsupportedOperationException(
+ "Get is not supported on tombstones");
+ }
+
+ /**
+ * Sets the value of the 'edgeId' field.
+ * @param value the value to set.
+ */
+ public void setEdgeId(java.lang.CharSequence value) {
+ throw new java.lang.UnsupportedOperationException(
+ "Set is not supported on tombstones");
+ }
+
+ /**
+ * Checks the dirty status of the 'edgeId' field. A field is dirty if it
+ * represents a change that has not yet been written to the database.
+ * @param value the value to set.
+ * @return boolean
+ */
+ public boolean isEdgeIdDirty(java.lang.CharSequence value) {
+ throw new java.lang.UnsupportedOperationException(
+ "IsDirty is not supported on tombstones");
+ }
+
+ /**
+ * Gets the value of the 'edgeWeight' field.
+ * @return Float
+ */
+ public java.lang.Float getEdgeWeight() {
+ throw new java.lang.UnsupportedOperationException(
+ "Get is not supported on tombstones");
+ }
+
+ /**
+ * Sets the value of the 'edgeWeight' field.
+ * @param value the value to set.
+ */
+ public void setEdgeWeight(java.lang.Float value) {
+ throw new java.lang.UnsupportedOperationException(
+ "Set is not supported on tombstones");
+ }
+
+ /**
+ * Checks the dirty status of the 'edgeWeight' field. A field is dirty if it
+ * represents a change that has not yet been written to the database.
+ * @param value the value to set.
+ * @return boolean
+ */
+ public boolean isEdgeWeightDirty(java.lang.Float value) {
+ throw new java.lang.UnsupportedOperationException(
+ "IsDirty is not supported on tombstones");
+ }
+
+ /**
+ * Gets the value of the 'vertexInId' field.
+ * @return CharSequence
+ */
+ public java.lang.CharSequence getVertexInId() {
+ throw new java.lang.UnsupportedOperationException(
+ "Get is not supported on tombstones");
+ }
+
+ /**
+ * Sets the value of the 'vertexInId' field.
+ * @param value the value to set.
+ */
+ public void setVertexInId(java.lang.CharSequence value) {
+ throw new java.lang.UnsupportedOperationException(
+ "Set is not supported on tombstones");
+ }
+
+ /**
+ * Checks the dirty status of the 'vertexInId' field. A field is dirty if it
+ * represents a change that has not yet been written to the database.
+ * @param value the value to set.
+ * @return boolean
+ */
+ public boolean isVertexInIdDirty(java.lang.CharSequence value) {
+ throw new java.lang.UnsupportedOperationException(
+ "IsDirty is not supported on tombstones");
+ }
+
+ /**
+ * Gets the value of the 'vertexOutId' field.
+ * @return CharSequence
+ */
+ public java.lang.CharSequence getVertexOutId() {
+ throw new java.lang.UnsupportedOperationException(
+ "Get is not supported on tombstones");
+ }
+
+ /**
+ * Sets the value of the 'vertexOutId' field.
+ * @param value the value to set.
+ */
+ public void setVertexOutId(java.lang.CharSequence value) {
+ throw new java.lang.UnsupportedOperationException(
+ "Set is not supported on tombstones");
+ }
+
+ /**
+ * Checks the dirty status of the 'vertexOutId' field. A field is dirty if
+ * it represents a change that has not yet been written to the database.
+ * @param value the value to set.
+ * @return boolean
+ */
+ public boolean isVertexOutIdDirty(java.lang.CharSequence value) {
+ throw new java.lang.UnsupportedOperationException(
+ "IsDirty is not supported on tombstones");
+ }
+
+ /**
+ * Gets the value of the 'label' field.
+ * @return CharSequence
+ */
+ public java.lang.CharSequence getLabel() {
+ throw new java.lang.UnsupportedOperationException(
+ "Get is not supported on tombstones");
+ }
+
+ /**
+ * Sets the value of the 'label' field.
+ * @param value the value to set.
+ */
+ public void setLabel(java.lang.CharSequence value) {
+ throw new java.lang.UnsupportedOperationException(
+ "Set is not supported on tombstones");
+ }
+
+ /**
+ * Checks the dirty status of the 'label' field. A field is dirty if it
+ * represents a change that has not yet been written to the database.
+ * @param value the value to set.
+ * @return boolean
+ */
+ public boolean isLabelDirty(java.lang.CharSequence value) {
+ throw new java.lang.UnsupportedOperationException(
+ "IsDirty is not supported on tombstones");
+ }
}
}
http://git-wip-us.apache.org/repos/asf/giraph/blob/7c61dcf4/giraph-gora/src/main/java/org/apache/giraph/io/gora/generated/GEdgeResult.java
----------------------------------------------------------------------
diff --git a/giraph-gora/src/main/java/org/apache/giraph/io/gora/generated/GEdgeResult.java b/giraph-gora/src/main/java/org/apache/giraph/io/gora/generated/GEdgeResult.java
index 0c3501c..c54e40e 100644
--- a/giraph-gora/src/main/java/org/apache/giraph/io/gora/generated/GEdgeResult.java
+++ b/giraph-gora/src/main/java/org/apache/giraph/io/gora/generated/GEdgeResult.java
@@ -15,35 +15,31 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.apache.giraph.io.gora.generated;
-import org.apache.avro.Schema;
-import org.apache.avro.AvroRuntimeException;
-import org.apache.avro.util.Utf8;
-import org.apache.gora.persistency.StateManager;
-import org.apache.gora.persistency.impl.PersistentBase;
-import org.apache.gora.persistency.impl.StateManagerImpl;
-
/**
- * Example Class for defining a Giraph-Edge.
+ * Example class for defining a Giraph-Edge result.
*/
@SuppressWarnings("all")
-public class GEdgeResult extends PersistentBase {
- /**
- * Schema used for the class.
- */
- public static final Schema OBJ_SCHEMA = Schema.parse("{\"type\":\"record\"," +
- "\"name\":\"GEdge\",\"namespace\":\"org.apache.giraph.gora.generated\"," +
- "\"fields\":[{\"name\":\"edgeId\",\"type\":\"string\"}," +
- "{\"name\":\"edgeWeight\",\"type\":\"float\"}," +
- "{\"name\":\"vertexInId\",\"type\":\"string\"}," +
- "{\"name\":\"vertexOutId\",\"type\":\"string\"}," +
- "{\"name\":\"label\",\"type\":\"string\"}]}");
+public class GEdgeResult extends
+ org.apache.gora.persistency.impl.PersistentBase implements
+ org.apache.avro.specific.SpecificRecord,
+ org.apache.gora.persistency.Persistent {
/**
- * Field enum
+ * Schema used for the class.
*/
+ public static final org.apache.avro.Schema SCHEMAS =
+ new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\"," +
+ "\"name\":\"GEdgeResult\"," +
+ "\"namespace\":\"org.apache.giraph.io.gora.generated\"," +
+ "\"fields\":[{\"name\":\"edgeId\",\"type\":\"string\"}," +
+ "{\"name\":\"edgeWeight\",\"type\":\"float\"}," +
+ "{\"name\":\"vertexInId\",\"type\":\"string\"}," +
+ "{\"name\":\"vertexOutId\",\"type\":\"string\"}," +
+ "{\"name\":\"label\",\"type\":\"string\"}]}");
+
+ /** Enum containing all data bean's fields. */
public static enum Field {
/**
* Edge id.
@@ -71,19 +67,19 @@ public class GEdgeResult extends PersistentBase {
LABEL(4, "label");
/**
- * Field index
+ * Field's index.
*/
private int index;
/**
- * Field name
+ * Field's name.
*/
private String name;
/**
- * Field constructor
- * @param index of attribute
- * @param name of attribute
+ * Field's constructor
+ * @param index field's index.
+ * @param name field's name.
*/
Field(int index, String name) {
this.index = index;
@@ -91,24 +87,24 @@ public class GEdgeResult extends PersistentBase {
}
/**
- * Gets index
- * @return int of attribute.
+ * Gets field's index.
+ * @return int field's index.
*/
public int getIndex() {
return index;
}
/**
- * Gets name
- * @return String of name.
+ * Gets field's name.
+ * @return String field's name.
*/
public String getName() {
return name;
}
/**
- * Gets name
- * @return String of name.
+ * Gets field's attributes to string.
+ * @return String field's attributes to string.
*/
public String toString() {
return name;
@@ -119,77 +115,61 @@ public class GEdgeResult extends PersistentBase {
* Array containing all fields/
*/
private static final String[] ALL_FIELDS = {
- "edgeId", "edgeWeight", "vertexInId", "vertexOutId", "label"
- };
-
- static {
- PersistentBase.registerFields(GEdgeResult.class, ALL_FIELDS);
- }
-
- /**
- * edgeId
- */
- private Utf8 edgeId;
+ "edgeId", "edgeWeight", "vertexInId", "vertexOutId", "label"};
/**
- * edgeWeight
+ * Tombstone.
*/
- private float edgeWeight;
+ private static final Tombstone TOMBSTONE = new Tombstone();
/**
- * vertexInId
+ * edgeId.
*/
- private Utf8 vertexInId;
+ private java.lang.CharSequence edgeId;
/**
- * vertexOutId
+ * edgeWeight.
*/
- private Utf8 vertexOutId;
+ private float edgeWeight;
/**
- * label
+ * vertexInId.
*/
- private Utf8 label;
+ private java.lang.CharSequence vertexInId;
/**
- * Default constructor.
+ * vertexOutId.
*/
- public GEdgeResult() {
- this(new StateManagerImpl());
- }
+ private java.lang.CharSequence vertexOutId;
/**
- * Constructor
- * @param stateManager from which the object will be created.
+ * label.
*/
- public GEdgeResult(StateManager stateManager) {
- super(stateManager);
- }
+ private java.lang.CharSequence label;
/**
- * Creates a new instance
- * @param stateManager from which the object will be created.
- * @return GEdge created
+ * Gets the total field count.
+ * @return int field count
*/
- public GEdgeResult newInstance(StateManager stateManager) {
- return new GEdgeResult(stateManager);
+ public int getFieldsCount() {
+ return GEdgeResult.ALL_FIELDS.length;
}
/**
- * Gets the object schema
- * @return Schema of the object.
+ * Gets the schema
+ * @return Schema
*/
- public Schema getSchema() {
- return OBJ_SCHEMA;
+ public org.apache.avro.Schema getSchema() {
+ return SCHEMAS;
}
/**
* Gets field
- * @param fieldIndex index field.
+ * @param field index field.
* @return Object from an index.
*/
- public Object get(int fieldIndex) {
- switch (fieldIndex) {
+ public java.lang.Object get(int field) {
+ switch (field) {
case 0:
return edgeId;
case 1:
@@ -201,114 +181,729 @@ public class GEdgeResult extends PersistentBase {
case 4:
return label;
default:
- throw new AvroRuntimeException("Bad index");
+ throw new org.apache.avro.AvroRuntimeException("Bad index");
}
}
/**
* Puts a value into a field.
- * @param fieldIndex index of field used.
- * @param fieldValue value of field used.
+ * @param field index of field used.
+ * @param value value of field used.
*/
@SuppressWarnings(value = "unchecked")
- public void put(int fieldIndex, Object fieldValue) {
- if (isFieldEqual(fieldIndex, fieldValue)) {
- return;
- }
- getStateManager().setDirty(this, fieldIndex);
- switch (fieldIndex) {
+ public void put(int field, java.lang.Object value) {
+ switch (field) {
case 0:
- edgeId = (Utf8) fieldValue; break;
+ edgeId = (java.lang.CharSequence) value;
+ break;
case 1:
- edgeWeight = (Float) fieldValue; break;
+ edgeWeight = (java.lang.Float) value;
+ break;
case 2:
- vertexInId = (Utf8) fieldValue; break;
+ vertexInId = (java.lang.CharSequence) value;
+ break;
case 3:
- vertexOutId = (Utf8) fieldValue; break;
+ vertexOutId = (java.lang.CharSequence) value;
+ break;
case 4:
- label = (Utf8) fieldValue; break;
+ label = (java.lang.CharSequence) value;
+ break;
default:
- throw new AvroRuntimeException("Bad index");
+ throw new org.apache.avro.AvroRuntimeException("Bad index");
}
}
/**
- * Gets edgeId
- * @return Utf8 edgeId
+ * Gets the value of the 'edgeId' field.
+ * @return CharSequence.
+ */
+ public java.lang.CharSequence getEdgeId() {
+ return edgeId;
+ }
+
+ /**
+ * Sets the value of the 'edgeId' field.
+ * @param value the value to set.
+ */
+ public void setEdgeId(java.lang.CharSequence value) {
+ this.edgeId = value;
+ setDirty(0);
+ }
+
+ /**
+ * Checks the dirty status of the 'edgeId' field. A field is dirty if it
+ * represents a change that has not yet been written to the database.
+ * @param value the value to set.
+ * @return boolean
+ */
+ public boolean isEdgeIdDirty(java.lang.CharSequence value) {
+ return isDirty(0);
+ }
+
+ /**
+ * Gets the value of the 'edgeWeight' field.
+ * @return Float
+ */
+ public java.lang.Float getEdgeWeight() {
+ return edgeWeight;
+ }
+
+ /**
+ * Sets the value of the 'edgeWeight' field.
+ * @param value the value to set.
+ */
+ public void setEdgeWeight(java.lang.Float value) {
+ this.edgeWeight = value;
+ setDirty(1);
+ }
+
+ /**
+ * Checks the dirty status of the 'edgeWeight' field. A field is dirty if it
+ * represents a change that has not yet been written to the database.
+ * @param value the value to set.
+ * @return boolean
+ */
+ public boolean isEdgeWeightDirty(java.lang.Float value) {
+ return isDirty(1);
+ }
+
+ /**
+ * Gets the value of the 'vertexInId' field.
+ * @return CharSequence
+ */
+ public java.lang.CharSequence getVertexInId() {
+ return vertexInId;
+ }
+
+ /**
+ * Sets the value of the 'vertexInId' field.
+ * @param value the value to set.
*/
- public Utf8 getEdgeId() {
- return (Utf8) get(0);
+ public void setVertexInId(java.lang.CharSequence value) {
+ this.vertexInId = value;
+ setDirty(2);
}
/**
- * Sets edgeId
- * @param value edgeId
+ * Checks the dirty status of the 'vertexInId' field. A field is dirty if it
+ * represents a change that has not yet been written to the database.
+ * @param value the value to set.
+ * @return boolean
*/
- public void setEdgeId(Utf8 value) {
- put(0, value);
+ public boolean isVertexInIdDirty(java.lang.CharSequence value) {
+ return isDirty(2);
}
/**
- * Gets edgeWeight
- * @return float edgeWeight
+ * Gets the value of the 'vertexOutId' field.
+ * @return CharSequence
*/
- public float getEdgeWeight() {
- return (Float) get(1);
+ public java.lang.CharSequence getVertexOutId() {
+ return vertexOutId;
}
/**
- * Sets edgeWeight
- * @param value edgeWeight
+ * Sets the value of the 'vertexOutId' field.
+ * @param value the value to set.
*/
- public void setEdgeWeight(float value) {
- put(1, value);
+ public void setVertexOutId(java.lang.CharSequence value) {
+ this.vertexOutId = value;
+ setDirty(3);
}
/**
- * Gets edgeVertexInId
- * @return Utf8 edgeVertexInId
+ * Checks the dirty status of the 'vertexOutId' field. A field is dirty if it
+ * represents a change that has not yet been written to the database.
+ * @param value the value to set.
+ * @return boolean
*/
- public Utf8 getVertexInId() {
- return (Utf8) get(2);
+ public boolean isVertexOutIdDirty(java.lang.CharSequence value) {
+ return isDirty(3);
}
/**
- * Sets edgeVertexInId
- * @param value edgeVertexInId
+ * Gets the value of the 'label' field.
+ * @return CharSequence
*/
- public void setVertexInId(Utf8 value) {
- put(2, value);
+ public java.lang.CharSequence getLabel() {
+ return label;
}
/**
- * Gets edgeVertexOutId
- * @return Utf8 edgeVertexOutId
+ * Sets the value of the 'label' field.
+ * @param value the value to set.
*/
- public Utf8 getVertexOutId() {
- return (Utf8) get(3);
+ public void setLabel(java.lang.CharSequence value) {
+ this.label = value;
+ setDirty(4);
}
/**
- * Sets edgeVertexOutId
- * @param value edgeVertexOutId
+ * Checks the dirty status of the 'label' field. A field is dirty if it
+ * represents a change that has not yet been written to the database.
+ * @param value the value to set.
+ * @return boolean
*/
- public void setVertexOutId(Utf8 value) {
- put(3, value);
+ public boolean isLabelDirty(java.lang.CharSequence value) {
+ return isDirty(4);
}
/**
- * Gets edgeLabel
- * @return Utf8 edgeLabel
+ * Creates a new GEdgeResult RecordBuilder.
+ * @return GEdge.Builder
*/
- public Utf8 getLabel() {
- return (Utf8) get(4);
+ public static org.apache.giraph.io.gora.generated.GEdgeResult.Builder
+ newBuilder() {
+ return new org.apache.giraph.io.gora.generated.GEdgeResult.Builder();
}
/**
- * Sets edgeLabel
- * @param value edgeLabel
+ * Creates a new GEdgeResult RecordBuilder by copying an existing Builder.
+ * @param other GEdgeResult.Builder
+ * @return GEdge.Builder
*/
- public void setLabel(Utf8 value) {
- put(4, value);
+ public static org.apache.giraph.io.gora.generated.GEdgeResult.Builder
+ newBuilder(org.apache.giraph.io.gora.generated.GEdgeResult.Builder other) {
+ return new org.apache.giraph.io.gora.generated.GEdgeResult.Builder(other);
+ }
+
+ /**
+ * Creates a new GEdgeResult RecordBuilder by copying an existing GEdgeResult
+ * instance
+ * @param other GEdgeResult
+ * @return GEdge.Builder
+ */
+ public static org.apache.giraph.io.gora.generated.GEdgeResult.Builder
+ newBuilder(org.apache.giraph.io.gora.generated.GEdgeResult other) {
+ return new org.apache.giraph.io.gora.generated.GEdgeResult.Builder(other);
+ }
+
+ /**
+ * Makes a deep copy from a bytebuffer.
+ * @param input ByteBuffer
+ * @return ByteBuffer
+ */
+ private static java.nio.ByteBuffer deepCopyToReadOnlyBuffer(
+ java.nio.ByteBuffer input) {
+ java.nio.ByteBuffer copy = java.nio.ByteBuffer.allocate(input.capacity());
+ int position = input.position();
+ input.reset();
+ int mark = input.position();
+ int limit = input.limit();
+ input.rewind();
+ input.limit(input.capacity());
+ copy.put(input);
+ input.rewind();
+ copy.rewind();
+ input.position(mark);
+ input.mark();
+ copy.position(mark);
+ copy.mark();
+ input.position(position);
+ copy.position(position);
+ input.limit(limit);
+ copy.limit(limit);
+ return copy.asReadOnlyBuffer();
+ }
+
+ /**
+ * RecordBuilder for GEdgeResult instances.
+ */
+ public static class Builder extends
+ org.apache.avro.specific.SpecificRecordBuilderBase<GEdgeResult> implements
+ org.apache.avro.data.RecordBuilder<GEdgeResult> {
+
+ /**
+ * edgeId.
+ */
+ private java.lang.CharSequence edgeId;
+
+ /**
+ * edgeWeight.
+ */
+ private float edgeWeight;
+
+ /**
+ * vertexInId
+ */
+ private java.lang.CharSequence vertexInId;
+
+ /**
+ * vertexOutId.
+ */
+ private java.lang.CharSequence vertexOutId;
+
+ /**
+ * label.
+ */
+ private java.lang.CharSequence label;
+
+ /** Creates a new Builder */
+ private Builder() {
+ super(org.apache.giraph.io.gora.generated.GEdgeResult.SCHEMAS);
+ }
+
+ /**
+ * Creates a Builder by copying an existing Builder.
+ * @param other GEdgeResult.Builder
+ */
+ private Builder(
+ org.apache.giraph.io.gora.generated.GEdgeResult.Builder other) {
+ super(other);
+ }
+
+ /**
+ * Creates a Builder by copying an existing GEdgeResult instance.
+ * @param other GEdgeResult
+ */
+ // CHECKSTYLE: stop Indentation
+ private Builder(org.apache.giraph.io.gora.generated.GEdgeResult other) {
+ super(org.apache.giraph.io.gora.generated.GEdgeResult.SCHEMAS);
+ if (isValidValue(fields()[0], other.edgeId)) {
+ this.edgeId = (java.lang.CharSequence) data().deepCopy(
+ fields()[0].schema(), other.edgeId);
+ fieldSetFlags()[0] = true;
+ }
+ if (isValidValue(fields()[1], other.edgeWeight)) {
+ this.edgeWeight = (java.lang.Float) data().deepCopy(
+ fields()[1].schema(), other.edgeWeight);
+ fieldSetFlags()[1] = true;
+ }
+ if (isValidValue(fields()[2], other.vertexInId)) {
+ this.vertexInId = (java.lang.CharSequence) data().deepCopy(
+ fields()[2].schema(), other.vertexInId);
+ fieldSetFlags()[2] = true;
+ }
+ if (isValidValue(fields()[3], other.vertexOutId)) {
+ this.vertexOutId = (java.lang.CharSequence) data().deepCopy(
+ fields()[3].schema(), other.vertexOutId);
+ fieldSetFlags()[3] = true;
+ }
+ if (isValidValue(fields()[4], other.label)) {
+ this.label = (java.lang.CharSequence) data().deepCopy(
+ fields()[4].schema(), other.label);
+ fieldSetFlags()[4] = true;
+ }
+ }
+ // CHECKSTYLE: resume Indentation
+
+ /**
+ * Gets the value of the 'edgeId' field.
+ * @return CharSequence
+ */
+ public java.lang.CharSequence getEdgeId() {
+ return edgeId;
+ }
+
+ /**
+ * Sets the value of the 'edgeId' field.
+ * @param value CharSequence
+ * @return GEdgeResult.Builder
+ */
+ // CHECKSTYLE: stop Indentation
+ public org.apache.giraph.io.gora.generated.GEdgeResult.Builder setEdgeId(
+ java.lang.CharSequence value) {
+ validate(fields()[0], value);
+ this.edgeId = value;
+ fieldSetFlags()[0] = true;
+ return this;
+ }
+ // CHECKSTYLE: resume Indentation
+
+ /**
+ * Checks whether the 'edgeId' field has been set.
+ * @return boolean
+ */
+ public boolean hasEdgeId() {
+ return fieldSetFlags()[0];
+ }
+
+ /**
+ * Clears the value of the 'edgeId' field.
+ * @return GEdgeResult.Builder
+ */
+ // CHECKSTYLE: stop Indentation
+ public org.apache.giraph.io.gora.generated.GEdgeResult.Builder
+ clearEdgeId() {
+ edgeId = null;
+ fieldSetFlags()[0] = false;
+ return this;
+ }
+ // CHECKSTYLE: resume Indentation
+
+ /**
+ * Gets the value of the 'edgeWeight' field.
+ * @return Float
+ */
+ public java.lang.Float getEdgeWeight() {
+ return edgeWeight;
+ }
+
+ /**
+ * Sets the value of the 'edgeWeight' field.
+ * @param value float
+ * @return GEdgeResult.Builder
+ */
+ // CHECKSTYLE: stop Indentation
+ public org.apache.giraph.io.gora.generated.GEdgeResult.Builder
+ setEdgeWeight(float value) {
+ validate(fields()[1], value);
+ this.edgeWeight = value;
+ fieldSetFlags()[1] = true;
+ return this;
+ }
+ // CHECKSTYLE: resume Indentation
+
+ /**
+ * Checks whether the 'edgeWeight' field has been set.
+ * @return boolean
+ */
+ public boolean hasEdgeWeight() {
+ return fieldSetFlags()[1];
+ }
+
+ /**
+ * Clears the value of the 'edgeWeight' field.
+ * @return GEdgeResult.Builder
+ */
+ // CHECKSTYLE: stop Indentation
+ public org.apache.giraph.io.gora.generated.GEdgeResult.Builder
+ clearEdgeWeight() {
+ fieldSetFlags()[1] = false;
+ return this;
+ }
+ // CHECKSTYLE: resume Indentation
+
+ /**
+ * Gets the value of the 'vertexInId' field.
+ * @return CharSequence
+ */
+ public java.lang.CharSequence getVertexInId() {
+ return vertexInId;
+ }
+
+ /**
+ * Sets the value of the 'vertexInId' field.
+ * @param value CharSequence
+ * @return GEdgeResult.Builder
+ */
+ // CHECKSTYLE: stop Indentation
+ public org.apache.giraph.io.gora.generated.GEdgeResult.Builder
+ setVertexInId(java.lang.CharSequence value) {
+ validate(fields()[2], value);
+ this.vertexInId = value;
+ fieldSetFlags()[2] = true;
+ return this;
+ }
+ // CHECKSTYLE: resume Indentation
+
+ /**
+ * Checks whether the 'vertexInId' field has been set.
+ * @return boolean.
+ */
+ public boolean hasVertexInId() {
+ return fieldSetFlags()[2];
+ }
+
+ /**
+ * Clears the value of the 'vertexInId' field.
+ * @return GEdgeResult.Builder
+ */
+ // CHECKSTYLE: stop Indentation
+ public org.apache.giraph.io.gora.generated.GEdgeResult.Builder
+ clearVertexInId() {
+ vertexInId = null;
+ fieldSetFlags()[2] = false;
+ return this;
+ }
+ // CHECKSTYLE: resume Indentation
+
+ /**
+ * Gets the value of the 'vertexOutId' field.
+ * @return CharSequence
+ */
+ public java.lang.CharSequence getVertexOutId() {
+ return vertexOutId;
+ }
+
+ /**
+ * Sets the value of the 'vertexOutId' field.
+ * @param value CharSequence
+ * @return GEdgeResult.Builder
+ */
+ // CHECKSTYLE: stop Indentation
+ public org.apache.giraph.io.gora.generated.GEdgeResult.Builder
+ setVertexOutId(java.lang.CharSequence value) {
+ validate(fields()[3], value);
+ this.vertexOutId = value;
+ fieldSetFlags()[3] = true;
+ return this;
+ }
+ // CHECKSTYLE: resume Indentation
+
+ /**
+ * Checks whether the 'vertexOutId' field has been set.
+ * @return boolean
+ */
+ public boolean hasVertexOutId() {
+ return fieldSetFlags()[3];
+ }
+
+ /**
+ * Clears the value of the 'vertexOutId' field.
+ * @return GEdgeResult.Builder
+ */
+ // CHECKSTYLE: stop Indentation
+ public org.apache.giraph.io.gora.generated.GEdgeResult.Builder
+ clearVertexOutId() {
+ vertexOutId = null;
+ fieldSetFlags()[3] = false;
+ return this;
+ }
+ // CHECKSTYLE: resume Indentation
+
+ /**
+ * Gets the value of the 'label' field.
+ * @return CharSequence
+ */
+ public java.lang.CharSequence getLabel() {
+ return label;
+ }
+
+ /**
+ * Sets the value of the 'label' field.
+ * @param value CharSequence
+ * @return GEdgeResult.Builder
+ */
+ // CHECKSTYLE: stop Indentation
+ public org.apache.giraph.io.gora.generated.GEdgeResult.Builder setLabel(
+ java.lang.CharSequence value) {
+ validate(fields()[4], value);
+ this.label = value;
+ fieldSetFlags()[4] = true;
+ return this;
+ }
+ // CHECKSTYLE: resume Indentation
+
+ /**
+ * Checks whether the 'label' field has been set.
+ * @return boolean
+ */
+ public boolean hasLabel() {
+ return fieldSetFlags()[4];
+ }
+
+ /**
+ * Clears the value of the 'label' field.
+ * @return GEdgeResult.Builder
+ */
+ // CHECKSTYLE: stop Indentation
+ public org.apache.giraph.io.gora.generated.GEdgeResult.Builder
+ clearLabel() {
+ label = null;
+ fieldSetFlags()[4] = false;
+ return this;
+ }
+ // CHECKSTYLE: resume Indentation
+
+ @Override
+ /**
+ * Builds a GEdgeResult.
+ * @return GEdgeResult
+ */
+ // CHECKSTYLE: stop IllegalCatch
+ public GEdgeResult build() {
+ try {
+ GEdgeResult record = new GEdgeResult();
+ record.edgeId = fieldSetFlags()[0] ? this.edgeId :
+ (java.lang.CharSequence) defaultValue(fields()[0]);
+ record.edgeWeight = fieldSetFlags()[1] ? this.edgeWeight :
+ (java.lang.Float) defaultValue(fields()[1]);
+ record.vertexInId = fieldSetFlags()[2] ? this.vertexInId :
+ (java.lang.CharSequence) defaultValue(fields()[2]);
+ record.vertexOutId = fieldSetFlags()[3] ? this.vertexOutId :
+ (java.lang.CharSequence) defaultValue(fields()[3]);
+ record.label = fieldSetFlags()[4] ? this.label :
+ (java.lang.CharSequence) defaultValue(fields()[4]);
+ return record;
+ } catch (Exception e) {
+ throw new org.apache.avro.AvroRuntimeException(e);
+ }
+ }
+ // CHECKSTYLE: resume IllegalCatch
+ }
+
+ /**
+ * Gets tombstone
+ * @return GEdgeResult.Tombstone
+ */
+ public GEdgeResult.Tombstone getTombstone() {
+ return TOMBSTONE;
+ }
+
+ /**
+ * Gets a new instance
+ * @return GEdgeResult.
+ */
+ public GEdgeResult newInstance() {
+ return newBuilder().build();
+ }
+
+ /**
+ * Tombstone class.
+ */
+ public static final class Tombstone extends GEdgeResult implements
+ org.apache.gora.persistency.Tombstone {
+
+ /**
+ * Default constructor.
+ */
+ private Tombstone() {
+ }
+
+ /**
+ * Gets the value of the 'edgeId' field.
+ * @return CharSequence
+ */
+ public java.lang.CharSequence getEdgeId() {
+ throw new java.lang.UnsupportedOperationException(
+ "Get is not supported on tombstones");
+ }
+
+ /**
+ * Sets the value of the 'edgeId' field.
+ * @param value the value to set.
+ */
+ public void setEdgeId(java.lang.CharSequence value) {
+ throw new java.lang.UnsupportedOperationException(
+ "Set is not supported on tombstones");
+ }
+
+ /**
+ * Checks the dirty status of the 'edgeId' field. A field is dirty if it
+ * represents a change that has not yet been written to the database.
+ * @param value the value to set.
+ * @return boolean
+ */
+ public boolean isEdgeIdDirty(java.lang.CharSequence value) {
+ throw new java.lang.UnsupportedOperationException(
+ "IsDirty is not supported on tombstones");
+ }
+
+ /**
+ * Gets the value of the 'edgeWeight' field.
+ * @return Float
+ */
+ public java.lang.Float getEdgeWeight() {
+ throw new java.lang.UnsupportedOperationException(
+ "Get is not supported on tombstones");
+ }
+
+ /**
+ * Sets the value of the 'edgeWeight' field.
+ * @param value the value to set.
+ */
+ public void setEdgeWeight(java.lang.Float value) {
+ throw new java.lang.UnsupportedOperationException(
+ "Set is not supported on tombstones");
+ }
+
+ /**
+ * Checks the dirty status of the 'edgeWeight' field. A field is dirty if it
+ * represents a change that has not yet been written to the database.
+ * @param value the value to set.
+ * @return boolean
+ */
+ public boolean isEdgeWeightDirty(java.lang.Float value) {
+ throw new java.lang.UnsupportedOperationException(
+ "IsDirty is not supported on tombstones");
+ }
+
+ /**
+ * Gets the value of the 'vertexInId' field.
+ * @return CharSequence
+ */
+ public java.lang.CharSequence getVertexInId() {
+ throw new java.lang.UnsupportedOperationException(
+ "Get is not supported on tombstones");
+ }
+
+ /**
+ * Sets the value of the 'vertexInId' field.
+ * @param value the value to set.
+ */
+ public void setVertexInId(java.lang.CharSequence value) {
+ throw new java.lang.UnsupportedOperationException(
+ "Set is not supported on tombstones");
+ }
+
+ /**
+ * Checks the dirty status of the 'vertexInId' field. A field is dirty if it
+ * represents a change that has not yet been written to the database.
+ * @param value the value to set.
+ * @return boolean
+ */
+ public boolean isVertexInIdDirty(java.lang.CharSequence value) {
+ throw new java.lang.UnsupportedOperationException(
+ "IsDirty is not supported on tombstones");
+ }
+
+ /**
+ * Gets the value of the 'vertexOutId' field.
+ * @return CharSequence
+ */
+ public java.lang.CharSequence getVertexOutId() {
+ throw new java.lang.UnsupportedOperationException(
+ "Get is not supported on tombstones");
+ }
+
+ /**
+ * Sets the value of the 'vertexOutId' field.
+ * @param value the value to set.
+ */
+ public void setVertexOutId(java.lang.CharSequence value) {
+ throw new java.lang.UnsupportedOperationException(
+ "Set is not supported on tombstones");
+ }
+
+ /**
+ * Checks the dirty status of the 'vertexOutId' field. A field is dirty if
+ * it represents a change that has not yet been written to the database.
+ * @param value the value to set.
+ * @return boolean
+ */
+ public boolean isVertexOutIdDirty(java.lang.CharSequence value) {
+ throw new java.lang.UnsupportedOperationException(
+ "IsDirty is not supported on tombstones");
+ }
+
+ /**
+ * Gets the value of the 'label' field.
+ * @return CharSequence
+ */
+ public java.lang.CharSequence getLabel() {
+ throw new java.lang.UnsupportedOperationException(
+ "Get is not supported on tombstones");
+ }
+
+ /**
+ * Sets the value of the 'label' field.
+ * @param value the value to set.
+ */
+ public void setLabel(java.lang.CharSequence value) {
+ throw new java.lang.UnsupportedOperationException(
+ "Set is not supported on tombstones");
+ }
+
+ /**
+ * Checks the dirty status of the 'label' field. A field is dirty if it
+ * represents a change that has not yet been written to the database.
+ * @param value the value to set.
+ * @return boolean
+ */
+ public boolean isLabelDirty(java.lang.CharSequence value) {
+ throw new java.lang.UnsupportedOperationException(
+ "IsDirty is not supported on tombstones");
+ }
}
}