Package org.apache.hadoop.fs

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


      int wait, int retries) 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 {
    while (true) {
      try {
        Path filePath = new Path(rootdir, HConstants.CLUSTER_ID_FILE_NAME);
        FSDataOutputStream s = fs.create(filePath);
        s.writeUTF(clusterId);
        s.close();
        if (LOG.isDebugEnabled()) {
          LOG.debug("Created cluster ID file at " + filePath.toString() +
              " with ID: " + clusterId);
        }
View Full Code Here

              if(s.indexOf("@abtest@")>=0)
              {
                String[] sss=s.split("@abtest@");
                if(sss.length>1)
                {
                  outputB.writeUTF(sss[1]+"\r\n");
                break;
                }

              }
            }
View Full Code Here

    public void input_invalid() throws Exception {
        LocalFileSystem fs = FileSystem.getLocal(conf);
        Path path = new Path(folder.newFile("testing").toURI());
        FSDataOutputStream output = fs.create(path);
        try {
            output.writeUTF("Hello, world!");
        } finally {
            output.close();
        }
        ModelInput<StringOption> in = format.createInput(
                StringOption.class,
View Full Code Here

      int wait, int retries) 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 {
    while (true) {
      try {
        Path filePath = new Path(rootdir, HConstants.CLUSTER_ID_FILE_NAME);
        FSDataOutputStream s = fs.create(filePath);
        s.writeUTF(clusterId);
        s.close();
        if (LOG.isDebugEnabled()) {
          LOG.debug("Created cluster ID file at " + filePath.toString() +
              " with ID: " + clusterId);
        }
View Full Code Here

    Path versionFile = new Path(rootdir, HConstants.VERSION_FILE_NAME);
    Path tmpFile = new Path(new Path(rootdir, HConstants.HBASE_TEMP_DIRECTORY), HConstants.VERSION_FILE_NAME);
    while (true) {
      try {
        FSDataOutputStream s = fs.create(tmpFile);
        s.writeUTF(version);
        s.close();
        if (!fs.rename(tmpFile, versionFile)) {
          throw new IOException("Unable to move temp version file to " + versionFile);
        }
        LOG.debug("Created version file at " + rootdir.toString() +
View Full Code Here

    Path idFfile = new Path(rootdir, HConstants.CLUSTER_ID_FILE_NAME);
    Path tmpFile = new Path(new Path(rootdir, HConstants.HBASE_TEMP_DIRECTORY), HConstants.CLUSTER_ID_FILE_NAME);
    while (true) {
      try {
        FSDataOutputStream s = fs.create(tmpFile);
        s.writeUTF(clusterId);
        s.close();
        if (!fs.rename(tmpFile, idFfile)) {
          throw new IOException("Unable to move temp version file to " + idFfile);
        }
        if (LOG.isDebugEnabled()) {
View Full Code Here

   * @throws IOException
   */
  public static void setVersion(FileSystem fs, Path rootdir) throws IOException {
    FSDataOutputStream s =
      fs.create(new Path(rootdir, HConstants.VERSION_FILE_NAME));
    s.writeUTF(HConstants.FILE_SYSTEM_VERSION);
    s.close();
  }

  /**
   * Verifies root directory path is a valid URI with a scheme
View Full Code Here

      Path widgetFile = new Path(widgetPath.toString());
      FileSystem fs;
      try {
        fs = FileSystem.get(config);
        FSDataOutputStream out = fs.create(widgetFile,true);
        out.writeUTF(widget.deserialize().toString());
        out.close();
      } catch (IOException ex) {
        log.error(ExceptionUtil.getStackTrace(ex));
      }
      cacheWidgets();
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.