- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中ml.shifu.guagua.hadoop.ZooKeeperMasterInterceptor
类的一些代码示例,展示了ZooKeeperMasterInterceptor
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZooKeeperMasterInterceptor
类的具体详情如下:
包路径:ml.shifu.guagua.hadoop.ZooKeeperMasterInterceptor
类名称:ZooKeeperMasterInterceptor
[英]To start zookeeper instance in cluster environment.
Compare with start zookeeper instance in client process, ZooKeeperMasterInterceptor can be used in cluster and even to start zookeeper ensemble in cluster to void single point failure issue.
[中]在集群环境中启动zookeeper实例。
与客户端进程中启动zookeeper实例相比,ZooKeeperMasterInterceptor可以在集群中使用,甚至可以在集群中启动zookeeper集成,避免单点故障问题。
代码示例来源: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: ShifuML/guagua
String localHostName = getLocalHostName();
LOG.warn("No valid zookeeper servers, start one in ZooKeeperMaster {}", localHostName);
zookeeperServer = startZookeeperServer(localHostName);
LOG.info("Zookeeper server is stated with thread: {}", zookeeperServer);
} else {
writeServerInfoToHDFS(context, zookeeperServer);
代码示例来源:origin: ml.shifu/guagua-mapreduce
String localHostName = getLocalHostName();
LOG.warn("No valid zookeeper servers, start one in ZooKeeperMaster {}", localHostName);
zookeeperServer = startZookeeperServer(localHostName);
LOG.info("Zookeeper server is stated with thread: {}", zookeeperServer);
} else {
writeServerInfoToHDFS(context, zookeeperServer);
代码示例来源:origin: ml.shifu/guagua-yarn
String localHostName = getLocalHostName();
LOG.warn("No valid zookeeper servers, start one in ZooKeeperMaster {}", localHostName);
zookeeperServer = startZookeeperServer(localHostName);
LOG.info("Zookeeper server is stated with thread: {}", zookeeperServer);
} else {
writeServerInfoToHDFS(context, zookeeperServer);
代码示例来源: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
String localHostName = getLocalHostName();
LOG.warn("No valid zookeeper servers, start one in ZooKeeperMaster {}", localHostName);
zookeeperServer = startZookeeperServer(localHostName);
LOG.info("Zookeeper server is stated with thread: {}", zookeeperServer);
} else {
writeServerInfoToHDFS(context, zookeeperServer);
代码示例来源: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
@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);
}
}
本文整理了Java中ml.shifu.guagua.hadoop.ZooKeeperMasterInterceptor.getLocalHostName()方法的一些代码示例,展示了ZooKeeper
本文整理了Java中ml.shifu.guagua.hadoop.ZooKeeperMasterInterceptor.writeServerInfoToHDFS()方法的一些代码示例,展示了ZooK
本文整理了Java中ml.shifu.guagua.hadoop.ZooKeeperMasterInterceptor.getZookeeperServerFolder()方法的一些代码示例,展示了Z
我是一名优秀的程序员,十分优秀!