Examples of readTextFile()


Examples of org.apache.crunch.impl.mr.MRPipeline.readTextFile()

  @Test
  public void testCompressText() throws Exception {
    String urlsFile = tmpDir.copyResourceFileName("urls.txt");
    String out = tmpDir.getFileName("out");
    MRPipeline p = new MRPipeline(CompressIT.class, tmpDir.getDefaultConfiguration());
    PCollection<String> in = p.readTextFile(urlsFile);
    in.write(Compress.gzip(To.textFile(out)));
    p.done();
    assertTrue(checkDirContainsExt(out, ".gz"));
  }
View Full Code Here

Examples of org.apache.crunch.impl.mr.MRPipeline.readTextFile()

    File src2 = tmpDir.copyResourceFile(Tests.resource(this, "src2.txt"));
    Files.copy(src1, new File(srcFiles, "src1.txt"));
    Files.copy(src2, new File(srcFiles, "src2.txt"));

    MRPipeline p = new MRPipeline(CombineFileIT.class, tmpDir.getDefaultConfiguration());
    PCollection<String> in = p.readTextFile(srcFiles.getAbsolutePath());
    in.write(To.textFile(outputFiles.getAbsolutePath()));
    p.done();
    assertEquals(4, outputFiles.listFiles().length);
  }
View Full Code Here

Examples of org.apache.crunch.impl.mr.MRPipeline.readTextFile()

    out2.flush();
    out2.close();

    final MRPipeline pipeline = new MRPipeline(MapsideJoinStrategyIT.class, tmpDir.getDefaultConfiguration());

    final PCollection<String> values1 = pipeline.readTextFile(path1.toString());
    final PCollection<String> values2 = pipeline.readTextFile(path2.toString());

    final PTable<Text, Text> convertedValues1 = convertStringToText(values1);
    final PTable<Text, Text> convertedValues2 = convertStringToText(values2);
View Full Code Here

Examples of org.apache.crunch.impl.mr.MRPipeline.readTextFile()

    out2.close();

    final MRPipeline pipeline = new MRPipeline(MapsideJoinStrategyIT.class, tmpDir.getDefaultConfiguration());

    final PCollection<String> values1 = pipeline.readTextFile(path1.toString());
    final PCollection<String> values2 = pipeline.readTextFile(path2.toString());

    final PTable<Text, Text> convertedValues1 = convertStringToText(values1);
    final PTable<Text, Text> convertedValues2 = convertStringToText(values2);

    // for map side join
View Full Code Here

Examples of org.apache.crunch.impl.spark.SparkPipeline.readTextFile()

  @Test
  public void testAvroReflectSortPair() throws IOException {
    Pipeline pipeline = new SparkPipeline("local", "sort");
    pipeline.enableDebug();
    String rsrc = tmpDir.copyResourceFileName("set2.txt");
    PCollection<Pair<String, StringWrapper>> in = pipeline.readTextFile(rsrc)
        .parallelDo(new MapFn<String, Pair<String, StringWrapper>>() {

          @Override
          public Pair<String, StringWrapper> map(String input) {
            return Pair.of(input, wrap(input));
View Full Code Here

Examples of org.apache.crunch.impl.spark.SparkPipeline.readTextFile()

  }

  @Test
  public void testAvroReflectSortTable() throws IOException {
    Pipeline pipeline = new SparkPipeline("local", "sort");
    PTable<String, StringWrapper> unsorted = pipeline.readTextFile(tmpDir.copyResourceFileName("set2.txt")).parallelDo(
        new MapFn<String, Pair<String, StringWrapper>>() {

          @Override
          public Pair<String, StringWrapper> map(String input) {
            return Pair.of(input, wrap(input));
View Full Code Here

Examples of org.apache.flink.api.java.ExecutionEnvironment.readTextFile()

   
    // construct the plan it will be multiple flat maps, all unioned
    // and the "unioned" dataSet will be grouped
    final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
   
    DataSet<String> source = env.readTextFile(IN_FILE);
    DataSet<Tuple2<String, Integer>> lastUnion = source.flatMap(new DummyFlatMap());
 
    for (int i = 1; i< NUM_INPUTS; i++){
      lastUnion = lastUnion.union(source.flatMap(new DummyFlatMap()));
    }
View Full Code Here

Examples of org.apache.flink.streaming.api.environment.LocalStreamEnvironment.readTextFile()

      fail();
    } catch (RuntimeException e) {
    }

    try {
      env.readTextFile("random/path/that/is/not/valid");
      fail();
    } catch (IllegalArgumentException e) {
    }
  }
View Full Code Here

Examples of org.platformlayer.ops.OpsTarget.readTextFile()

      return;
    }

    String fstabLine = "\ncgroup\t/cgroup\tcgroup\tdefaults\t0\t0";
    File fstabFile = new File("/etc/fstab");
    String fstab = target.readTextFile(fstabFile);
    fstab += fstabLine;
    FileUpload.upload(target, fstabFile, fstab);

    target.mkdir(cgroupsFile);
View Full Code Here

Examples of org.platformlayer.ops.OpsTarget.readTextFile()

    @Override
    protected byte[] getContentsBytes() throws OpsException {
      if (!built) {
        OpsTarget target = OpsContext.get().getInstance(OpsTarget.class);

        String etcIssue = target.readTextFile(new File("/etc/issue"));
        if (etcIssue.startsWith("Debian")) {
          addDefaultsDebian(target);
        } else if (etcIssue.startsWith("Ubuntu")) {
          addDefaultsUbuntu(target);
        } else {
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.