Package org.apache.hadoop.fs

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


        // write the jobtracker.info file
        try {
          FSDataOutputStream out = FileSystem.create(fs, restartFile,
                                                     filePerm);
          out.writeInt(0);
          out.close();
        } catch (IOException ioe) {
          LOG.warn("Writing to file " + restartFile + " failed!");
          LOG.warn("FileSystem is not ready yet!");
          fs.delete(restartFile, false);
View Full Code Here


      //TODO This is similar to jobhistory recovery, maybe this common code
      //      can be factored out.
     
      // write to the tmp file
      FSDataOutputStream out = FileSystem.create(fs, tmpRestartFile, filePerm);
      out.writeInt(restartCount);
      out.close();

      // delete the main file
      fs.delete(restartFile, false);
     
View Full Code Here

      Path recoveredEditsDir = HLog.getRegionDirRecoveredEditsDir(regiondir);
      for (int i = 1000; i < 1050; i += 10) {
        Path recoveredEdits = new Path(
            recoveredEditsDir, String.format("%019d", i));
        FSDataOutputStream dos=  fs.create(recoveredEdits);
        dos.writeInt(i);
        dos.close();
      }
      long minSeqId = 2000;
      Path recoveredEdits = new Path(
          recoveredEditsDir, String.format("%019d", minSeqId-1));
View Full Code Here

  public static void writeInt(int value, Path path, Configuration conf) throws IOException {
    FileSystem fs = FileSystem.get(path.toUri(), conf);
    FSDataOutputStream out = fs.create(path);
    try {
      out.writeInt(value);
    } finally {
      Closeables.closeQuietly(out);
    }
  }
View Full Code Here

      WritableUtils.writeString(output, MLPType);
      output.writeDouble(learningRate);
      output.writeDouble(regularization);
      output.writeDouble(momentum);
      output.writeInt(numberOfLayers);
      WritableUtils.writeString(output, squashingFunctionName);
      WritableUtils.writeString(output, costFunctionName);

      // write the number of neurons for each layer
      for (int i = 0; i < numberOfLayers; ++i) {
View Full Code Here

      WritableUtils.writeString(output, squashingFunctionName);
      WritableUtils.writeString(output, costFunctionName);

      // write the number of neurons for each layer
      for (int i = 0; i < numberOfLayers; ++i) {
        output.writeInt(layerSizeArray[i]);
      }

      double[][] matrix01 = { // 4 by 2
      { 0.5, 0.2 }, { 0.1, 0.1 }, { 0.2, 0.5 }, { 0.1, 0.5 } };
View Full Code Here

      // serialize the feature transformer
      FeatureTransformer transformer = new DefaultFeatureTransformer();
      Class<? extends FeatureTransformer> featureTransformerCls = transformer.getClass();
      byte[] featureTransformerBytes = SerializationUtils.serialize(featureTransformerCls);
      output.writeInt(featureTransformerBytes.length);
      output.write(featureTransformerBytes);
     
      output.close();

    } catch (IOException e) {
View Full Code Here

        // write the jobtracker.info file
        try {
          FSDataOutputStream out = FileSystem.create(fs, restartFile,
                                                     filePerm);
          out.writeInt(0);
          out.close();
        } catch (IOException ioe) {
          LOG.warn("Writing to file " + restartFile + " failed!");
          LOG.warn("FileSystem is not ready yet!");
          fs.delete(restartFile, false);
View Full Code Here

      //TODO This is similar to jobhistory recovery, maybe this common code
      //      can be factored out.
     
      // write to the tmp file
      FSDataOutputStream out = FileSystem.create(fs, tmpRestartFile, filePerm);
      out.writeInt(restartCount);
      out.close();

      // delete the main file
      fs.delete(restartFile, false);
     
View Full Code Here

    //write the serialized task information to a file to pass to the truncater
    Path taskRanFilePath =
      ldirAlloc.getLocalPathForWrite(taskRanFile, conf);
    LocalFileSystem lfs = FileSystem.getLocal(conf);
    FSDataOutputStream out = lfs.create(taskRanFilePath);
    out.writeInt(allAttempts.size());
    for (Task t : allAttempts) {
      out.writeBoolean(t.isMapTask());
      t.write(out);
    }
    out.close();
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.