Package org.apache.hadoop.fs

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


      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


        // 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

        // <number of files>
        // <used file prefix 0><used file prefix 1>...
        // <aggregator data length><aggregators as a serialized JSON byte array>
        FSDataOutputStream finalizedOutputStream =
            getFs().create(finalizedCheckpointPath);
        finalizedOutputStream.writeInt(chosenWorkerInfoList.size());
        for (WorkerInfo chosenWorkerInfo : chosenWorkerInfoList) {
            String chosenWorkerInfoPrefix =
                getCheckpointBasePath(superstep) + "." +
                chosenWorkerInfo.getHostnameId();
            finalizedOutputStream.writeUTF(chosenWorkerInfoPrefix);
View Full Code Here

        String mergedAggregatorPath =
            getMergedAggregatorPath(getApplicationAttempt(), superstep - 1);
        if (getZkExt().exists(mergedAggregatorPath, false) != null) {
            byte [] aggregatorZkData =
                getZkExt().getData(mergedAggregatorPath, false, null);
            finalizedOutputStream.writeInt(aggregatorZkData.length);
            finalizedOutputStream.write(aggregatorZkData);
        }
        else {
            finalizedOutputStream.writeInt(0);
        }
View Full Code Here

                getZkExt().getData(mergedAggregatorPath, false, null);
            finalizedOutputStream.writeInt(aggregatorZkData.length);
            finalizedOutputStream.write(aggregatorZkData);
        }
        else {
            finalizedOutputStream.writeInt(0);
        }
        finalizedOutputStream.close();
        lastCheckpointedSuperstep = superstep;
        lastCheckpointedSuperstepCounter.increment(superstep -
            lastCheckpointedSuperstepCounter.getValue());
View Full Code Here

      Path recoveredEditsDir = HLogUtil.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));
      FSDataOutputStream dos = fs.create(recoveredEdits);
View Full Code Here

        fs.delete(new Path(temp2), true);

        int sum = 0;
        FSDataOutputStream os = fs.create(new Path(temp2), false);
        os.writeInt(al.size() + 1);
        for (IntWritable l: al) {
            os.writeInt(sum);
            sum += l.get();
        }
        os.writeInt(sum);
View Full Code Here

        int sum = 0;
        FSDataOutputStream os = fs.create(new Path(temp2), false);
        os.writeInt(al.size() + 1);
        for (IntWritable l: al) {
            os.writeInt(sum);
            sum += l.get();
        }
        os.writeInt(sum);
        os.close();
        System.out.println(sum);
View Full Code Here

        os.writeInt(al.size() + 1);
        for (IntWritable l: al) {
            os.writeInt(sum);
            sum += l.get();
        }
        os.writeInt(sum);
        os.close();
        System.out.println(sum);


        {
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.