Package org.apache.hadoop.fs

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


    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

          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

        Instance instance = converter.convert(line);
        double prediction = forest.classify(dataset, rng, instance);

        if (ofile != null) {
          ofile.writeChars(Double.toString(prediction)); // write the prediction
          ofile.writeChar('\n');
        }
       
        results.add(new double[] {dataset.getLabel(instance), prediction});
      }
View Full Code Here

        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

        }

        FSDataOutputStream os = fs.create(path);

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

        os.close();
    }
View Full Code Here

    long nTasks = Long.parseLong(conf.get("dfs.nTasks"));
    long nmaps = Long.parseLong(conf.get("dfs.nmaps"));


    out.writeChars("-----------------------------\n");
    out.writeChars("Number of tasks:\t" + nmaps + "\n");
    out.writeChars("Files per task:\t\t" + nTasks + "\n");
    float min = Float.MAX_VALUE;
    float max = Float.MIN_VALUE;
View Full Code Here

    long nTasks = Long.parseLong(conf.get("dfs.nTasks"));
    long nmaps = Long.parseLong(conf.get("dfs.nmaps"));


    out.writeChars("-----------------------------\n");
    out.writeChars("Number of tasks:\t" + nmaps + "\n");
    out.writeChars("Files per task:\t\t" + nTasks + "\n");
    float min = Float.MAX_VALUE;
    float max = Float.MIN_VALUE;

    // TODO Auto-generated method stub
View Full Code Here

    long nmaps = Long.parseLong(conf.get("dfs.nmaps"));


    out.writeChars("-----------------------------\n");
    out.writeChars("Number of tasks:\t" + nmaps + "\n");
    out.writeChars("Files per task:\t\t" + nTasks + "\n");
    float min = Float.MAX_VALUE;
    float max = Float.MIN_VALUE;

    // TODO Auto-generated method stub
    for (; values.hasNext();) {
View Full Code Here

      // String.valueOf(ioRate)));
      // out.writeChars(bufferSize + " bytes\t\t" + ioRate +
      // " Mb/s\n");
      averageIORate += ioRate;
    }
    out.writeChars("Min\t\t\t" + min + "\n");
    out.writeChars("Max\t\t\t" + max + "\n");
    averageIORate /= size;
    float temp = (float) 0.0;
    for (int i = 0; i < list.size(); i++) {
      temp += Math.pow(list.get(i) - averageIORate, 2);
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.