Examples of writeChars()


Examples of org.apache.hadoop.fs.FSDataOutputStream.writeChars()

    assertEquals(DUMMY_FS_URI, FileSystem.getDefaultUri(conf).toString());
    // add a local file
    Path localPath = new Path("testFile1");
    FileSystem lfs = FileSystem.getLocal(conf);
    FSDataOutputStream dos = lfs.create(localPath);
    dos.writeChars("Local file for CFIF");
    dos.close();

    Job job = Job.getInstance(conf);
    FileInputFormat.setInputPaths(job, lfs.makeQualified(localPath));
    DummyInputFormat inFormat = new DummyInputFormat();
View Full Code Here

Examples of org.apache.hadoop.fs.FSDataOutputStream.writeChars()

    Path homedir = store.getHomedir();
    Path dstPath = new Path(homedir, origPath.getName());
    FSDataOutputStream stream = fs.create(origPath, null, true, 512, (short) 3,
        (long) 1024,
        null);
    stream.writeChars("CORRUPT FILE!!!!");
    stream.close();

    try {
      store.completeCompaction(storeFiles, compactedFile);
    } catch (Exception e) {
View Full Code Here

Examples of org.apache.hadoop.fs.FSDataOutputStream.writeChars()

          if (ofile == null) {
            // this is the first value, it contains the name of the input file
            ofile = fs.create(new Path(outputPath, value).suffix(".out"));
          } else {
            // The key contains the correct label of the data. The value contains a prediction
            ofile.writeChars(value); // write the prediction
            ofile.writeChar('\n');

            resList.add(new double[]{key, Double.valueOf(value)});
          }
        }
View Full Code Here

Examples of org.apache.hadoop.fs.FSDataOutputStream.writeChars()

      Instance instance = converter.convert(0, line);
      int prediction = forest.classify(rng, instance);

      if (outputPath != null) {
        ofile.writeChars(Integer.toString(prediction)); // write the prediction
        ofile.writeChar('\n');
      }

      if (analyzer != null) {
        analyzer.addInstance(dataset.getLabel(instance.getLabel()),
View Full Code Here

Examples of org.apache.hadoop.fs.FSDataOutputStream.writeChars()

          if (ofile == null) {
            // this is the first value, it contains the name of the input file
            ofile = fs.create(new Path(outputPath, value.toString()).suffix(".out"));
          } else {
            // The key contains the correct label of the data. The value contains a prediction
            ofile.writeChars(value.toString()); // write the prediction
            ofile.writeChar('\n');

            if (analyzer != null) {
                analyzer.addInstance(
                        dataset.getLabel((int)key.get()),
View Full Code Here

Examples of org.apache.hadoop.fs.FSDataOutputStream.writeChars()

    // Now lets corrupt the compacted file.
    FileSystem fs = store.getFileSystem();
    // default compaction policy created one and only one new compacted file
    Path dstPath = store.getRegionFileSystem().createTempName();
    FSDataOutputStream stream = fs.create(dstPath, null, true, 512, (short)3, (long)1024, null);
    stream.writeChars("CORRUPT FILE!!!!");
    stream.close();
    Path origPath = store.getRegionFileSystem().commitStoreFile(
      Bytes.toString(COLUMN_FAMILY), dstPath);

    try {
View Full Code Here

Examples of org.apache.hadoop.fs.FSDataOutputStream.writeChars()

        }

        FSDataOutputStream os = fs.create(path);

        for (int i = 0; i < rowCount; i++) {
            os.writeChars(i + "\n");
        }

        os.close();
    }
View Full Code Here

Examples of org.apache.hadoop.fs.FSDataOutputStream.writeChars()

        if (fs.exists(path)) {
            fs.delete(path, true);
        }
        FSDataOutputStream os = fs.create(path);
        for (int i = 0; i < rowCount; i++) {
            os.writeChars(i + "\n");
        }
        os.close();
    }

    public static class MapFail extends
View Full Code Here

Examples of org.apache.hadoop.fs.FSDataOutputStream.writeChars()

            finished.add(dr);
          }

          // mark each finished region as successfully split.
          for (Pair<byte[], byte[]> region : finished) {
            splitOut.writeChars("- " + splitAlgo.rowToStr(region.getFirst())
                + " " + splitAlgo.rowToStr(region.getSecond()) + "\n");
            splitCount++;
            if (splitCount % 10 == 0) {
              long tDiff = (System.currentTimeMillis() - startTime)
                  / splitCount;
View Full Code Here

Examples of org.apache.hadoop.fs.FSDataOutputStream.writeChars()

          if (finished.isEmpty()) {
            Thread.sleep(30 * 1000);
          } else {
            outstanding.removeAll(finished);
            for (Pair<byte[], byte[]> region : finished) {
              splitOut.writeChars("- " + splitAlgo.rowToStr(region.getFirst())
                  + " " + splitAlgo.rowToStr(region.getSecond()) + "\n");
            }
          }
        }
      }
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.