Package org.apache.hadoop.fs

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


   */
  public static void setVersion(FileSystem fs, Path rootdir, String version)
  throws IOException {
    FSDataOutputStream s =
      fs.create(new Path(rootdir, HConstants.VERSION_FILE_NAME));
    s.writeUTF(version);
    s.close();
    LOG.debug("Created version file at " + rootdir.toString() + " set its version at:" + version);
  }

  /**
 
View Full Code Here


        finalizedOutputStream.writeInt(chosenWorkerInfoList.size());
        for (WorkerInfo chosenWorkerInfo : chosenWorkerInfoList) {
            String chosenWorkerInfoPrefix =
                getCheckpointBasePath(superstep) + "." +
                chosenWorkerInfo.getHostnameId();
            finalizedOutputStream.writeUTF(chosenWorkerInfoPrefix);
        }
        String mergedAggregatorPath =
            getMergedAggregatorPath(getApplicationAttempt(), superstep - 1);
        if (getZkExt().exists(mergedAggregatorPath, false) != null) {
            byte [] aggregatorZkData =
View Full Code Here

      String doneSummaryFileName = getTempFileName(JobHistoryUtils
          .getIntermediateSummaryFileName(jobId));
      qualifiedSummaryDoneFile = doneDirFS.makeQualified(new Path(
          doneDirPrefixPath, doneSummaryFileName));
      summaryFileOut = doneDirFS.create(qualifiedSummaryDoneFile, true);
      summaryFileOut.writeUTF(mi.getJobSummary().getJobSummaryString());
      summaryFileOut.close();
    } catch (IOException e) {
      LOG.info("Unable to write out JobSummaryInfo to ["
          + qualifiedSummaryDoneFile + "]", e);
      throw e;
View Full Code Here

   */
  public static void setVersion(FileSystem fs, Path rootdir, String version)
  throws IOException {
    FSDataOutputStream s =
      fs.create(new Path(rootdir, HConstants.VERSION_FILE_NAME));
    s.writeUTF(version);
    s.close();
    LOG.debug("Created version file at " + rootdir.toString() + " set its version at:" + version);
  }

  /**
 
View Full Code Here

      int wait) throws IOException {
    Path versionFile = new Path(rootdir, HConstants.VERSION_FILE_NAME);
    while (true) {
      try {
        FSDataOutputStream s = fs.create(versionFile);
        s.writeUTF(version);
        LOG.debug("Created version file at " + rootdir.toString() +
            " set its version at:" + version);
        s.close();
        return;
      } catch (IOException e) {
View Full Code Here

      int wait) throws IOException {
    Path versionFile = new Path(rootdir, HConstants.VERSION_FILE_NAME);
    while (true) {
      try {
        FSDataOutputStream s = fs.create(versionFile);
        s.writeUTF(version);
        LOG.debug("Created version file at " + rootdir.toString() +
            " set its version at:" + version);
        s.close();
        return;
      } catch (IOException e) {
View Full Code Here

    syncClient.storeInformation(writeKey, arrWritable, true, null);

    String writePath = "checkpoint/job_checkpttest_0001/3/1";
    FSDataOutputStream out = dfs.create(new Path(writePath));
    for (int i = 0; i < 5; ++i) {
      out.writeUTF(txtMessage.getClass().getCanonicalName());
      txtMessage.write(out);
    }
    out.close();

    @SuppressWarnings("unused")
View Full Code Here

    fs.mkdirs(input);
    LoggerUtils.log(Main.class.getName(), "create dir:" + input.toString());
    Path inputFile = new Path(input, "jingdong");
    if (!fs.exists(inputFile)) {
      FSDataOutputStream file = fs.create(inputFile);
      file.writeUTF("http://www.jd.com");
      file.flush();
      file.close();
    }
    Path output = new Path("/price/jingdong/output/url");
    if (fs.exists(output)) {
View Full Code Here

    if (!fs.exists(file)) {
      output = fs.create(file);
    } else {
      output = fs.append(file);
    }
    output.writeUTF(log);
    output.flush();
    output.close();
  }
}
View Full Code Here

        deldir(hdfs,"/logs");
       
        Path srcPath = new Path("/srcdat", testfilename);
        Path destPath = new Path("/destdat", testfilename);
        FSDataOutputStream out = fs.create(srcPath, true);
        out.writeUTF(srcData);
        out.close();

        out = fs.create(destPath, true);
        out.writeUTF(destData);
        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.