gpt4 book ai didi

org.apache.hadoop.ha.ZKFCProtocol类的使用及代码示例

转载 作者:知者 更新时间:2024-03-14 03:04:49 27 4
gpt4 key购买 nike

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

ZKFCProtocol介绍

[英]Protocol exposed by the ZKFailoverController, allowing for graceful failover.
[中]ZKFailoverController公开的协议,允许优雅的故障切换。

代码示例

代码示例来源:origin: org.apache.hadoop/hadoop-common

@Override
public GracefulFailoverResponseProto gracefulFailover(
  RpcController controller, GracefulFailoverRequestProto request)
  throws ServiceException {
 try {
  server.gracefulFailover();
  return GracefulFailoverResponseProto.getDefaultInstance();
 } catch (IOException e) {
  throw new ServiceException(e);
 }
}

代码示例来源:origin: org.apache.hadoop/hadoop-common

/**
 * Ask the remote zkfc to cede its active status and wait for the specified
 * timeout before attempting to claim leader status.
 * @param remote node to ask
 * @param timeout amount of time to cede
 * @return the {@link ZKFCProtocol} used to talk to the ndoe
 * @throws IOException
 */
private ZKFCProtocol cedeRemoteActive(HAServiceTarget remote, int timeout)
 throws IOException {
 LOG.info("Asking " + remote + " to cede its active state for "
       + timeout + "ms");
 ZKFCProtocol oldZkfc = remote.getZKFCProxy(conf, timeout);
 oldZkfc.cedeActive(timeout);
 return oldZkfc;
}

代码示例来源:origin: org.apache.hadoop/hadoop-common

/**
 * Initiate a graceful failover by talking to the target node's ZKFC.
 * This sends an RPC to the ZKFC, which coordinates the failover.
 * 
 * @param toNode the node to fail to
 * @return status code (0 for success)
 * @throws IOException if failover does not succeed
 */
private int gracefulFailoverThroughZKFCs(HAServiceTarget toNode)
  throws IOException {
 int timeout = FailoverController.getRpcTimeoutToNewActive(getConf());
 ZKFCProtocol proxy = toNode.getZKFCProxy(getConf(), timeout);
 try {
  proxy.gracefulFailover();
  out.println("Failover to " + toNode + " successful");
 } catch (ServiceFailedException sfe) {
  errOut.println("Failover failed: " + sfe.getLocalizedMessage());
  return -1;
 }
 return 0;
}

代码示例来源:origin: org.apache.hadoop/hadoop-common

@Override
public CedeActiveResponseProto cedeActive(RpcController controller,
  CedeActiveRequestProto request) throws ServiceException {
 try {
  server.cedeActive(request.getMillisToCede());
  return CedeActiveResponseProto.getDefaultInstance();
 } catch (IOException e) {
  throw new ServiceException(e);
 }
}

代码示例来源:origin: io.hops/hadoop-common

@Override
public GracefulFailoverResponseProto gracefulFailover(
  RpcController controller, GracefulFailoverRequestProto request)
  throws ServiceException {
 try {
  server.gracefulFailover();
  return GracefulFailoverResponseProto.getDefaultInstance();
 } catch (IOException e) {
  throw new ServiceException(e);
 }
}

代码示例来源:origin: org.apache.hadoop/hadoop-common

zkfc.cedeActive(-1);

代码示例来源:origin: io.prestosql.hadoop/hadoop-apache

@Override
public GracefulFailoverResponseProto gracefulFailover(
  RpcController controller, GracefulFailoverRequestProto request)
  throws ServiceException {
 try {
  server.gracefulFailover();
  return GracefulFailoverResponseProto.getDefaultInstance();
 } catch (IOException e) {
  throw new ServiceException(e);
 }
}

代码示例来源:origin: io.hops/hadoop-common

@Override
public CedeActiveResponseProto cedeActive(RpcController controller,
  CedeActiveRequestProto request) throws ServiceException {
 try {
  server.cedeActive(request.getMillisToCede());
  return CedeActiveResponseProto.getDefaultInstance();
 } catch (IOException e) {
  throw new ServiceException(e);
 }
}

代码示例来源:origin: ch.cern.hadoop/hadoop-common

@Override
public GracefulFailoverResponseProto gracefulFailover(
  RpcController controller, GracefulFailoverRequestProto request)
  throws ServiceException {
 try {
  server.gracefulFailover();
  return GracefulFailoverResponseProto.getDefaultInstance();
 } catch (IOException e) {
  throw new ServiceException(e);
 }
}

代码示例来源:origin: com.github.jiayuhan-it/hadoop-common

@Override
public CedeActiveResponseProto cedeActive(RpcController controller,
  CedeActiveRequestProto request) throws ServiceException {
 try {
  server.cedeActive(request.getMillisToCede());
  return CedeActiveResponseProto.getDefaultInstance();
 } catch (IOException e) {
  throw new ServiceException(e);
 }
}

代码示例来源:origin: com.github.jiayuhan-it/hadoop-common

@Override
public GracefulFailoverResponseProto gracefulFailover(
  RpcController controller, GracefulFailoverRequestProto request)
  throws ServiceException {
 try {
  server.gracefulFailover();
  return GracefulFailoverResponseProto.getDefaultInstance();
 } catch (IOException e) {
  throw new ServiceException(e);
 }
}

代码示例来源:origin: ch.cern.hadoop/hadoop-common

@Override
public CedeActiveResponseProto cedeActive(RpcController controller,
  CedeActiveRequestProto request) throws ServiceException {
 try {
  server.cedeActive(request.getMillisToCede());
  return CedeActiveResponseProto.getDefaultInstance();
 } catch (IOException e) {
  throw new ServiceException(e);
 }
}

代码示例来源:origin: io.hops/hadoop-common

/**
 * Initiate a graceful failover by talking to the target node's ZKFC.
 * This sends an RPC to the ZKFC, which coordinates the failover.
 * 
 * @param toNode the node to fail to
 * @return status code (0 for success)
 * @throws IOException if failover does not succeed
 */
private int gracefulFailoverThroughZKFCs(HAServiceTarget toNode)
  throws IOException {
 int timeout = FailoverController.getRpcTimeoutToNewActive(getConf());
 ZKFCProtocol proxy = toNode.getZKFCProxy(getConf(), timeout);
 try {
  proxy.gracefulFailover();
  out.println("Failover to " + toNode + " successful");
 } catch (ServiceFailedException sfe) {
  errOut.println("Failover failed: " + sfe.getLocalizedMessage());
  return -1;
 }
 return 0;
}

代码示例来源:origin: io.prestosql.hadoop/hadoop-apache

@Override
public CedeActiveResponseProto cedeActive(RpcController controller,
  CedeActiveRequestProto request) throws ServiceException {
 try {
  server.cedeActive(request.getMillisToCede());
  return CedeActiveResponseProto.getDefaultInstance();
 } catch (IOException e) {
  throw new ServiceException(e);
 }
}

代码示例来源:origin: ch.cern.hadoop/hadoop-common

/**
 * Initiate a graceful failover by talking to the target node's ZKFC.
 * This sends an RPC to the ZKFC, which coordinates the failover.
 * 
 * @param toNode the node to fail to
 * @return status code (0 for success)
 * @throws IOException if failover does not succeed
 */
private int gracefulFailoverThroughZKFCs(HAServiceTarget toNode)
  throws IOException {
 int timeout = FailoverController.getRpcTimeoutToNewActive(getConf());
 ZKFCProtocol proxy = toNode.getZKFCProxy(getConf(), timeout);
 try {
  proxy.gracefulFailover();
  out.println("Failover to " + toNode + " successful");
 } catch (ServiceFailedException sfe) {
  errOut.println("Failover failed: " + sfe.getLocalizedMessage());
  return -1;
 }
 return 0;
}

代码示例来源:origin: io.hops/hadoop-common

timeout + "ms");
ZKFCProtocol oldZkfc = oldActive.getZKFCProxy(conf, timeout);
oldZkfc.cedeActive(timeout);
oldZkfc.cedeActive(-1);

代码示例来源:origin: com.github.jiayuhan-it/hadoop-common

/**
 * Initiate a graceful failover by talking to the target node's ZKFC.
 * This sends an RPC to the ZKFC, which coordinates the failover.
 * 
 * @param toNode the node to fail to
 * @return status code (0 for success)
 * @throws IOException if failover does not succeed
 */
private int gracefulFailoverThroughZKFCs(HAServiceTarget toNode)
  throws IOException {
 int timeout = FailoverController.getRpcTimeoutToNewActive(getConf());
 ZKFCProtocol proxy = toNode.getZKFCProxy(getConf(), timeout);
 try {
  proxy.gracefulFailover();
  out.println("Failover to " + toNode + " successful");
 } catch (ServiceFailedException sfe) {
  errOut.println("Failover failed: " + sfe.getLocalizedMessage());
  return -1;
 }
 return 0;
}

代码示例来源:origin: ch.cern.hadoop/hadoop-common

timeout + "ms");
ZKFCProtocol oldZkfc = oldActive.getZKFCProxy(conf, timeout);
oldZkfc.cedeActive(timeout);
oldZkfc.cedeActive(-1);

代码示例来源:origin: io.prestosql.hadoop/hadoop-apache

/**
 * Initiate a graceful failover by talking to the target node's ZKFC.
 * This sends an RPC to the ZKFC, which coordinates the failover.
 * 
 * @param toNode the node to fail to
 * @return status code (0 for success)
 * @throws IOException if failover does not succeed
 */
private int gracefulFailoverThroughZKFCs(HAServiceTarget toNode)
  throws IOException {
 int timeout = FailoverController.getRpcTimeoutToNewActive(getConf());
 ZKFCProtocol proxy = toNode.getZKFCProxy(getConf(), timeout);
 try {
  proxy.gracefulFailover();
  out.println("Failover to " + toNode + " successful");
 } catch (ServiceFailedException sfe) {
  errOut.println("Failover failed: " + sfe.getLocalizedMessage());
  return -1;
 }
 return 0;
}

代码示例来源:origin: com.github.jiayuhan-it/hadoop-common

timeout + "ms");
ZKFCProtocol oldZkfc = oldActive.getZKFCProxy(conf, timeout);
oldZkfc.cedeActive(timeout);
oldZkfc.cedeActive(-1);

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com