public class ClusterSwitcher extends Object implements Closeable
| 构造器和说明 |
|---|
ClusterSwitcher(ConnectInfo connectInfo,
org.apache.hadoop.conf.Configuration conf) |
| 限定符和类型 | 方法和说明 |
|---|---|
protected void |
checkClusterKey(String targetClusterKey) |
void |
close() |
protected SwitchCommand |
getCommandFrom(org.apache.hadoop.conf.Configuration conf) |
protected ConnectInfo |
getConnectInfoFrom(org.apache.hadoop.conf.Configuration conf) |
ConnectInfo |
getConnectNode() |
String |
getCurrentActiveCluster() |
Map<String,Integer> |
getCurrentLinkCount() |
List<String> |
getDualTables() |
protected List<String> |
getDualTablesFrom(org.apache.hadoop.conf.Configuration conf) |
Map<String,com.alibaba.fastjson.JSONObject> |
getDualTrace() |
protected Map<String,com.alibaba.fastjson.JSONObject> |
getDualTraceFrom(org.apache.hadoop.conf.Configuration conf) |
protected Integer |
getLinkCountFrom(org.apache.hadoop.conf.Configuration conf) |
protected List<org.apache.hadoop.hbase.util.Pair<String,Integer>> |
listCurrentLinkCount() |
protected List<org.apache.hadoop.hbase.util.Pair<String,SwitchCommand>> |
listCurrentSwitchCommands() |
static void |
main(String[] args) |
void |
setConnectNode() |
void |
setDualTables(List<String> dualTables) |
int |
switchTo(String targetClusterKey) |
protected int |
switchTo(String targetClusterKey,
long ts,
boolean skipCheck) |
public ClusterSwitcher(ConnectInfo connectInfo, org.apache.hadoop.conf.Configuration conf) throws IOException
IOExceptionprotected SwitchCommand getCommandFrom(org.apache.hadoop.conf.Configuration conf) throws IOException, org.apache.zookeeper.KeeperException, InterruptedException
IOExceptionorg.apache.zookeeper.KeeperExceptionInterruptedExceptionprotected ConnectInfo getConnectInfoFrom(org.apache.hadoop.conf.Configuration conf) throws IOException, org.apache.zookeeper.KeeperException, InterruptedException
IOExceptionorg.apache.zookeeper.KeeperExceptionInterruptedExceptionprotected List<String> getDualTablesFrom(org.apache.hadoop.conf.Configuration conf) throws IOException, org.apache.zookeeper.KeeperException, InterruptedException
IOExceptionorg.apache.zookeeper.KeeperExceptionInterruptedExceptionprotected Map<String,com.alibaba.fastjson.JSONObject> getDualTraceFrom(org.apache.hadoop.conf.Configuration conf) throws IOException, org.apache.zookeeper.KeeperException, InterruptedException
IOExceptionorg.apache.zookeeper.KeeperExceptionInterruptedExceptionprotected Integer getLinkCountFrom(org.apache.hadoop.conf.Configuration conf) throws IOException, org.apache.zookeeper.KeeperException, InterruptedException
IOExceptionorg.apache.zookeeper.KeeperExceptionInterruptedExceptionprotected void checkClusterKey(String targetClusterKey) throws IOException, org.apache.zookeeper.KeeperException
IOExceptionorg.apache.zookeeper.KeeperExceptionpublic void close()
close 在接口中 Closeableclose 在接口中 AutoCloseableprotected int switchTo(String targetClusterKey, long ts, boolean skipCheck) throws IOException, org.apache.zookeeper.KeeperException, InterruptedException
IOExceptionorg.apache.zookeeper.KeeperExceptionInterruptedExceptionprotected List<org.apache.hadoop.hbase.util.Pair<String,SwitchCommand>> listCurrentSwitchCommands() throws InterruptedException
protected List<org.apache.hadoop.hbase.util.Pair<String,Integer>> listCurrentLinkCount() throws InterruptedException
public int switchTo(String targetClusterKey) throws IOException, org.apache.zookeeper.KeeperException, InterruptedException
IOExceptionorg.apache.zookeeper.KeeperExceptionInterruptedExceptionpublic void setConnectNode()
throws IOException,
org.apache.zookeeper.KeeperException
IOExceptionorg.apache.zookeeper.KeeperExceptionpublic ConnectInfo getConnectNode() throws IOException, org.apache.zookeeper.KeeperException, InterruptedException
IOExceptionorg.apache.zookeeper.KeeperExceptionInterruptedExceptionpublic void setDualTables(List<String> dualTables) throws IOException, org.apache.zookeeper.KeeperException
IOExceptionorg.apache.zookeeper.KeeperExceptionpublic List<String> getDualTables() throws IOException, org.apache.zookeeper.KeeperException, InterruptedException
IOExceptionorg.apache.zookeeper.KeeperExceptionInterruptedExceptionpublic Map<String,com.alibaba.fastjson.JSONObject> getDualTrace() throws IOException, org.apache.zookeeper.KeeperException, InterruptedException
IOExceptionorg.apache.zookeeper.KeeperExceptionInterruptedExceptionpublic String getCurrentActiveCluster() throws InterruptedException, IOException
public Map<String,Integer> getCurrentLinkCount() throws InterruptedException, IOException
Copyright © 2019. All rights reserved.