0

I am receiving the following error when I run the SimpleOutDegreeCountComputation proogramme in Apache Giraph. I am using JsonLongDoubleFloatDouble as the input format.

$HADOOP_HOME/bin/hadoop jar $GIRAPH_HOME/giraph-examples/target/giraph-examples-1.2.0-SNAPSHOT-for-hadoop-1.2.1-jar-with-dependencies.jar org.apache.giraph.GiraphRunner org.apache.giraph.examples.SimpleOutDegreeCountComputation -vif org.apache.giraph.io.formats.JsonLongDoubleFloatDoubleVertexInputFormat -vip /user/hduser/input/tiny_graph.txt -vof org.apache.giraph.io.formats.IdWithValueTextOutputFormat -op /user/hduser/output/Simpleout -w 1 Warning: $HADOOP_HOME is deprecated.

15/05/18 12:56:04 INFO utils.ConfigurationUtils: No edge input format specified. Ensure your InputFormat does not require one. 15/05/18 12:56:04 INFO utils.ConfigurationUtils: No edge output format specified. Ensure your OutputFormat does not require one. Exception in thread "main" java.lang.IllegalStateException: checkClassTypes: vertex value types not assignable, computation - class org.apache.hadoop.io.LongWritable, VertexInputFormat - class org.apache.hadoop.io.DoubleWritable at org.apache.giraph.job.GiraphConfigurationValidator.checkAssignable(GiraphConfigurationValidator.java:381) at org.apache.giraph.job.GiraphConfigurationValidator.verifyVertexInputFormatGenericTypes(GiraphConfigurationValidator.java:228) at org.apache.giraph.job.GiraphConfigurationValidator.validateConfiguration(GiraphConfigurationValidator.java:141) at org.apache.giraph.utils.ConfigurationUtils.parseArgs(ConfigurationUtils.java:222) at org.apache.giraph.GiraphRunner.run(GiraphRunner.java:74) at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:65) at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:79) at org.apache.giraph.GiraphRunner.main(GiraphRunner.java:124) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.apache.hadoop.util.RunJar.main(RunJar.java:160) ^[[Ahduser@deepa-Inspiron-N5050:/usr/local/hadoop/bin$ $HADOOP_HOME/bin/hadoop jGIRAPH_HOME/giraph-examples/target/giraph-examples-1.2.0-SNAPSHOT-for-hadoop-1.2.1-jar-with-dependencies.jar org.apache.giraph.GiraphRunner org.apache.giraph.examples.SimpleOutDegreeCountComputation -vif org.apache.giraph.io.formats.JsonLongDoubleFloatDoubleVertexInputFormat -vip /user/hduser/input/tiny_graph.txt -vof org.apache.giraph.io.formats.IdWithValueTextOutputFormat -op /user/hduser/output/Simpleout -w 1

David Hoelzer
  • 15,862
  • 4
  • 48
  • 67

2 Answers2

1

as the logs says your computation e.g. SimpleOutDegreeCountComputation needs LongWritable format for vertex`s id while your data in hdfs is DoubleWritable. So, have two choices: changing SimpleOutDegreeCountComputation to work with DoubleWritable or convert your data from DoubleWritable into LongWritable.

1

This is because of the following reason. SimpleOutDegreeCountComputation has following signature-

public class SimpleOutDegreeCountComputation extends 
BasicComputation<LongWritable, LongWritable, DoubleWritable, DoubleWritable{
//Logic for out degree
}

Here, the BasicComputation asks for

>1. Long Vertex ID 
>2. Long Vertex Value
>3. Double Edge weight
>4. Double message type

You are trying to use JsonLongDoubleFloatDouble format for input. Which give you

>1. Long Vertex ID
>2. Double Vertex Value
>3. Float Edge Weight
>4. Double message type

Change the BasicComputation signature in the program accordingly.