You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apex.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2017/12/01 05:44:00 UTC

[jira] [Commented] (APEXMALHAR-2550) NycTaxiDataReader throws exception when encountering lines with unrecognized format in the NYC taxi example

    [ https://issues.apache.org/jira/browse/APEXMALHAR-2550?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16273966#comment-16273966 ] 

ASF GitHub Bot commented on APEXMALHAR-2550:
--------------------------------------------

asfgit closed pull request #681: APEXMALHAR-2550 use the launch machine host name for default pub/sub address
URL: https://github.com/apache/apex-malhar/pull/681
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/examples/nyctaxi/src/main/java/org/apache/apex/examples/nyctaxi/Application.java b/examples/nyctaxi/src/main/java/org/apache/apex/examples/nyctaxi/Application.java
index a484ec76e2..a59c3a401c 100644
--- a/examples/nyctaxi/src/main/java/org/apache/apex/examples/nyctaxi/Application.java
+++ b/examples/nyctaxi/src/main/java/org/apache/apex/examples/nyctaxi/Application.java
@@ -21,6 +21,7 @@
 
 import java.net.URI;
 import java.net.URISyntaxException;
+import java.net.UnknownHostException;
 
 import org.joda.time.Duration;
 
@@ -33,6 +34,7 @@
 import org.apache.apex.malhar.lib.window.impl.KeyedWindowedOperatorImpl;
 import org.apache.commons.lang3.mutable.MutableDouble;
 import org.apache.hadoop.conf.Configuration;
+
 import com.google.common.base.Throwables;
 
 import com.datatorrent.api.DAG;
@@ -87,16 +89,16 @@ public void populateDAG(DAG dag, Configuration conf)
     wsQuery.enableEmbeddedMode();
     wsQuery.setTopic("nyctaxi.query");
     try {
-      wsQuery.setUri(new URI("ws://localhost:8890/pubsub"));
-    } catch (URISyntaxException ex) {
+      wsQuery.setUri(new URI("ws://" + java.net.InetAddress.getLocalHost().getHostName() + ":8890/pubsub"));
+    } catch (URISyntaxException | UnknownHostException ex) {
       throw Throwables.propagate(ex);
     }
     dataServer.setEmbeddableQueryInfoProvider(wsQuery);
     PubSubWebSocketAppDataResult wsResult = dag.addOperator("QueryResult", new PubSubWebSocketAppDataResult());
     wsResult.setTopic("nyctaxi.result");
     try {
-      wsResult.setUri(new URI("ws://localhost:8890/pubsub"));
-    } catch (URISyntaxException ex) {
+      wsResult.setUri(new URI("ws://" + java.net.InetAddress.getLocalHost().getHostName() + ":8890/pubsub"));
+    } catch (URISyntaxException | UnknownHostException ex) {
       throw Throwables.propagate(ex);
     }
     dag.addStream("server_to_query_output", dataServer.queryResult, wsResult.input);


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


> NycTaxiDataReader throws exception when encountering lines with unrecognized format in the NYC taxi example
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: APEXMALHAR-2550
>                 URL: https://issues.apache.org/jira/browse/APEXMALHAR-2550
>             Project: Apache Apex Malhar
>          Issue Type: Bug
>            Reporter: David Yan
>            Assignee: David Yan
>
> 17/11/28 16:21:42 ERROR engine.StreamingContainer: Operator set [OperatorDeployInfo[id=1,name=NycTaxiDataReader,type=INPUT,checkpoint={ffffffffffffffff, 0, 0},inputs=[],outputs=[OperatorDeployInfo.OutputDeployInfo[portName=output,streamId=input_to_parser,bufferServer=localhost]]]] stopped running due to an exception.
> java.lang.ArrayIndexOutOfBoundsException: 1
> 	at org.apache.apex.examples.nyctaxi.NycTaxiDataReader.readEntity(NycTaxiDataReader.java:58)
> 	at org.apache.apex.examples.nyctaxi.NycTaxiDataReader.readEntity(NycTaxiDataReader.java:34)
> 	at com.datatorrent.lib.io.fs.AbstractFileInputOperator.emitTuples(AbstractFileInputOperator.java:684)
> 	at com.datatorrent.stram.engine.InputNode.run(InputNode.java:124)
> and
> ask=0,partitionKeys=<null>]],outputs=[OperatorDeployInfo.OutputDeployInfo[portName=output,streamId=parser_to_extractor,bufferServer=localhost]]]] stopped running due to an exception.
> java.lang.ArrayIndexOutOfBoundsException: 18
> at org.apache.apex.examples.nyctaxi.NycTaxiCsvParser$1.process(NycTaxiCsvParser.java:49)
> at org.apache.apex.examples.nyctaxi.NycTaxiCsvParser$1.process(NycTaxiCsvParser.java:39)
> at com.datatorrent.api.DefaultInputPort.put(DefaultInputPort.java:79)
> at com.datatorrent.stram.stream.BufferServerSubscriber$BufferReservoir.sweep(BufferServerSubscriber.java:288)
> at com.datatorrent.stram.engine.GenericNode.run(GenericNode.java:269)
> at com.datatorrent.stram.engine.StreamingContainer$2.run(StreamingContainer.java:1428)



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)