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

    https://github.com/apache/spark/pull/552#discussion_r12353063
  
    --- Diff: examples/src/main/java/org/apache/spark/examples/JavaTC.java ---
    @@ -61,14 +62,9 @@
       }
     
       public static void main(String[] args) {
    -    if (args.length == 0) {
    -      System.err.println("Usage: JavaTC <host> [<slices>]");
    -      System.exit(1);
    -    }
    -
    -    JavaSparkContext sc = new JavaSparkContext(args[0], "JavaTC",
    -        System.getenv("SPARK_HOME"), 
JavaSparkContext.jarOfClass(JavaTC.class));
    -    Integer slices = (args.length > 1) ? Integer.parseInt(args[1]): 2;
    +    SparkConf sparkConf = new 
org.apache.spark.SparkConf().setAppName("JavaHdfsLR");
    +    JavaSparkContext sc = new JavaSparkContext(sparkConf);
    +    Integer slices = (args.length > 0) ? Integer.parseInt(args[0]): 2;
    --- End diff --
    
    Yeah, in scala we have no space before colon, but this is a common pattern 
in Java (e.g. `bool ? 1 : 2` is short-hand for `if (bool) { 1 } else { 2 }`). 
We do this elsewhere in other examples, actually.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to