You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by tdas <gi...@git.apache.org> on 2014/10/01 00:20:46 UTC

[GitHub] spark pull request: SPARK-2548 [STREAMING] JavaRecoverableWordCoun...

Github user tdas commented on a diff in the pull request:

    https://github.com/apache/spark/pull/2564#discussion_r18251478
  
    --- Diff: examples/src/main/java/org/apache/spark/examples/streaming/JavaRecoverableNetworkWordCount.java ---
    @@ -0,0 +1,160 @@
    +/*
    + * 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.
    + */
    +
    +package org.apache.spark.examples.streaming;
    +
    +import java.io.File;
    +import java.io.IOException;
    +import java.nio.charset.Charset;
    +import java.util.Arrays;
    +import java.util.regex.Pattern;
    +
    +import scala.Tuple2;
    +import com.google.common.collect.Lists;
    +import com.google.common.io.Files;
    +
    +import org.apache.spark.SparkConf;
    +import org.apache.spark.api.java.JavaPairRDD;
    +import org.apache.spark.api.java.function.FlatMapFunction;
    +import org.apache.spark.api.java.function.Function2;
    +import org.apache.spark.api.java.function.PairFunction;
    +import org.apache.spark.streaming.Durations;
    +import org.apache.spark.streaming.Time;
    +import org.apache.spark.streaming.api.java.JavaDStream;
    +import org.apache.spark.streaming.api.java.JavaPairDStream;
    +import org.apache.spark.streaming.api.java.JavaReceiverInputDStream;
    +import org.apache.spark.streaming.api.java.JavaStreamingContext;
    +import org.apache.spark.streaming.api.java.JavaStreamingContextFactory;
    +
    +/**
    + * Counts words in text encoded with UTF8 received from the network every second.
    + *
    + * Usage: JavaRecoverableNetworkWordCount <hostname> <port> <checkpoint-directory> <output-file>
    + *   <hostname> and <port> describe the TCP server that Spark Streaming would connect to receive
    + *   data. <checkpoint-directory> directory to HDFS-compatible file system which checkpoint data
    + *   <output-file> file to which the word counts will be appended
    + *
    + * <checkpoint-directory> and <output-file> must be absolute paths
    + *
    + * To run this on your local machine, you need to first run a Netcat server
    + *
    + *      `$ nc -lk 9999`
    + *
    + * and run the example as
    + *
    + *      `$ ./bin/run-example org.apache.spark.examples.streaming.JavaRecoverableNetworkWordCount \
    + *              localhost 9999 ~/checkpoint/ ~/out`
    + *
    + * If the directory ~/checkpoint/ does not exist (e.g. running for the first time), it will create
    + * a new StreamingContext (will print "Creating new context" to the console). Otherwise, if
    + * checkpoint data exists in ~/checkpoint/, then it will create StreamingContext from
    + * the checkpoint data.
    + *
    + * To run this example in a local standalone cluster with automatic driver recovery,
    --- End diff --
    
    Can you remove this reference to spark standalone cluster mode? These instructions are old and irrelevant. Please remove from both examples :)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org