Return-Path: X-Original-To: apmail-giraph-user-archive@www.apache.org Delivered-To: apmail-giraph-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 720C417C25 for ; Tue, 8 Sep 2015 23:02:53 +0000 (UTC) Received: (qmail 58487 invoked by uid 500); 8 Sep 2015 23:02:31 -0000 Delivered-To: apmail-giraph-user-archive@giraph.apache.org Received: (qmail 58437 invoked by uid 500); 8 Sep 2015 23:02:31 -0000 Mailing-List: contact user-help@giraph.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@giraph.apache.org Delivered-To: mailing list user@giraph.apache.org Received: (qmail 58427 invoked by uid 99); 8 Sep 2015 23:02:31 -0000 Received: from Unknown (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Sep 2015 23:02:31 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 90D401A08BB for ; Tue, 8 Sep 2015 23:02:30 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 4.911 X-Spam-Level: **** X-Spam-Status: No, score=4.911 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=3, KAM_BADIPHTTP=2, SPF_PASS=-0.001, T_KAM_HTML_FONT_INVALID=0.01, URIBL_BLOCKED=0.001, WEIRD_PORT=0.001] autolearn=disabled Authentication-Results: spamd2-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-us-west.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id iCb8mwbBoUOz for ; Tue, 8 Sep 2015 23:02:18 +0000 (UTC) Received: from mail-oi0-f44.google.com (mail-oi0-f44.google.com [209.85.218.44]) by mx1-us-west.apache.org (ASF Mail Server at mx1-us-west.apache.org) with ESMTPS id 6EA9E2108A for ; Tue, 8 Sep 2015 23:02:18 +0000 (UTC) Received: by oiev17 with SMTP id v17so68193982oie.1 for ; Tue, 08 Sep 2015 16:02:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to:content-type; bh=RL42qwM0CozzUDH8ZY1rpBCaGlNwnc//42IO1ddFB6I=; b=l5NxXDX6ahsNyJBlGXJu/8JGaaB0EEZlsgzqG/5jt8FKqLCFPRtUeGtunsWsr4Ck/w 60Eptn2rlJIDObKySTDFlQJp+KBhJueW2Hg2sh7qAd5LLTSEy/OlaiJb1R0jim4qjQoT D5HaiYmoNr1n/sU4eIj/LEL2U1VMgCbkSsU5T4NY0HO1Skcz5O963wK9YzwSQIjQZnKI hJNMgtjlmQizDI2Z2PSctPqM5Z3EIwGvGl1jtL9ZglRSiGGKpbjPv0bKohoeXfbMptSD FgiueTCxPcKOU1aozfX2utqn3GsDakvScIwjvutrEs1bgRkOcDNtqxqsEYMzuqf9+Iuc ZnQg== X-Received: by 10.202.188.85 with SMTP id m82mr22424343oif.70.1441753337789; Tue, 08 Sep 2015 16:02:17 -0700 (PDT) MIME-Version: 1.0 Received: by 10.202.44.149 with HTTP; Tue, 8 Sep 2015 16:01:58 -0700 (PDT) From: =?UTF-8?Q?Jos=C3=A9_Luis_Larroque?= Date: Tue, 8 Sep 2015 20:01:58 -0300 Message-ID: Subject: java.io.IOException: ensureRemaining: Only * bytes remaining, trying to read * To: user@giraph.apache.org Content-Type: multipart/alternative; boundary=001a113dd1328d845b051f445b89 --001a113dd1328d845b051f445b89 Content-Type: text/plain; charset=UTF-8 Hi guys, i'm having some problems with custom classes in giraph. I made a VertexInput and Output format, but i always getting the following error: *java.io.IOException: ensureRemaining: Only * bytes remaining, trying to read ** with different values where the "*" are placed. This was This problem happen when a vertexIterator do next(), and there aren't any more vertex left. This iterator it's invocated from a flush method, but i don't understand, basically, why the "next()" method is failing. Here are some logs and classes... *My log is the following*: 15/09/08 00:52:21 INFO bsp.BspService: BspService: Connecting to ZooKeeper with job giraph_yarn_application_1441683854213_0001, 1 on localhost:22181 15/09/08 00:52:21 INFO zookeeper.ZooKeeper: Client environment:zookeeper.version=3.4.5-1392090, built on 09/30/2012 17:52 GMT 15/09/08 00:52:21 INFO zookeeper.ZooKeeper: Client environment:host.name =localhost 15/09/08 00:52:21 INFO zookeeper.ZooKeeper: Client environment:java.version=1.7.0_79 15/09/08 00:52:21 INFO zookeeper.ZooKeeper: Client environment:java.vendor=Oracle Corporation 15/09/08 00:52:21 INFO zookeeper.ZooKeeper: Client environment:java.home=/usr/lib/jvm/java-7-openjdk-amd64/jre 15/09/08 00:52:21 INFO zookeeper.ZooKeeper: Client environment:java.class.path=.:${CLASSPATH}:./*:$HADOOP_CONF_DIR:$HADOOP_COMMON_HOME/share/hadoop/common/*:$HADOOP_COMMON_HOME/share/hadoop/common/lib/*:$HADOOP_H$ 15/09/08 00:52:21 INFO zookeeper.ZooKeeper: Client environment:java.library.path=/usr/java/packages/lib/amd64:/usr/lib/x86_64-linux-gnu/jni:/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/usr/lib/jni:/lib:/usr/l$ 15/09/08 00:52:21 INFO zookeeper.ZooKeeper: Client environment:java.io.tmpdir=/tmp 15/09/08 00:52:21 INFO zookeeper.ZooKeeper: Client environment:java.compiler= 15/09/08 00:52:21 INFO zookeeper.ZooKeeper: Client environment:os.name=Linux 15/09/08 00:52:21 INFO zookeeper.ZooKeeper: Client environment:os.arch=amd64 15/09/08 00:52:21 INFO zookeeper.ZooKeeper: Client environment:os.version=3.13.0-62-generic 15/09/08 00:52:21 INFO zookeeper.ZooKeeper: Client environment:user.name =hduser 15/09/08 00:52:21 INFO zookeeper.ZooKeeper: Client environment:user.home=/home/hduser 15/09/08 00:52:21 INFO zookeeper.ZooKeeper: Client environment:user.dir=/app/hadoop/tmp/nm-local-dir/usercache/hduser/appcache/application_1441683854213_0001/container_1441683854213_0001_01_000003 15/09/08 00:52:21 INFO zookeeper.ZooKeeper: Initiating client connection, connectString=localhost:22181 sessionTimeout=60000 watcher=org.apache.giraph.worker.BspServiceWorker@4256d3a0 15/09/08 00:52:21 INFO zookeeper.ClientCnxn: Opening socket connection to server localhost/127.0.0.1:22181. Will not attempt to authenticate using SASL (unknown error) 15/09/08 00:52:21 INFO zookeeper.ClientCnxn: Socket connection established to localhost/127.0.0.1:22181, initiating session 15/09/08 00:52:21 INFO zookeeper.ClientCnxn: Session establishment complete on server localhost/127.0.0.1:22181, sessionid = 0x14fab0de0bb0002, negotiated timeout = 40000 15/09/08 00:52:21 INFO bsp.BspService: process: Asynchronous connection complete. 15/09/08 00:52:21 INFO netty.NettyServer: NettyServer: Using execution group with 8 threads for requestFrameDecoder. 15/09/08 00:52:21 INFO Configuration.deprecation: mapred.map.tasks is deprecated. Instead, use mapreduce.job.maps 15/09/08 00:52:21 INFO netty.NettyServer: start: Started server communication server: localhost/127.0.0.1:30001 with up to 16 threads on bind attempt 0 with sendBufferSize = 32768 receiveBufferSize = 524288 15/09/08 00:52:21 INFO netty.NettyClient: NettyClient: Using execution handler with 8 threads after request-encoder. 15/09/08 00:52:21 INFO graph.GraphTaskManager: setup: Registering health of this worker... 15/09/08 00:52:21 INFO yarn.GiraphYarnTask: [STATUS: task-1] WORKER_ONLY starting... 15/09/08 00:52:22 INFO bsp.BspService: getJobState: Job state already exists (/_hadoopBsp/giraph_yarn_application_1441683854213_0001/_masterJobState) 15/09/08 00:52:22 INFO bsp.BspService: getApplicationAttempt: Node /_hadoopBsp/giraph_yarn_application_1441683854213_0001/_applicationAttemptsDir already exists! 15/09/08 00:52:22 INFO bsp.BspService: getApplicationAttempt: Node /_hadoopBsp/giraph_yarn_application_1441683854213_0001/_applicationAttemptsDir already exists! 15/09/08 00:52:22 INFO worker.BspServiceWorker: registerHealth: Created my health node for attempt=0, superstep=-1 with /_hadoopBsp/giraph_yarn_application_1441683854213_0001/_applicationAttemptsDir/0/_superstepD$ 15/09/08 00:52:22 INFO netty.NettyServer: start: Using Netty without authentication. 15/09/08 00:52:22 INFO bsp.BspService: process: partitionAssignmentsReadyChanged (partitions are assigned) 15/09/08 00:52:22 INFO worker.BspServiceWorker: startSuperstep: Master(hostname=localhost, MRtaskID=0, port=30000) 15/09/08 00:52:22 INFO worker.BspServiceWorker: startSuperstep: Ready for computation on superstep -1 since worker selection and vertex range assignments are done in /_hadoopBsp/giraph_yarn_application_1441683854$ 15/09/08 00:52:22 INFO yarn.GiraphYarnTask: [STATUS: task-1] startSuperstep: WORKER_ONLY - Attempt=0, Superstep=-1 15/09/08 00:52:22 INFO netty.NettyClient: Using Netty without authentication. 15/09/08 00:52:22 INFO netty.NettyClient: Using Netty without authentication. 15/09/08 00:52:22 INFO netty.NettyClient: connectAllAddresses: Successfully added 2 connections, (2 total connected) 0 failed, 0 failures total. 15/09/08 00:52:22 INFO netty.NettyServer: start: Using Netty without authentication. 15/09/08 00:52:22 INFO handler.RequestDecoder: decode: Server window metrics MBytes/sec received = 0, MBytesReceived = 0.0001, ave received req MBytes = 0.0001, secs waited = 1.44168435E9 15/09/08 00:52:22 INFO worker.BspServiceWorker: loadInputSplits: Using 1 thread(s), originally 1 threads(s) for 1 total splits. 15/09/08 00:52:22 INFO worker.InputSplitsHandler: reserveInputSplit: Reserved input split path /_hadoopBsp/giraph_yarn_application_1441683854213_0001/_vertexInputSplitDir/0, overall roughly 0.0% input splits rese$ 15/09/08 00:52:22 INFO worker.InputSplitsCallable: getInputSplit: Reserved /_hadoopBsp/giraph_yarn_application_1441683854213_0001/_vertexInputSplitDir/0 from ZooKeeper and got input split 'hdfs://hdnode01:54310/u$ 15/09/08 00:52:22 INFO worker.InputSplitsCallable: loadFromInputSplit: Finished loading /_hadoopBsp/giraph_yarn_application_1441683854213_0001/_vertexInputSplitDir/0 (v=6, e=10) 15/09/08 00:52:22 INFO worker.InputSplitsCallable: call: Loaded 1 input splits in 0.16241108 secs, (v=6, e=10) 36.94329 vertices/sec, 61.572155 edges/sec 15/09/08 00:52:22 ERROR utils.LogStacktraceCallable: Execution of callable failed java.lang.IllegalStateException: next: IOException at org.apache.giraph.utils.VertexIterator.next(VertexIterator.java:101) at org.apache.giraph.partition.BasicPartition.addPartitionVertices(BasicPartition.java:99) at org.apache.giraph.comm.requests.SendWorkerVerticesRequest.doRequest(SendWorkerVerticesRequest.java:115) at org.apache.giraph.comm.netty.NettyWorkerClientRequestProcessor.doRequest(NettyWorkerClientRequestProcessor.java:466) at org.apache.giraph.comm.netty.NettyWorkerClientRequestProcessor.flush(NettyWorkerClientRequestProcessor.java:412) at org.apache.giraph.worker.InputSplitsCallable.call(InputSplitsCallable.java:241) at org.apache.giraph.worker.InputSplitsCallable.call(InputSplitsCallable.java:60) at org.apache.giraph.utils.LogStacktraceCallable.call(LogStacktraceCallable.java:51) at java.util.concurrent.FutureTask.run(FutureTask.java:262) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745) Caused by: java.io.IOException: ensureRemaining: Only 0 bytes remaining, trying to read 1 at org.apache.giraph.utils.UnsafeReads.ensureRemaining(UnsafeReads.java:77) at org.apache.giraph.utils.UnsafeArrayReads.readByte(UnsafeArrayReads.java:123) at org.apache.giraph.utils.UnsafeReads.readLine(UnsafeReads.java:100) at pruebas.TextAndDoubleComplexWritable.readFields(TextAndDoubleComplexWritable.java:37) at org.apache.giraph.utils.WritableUtils.reinitializeVertexFromDataInput(WritableUtils.java:540) at org.apache.giraph.utils.VertexIterator.next(VertexIterator.java:98) ... 11 more 15/09/08 00:52:22 ERROR worker.BspServiceWorker: unregisterHealth: Got failure, unregistering health on /_hadoopBsp/giraph_yarn_application_1441683854213_0001/_applicationAttemptsDir/0/_superstepDir/-1/_workerHea$ 15/09/08 00:52:22 ERROR yarn.GiraphYarnTask: GiraphYarnTask threw a top-level exception, failing task java.lang.RuntimeException: run: Caught an unrecoverable exception waitFor: ExecutionException occurred while waiting for org.apache.giraph.utils.ProgressableUtils$FutureWaitable@4bbf48f0 at org.apache.giraph.yarn.GiraphYarnTask.run(GiraphYarnTask.java:104) at org.apache.giraph.yarn.GiraphYarnTask.main(GiraphYarnTask.java:183) Caused by: java.lang.IllegalStateException: waitFor: ExecutionException occurred while waiting for org.apache.giraph.utils.ProgressableUtils$FutureWaitable@4bbf48f0 at org.apache.giraph.utils.ProgressableUtils.waitFor(ProgressableUtils.java:193) at org.apache.giraph.utils.ProgressableUtils.waitForever(ProgressableUtils.java:151) at org.apache.giraph.utils.ProgressableUtils.waitForever(ProgressableUtils.java:136) at org.apache.giraph.utils.ProgressableUtils.getFutureResult(ProgressableUtils.java:99) at org.apache.giraph.utils.ProgressableUtils.getResultsWithNCallables(ProgressableUtils.java:233) at org.apache.giraph.worker.BspServiceWorker.loadInputSplits(BspServiceWorker.java:316) at org.apache.giraph.worker.BspServiceWorker.loadVertices(BspServiceWorker.java:409) at org.apache.giraph.worker.BspServiceWorker.setup(BspServiceWorker.java:629) at org.apache.giraph.graph.GraphTaskManager.execute(GraphTaskManager.java:284) at org.apache.giraph.yarn.GiraphYarnTask.run(GiraphYarnTask.java:92) ... 1 more Caused by: java.util.concurrent.ExecutionException: java.lang.IllegalStateException: next: IOException at java.util.concurrent.FutureTask.report(FutureTask.java:122) at java.util.concurrent.FutureTask.get(FutureTask.java:202) at org.apache.giraph.utils.ProgressableUtils$FutureWaitable.waitFor(ProgressableUtils.java:312) at org.apache.giraph.utils.ProgressableUtils.waitFor(ProgressableUtils.java:185) ... 10 more Caused by: java.lang.IllegalStateException: next: IOException at org.apache.giraph.utils.VertexIterator.next(VertexIterator.java:101) at org.apache.giraph.partition.BasicPartition.addPartitionVertices(BasicPartition.java:99) at org.apache.giraph.comm.requests.SendWorkerVerticesRequest.doRequest(SendWorkerVerticesRequest.java:115) at org.apache.giraph.comm.netty.NettyWorkerClientRequestProcessor.doRequest(NettyWorkerClientRequestProcessor.java:466) at org.apache.giraph.comm.netty.NettyWorkerClientRequestProcessor.flush(NettyWorkerClientRequestProcessor.java:412) at org.apache.giraph.worker.InputSplitsCallable.call(InputSplitsCallable.java:241) at org.apache.giraph.worker.InputSplitsCallable.call(InputSplitsCallable.java:60) at org.apache.giraph.utils.LogStacktraceCallable.call(LogStacktraceCallable.java:51) at java.util.concurrent.FutureTask.run(FutureTask.java:262) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745) *Caused by: java.io.IOException: ensureRemaining: Only 0 bytes remaining, trying to read 1* at org.apache.giraph.utils.UnsafeReads.ensureRemaining(UnsafeReads.java:77) at org.apache.giraph.utils.UnsafeArrayReads.readByte(UnsafeArrayReads.java:123) at org.apache.giraph.utils.UnsafeReads.readLine(UnsafeReads.java:100) at pruebas.TextAndDoubleComplexWritable.readFields(TextAndDoubleComplexWritable.java:37) at org.apache.giraph.utils.WritableUtils.reinitializeVertexFromDataInput(WritableUtils.java:540) at org.apache.giraph.utils.VertexIterator.next(VertexIterator.java:98) ... 11 more *My computation class:* import java.io.IOException; import org.apache.giraph.conf.StrConfOption; import org.apache.giraph.edge.Edge; import org.apache.giraph.examples.Algorithm; import org.apache.giraph.graph.BasicComputation; import org.apache.giraph.graph.Vertex; import org.apache.hadoop.io.DoubleWritable; import org.apache.hadoop.io.Text; import org.apache.log4j.Logger; import pruebas.TextAndDoubleComplexWritable; /** * Busca todos los caminos navegacionales. Adaptacion de * https://github.com/MarcoLotz * /GiraphBFSSO/blob/master/src/uk/co/qmul/giraph/structurebfs * /SimpleBFSStructureComputation.java de @MarcoLotz, a los datos de wikiquotes * generados por el proyecto generacion_de_grafo_wikiquotes */ @Algorithm(name = "Busqueda de Caminos Navegacionales", description = "Busca todos los caminos navegacionales de un grafo") public class BusquedaDeCaminosNavegacionalesWikiquote extends BasicComputation { /** * Id origen de la busqueda de caminos navegacionales, indica el primer * vertice a procesar en el superstep 0 */ public static final StrConfOption SOURCE_ID = new StrConfOption( "BusquedaDeCaminosNavegacionales.sourceId", "Portada", "El vertice de origen, de la busqueda de todos los caminos navegacionales"); // public static final LongConfOption DEST_ID = new LongConfOption( // "BusquedaDeCaminosNavegacionales.destId", 2, // "El vertice de destino, de la busqueda de todos los caminos navegacionales"); /** Class logger */ private static final Logger LOG = Logger .getLogger(BusquedaDeCaminosNavegacionalesWikiquote.class); /** * Define a maximum number of supersteps */ public final int MAX_SUPERSTEPS = 5; /** * Is this vertex the source id? * * @param vertex * Vertex * @return True if the source id */ private boolean isStart(Vertex vertex) { return vertex.getId().toString() .equals(SOURCE_ID.get(getConf()).toString()); } /** * Send messages to all the connected vertices. The content of the messages * is not important, since just the event of receiving a message removes the * vertex from the inactive status. * * @param vertex */ public void BFSMessages( Vertex vertex) { for (Edge edge : vertex.getEdges()) { sendMessage(edge.getTargetVertexId(), vertex.getId()); } } @Override public void compute( Vertex vertex, Iterable messages) throws IOException { // Forces convergence in maximum superstep if (!(getSuperstep() == MAX_SUPERSTEPS)) { // Only start vertex should work in the first superstep // All the other should vote to halt and wait for // messages. // Si se corre desde JUnit, el primer superstep es el 1, pero al // invocar desde la linea de comandos es 0 if (getSuperstep() == 0) { if (isStart(vertex)) { vertex.getValue().setVertexData(new Double(getSuperstep())); BFSMessages(vertex); if (LOG.isInfoEnabled()) { LOG.info("[Start Vertex] Vertex ID: " + vertex.getId()); } } else { // Initialise with infinite depth other vertex vertex.getValue().setVertexData( new Double(Integer.MAX_VALUE)); } } // if it is not the first Superstep (Superstep 0) : // Check vertex ID else { // It is the first time that this vertex is being computed if (vertex.getValue().getVertexData() == Integer.MAX_VALUE) { // The depth has the same value that the superstep vertex.getValue().setVertexData(new Double(getSuperstep())); String idsDeVerticesPredecesores = ""; for (Text message : messages) { idsDeVerticesPredecesores += message.toString(); } vertex.getValue().setIds_vertices_anteriores( idsDeVerticesPredecesores); // Continue on the structure BFSMessages(vertex); } // Else this vertex was already analysed in a previous // iteration. } vertex.voteToHalt(); } } } My *Input format:*package pruebas; import org.apache.giraph.edge.Edge; import org.apache.giraph.edge.EdgeFactory; import org.apache.giraph.io.formats.AdjacencyListTextVertexInputFormat; import org.apache.hadoop.io.DoubleWritable; import org.apache.hadoop.io.Text; import org.apache.hadoop.mapreduce.InputSplit; import org.apache.hadoop.mapreduce.TaskAttemptContext; /** * @author hduser * */ public class IdTextWithComplexValueInputFormat extends AdjacencyListTextVertexInputFormat { @Override public AdjacencyListTextVertexReader createVertexReader(InputSplit split, TaskAttemptContext context) { return new TextComplexValueDoubleAdjacencyListVertexReader(); } protected class TextComplexValueDoubleAdjacencyListVertexReader extends AdjacencyListTextVertexReader { /** * Constructor with * {@link AdjacencyListTextVertexInputFormat.LineSanitizer}. * * @param lineSanitizer * the sanitizer to use for reading */ public TextComplexValueDoubleAdjacencyListVertexReader() { super(); } @Override public Text decodeId(String s) { return new Text(s); } @Override public TextAndDoubleComplexWritable decodeValue(String s) { TextAndDoubleComplexWritable valorComplejo = new TextAndDoubleComplexWritable(); valorComplejo.setVertexData(Double.valueOf(s)); valorComplejo.setIds_vertices_anteriores(""); return valorComplejo; } @Override public Edge decodeEdge(String s1, String s2) { return EdgeFactory.create(new Text(s1), new DoubleWritable(Double.valueOf(s2))); } } } My *Output format:* package pruebas; import java.io.IOException; import org.apache.giraph.graph.Vertex; import org.apache.giraph.io.formats.IdWithValueTextOutputFormat; import org.apache.giraph.io.formats.TextVertexOutputFormat; import org.apache.hadoop.io.DoubleWritable; import org.apache.hadoop.io.Text; import org.apache.hadoop.mapreduce.TaskAttemptContext; /** * @author hduser * */ public class IdTextWithComplexValueOutputFormat extends TextVertexOutputFormat { /** Specify the output delimiter */ public static final String LINE_TOKENIZE_VALUE = "output.delimiter"; /** Default output delimiter */ public static final String LINE_TOKENIZE_VALUE_DEFAULT = "\t"; /** Reverse id and value order? */ public static final String REVERSE_ID_AND_VALUE = "reverse.id.and.value"; /** Default is to not reverse id and value order. */ public static final boolean REVERSE_ID_AND_VALUE_DEFAULT = false; @Override public TextVertexOutputFormat.TextVertexWriter createVertexWriter( TaskAttemptContext context) throws IOException, InterruptedException { return new IdWithValueVertexWriter(); } /** * Vertex writer used with {@link IdWithValueTextOutputFormat}. */ protected class IdWithValueVertexWriter extends TextVertexWriterToEachLine { /** Saved delimiter */ private String delimiter; /** Cached reserve option */ private boolean reverseOutput; @Override public void initialize(TaskAttemptContext context) throws IOException, InterruptedException { super.initialize(context); delimiter = getConf().get(LINE_TOKENIZE_VALUE, LINE_TOKENIZE_VALUE_DEFAULT); reverseOutput = getConf().getBoolean(REVERSE_ID_AND_VALUE, REVERSE_ID_AND_VALUE_DEFAULT); } protected Text convertVertexToLine( Vertex vertex) throws IOException { StringBuilder str = new StringBuilder(); if (reverseOutput) { imprimirCaminosNavegacionales(vertex, str); str.append(delimiter); str.append(vertex.getId().toString()); } else { str.append(vertex.getId().toString()); str.append(delimiter); imprimirCaminosNavegacionales(vertex, str); } return new Text(str.toString()); } private void imprimirCaminosNavegacionales( Vertex vertex, StringBuilder str) { str.append(vertex.getId()); str.append(LINE_TOKENIZE_VALUE_DEFAULT); for (String idVerticeAnterior : vertex.getValue() .getIds_vertices_anteriores() .split(LINE_TOKENIZE_VALUE_DEFAULT)) { str.append(idVerticeAnterior + "/" + vertex.getId()); str.append(LINE_TOKENIZE_VALUE_DEFAULT); } str.append(vertex.getValue().toString()); } } } *My input file:* Portada 0.0 Sugerencias 1.0 Proverbios 0.0 Neil 0.0 Luna 1.0 ideal 1.0 verdad 1.0 Categoria:Ingenieros 2.0 Categoria:Estadounidenses 2.0 Categoria:Astronautas 2.0 Categoria:Ingenieros 1.0 Neil 2.0 Categoria:Estadounidenses 1.0 Neil 2.0 Categoria:Astronautas 1.0 Neil 2.0 and i execute it with this *command*: $HADOOP_HOME/bin/yarn jar $GIRAPH_HOME/giraph-examples/target/giraph-examples-1.1.0-for-hadoop-2.4.0-jar-with-dependencies.jar org.apache.giraph.GiraphRunner lectura_de_grafo.BusquedaDeCaminosNavegacionalesWikiquote -vif pruebas.IdTextWithComplexValueInputFormat -vip /user/hduser/input/wiki-graph-chiquito.txt -vof pruebas.IdTextWithComplexValueOutputFormat -op /user/hduser/output/caminosNavegacionales -w 2 -yh 250 --001a113dd1328d845b051f445b89 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi guys, i'm having some problems with = custom classes in giraph. I made a VertexInput and Output format, but i alw= ays getting the following error:

java.io.IOException: ensureRema= ining: Only * bytes remaining, trying to read *


with diffe= rent values where the "*" are placed. This was This problem happe= n when a vertexIterator do next(), and there aren't any more vertex lef= t. This iterator it's invocated from a flush method, but i don't un= derstand, basically, why the=C2=A0 "next()"=C2=A0 method is faili= ng. Here are some logs and classes...

My log is the fo= llowing:

15/09/08 00:52:21 INFO bsp.BspService:= BspService: Connecting to ZooKeeper with job giraph_yarn_application_14416= 83854213_0001, 1 on localhost:22181
15/09/08 00:52:21 INFO zookeeper.Zoo= Keeper: Client environment:zookeeper.version=3D3.4.5-1392090, built on 09/3= 0/2012 17:52 GMT
15/09/08 00:52:21 INFO zookeeper.ZooKeeper: Client envi= ronment:host.name=3Dlocalhost
15/09/08 = 00:52:21 INFO zookeeper.ZooKeeper: Client environment:java.version=3D1.7.0_= 79
15/09/08 00:52:21 INFO zookeeper.ZooKeeper: Client environment:java.v= endor=3DOracle Corporation
15/09/08 00:52:21 INFO zookeeper.ZooKeeper: C= lient environment:java.home=3D/usr/lib/jvm/java-7-openjdk-amd64/jre
15/0= 9/08 00:52:21 INFO zookeeper.ZooKeeper: Client environment:java.class.path= =3D.:${CLASSPATH}:./*:$HADOOP_CONF_DIR:$HADOOP_COMMON_HOME/share/hadoop/com= mon/*:$HADOOP_COMMON_HOME/share/hadoop/common/lib/*:$HADOOP_H$
15/09/08 = 00:52:21 INFO zookeeper.ZooKeeper: Client environment:java.library.path=3D/= usr/java/packages/lib/amd64:/usr/lib/x86_64-linux-gnu/jni:/lib/x86_64-linux= -gnu:/usr/lib/x86_64-linux-gnu:/usr/lib/jni:/lib:/usr/l$
15/09/08 00:52:= 21 INFO zookeeper.ZooKeeper: Client environment:java.io.tmpdir=3D/tmp
15= /09/08 00:52:21 INFO zookeeper.ZooKeeper: Client environment:java.compiler= =3D<NA>
15/09/08 00:52:21 INFO zookeeper.ZooKeeper: Client environ= ment:os.name=3DLinux
15/09/08 00:52:21 IN= FO zookeeper.ZooKeeper: Client environment:os.arch=3Damd64
15/09/08 00:5= 2:21 INFO zookeeper.ZooKeeper: Client environment:os.version=3D3.13.0-62-ge= neric
15/09/08 00:52:21 INFO zookeeper.ZooKeeper: Client environment:user.name=3Dhduser
15/09/08 00:52:21 INFO = zookeeper.ZooKeeper: Client environment:user.home=3D/home/hduser
15/09/0= 8 00:52:21 INFO zookeeper.ZooKeeper: Client environment:user.dir=3D/app/had= oop/tmp/nm-local-dir/usercache/hduser/appcache/application_1441683854213_00= 01/container_1441683854213_0001_01_000003
15/09/08 00:52:21 INFO zookeep= er.ZooKeeper: Initiating client connection, connectString=3Dlocalhost:22181= sessionTimeout=3D60000 watcher=3Dorg.apache.giraph.worker.BspServiceWorker= @4256d3a0
15/09/08 00:52:21 INFO zookeeper.ClientCnxn: Opening socket co= nnection to server localhost/127.0.0.1:2= 2181. Will not attempt to authenticate using SASL (unknown error)
15= /09/08 00:52:21 INFO zookeeper.ClientCnxn: Socket connection established to= localhost/127.0.0.1:22181, initiati= ng session
15/09/08 00:52:21 INFO zookeeper.ClientCnxn: Session establis= hment complete on server localhost/127.0= .0.1:22181, sessionid =3D 0x14fab0de0bb0002, negotiated timeout =3D 400= 00
15/09/08 00:52:21 INFO bsp.BspService: process: Asynchronous connecti= on complete.
15/09/08 00:52:21 INFO netty.NettyServer: NettyServer: Usin= g execution group with 8 threads for requestFrameDecoder.
15/09/08 00:52= :21 INFO Configuration.deprecation: mapred.map.tasks is deprecated. Instead= , use mapreduce.job.maps
15/09/08 00:52:21 INFO netty.NettyServer: start= : Started server communication server: localhost/127.0.0.1:30001 with up to 16 threads on bind attempt 0 with s= endBufferSize =3D 32768 receiveBufferSize =3D 524288
15/09/08 00:52:21 I= NFO netty.NettyClient: NettyClient: Using execution handler with 8 threads = after request-encoder.
15/09/08 00:52:21 INFO graph.GraphTaskManager: se= tup: Registering health of this worker...
15/09/08 00:52:21 INFO yarn.Gi= raphYarnTask: [STATUS: task-1] WORKER_ONLY starting...
15/09/08 00:52:22= INFO bsp.BspService: getJobState: Job state already exists (/_hadoopBsp/gi= raph_yarn_application_1441683854213_0001/_masterJobState)
15/09/08 00:52= :22 INFO bsp.BspService: getApplicationAttempt: Node /_hadoopBsp/giraph_yar= n_application_1441683854213_0001/_applicationAttemptsDir already exists!15/09/08 00:52:22 INFO bsp.BspService: getApplicationAttempt: Node /_hadoo= pBsp/giraph_yarn_application_1441683854213_0001/_applicationAttemptsDir alr= eady exists!
15/09/08 00:52:22 INFO worker.BspServiceWorker: registerHea= lth: Created my health node for attempt=3D0, superstep=3D-1 with /_hadoopBs= p/giraph_yarn_application_1441683854213_0001/_applicationAttemptsDir/0/_sup= erstepD$
15/09/08 00:52:22 INFO netty.NettyServer: start: Using Netty wi= thout authentication.
15/09/08 00:52:22 INFO bsp.BspService: process: pa= rtitionAssignmentsReadyChanged (partitions are assigned)
15/09/08 00:52:= 22 INFO worker.BspServiceWorker: startSuperstep: Master(hostname=3Dlocalhos= t, MRtaskID=3D0, port=3D30000)
15/09/08 00:52:22 INFO worker.BspServiceW= orker: startSuperstep: Ready for computation on superstep -1 since worker s= election and vertex range assignments are done in /_hadoopBsp/giraph_yarn_a= pplication_1441683854$
15/09/08 00:52:22 INFO yarn.GiraphYarnTask: [STAT= US: task-1] startSuperstep: WORKER_ONLY - Attempt=3D0, Superstep=3D-1
15= /09/08 00:52:22 INFO netty.NettyClient: Using Netty without authentication.=
15/09/08 00:52:22 INFO netty.NettyClient: Using Netty without authentic= ation.
15/09/08 00:52:22 INFO netty.NettyClient: connectAllAddresses: Su= ccessfully added 2 connections, (2 total connected) 0 failed, 0 failures to= tal.
15/09/08 00:52:22 INFO netty.NettyServer: start: Using Netty withou= t authentication.
15/09/08 00:52:22 INFO handler.RequestDecoder: decode:= Server window metrics MBytes/sec received =3D 0, MBytesReceived =3D 0.0001= , ave received req MBytes =3D 0.0001, secs waited =3D 1.44168435E9
15/09= /08 00:52:22 INFO worker.BspServiceWorker: loadInputSplits: Using 1 thread(= s), originally 1 threads(s) for 1 total splits.
15/09/08 00:52:22 INFO w= orker.InputSplitsHandler: reserveInputSplit: Reserved input split path /_ha= doopBsp/giraph_yarn_application_1441683854213_0001/_vertexInputSplitDir/0, = overall roughly 0.0% input splits rese$
15/09/08 00:52:22 INFO worker.In= putSplitsCallable: getInputSplit: Reserved /_hadoopBsp/giraph_yarn_applicat= ion_1441683854213_0001/_vertexInputSplitDir/0 from ZooKeeper and got input = split 'hdfs://hdnode01:54310/u$
15/09/08 00:52:22 INFO worker.InputS= plitsCallable: loadFromInputSplit: Finished loading /_hadoopBsp/giraph_yarn= _application_1441683854213_0001/_vertexInputSplitDir/0 (v=3D6, e=3D10)
1= 5/09/08 00:52:22 INFO worker.InputSplitsCallable: call: Loaded 1 input spli= ts in 0.16241108 secs, (v=3D6, e=3D10) 36.94329 vertices/sec, 61.572155 edg= es/sec
15/09/08 00:52:22 ERROR utils.LogStacktraceCallable: Execution of= callable failed

java.lang.IllegalStateException: next: IOException<= br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 at org.apache.giraph.utils.Ve= rtexIterator.next(VertexIterator.java:101)
=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 at org.apache.giraph.partition.BasicPartition.addPartitionV= ertices(BasicPartition.java:99)
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 at org.apache.giraph.comm.requests.SendWorkerVerticesRequest.doRequest(= SendWorkerVerticesRequest.java:115)
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0 at org.apache.giraph.comm.netty.NettyWorkerClientRequestProcessor.do= Request(NettyWorkerClientRequestProcessor.java:466)
=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0 at org.apache.giraph.comm.netty.NettyWorkerClientR= equestProcessor.flush(NettyWorkerClientRequestProcessor.java:412)
=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 at org.apache.giraph.worker.InputSplit= sCallable.call(InputSplitsCallable.java:241)
=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 at org.apache.giraph.worker.InputSplitsCallable.call(InputS= plitsCallable.java:60)
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 at org= .apache.giraph.utils.LogStacktraceCallable.call(LogStacktraceCallable.java:= 51)
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 at java.util.concurrent.F= utureTask.run(FutureTask.java:262)
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecu= tor.java:1145)
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 at java.util.c= oncurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 at java.lang.Thread.run(Thread.java= :745)
Caused by: java.io.IOException: ensureRemaining: Only 0 bytes rema= ining, trying to read 1
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 at or= g.apache.giraph.utils.UnsafeReads.ensureRemaining(UnsafeReads.java:77)
= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 at org.apache.giraph.utils.Unsaf= eArrayReads.readByte(UnsafeArrayReads.java:123)
=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 at org.apache.giraph.utils.UnsafeReads.readLine(UnsafeRe= ads.java:100)
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 at pruebas.Text= AndDoubleComplexWritable.readFields(TextAndDoubleComplexWritable.java:37)=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 at org.apache.giraph.utils.Wri= tableUtils.reinitializeVertexFromDataInput(WritableUtils.java:540)
=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 at org.apache.giraph.utils.VertexIt= erator.next(VertexIterator.java:98)
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0 ... 11 more
15/09/08 00:52:22 ERROR worker.BspServiceWorker: unre= gisterHealth: Got failure, unregistering health on /_hadoopBsp/giraph_yarn_= application_1441683854213_0001/_applicationAttemptsDir/0/_superstepDir/-1/_= workerHea$
15/09/08 00:52:22 ERROR yarn.GiraphYarnTask: GiraphYarnTask t= hrew a top-level exception, failing task
java.lang.RuntimeException: run= : Caught an unrecoverable exception waitFor: ExecutionException occurred wh= ile waiting for org.apache.giraph.utils.ProgressableUtils$FutureWaitable@4b= bf48f0
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 at org.apache.giraph.y= arn.GiraphYarnTask.run(GiraphYarnTask.java:104)
=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 at org.apache.giraph.yarn.GiraphYarnTask.main(GiraphYarn= Task.java:183)
Caused by: java.lang.IllegalStateException: waitFor: Exec= utionException occurred while waiting for org.apache.giraph.utils.Progressa= bleUtils$FutureWaitable@4bbf48f0
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 at org.apache.giraph.utils.ProgressableUtils.waitFor(ProgressableUtils.= java:193)
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 at org.apache.girap= h.utils.ProgressableUtils.waitForever(ProgressableUtils.java:151)
=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 at org.apache.giraph.utils.Progressabl= eUtils.waitForever(ProgressableUtils.java:136)
=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 at org.apache.giraph.utils.ProgressableUtils.getFutureRe= sult(ProgressableUtils.java:99)
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 at org.apache.giraph.utils.ProgressableUtils.getResultsWithNCallables(P= rogressableUtils.java:233)
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 at= org.apache.giraph.worker.BspServiceWorker.loadInputSplits(BspServiceWorker= .java:316)
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 at org.apache.gira= ph.worker.BspServiceWorker.loadVertices(BspServiceWorker.java:409)
=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 at org.apache.giraph.worker.BspServ= iceWorker.setup(BspServiceWorker.java:629)
=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 at org.apache.giraph.graph.GraphTaskManager.execute(GraphTa= skManager.java:284)
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 at org.ap= ache.giraph.yarn.GiraphYarnTask.run(GiraphYarnTask.java:92)
=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ... 1 more
Caused by: java.util.concurren= t.ExecutionException: java.lang.IllegalStateException: next: IOException=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 at java.util.concurrent.FutureT= ask.report(FutureTask.java:122)
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 at java.util.concurrent.FutureTask.get(FutureTask.java:202)
=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 at org.apache.giraph.utils.Progressabl= eUtils$FutureWaitable.waitFor(ProgressableUtils.java:312)
=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 at org.apache.giraph.utils.ProgressableUtils= .waitFor(ProgressableUtils.java:185)
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 ... 10 more
Caused by: java.lang.IllegalStateException: next: = IOException
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 at org.apache.gir= aph.utils.VertexIterator.next(VertexIterator.java:101)
=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0 at org.apache.giraph.partition.BasicPartition.a= ddPartitionVertices(BasicPartition.java:99)
=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 at org.apache.giraph.comm.requests.SendWorkerVerticesReques= t.doRequest(SendWorkerVerticesRequest.java:115)
=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 at org.apache.giraph.comm.netty.NettyWorkerClientRequest= Processor.doRequest(NettyWorkerClientRequestProcessor.java:466)
=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 at org.apache.giraph.comm.netty.NettyW= orkerClientRequestProcessor.flush(NettyWorkerClientRequestProcessor.java:41= 2)
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 at org.apache.giraph.worke= r.InputSplitsCallable.call(InputSplitsCallable.java:241)
=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0 at org.apache.giraph.worker.InputSplitsCallable= .call(InputSplitsCallable.java:60)
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0 at org.apache.giraph.utils.LogStacktraceCallable.call(LogStacktraceC= allable.java:51)
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 at java.util= .concurrent.FutureTask.run(FutureTask.java:262)
=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 at java.util.concurrent.ThreadPoolExecutor.runWorker(Thr= eadPoolExecutor.java:1145)
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 at= java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java= :615)
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 at java.lang.Thread.run= (Thread.java:745)
Caused by: java.io.IOException: en= sureRemaining: Only 0 bytes remaining, trying to read 1
=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 at org.apache.giraph.utils.UnsafeRe= ads.ensureRemaining(UnsafeReads.java:77)
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 at org.apache.giraph.utils.UnsafeArrayReads.readByte(UnsafeArr= ayReads.java:123)
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 at org.apac= he.giraph.utils.UnsafeReads.readLine(UnsafeReads.java:100)
=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 at pruebas.TextAndDoubleComplexWritable.read= Fields(TextAndDoubleComplexWritable.java:37)
=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 at org.apache.giraph.utils.WritableUtils.reinitializeVertex= FromDataInput(WritableUtils.java:540)
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 at org.apache.giraph.utils.VertexIterator.next(VertexIterator.jav= a:98)
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ... 11 more
<= br>


My computation class:
import java.io.IOException;

import org.apache.giraph.co= nf.StrConfOption;
import org.apache.giraph.edge.Edge;
import org.apac= he.giraph.examples.Algorithm;
import org.apache.giraph.graph.BasicComput= ation;
import org.apache.giraph.graph.Vertex;
import org.apache.hadoo= p.io.DoubleWritable;
import org.apache.hadoop.io.Text;
import org.apa= che.log4j.Logger;

import pruebas.TextAndDoubleComplexWritable;
/**
=C2=A0* Busca todos los caminos navegacionales. Adaptacion de
= =C2=A0* https://github.com/MarcoLo= tz
=C2=A0* /GiraphBFSSO/blob/master/src/uk/co/qmul/giraph/structureb= fs
=C2=A0* /SimpleBFSStructureComputation.java de @MarcoLotz, a los dato= s de wikiquotes
=C2=A0* generados por el proyecto generacion_de_grafo_wi= kiquotes
=C2=A0*/
@Algorithm(name =3D "Busqueda de Caminos Naveg= acionales", description =3D "Busca todos los caminos navegacional= es de un grafo")
public class BusquedaDeCaminosNavegacionalesWikiqu= ote
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 extends
=C2=A0=C2=A0=C2=A0 = =C2=A0=C2=A0=C2=A0 BasicComputation<Text, TextAndDoubleComplexWritable, = DoubleWritable, Text> {
=C2=A0=C2=A0=C2=A0 /**
=C2=A0=C2=A0=C2=A0 = =C2=A0* Id origen de la busqueda de caminos navegacionales, indica el prime= r
=C2=A0=C2=A0=C2=A0 =C2=A0* vertice a procesar en el superstep 0
=C2= =A0=C2=A0=C2=A0 =C2=A0*/
=C2=A0=C2=A0=C2=A0 public static final StrConfO= ption SOURCE_ID =3D new StrConfOption(
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0= =C2=A0 =C2=A0=C2=A0=C2=A0 "BusquedaDeCaminosNavegacionales.sourceId&qu= ot;, "Portada",
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0= =C2=A0=C2=A0 "El vertice de origen, de la busqueda de todos los camino= s navegacionales");
=C2=A0=C2=A0=C2=A0 // public static final LongC= onfOption DEST_ID =3D new LongConfOption(
=C2=A0=C2=A0=C2=A0 // "Bu= squedaDeCaminosNavegacionales.destId", 2,
=C2=A0=C2=A0=C2=A0 // &qu= ot;El vertice de destino, de la busqueda de todos los caminos navegacionale= s");
=C2=A0=C2=A0=C2=A0 /** Class logger */
=C2=A0=C2=A0=C2=A0 p= rivate static final Logger LOG =3D Logger
=C2=A0=C2=A0=C2=A0 =C2=A0=C2= =A0=C2=A0 =C2=A0=C2=A0=C2=A0 .getLogger(BusquedaDeCaminosNavegacionalesWiki= quote.class);

=C2=A0=C2=A0=C2=A0 /**
=C2=A0=C2=A0=C2=A0 =C2=A0* D= efine a maximum number of supersteps
=C2=A0=C2=A0=C2=A0 =C2=A0*/
=C2= =A0=C2=A0=C2=A0 public final int MAX_SUPERSTEPS =3D 5;

=C2=A0=C2=A0= =C2=A0 /**
=C2=A0=C2=A0=C2=A0 =C2=A0* Is this vertex the source id?
= =C2=A0=C2=A0=C2=A0 =C2=A0*
=C2=A0=C2=A0=C2=A0 =C2=A0* @param vertex
= =C2=A0=C2=A0=C2=A0 =C2=A0*=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 Vertex
=C2=A0=C2=A0=C2=A0 =C2=A0* @return True if the= source id
=C2=A0=C2=A0=C2=A0 =C2=A0*/
=C2=A0=C2=A0=C2=A0 private boo= lean isStart(Vertex<Text, ?, ?> vertex) {
=C2=A0=C2=A0=C2=A0 =C2= =A0=C2=A0=C2=A0 return vertex.getId().toString()
=C2=A0=C2=A0=C2=A0 =C2= =A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 .equals(SOURCE_ID.get= (getConf()).toString());
=C2=A0=C2=A0=C2=A0 }

=C2=A0=C2=A0=C2=A0 = /**
=C2=A0=C2=A0=C2=A0 =C2=A0* Send messages to all the connected vertic= es. The content of the messages
=C2=A0=C2=A0=C2=A0 =C2=A0* is not import= ant, since just the event of receiving a message removes the
=C2=A0=C2= =A0=C2=A0 =C2=A0* vertex from the inactive status.
=C2=A0=C2=A0=C2=A0 = =C2=A0*
=C2=A0=C2=A0=C2=A0 =C2=A0* @param vertex
=C2=A0=C2=A0=C2=A0 = =C2=A0*/
=C2=A0=C2=A0=C2=A0 public void BFSMessages(
=C2=A0=C2=A0=C2= =A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 Vertex<Text, TextAndDoubleComp= lexWritable, DoubleWritable> vertex) {
=C2=A0=C2=A0=C2=A0 =C2=A0=C2= =A0=C2=A0 for (Edge<Text, DoubleWritable> edge : vertex.getEdges()) {=
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 sendMessage(ed= ge.getTargetVertexId(), vertex.getId());
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0= =C2=A0 }
=C2=A0=C2=A0=C2=A0 }

=C2=A0=C2=A0=C2=A0 @Override
=C2= =A0=C2=A0=C2=A0 public void compute(
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2= =A0 =C2=A0=C2=A0=C2=A0 Vertex<Text, TextAndDoubleComplexWritable, Double= Writable> vertex,
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0= =C2=A0 Iterable<Text> messages) throws IOException {

=C2=A0=C2= =A0=C2=A0 =C2=A0=C2=A0=C2=A0 // Forces convergence in maximum superstep
= =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 if (!(getSuperstep() =3D=3D MAX_SUPER= STEPS)) {
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 // On= ly start vertex should work in the first superstep
=C2=A0=C2=A0=C2=A0 = =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 // All the other should vote to halt = and wait for
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 //= messages.

=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 = // Si se corre desde JUnit, el primer superstep es el 1, pero al
=C2=A0= =C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 // invocar desde la line= a de comandos es 0
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2= =A0 if (getSuperstep() =3D=3D 0) {
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 if (isStart(vertex)) {
=C2=A0=C2= =A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0= =C2=A0=C2=A0 vertex.getValue().setVertexData(new Double(getSuperstep()));=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2= =A0 =C2=A0=C2=A0=C2=A0 BFSMessages(vertex);
=C2=A0=C2=A0=C2=A0 =C2=A0=C2= =A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 if (LOG.= isInfoEnabled()) {
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2= =A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 LOG.info("= ;[Start Vertex] Vertex ID: " + vertex.getId());
=C2=A0=C2=A0=C2=A0 = =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0= }
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0= =C2=A0 } else { // Initialise with infinite depth other vertex
=C2=A0=C2= =A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0= =C2=A0=C2=A0 vertex.getValue().setVertexData(
=C2=A0=C2=A0=C2=A0 =C2=A0= =C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2= =A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 new Double(Integer.MAX_VALUE));
=C2= =A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 }<= br>=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 }

=C2=A0= =C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 // if it is not the firs= t Superstep (Superstep 0) :
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0= =C2=A0=C2=A0 // Check vertex ID

=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2= =A0 =C2=A0=C2=A0=C2=A0 else {
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2= =A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 // It is the first time that this vertex= is being computed
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2= =A0 =C2=A0=C2=A0=C2=A0 if (vertex.getValue().getVertexData() =3D=3D Integer= .MAX_VALUE) {
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 = =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 // The depth has the same value that = the superstep
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 = =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 vertex.getValue().setVertexData(new D= ouble(getSuperstep()));

=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0= =C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 String idsDeVerticesPred= ecesores =3D "";
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0= =C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 for (Text message : mess= ages) {
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0= =C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 idsDeVerticesPredecesore= s +=3D message.toString();
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0= =C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 }
=C2=A0=C2=A0=C2=A0 = =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0= vertex.getValue().setIds_vertices_anteriores(
=C2=A0=C2=A0=C2=A0 =C2=A0= =C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2= =A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 idsDeVerticesPredecesores);

=C2= =A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 = =C2=A0=C2=A0=C2=A0 // Continue on the structure
=C2=A0=C2=A0=C2=A0 =C2= =A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 BF= SMessages(vertex);
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2= =A0 =C2=A0=C2=A0=C2=A0 }
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2= =A0=C2=A0 =C2=A0=C2=A0=C2=A0 // Else this vertex was already analysed in a = previous
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0= =C2=A0=C2=A0 // iteration.
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0= =C2=A0=C2=A0 }
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 = vertex.voteToHalt();
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 }
=C2=A0= =C2=A0=C2=A0 }
}

My Input format:

package pruebas;

import org.apache.giraph.edge.Edg= e;
import org.apache.giraph.edge.EdgeFactory;
import org.apache.girap= h.io.formats.AdjacencyListTextVertexInputFormat;
import org.apache.hadoo= p.io.DoubleWritable;
import org.apache.hadoop.io.Text;
import org.apa= che.hadoop.mapreduce.InputSplit;
import org.apache.hadoop.mapreduce.Task= AttemptContext;

/**
=C2=A0* @author hduser
=C2=A0*
=C2=A0*/=
public class IdTextWithComplexValueInputFormat
=C2=A0=C2=A0=C2=A0 = =C2=A0=C2=A0=C2=A0 extends
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 Adjacen= cyListTextVertexInputFormat<Text, TextAndDoubleComplexWritable, DoubleWr= itable> {

=C2=A0=C2=A0=C2=A0 @Override
=C2=A0=C2=A0=C2=A0 publ= ic AdjacencyListTextVertexReader createVertexReader(InputSplit split,
= =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 TaskAttemptContext= context) {
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 return new TextComplex= ValueDoubleAdjacencyListVertexReader();
=C2=A0=C2=A0=C2=A0 }

=C2= =A0=C2=A0=C2=A0 protected class TextComplexValueDoubleAdjacencyListVertexRe= ader extends
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 Ad= jacencyListTextVertexReader {

=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 = /**
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0* Constructor with
= =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0* {@link AdjacencyListTextVerte= xInputFormat.LineSanitizer}.
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2= =A0*
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0* @param lineSanitizer<= br>=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0*=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 the sanitizer to use for reading=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0*/
=C2=A0=C2=A0=C2=A0 =C2= =A0=C2=A0=C2=A0 public TextComplexValueDoubleAdjacencyListVertexReader() {<= br>=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 super();
=C2= =A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 }

=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0= =C2=A0 @Override
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 public Text decod= eId(String s) {
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0= return new Text(s);
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 }

=C2= =A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 @Override
=C2=A0=C2=A0=C2=A0 =C2=A0= =C2=A0=C2=A0 public TextAndDoubleComplexWritable decodeValue(String s) {=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 TextAndDoubleComp= lexWritable valorComplejo =3D new TextAndDoubleComplexWritable();
=C2=A0= =C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 valorComplejo.setVertexD= ata(Double.valueOf(s));
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2= =A0=C2=A0 valorComplejo.setIds_vertices_anteriores("");
=C2=A0= =C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 return valorComplejo;=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 }

=C2=A0=C2=A0=C2=A0 =C2=A0= =C2=A0=C2=A0 @Override
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 public Edge= <Text, DoubleWritable> decodeEdge(String s1, String s2) {
=C2=A0= =C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 return EdgeFactory.creat= e(new Text(s1),
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 new DoubleWritable(Double.valueOf(s2= )));
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 }
=C2=A0=C2=A0=C2=A0 }
=
}


My Output format:
package pruebas;

import java.io.IOException;

import org.a= pache.giraph.graph.Vertex;
import org.apache.giraph.io.formats.IdWithVal= ueTextOutputFormat;
import org.apache.giraph.io.formats.TextVertexOutput= Format;
import org.apache.hadoop.io.DoubleWritable;
import org.apache= .hadoop.io.Text;
import org.apache.hadoop.mapreduce.TaskAttemptContext;<= br>
/**
=C2=A0* @author hduser
=C2=A0*
=C2=A0*/
public class= IdTextWithComplexValueOutputFormat
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2= =A0 extends
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 TextVertexOutputFormat= <Text, TextAndDoubleComplexWritable, DoubleWritable> {

=C2=A0= =C2=A0=C2=A0 /** Specify the output delimiter */
=C2=A0=C2=A0=C2=A0 publ= ic static final String LINE_TOKENIZE_VALUE =3D "output.delimiter"= ;
=C2=A0=C2=A0=C2=A0 /** Default output delimiter */
=C2=A0=C2=A0=C2= =A0 public static final String LINE_TOKENIZE_VALUE_DEFAULT =3D "\t&quo= t;;
=C2=A0=C2=A0=C2=A0 /** Reverse id and value order? */
=C2=A0=C2= =A0=C2=A0 public static final String REVERSE_ID_AND_VALUE =3D "reverse= .id.and.value";
=C2=A0=C2=A0=C2=A0 /** Default is to not reverse id= and value order. */
=C2=A0=C2=A0=C2=A0 public static final boolean REVE= RSE_ID_AND_VALUE_DEFAULT =3D false;

=C2=A0=C2=A0=C2=A0 @Override
= =C2=A0=C2=A0=C2=A0 public TextVertexOutputFormat<Text, TextAndDoubleComp= lexWritable, DoubleWritable>.TextVertexWriter createVertexWriter(
=C2= =A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 TaskAttemptContext co= ntext) throws IOException,
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0= =C2=A0=C2=A0 InterruptedException {

=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0= =C2=A0 return new IdWithValueVertexWriter();
=C2=A0=C2=A0=C2=A0 }
=C2=A0=C2=A0=C2=A0 /**
=C2=A0=C2=A0=C2=A0 =C2=A0* Vertex writer used wi= th {@link IdWithValueTextOutputFormat}.
=C2=A0=C2=A0=C2=A0 =C2=A0*/
= =C2=A0=C2=A0=C2=A0 protected class IdWithValueVertexWriter extends TextVert= exWriterToEachLine {
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 /** Saved del= imiter */
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 private String delimiter= ;
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 /** Cached reserve option */
= =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 private boolean reverseOutput;
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 @Override
=C2=A0=C2=A0=C2=A0 =C2= =A0=C2=A0=C2=A0 public void initialize(TaskAttemptContext context) throws I= OException,
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2= =A0=C2=A0=C2=A0 InterruptedException {
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0= =C2=A0 =C2=A0=C2=A0=C2=A0 super.initialize(context);
=C2=A0=C2=A0=C2=A0 = =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 delimiter =3D getConf().get(LINE_TOKE= NIZE_VALUE,
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2= =A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 LINE_TOKENIZE_VALUE_DEFAULT);
=C2=A0= =C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 reverseOutput =3D getCon= f().getBoolean(REVERSE_ID_AND_VALUE,
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2= =A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 REVERSE_ID_AND= _VALUE_DEFAULT);
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 }

=C2=A0= =C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 protected Text convertVertexToLine(
=C2= =A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 Ve= rtex<Text, TextAndDoubleComplexWritable, DoubleWritable> vertex)
= =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0= throws IOException {
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0= =C2=A0 StringBuilder str =3D new StringBuilder();
=C2=A0=C2=A0=C2=A0 =C2= =A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 if (reverseOutput) {
=C2=A0=C2=A0=C2= =A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 imprimirCamino= sNavegacionales(vertex, str);
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2= =A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 str.append(delimiter);
=C2=A0=C2=A0= =C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 str.append(= vertex.getId().toString());
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0= =C2=A0=C2=A0 } else {
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0= =C2=A0 =C2=A0=C2=A0=C2=A0 str.append(vertex.getId().toString());
=C2=A0= =C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 str.a= ppend(delimiter);
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2= =A0 =C2=A0=C2=A0=C2=A0 imprimirCaminosNavegacionales(vertex, str);
=C2= =A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 }
=C2=A0=C2=A0=C2= =A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 return new Text(str.toString());<= br>=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 }

=C2=A0=C2=A0=C2=A0 =C2=A0= =C2=A0=C2=A0 private void imprimirCaminosNavegacionales(
=C2=A0=C2=A0=C2= =A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 Vertex<Text= , TextAndDoubleComplexWritable, DoubleWritable> vertex,
=C2=A0=C2=A0= =C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 StringBuild= er str) {
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 str.a= ppend(vertex.getId());
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2= =A0=C2=A0 str.append(LINE_TOKENIZE_VALUE_DEFAULT);
=C2=A0=C2=A0=C2=A0 = =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 for (String idVerticeAnterior : verte= x.getValue()
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 = =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 .getIds_vertices_anteriores()
=C2= =A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 = =C2=A0=C2=A0=C2=A0 .split(LINE_TOKENIZE_VALUE_DEFAULT)) {
=C2=A0=C2=A0= =C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 str.append(= idVerticeAnterior + "/" + vertex.getId());
=C2=A0=C2=A0=C2=A0 = =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 str.append(LINE_TO= KENIZE_VALUE_DEFAULT);
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2= =A0=C2=A0 }
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 str= .append(vertex.getValue().toString());
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0= =C2=A0 }
=C2=A0=C2=A0=C2=A0 }
}

My input file:
Portada=C2=A0=C2=A0= =C2=A0 0.0=C2=A0=C2=A0=C2=A0 Sugerencias=C2=A0=C2=A0=C2=A0 1.0
Proverbio= s=C2=A0=C2=A0=C2=A0 0.0
Neil=C2=A0=C2=A0=C2=A0 0.0=C2=A0=C2=A0=C2=A0 Lun= a=C2=A0=C2=A0=C2=A0 1.0=C2=A0=C2=A0=C2=A0 ideal=C2=A0=C2=A0=C2=A0 1.0=C2=A0= =C2=A0=C2=A0 verdad=C2=A0=C2=A0=C2=A0 1.0=C2=A0=C2=A0=C2=A0 Categoria:Ingen= ieros=C2=A0=C2=A0=C2=A0 2.0=C2=A0=C2=A0=C2=A0 Categoria:Estadounidenses=C2= =A0=C2=A0=C2=A0 2.0=C2=A0=C2=A0=C2=A0 Categoria:Astronautas=C2=A0=C2=A0=C2= =A0 2.0
Categoria:Ingenieros=C2=A0=C2=A0=C2=A0 1.0=C2=A0=C2=A0=C2=A0 Nei= l=C2=A0=C2=A0=C2=A0 2.0
Categoria:Estadounidenses=C2=A0=C2=A0=C2=A0 1.0= =C2=A0=C2=A0=C2=A0 Neil=C2=A0=C2=A0=C2=A0 2.0
Categoria:Astronautas=C2= =A0=C2=A0=C2=A0 1.0=C2=A0=C2=A0=C2=A0 Neil=C2=A0=C2=A0=C2=A0 2.0
=

and i execute it with this command:

$HADOOP_HOME/bin/yarn jar $GIRAPH= _HOME/giraph-examples/target/giraph-examples-1.1.0-for-hadoop-2.4.0-jar-wit= h-dependencies.jar org.apache.giraph.GiraphRunner lectura_de_grafo.Busqueda= DeCaminosNavegacionalesWikiquote -vif pruebas.IdTextWithComplexValueInputFo= rmat -vip /user/hduser/input/wiki-graph-chiquito.txt -vof pruebas.IdTextWit= hComplexValueOutputFormat -op /user/hduser/output/caminosNavegacionales -w = 2 -yh 250


--001a113dd1328d845b051f445b89--