Package org.apache.hadoop.fs

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


      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();
      doneDirFS.setPermission(qualifiedSummaryDoneFile, new FsPermission(
          JobHistoryUtils.HISTORY_INTERMEDIATE_FILE_PERMISSIONS));
    } catch (IOException e) {
      LOG.info("Unable to write out JobSummaryInfo to ["
View Full Code Here


    cnt = 0;
    sLogger.info("Writing " + outputFile);
    FSDataOutputStream out = fs.create(new Path(outputFile), true);
    out.writeInt(list.size());
    for (int i = 0; i < list.size(); i++) {
      out.writeUTF(list.get(i));
      cnt++;
      if (cnt % 100000 == 0) {
        sLogger.info(cnt + " docs");
      }
    }
View Full Code Here

        root.addServlet(new ServletHolder(new FetchDocidServlet()), "/fetch_docid");
        root.addServlet(new ServletHolder(new FetchDocnoServlet()), "/fetch_docno");
        root.addServlet(new ServletHolder(new HomeServlet()), "/");

        FSDataOutputStream out = FileSystem.get(conf).create(tmpPath, true);
        out.writeUTF(host);
        out.close();

        try {
          server.start();
        } catch (Exception e) {
View Full Code Here

  }

  public static void writeString(FileSystem fs, String path, String val) {
    try {
      FSDataOutputStream out = fs.create(new Path(path), true);
      out.writeUTF(val);
      out.close();
    } catch (IOException e) {
      e.printStackTrace();
    }
  }
View Full Code Here

    Path upper = path(mixedCaseFilename);
    Path lower = path(mixedCaseFilename.toLowerCase(Locale.ENGLISH));
    assertFalse("File exists" + upper, fs.exists(upper));
    assertFalse("File exists" + lower, fs.exists(lower));
    FSDataOutputStream out = fs.create(upper);
    out.writeUTF("UPPER");
    out.close();
    FileStatus upperStatus = fs.getFileStatus(upper);
    assertExists("Original upper case file" + upper, upper);
    //verify the lower-case version of the filename doesn't exist
    assertPathDoesNotExist("lower case file", lower);
View Full Code Here

    //verify the lower-case version of the filename doesn't exist
    assertPathDoesNotExist("lower case file", lower);
    //now overwrite the lower case version of the filename with a
    //new version.
    out = fs.create(lower);
    out.writeUTF("l");
    out.close();
    assertExists("lower case file", lower);
    //verifEy the length of the upper file hasn't changed
    assertExists("Original upper case file " + upper, upper);
    FileStatus newStatus = fs.getFileStatus(upper);
View Full Code Here

      root.addServlet(new ServletHolder(new FetchDocnoServlet()), "/fetch_docno");
      root.addServlet(new ServletHolder(new FetchDocContentServlet()), "/fetch_content");
      root.addServlet(new ServletHolder(new HomeServlet()), "/");

      FSDataOutputStream out = FileSystem.get(conf).create(tmpPath, true);
      out.writeUTF(host);
      out.close();

      try {
        server.start();
      } catch (Exception e) {
View Full Code Here

    LOG.info("Writing index file...");
    LineReader reader = new LineReader(fs.open(new Path(outputPath + "/part-00000")));
    FSDataOutputStream out = fs.create(new Path(indexFile), true);

    out.writeUTF(IndexableAnchorTextForwardIndex.class.getName());
    out.writeUTF(collectionPath);
    out.writeInt(blocks);

    int cnt = 0;
    Text line = new Text();
View Full Code Here

    LOG.info("Writing index file...");
    LineReader reader = new LineReader(fs.open(new Path(outputPath + "/part-00000")));
    FSDataOutputStream out = fs.create(new Path(indexFile), true);

    out.writeUTF(IndexableAnchorTextForwardIndex.class.getName());
    out.writeUTF(collectionPath);
    out.writeInt(blocks);

    int cnt = 0;
    Text line = new Text();
    while (reader.readLine(line) > 0) {
View Full Code Here

    cnt = 0;
    LOG.info("Writing " + output);
    FSDataOutputStream out = fs.create(output, true);
    out.writeInt(list.size());
    for (int i = 0; i < list.size(); i++) {
      out.writeUTF(list.get(i));
      cnt++;
      if (cnt % 100000 == 0) {
        LOG.info(cnt + " docs");
      }
    }
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.