ml.shifu.guagua.hadoop.ZooKeeperMasterInterceptor.getZookeeperServerFolder()方法的使用及代码示例

x33g5p2x  于2022-02-05 转载在 其他  
字(5.5k)|赞(0)|评价(0)|浏览(95)

本文整理了Java中ml.shifu.guagua.hadoop.ZooKeeperMasterInterceptor.getZookeeperServerFolder()方法的一些代码示例,展示了ZooKeeperMasterInterceptor.getZookeeperServerFolder()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZooKeeperMasterInterceptor.getZookeeperServerFolder()方法的具体详情如下:
包路径:ml.shifu.guagua.hadoop.ZooKeeperMasterInterceptor
类名称:ZooKeeperMasterInterceptor
方法名:getZookeeperServerFolder

ZooKeeperMasterInterceptor.getZookeeperServerFolder介绍

暂无

代码示例

代码示例来源:origin: ShifuML/guagua

@Override
public void postApplication(MasterContext<MASTER_RESULT, WORKER_RESULT> context) {
  if(this.isNeedStartZookeeper) {
    try {
      this.fileSystem.delete(new Path(this.getZookeeperServerFolder(context)), true);
    } catch (IOException e) {
      throw new GuaguaRuntimeException(e);
    }
  }
}

代码示例来源:origin: ml.shifu/guagua-mapreduce

@Override
public void postApplication(MasterContext<MASTER_RESULT, WORKER_RESULT> context) {
  if(this.isNeedStartZookeeper) {
    try {
      this.fileSystem.delete(new Path(this.getZookeeperServerFolder(context)), true);
    } catch (IOException e) {
      throw new GuaguaRuntimeException(e);
    }
  }
}

代码示例来源:origin: ml.shifu/guagua-yarn

@Override
public void postApplication(MasterContext<MASTER_RESULT, WORKER_RESULT> context) {
  if(this.isNeedStartZookeeper) {
    try {
      this.fileSystem.delete(new Path(this.getZookeeperServerFolder(context)), true);
    } catch (IOException e) {
      throw new GuaguaRuntimeException(e);
    }
  }
}

代码示例来源:origin: ShifuML/guagua

@Override
public void postApplication(MasterContext<MASTER_RESULT, WORKER_RESULT> context) {
  if(this.isNeedStartZookeeper) {
    try {
      this.fileSystem.delete(new Path(this.getZookeeperServerFolder(context)), true);
    } catch (IOException e) {
      throw new GuaguaRuntimeException(e);
    }
  }
}

代码示例来源:origin: ShifuML/guagua

/**
 * Write zookeeper server info to HDFS. Then worker can get such info and connect to such server..
 */
private void writeServerInfoToHDFS(MasterContext<MASTER_RESULT, WORKER_RESULT> context,
    String embededZooKeeperServer) {
  String hdfsZookeeperServerFolder = getZookeeperServerFolder(context);
  PrintWriter pw = null;
  try {
    if(!this.fileSystem.exists(new Path(hdfsZookeeperServerFolder))) {
      this.fileSystem.mkdirs(new Path(hdfsZookeeperServerFolder));
    }
    this.zookeeperServerPath = fileSystem.makeQualified(new Path(hdfsZookeeperServerFolder,
        GuaguaConstants.GUAGUA_CLUSTER_ZOOKEEPER_SERVER_FILE));
    LOG.info("Writing hdfs zookeeper server info to {}", this.zookeeperServerPath);
    FSDataOutputStream fos = fileSystem.create(this.zookeeperServerPath);
    pw = new PrintWriter(fos);
    pw.println(embededZooKeeperServer);
    pw.flush();
  } catch (IOException e) {
    LOG.error("Error in writing output.", e);
  } catch (Exception e) {
    LOG.error("Error in writing output.", e);
  } finally {
    IOUtils.closeStream(pw);
  }
}

代码示例来源:origin: ml.shifu/guagua-yarn

/**
 * Write zookeeper server info to HDFS. Then worker can get such info and connect to such server..
 */
private void writeServerInfoToHDFS(MasterContext<MASTER_RESULT, WORKER_RESULT> context,
    String embededZooKeeperServer) {
  String hdfsZookeeperServerFolder = getZookeeperServerFolder(context);
  PrintWriter pw = null;
  try {
    if(!this.fileSystem.exists(new Path(hdfsZookeeperServerFolder))) {
      this.fileSystem.mkdirs(new Path(hdfsZookeeperServerFolder));
    }
    this.zookeeperServerPath = fileSystem.makeQualified(new Path(hdfsZookeeperServerFolder,
        GuaguaConstants.GUAGUA_CLUSTER_ZOOKEEPER_SERVER_FILE));
    LOG.info("Writing hdfs zookeeper server info to {}", this.zookeeperServerPath);
    FSDataOutputStream fos = fileSystem.create(this.zookeeperServerPath);
    pw = new PrintWriter(fos);
    pw.println(embededZooKeeperServer);
    pw.flush();
  } catch (IOException e) {
    LOG.error("Error in writing output.", e);
  } catch (Exception e) {
    LOG.error("Error in writing output.", e);
  } finally {
    IOUtils.closeStream(pw);
  }
}

代码示例来源:origin: ml.shifu/guagua-mapreduce

/**
 * Write zookeeper server info to HDFS. Then worker can get such info and connect to such server..
 */
private void writeServerInfoToHDFS(MasterContext<MASTER_RESULT, WORKER_RESULT> context,
    String embededZooKeeperServer) {
  String hdfsZookeeperServerFolder = getZookeeperServerFolder(context);
  PrintWriter pw = null;
  try {
    if(!this.fileSystem.exists(new Path(hdfsZookeeperServerFolder))) {
      this.fileSystem.mkdirs(new Path(hdfsZookeeperServerFolder));
    }
    this.zookeeperServerPath = fileSystem.makeQualified(new Path(hdfsZookeeperServerFolder,
        GuaguaConstants.GUAGUA_CLUSTER_ZOOKEEPER_SERVER_FILE));
    LOG.info("Writing hdfs zookeeper server info to {}", this.zookeeperServerPath);
    FSDataOutputStream fos = fileSystem.create(this.zookeeperServerPath);
    pw = new PrintWriter(fos);
    pw.println(embededZooKeeperServer);
    pw.flush();
  } catch (IOException e) {
    LOG.error("Error in writing output.", e);
  } catch (Exception e) {
    LOG.error("Error in writing output.", e);
  } finally {
    IOUtils.closeStream(pw);
  }
}

代码示例来源:origin: ShifuML/guagua

/**
 * Write zookeeper server info to HDFS. Then worker can get such info and connect to such server..
 */
private void writeServerInfoToHDFS(MasterContext<MASTER_RESULT, WORKER_RESULT> context,
    String embededZooKeeperServer) {
  String hdfsZookeeperServerFolder = getZookeeperServerFolder(context);
  PrintWriter pw = null;
  try {
    if(!this.fileSystem.exists(new Path(hdfsZookeeperServerFolder))) {
      this.fileSystem.mkdirs(new Path(hdfsZookeeperServerFolder));
    }
    this.zookeeperServerPath = fileSystem.makeQualified(new Path(hdfsZookeeperServerFolder,
        GuaguaConstants.GUAGUA_CLUSTER_ZOOKEEPER_SERVER_FILE));
    LOG.info("Writing hdfs zookeeper server info to {}", this.zookeeperServerPath);
    FSDataOutputStream fos = fileSystem.create(this.zookeeperServerPath);
    pw = new PrintWriter(fos);
    pw.println(embededZooKeeperServer);
    pw.flush();
  } catch (IOException e) {
    LOG.error("Error in writing output.", e);
  } catch (Exception e) {
    LOG.error("Error in writing output.", e);
  } finally {
    IOUtils.closeStream(pw);
  }
}

相关文章