Package org.apache.spark.api.java

Examples of org.apache.spark.api.java.JavaDoubleRDD.first()


      List<Double> lengths = new LinkedList<Double>();
      for (String word : s.split(" ")) lengths.add(word.length() * 1.0);
      return lengths;
    });

    Double x = doubles.first();
    Assert.assertEquals(5.0, doubles.first().doubleValue(), 0.01);
    Assert.assertEquals(11, pairs.count());
  }

  @Test
View Full Code Here


      for (String word : s.split(" ")) lengths.add(word.length() * 1.0);
      return lengths;
    });

    Double x = doubles.first();
    Assert.assertEquals(5.0, doubles.first().doubleValue(), 0.01);
    Assert.assertEquals(11, pairs.count());
  }

  @Test
  public void mapsFromPairsToPairs() {
View Full Code Here

        List<Double> lengths = new LinkedList<Double>();
        for (String word : s.split(" ")) lengths.add(word.length() * 1.0);
        return lengths;
      }
    });
    Assert.assertEquals(5.0, doubles.first(), 0.01);
    Assert.assertEquals(11, pairs.count());
  }

  @SuppressWarnings("unchecked")
  @Test
View Full Code Here

      List<Double> lengths = new LinkedList<>();
      for (String word : s.split(" ")) lengths.add(word.length() * 1.0);
      return lengths;
    });

    Double x = doubles.first();
    Assert.assertEquals(5.0, doubles.first(), 0.01);
    Assert.assertEquals(11, pairs.count());
  }

  @Test
View Full Code Here

      for (String word : s.split(" ")) lengths.add(word.length() * 1.0);
      return lengths;
    });

    Double x = doubles.first();
    Assert.assertEquals(5.0, doubles.first(), 0.01);
    Assert.assertEquals(11, pairs.count());
  }

  @Test
  public void mapsFromPairsToPairs() {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.