Hi Jyoti,

Even I'm new to this and i'm no expert. But this is how i made it work.
Note, This might not be the best way to run the job. I'm not sure :)

But here you go,

*Step 1*: I place my own giraph code containing vertex.compute in *
$GIRAPH_HOME/**
giraph-examples/src/main/java/org/apache/giraph/examples/<yourFile.java>*.
Note, I added this line to the my vertex giraph java file.
*"package org.apache.giraph.examples;"*

*Step 2*: Then I went to *$GIRAPH_HOME/**giraph-examples/* directory and
executed the following command *"mvn compile"*.

*Step 3*: Not sure if this step is needed. But give it a try. I exported
the *giraph-examples-1.0.0-for-hadoop-0.20.203.0-jar-with-dependencies.jar*
which
is present in target directory to hadoop classpath.

*Step 4*: Ran the below command and job ran successfully.

*"hadoop jar
giraph-examples-1.0.0-for-hadoop-0.20.203.0-jar-with-dependencies.jar
org.apache.giraph.GiraphRunner org.apache.giraph.examples.MyMaximumValue
-vif
org.apache.giraph.io.formats.JsonLongDoubleFloatDoubleVertexInputFormat
-vip /user/MaxInput.txt -of
org.apache.giraph.io.formats.IdWithValueTextOutputFormat -op
/user/graphout/test7/ -w 1"*


It worked fine for me. Hopefully it will work for you as well.


Regards,
Suman Bharadwaj S



On Sun, Oct 27, 2013 at 6:33 PM, Jyoti Yadav <rao.jyoti26ya...@gmail.com>wrote:

> Hi ..
> I want to run my own giraph program. I made some modification to already
> existiing SimpleShortestPathsComputation program.
>
> I compiled it and created a jar file.
> I gave following command.
>
>  bin/hadoop jar
> $GIRAPH_HOME/giraph-examples/target/giraph-examples-1.1.0-SNAPSHOT-for-hadoop-0.20.203.0-jar-with-dependencies.jar
> org.apache.giraph.GiraphRunner -libjars /home/hduser/sp2.jar
> SimpleShortestPathsComputation*1* -vif
> org.apache.giraph.io.formats.JsonLongDoubleFloatDoubleVertexInputFormat
> -vip /user/hduser/sp_input/tiny_graph.txt -vof
> org.apache.giraph.io.formats.IdWithValueTextOutputFormat -op
> /user/hduser/sp_output7/shortestpaths -w 1
>
>
> I am getting following error..
>
>
> Exception in thread "main" java.lang.ClassNotFoundException:
> SimpleShortestPathsComputation1
>     at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
>     at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
>     at java.security.AccessController.doPrivileged(Native Method)
>     at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
>     at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
>     at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
>     at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
>     at java.lang.Class.forName0(Native Method)
>     at java.lang.Class.forName(Class.java:190)
>     at
> org.apache.giraph.utils.ConfigurationUtils.handleComputationClass(ConfigurationUtils.java:470)
>     at
> org.apache.giraph.utils.ConfigurationUtils.populateGiraphConfiguration(ConfigurationUtils.java:453)
>     at
> org.apache.giraph.utils.ConfigurationUtils.parseArgs(ConfigurationUtils.java:207)
>     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:156)
>
>
> Please help me out..I am badly tangled..
>
> Thanks
> Jyoti
>
>
>

Reply via email to