Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
#法外狂徒张三
DolphinScheduler
提交
758da8b9
DolphinScheduler
项目概览
#法外狂徒张三
/
DolphinScheduler
与 Fork 源项目一致
Fork自
apache / DolphinScheduler
通知
12
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
DolphinScheduler
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
758da8b9
编写于
7月 09, 2019
作者:
leon-baoliang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update
上级
1ab0a02a
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
223 addition
and
74 deletion
+223
-74
escheduler-api/src/main/java/cn/escheduler/api/controller/MonitorController.java
.../java/cn/escheduler/api/controller/MonitorController.java
+2
-2
escheduler-api/src/main/java/cn/escheduler/api/service/MonitorService.java
...c/main/java/cn/escheduler/api/service/MonitorService.java
+39
-2
escheduler-api/src/main/java/cn/escheduler/api/utils/ZookeeperMonitor.java
...c/main/java/cn/escheduler/api/utils/ZookeeperMonitor.java
+38
-2
escheduler-api/src/test/java/cn/escheduler/api/utils/ZookeeperMonitorUtilsTest.java
...va/cn/escheduler/api/utils/ZookeeperMonitorUtilsTest.java
+34
-0
escheduler-common/src/main/java/cn/escheduler/common/queue/TaskQueueZkImpl.java
...main/java/cn/escheduler/common/queue/TaskQueueZkImpl.java
+0
-10
escheduler-common/src/main/java/cn/escheduler/common/zk/AbstractZKClient.java
...c/main/java/cn/escheduler/common/zk/AbstractZKClient.java
+82
-5
escheduler-common/src/test/java/cn/escheduler/common/queue/TaskQueueImplTest.java
...st/java/cn/escheduler/common/queue/TaskQueueImplTest.java
+0
-2
escheduler-server/src/main/java/cn/escheduler/server/ResInfo.java
...er-server/src/main/java/cn/escheduler/server/ResInfo.java
+25
-0
escheduler-server/src/main/java/cn/escheduler/server/zk/ZKMasterClient.java
...src/main/java/cn/escheduler/server/zk/ZKMasterClient.java
+0
-39
escheduler-server/src/main/java/cn/escheduler/server/zk/ZKWorkerClient.java
...src/main/java/cn/escheduler/server/zk/ZKWorkerClient.java
+0
-10
escheduler-server/src/test/java/cn/escheduler/server/zk/ZKWorkerClientTest.java
...test/java/cn/escheduler/server/zk/ZKWorkerClientTest.java
+3
-2
未找到文件。
escheduler-api/src/main/java/cn/escheduler/api/controller/MonitorController.java
浏览文件 @
758da8b9
...
@@ -66,7 +66,7 @@ public class MonitorController extends BaseController{
...
@@ -66,7 +66,7 @@ public class MonitorController extends BaseController{
logger
.
info
(
"login user: {}, query all master"
,
loginUser
.
getUserName
());
logger
.
info
(
"login user: {}, query all master"
,
loginUser
.
getUserName
());
try
{
try
{
logger
.
info
(
"list master, user:{}"
,
loginUser
.
getUserName
());
logger
.
info
(
"list master, user:{}"
,
loginUser
.
getUserName
());
Map
<
String
,
Object
>
result
=
serve
rService
.
queryMaster
(
loginUser
);
Map
<
String
,
Object
>
result
=
monito
rService
.
queryMaster
(
loginUser
);
return
returnDataList
(
result
);
return
returnDataList
(
result
);
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
logger
.
error
(
LIST_MASTERS_ERROR
.
getMsg
(),
e
);
logger
.
error
(
LIST_MASTERS_ERROR
.
getMsg
(),
e
);
...
@@ -86,7 +86,7 @@ public class MonitorController extends BaseController{
...
@@ -86,7 +86,7 @@ public class MonitorController extends BaseController{
public
Result
listWorker
(
@ApiIgnore
@RequestAttribute
(
value
=
Constants
.
SESSION_USER
)
User
loginUser
)
{
public
Result
listWorker
(
@ApiIgnore
@RequestAttribute
(
value
=
Constants
.
SESSION_USER
)
User
loginUser
)
{
logger
.
info
(
"login user: {}, query all workers"
,
loginUser
.
getUserName
());
logger
.
info
(
"login user: {}, query all workers"
,
loginUser
.
getUserName
());
try
{
try
{
Map
<
String
,
Object
>
result
=
serve
rService
.
queryWorker
(
loginUser
);
Map
<
String
,
Object
>
result
=
monito
rService
.
queryWorker
(
loginUser
);
return
returnDataList
(
result
);
return
returnDataList
(
result
);
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
logger
.
error
(
LIST_WORKERS_ERROR
.
getMsg
(),
e
);
logger
.
error
(
LIST_WORKERS_ERROR
.
getMsg
(),
e
);
...
...
escheduler-api/src/main/java/cn/escheduler/api/service/MonitorService.java
浏览文件 @
758da8b9
...
@@ -18,13 +18,16 @@ package cn.escheduler.api.service;
...
@@ -18,13 +18,16 @@ package cn.escheduler.api.service;
import
cn.escheduler.api.enums.Status
;
import
cn.escheduler.api.enums.Status
;
import
cn.escheduler.api.utils.Constants
;
import
cn.escheduler.api.utils.Constants
;
import
cn.escheduler.api.utils.ZookeeperMonitor
Utils
;
import
cn.escheduler.api.utils.ZookeeperMonitor
;
import
cn.escheduler.dao.MonitorDBDao
;
import
cn.escheduler.dao.MonitorDBDao
;
import
cn.escheduler.dao.model.MasterServer
;
import
cn.escheduler.dao.model.MonitorRecord
;
import
cn.escheduler.dao.model.MonitorRecord
;
import
cn.escheduler.dao.model.User
;
import
cn.escheduler.dao.model.User
;
import
cn.escheduler.dao.model.ZookeeperRecord
;
import
cn.escheduler.dao.model.ZookeeperRecord
;
import
org.apache.hadoop.mapred.Master
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -52,6 +55,22 @@ public class MonitorService extends BaseService{
...
@@ -52,6 +55,22 @@ public class MonitorService extends BaseService{
}
}
/**
* query master list
*
* @param loginUser
* @return
*/
public
Map
<
String
,
Object
>
queryMaster
(
User
loginUser
)
{
Map
<
String
,
Object
>
result
=
new
HashMap
<>(
5
);
List
<
MasterServer
>
masterServers
=
new
ZookeeperMonitor
().
getMasterServers
();
result
.
put
(
Constants
.
DATA_LIST
,
masterServers
);
putMsg
(
result
,
Status
.
SUCCESS
);
return
result
;
}
/**
/**
* query zookeeper state
* query zookeeper state
...
@@ -61,7 +80,7 @@ public class MonitorService extends BaseService{
...
@@ -61,7 +80,7 @@ public class MonitorService extends BaseService{
public
Map
<
String
,
Object
>
queryZookeeperState
(
User
loginUser
)
{
public
Map
<
String
,
Object
>
queryZookeeperState
(
User
loginUser
)
{
Map
<
String
,
Object
>
result
=
new
HashMap
<>(
5
);
Map
<
String
,
Object
>
result
=
new
HashMap
<>(
5
);
List
<
ZookeeperRecord
>
zookeeperRecordList
=
ZookeeperMonitor
Utils
.
zookeeperInfoList
();
List
<
ZookeeperRecord
>
zookeeperRecordList
=
ZookeeperMonitor
.
zookeeperInfoList
();
result
.
put
(
Constants
.
DATA_LIST
,
zookeeperRecordList
);
result
.
put
(
Constants
.
DATA_LIST
,
zookeeperRecordList
);
putMsg
(
result
,
Status
.
SUCCESS
);
putMsg
(
result
,
Status
.
SUCCESS
);
...
@@ -69,4 +88,22 @@ public class MonitorService extends BaseService{
...
@@ -69,4 +88,22 @@ public class MonitorService extends BaseService{
return
result
;
return
result
;
}
}
/**
* query master list
*
* @param loginUser
* @return
*/
public
Map
<
String
,
Object
>
queryWorker
(
User
loginUser
)
{
Map
<
String
,
Object
>
result
=
new
HashMap
<>(
5
);
List
<
MasterServer
>
workerServers
=
new
ZookeeperMonitor
().
getWorkerServers
();
result
.
put
(
Constants
.
DATA_LIST
,
workerServers
);
putMsg
(
result
,
Status
.
SUCCESS
);
return
result
;
}
}
}
escheduler-api/src/main/java/cn/escheduler/api/utils/ZookeeperMonitor
Utils
.java
→
escheduler-api/src/main/java/cn/escheduler/api/utils/ZookeeperMonitor.java
浏览文件 @
758da8b9
package
cn.escheduler.api.utils
;
package
cn.escheduler.api.utils
;
import
cn.escheduler.common.zk.AbstractZKClient
;
import
cn.escheduler.common.zk.AbstractZKClient
;
import
cn.escheduler.dao.model.MasterServer
;
import
cn.escheduler.dao.model.ZookeeperRecord
;
import
cn.escheduler.dao.model.ZookeeperRecord
;
import
cn.escheduler.server.ResInfo
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
sun.jvm.hotspot.opto.MachSafePointNode
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
/**
/**
* monitor zookeeper info
* monitor zookeeper info
*/
*/
public
class
ZookeeperMonitor
Utils
{
public
class
ZookeeperMonitor
extends
AbstractZKClient
{
private
static
final
Logger
LOG
=
LoggerFactory
.
getLogger
(
ZookeeperMonitor
Utils
.
class
);
private
static
final
Logger
LOG
=
LoggerFactory
.
getLogger
(
ZookeeperMonitor
.
class
);
private
static
final
String
zookeeperList
=
AbstractZKClient
.
getZookeeperQuorum
();
private
static
final
String
zookeeperList
=
AbstractZKClient
.
getZookeeperQuorum
();
/**
/**
...
@@ -33,6 +37,38 @@ public class ZookeeperMonitorUtils {
...
@@ -33,6 +37,38 @@ public class ZookeeperMonitorUtils {
return
null
;
return
null
;
}
}
/**
* get server list.
* @param isMaster
* @return
*/
public
List
<
MasterServer
>
getServers
(
boolean
isMaster
){
List
<
MasterServer
>
masterServers
=
new
ArrayList
<>();
Map
<
String
,
String
>
masterMap
=
getServerList
(
isMaster
);
String
parentPath
=
isMaster
?
getMasterZNodeParentPath
()
:
getWorkerZNodeParentPath
();
for
(
String
path
:
masterMap
.
keySet
()){
MasterServer
masterServer
=
ResInfo
.
parseHeartbeatForZKInfo
(
masterMap
.
get
(
path
));
masterServer
.
setZkDirectory
(
parentPath
+
"/"
+
path
);
masterServers
.
add
(
masterServer
);
}
return
masterServers
;
}
/**
* get master servers
* @return
*/
public
List
<
MasterServer
>
getMasterServers
(){
return
getServers
(
true
);
}
/**
* master construct is the same with worker, use the master instead
* @return
*/
public
List
<
MasterServer
>
getWorkerServers
(){
return
getServers
(
false
);
}
private
static
List
<
ZookeeperRecord
>
zookeeperInfoList
(
String
zookeeperServers
)
{
private
static
List
<
ZookeeperRecord
>
zookeeperInfoList
(
String
zookeeperServers
)
{
...
...
escheduler-api/src/test/java/cn/escheduler/api/utils/ZookeeperMonitorUtilsTest.java
0 → 100644
浏览文件 @
758da8b9
package
cn.escheduler.api.utils
;
import
cn.escheduler.dao.model.MasterServer
;
import
org.junit.Assert
;
import
org.junit.Test
;
import
javax.crypto.MacSpi
;
import
java.util.List
;
import
static
org
.
junit
.
Assert
.*;
public
class
ZookeeperMonitorUtilsTest
{
@Test
public
void
testGetMasterLsit
(){
ZookeeperMonitor
zookeeperMonitor
=
new
ZookeeperMonitor
();
List
<
MasterServer
>
masterServerList
=
zookeeperMonitor
.
getMasterServers
();
List
<
MasterServer
>
workerServerList
=
zookeeperMonitor
.
getWorkerServers
();
System
.
out
.
println
(
"master:"
+
masterServerList
);
System
.
out
.
println
(
"worker:"
+
workerServerList
);
Assert
.
assertEquals
(
masterServerList
.
size
(),
1
);
Assert
.
assertEquals
(
workerServerList
.
size
(),
1
);
}
}
\ No newline at end of file
escheduler-common/src/main/java/cn/escheduler/common/queue/TaskQueueZkImpl.java
浏览文件 @
758da8b9
...
@@ -417,16 +417,6 @@ public class TaskQueueZkImpl extends AbstractZKClient implements ITaskQueue {
...
@@ -417,16 +417,6 @@ public class TaskQueueZkImpl extends AbstractZKClient implements ITaskQueue {
}
}
}
}
/**
* get zookeeper client of CuratorFramework
* @return
*/
public
CuratorFramework
getZkClient
()
{
return
zkClient
;
}
/**
/**
* Get the task queue path
* Get the task queue path
* @param key task queue name
* @param key task queue name
...
...
escheduler-common/src/main/java/cn/escheduler/common/zk/AbstractZKClient.java
浏览文件 @
758da8b9
...
@@ -30,13 +30,12 @@ import org.apache.curator.framework.imps.CuratorFrameworkState;
...
@@ -30,13 +30,12 @@ import org.apache.curator.framework.imps.CuratorFrameworkState;
import
org.apache.curator.framework.state.ConnectionState
;
import
org.apache.curator.framework.state.ConnectionState
;
import
org.apache.curator.framework.state.ConnectionStateListener
;
import
org.apache.curator.framework.state.ConnectionStateListener
;
import
org.apache.curator.retry.ExponentialBackoffRetry
;
import
org.apache.curator.retry.ExponentialBackoffRetry
;
import
org.apache.hadoop.hbase.protobuf.generated.MasterProtos
;
import
org.apache.zookeeper.CreateMode
;
import
org.apache.zookeeper.CreateMode
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
java.util.ArrayList
;
import
java.util.*
;
import
java.util.Date
;
import
java.util.List
;
import
static
cn
.
escheduler
.
common
.
Constants
.*;
import
static
cn
.
escheduler
.
common
.
Constants
.*;
...
@@ -213,9 +212,9 @@ public abstract class AbstractZKClient {
...
@@ -213,9 +212,9 @@ public abstract class AbstractZKClient {
protected
void
initSystemZNode
(){
protected
void
initSystemZNode
(){
try
{
try
{
// read master node parent path from conf
// read master node parent path from conf
masterZNodeParentPath
=
conf
.
getString
(
Constants
.
ZOOKEEPER_ESCHEDULER_MASTERS
);
masterZNodeParentPath
=
getMasterZNodeParentPath
(
);
// read worker node parent path from conf
// read worker node parent path from conf
workerZNodeParentPath
=
conf
.
getString
(
Constants
.
ZOOKEEPER_ESCHEDULER_WORKERS
);
workerZNodeParentPath
=
getWorkerZNodeParentPath
(
);
// read server node parent path from conf
// read server node parent path from conf
deadServerZNodeParentPath
=
conf
.
getString
(
ZOOKEEPER_ESCHEDULER_DEAD_SERVERS
);
deadServerZNodeParentPath
=
conf
.
getString
(
ZOOKEEPER_ESCHEDULER_DEAD_SERVERS
);
...
@@ -243,6 +242,7 @@ public abstract class AbstractZKClient {
...
@@ -243,6 +242,7 @@ public abstract class AbstractZKClient {
}
}
}
}
public
void
removeDeadServerByHost
(
String
host
,
String
serverType
)
throws
Exception
{
public
void
removeDeadServerByHost
(
String
host
,
String
serverType
)
throws
Exception
{
List
<
String
>
deadServers
=
zkClient
.
getChildren
().
forPath
(
deadServerZNodeParentPath
);
List
<
String
>
deadServers
=
zkClient
.
getChildren
().
forPath
(
deadServerZNodeParentPath
);
for
(
String
serverPath
:
deadServers
){
for
(
String
serverPath
:
deadServers
){
...
@@ -291,6 +291,8 @@ public abstract class AbstractZKClient {
...
@@ -291,6 +291,8 @@ public abstract class AbstractZKClient {
}
}
/**
/**
* for stop server
* for stop server
* @param serverStoppable
* @param serverStoppable
...
@@ -340,6 +342,81 @@ public abstract class AbstractZKClient {
...
@@ -340,6 +342,81 @@ public abstract class AbstractZKClient {
return
sb
.
toString
();
return
sb
.
toString
();
}
}
/**
* get master server list map.
* result : {host : resource info}
* @return
*/
public
Map
<
String
,
String
>
getServerList
(
boolean
isMaster
){
Map
<
String
,
String
>
masterMap
=
new
HashMap
<>();
try
{
String
path
=
isMaster
?
getMasterZNodeParentPath
()
:
getWorkerZNodeParentPath
();
List
<
String
>
serverList
=
getZkClient
().
getChildren
().
forPath
(
path
);
for
(
String
server
:
serverList
){
byte
[]
bytes
=
getZkClient
().
getData
().
forPath
(
path
+
"/"
+
server
);
masterMap
.
putIfAbsent
(
server
,
new
String
(
bytes
));
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
return
masterMap
;
}
/**
* get zkclient
* @return
*/
public
CuratorFramework
getZkClient
()
{
return
zkClient
;
}
/**
* get worker node parent path
* @return
*/
protected
String
getWorkerZNodeParentPath
(){
return
conf
.
getString
(
Constants
.
ZOOKEEPER_ESCHEDULER_WORKERS
);};
/**
* get master node parent path
* @return
*/
protected
String
getMasterZNodeParentPath
(){
return
conf
.
getString
(
Constants
.
ZOOKEEPER_ESCHEDULER_MASTERS
);}
/**
* get master lock path
* @return
*/
public
String
getMasterLockPath
(){
return
conf
.
getString
(
Constants
.
ZOOKEEPER_ESCHEDULER_LOCK_MASTERS
);
}
/**
* get master start up lock path
* @return
*/
public
String
getMasterStartUpLockPath
(){
return
conf
.
getString
(
Constants
.
ZOOKEEPER_ESCHEDULER_LOCK_FAILOVER_STARTUP_MASTERS
);
}
/**
* get master failover lock path
* @return
*/
public
String
getMasterFailoverLockPath
(){
return
conf
.
getString
(
Constants
.
ZOOKEEPER_ESCHEDULER_LOCK_FAILOVER_MASTERS
);
}
/**
* get worker failover lock path
* @return
*/
public
String
getWorkerFailoverLockPath
(){
return
conf
.
getString
(
Constants
.
ZOOKEEPER_ESCHEDULER_LOCK_FAILOVER_WORKERS
);
}
@Override
@Override
public
String
toString
()
{
public
String
toString
()
{
return
"AbstractZKClient{"
+
return
"AbstractZKClient{"
+
...
...
escheduler-common/src/test/java/cn/escheduler/common/queue/TaskQueueImplTest.java
浏览文件 @
758da8b9
...
@@ -84,8 +84,6 @@ public class TaskQueueImplTest {
...
@@ -84,8 +84,6 @@ public class TaskQueueImplTest {
return
;
return
;
}
}
String
node2
=
tasks
.
get
(
0
);
}
}
...
...
escheduler-server/src/main/java/cn/escheduler/server/ResInfo.java
浏览文件 @
758da8b9
...
@@ -17,8 +17,12 @@
...
@@ -17,8 +17,12 @@
package
cn.escheduler.server
;
package
cn.escheduler.server
;
import
cn.escheduler.common.Constants
;
import
cn.escheduler.common.Constants
;
import
cn.escheduler.common.utils.DateUtils
;
import
cn.escheduler.common.utils.JSONUtils
;
import
cn.escheduler.common.utils.JSONUtils
;
import
cn.escheduler.common.utils.OSUtils
;
import
cn.escheduler.common.utils.OSUtils
;
import
cn.escheduler.dao.model.MasterServer
;
import
java.util.Date
;
/**
/**
* heartbeat for ZK reigster res info
* heartbeat for ZK reigster res info
...
@@ -119,4 +123,25 @@ public class ResInfo {
...
@@ -119,4 +123,25 @@ public class ResInfo {
+
lastHeartbeatTime
;
+
lastHeartbeatTime
;
}
}
/**
* parse heartbeat info for zk
* @param heartBeatInfo
* @return
*/
public
static
MasterServer
parseHeartbeatForZKInfo
(
String
heartBeatInfo
){
MasterServer
masterServer
=
null
;
String
[]
masterArray
=
heartBeatInfo
.
split
(
Constants
.
COMMA
);
if
(
masterArray
.
length
!=
6
){
return
masterServer
;
}
masterServer
=
new
MasterServer
();
masterServer
.
setHost
(
masterArray
[
0
]);
masterServer
.
setPort
(
Integer
.
parseInt
(
masterArray
[
1
]));
masterServer
.
setResInfo
(
getResInfoJson
(
Double
.
parseDouble
(
masterArray
[
2
]),
Double
.
parseDouble
(
masterArray
[
3
])));
masterServer
.
setCreateTime
(
DateUtils
.
stringToDate
(
masterArray
[
4
]));
masterServer
.
setLastHeartbeatTime
(
DateUtils
.
stringToDate
(
masterArray
[
5
]));
return
masterServer
;
}
}
}
escheduler-server/src/main/java/cn/escheduler/server/zk/ZKMasterClient.java
浏览文件 @
758da8b9
...
@@ -448,45 +448,6 @@ public class ZKMasterClient extends AbstractZKClient {
...
@@ -448,45 +448,6 @@ public class ZKMasterClient extends AbstractZKClient {
}
}
/**
* get master lock path
* @return
*/
public
String
getMasterLockPath
(){
return
conf
.
getString
(
Constants
.
ZOOKEEPER_ESCHEDULER_LOCK_MASTERS
);
}
/**
* get master start up lock path
* @return
*/
public
String
getMasterStartUpLockPath
(){
return
conf
.
getString
(
Constants
.
ZOOKEEPER_ESCHEDULER_LOCK_FAILOVER_STARTUP_MASTERS
);
}
/**
* get master failover lock path
* @return
*/
public
String
getMasterFailoverLockPath
(){
return
conf
.
getString
(
Constants
.
ZOOKEEPER_ESCHEDULER_LOCK_FAILOVER_MASTERS
);
}
/**
* get worker failover lock path
* @return
*/
public
String
getWorkerFailoverLockPath
(){
return
conf
.
getString
(
Constants
.
ZOOKEEPER_ESCHEDULER_LOCK_FAILOVER_WORKERS
);
}
/**
* get zkclient
* @return
*/
public
CuratorFramework
getZkClient
()
{
return
zkClient
;
}
/**
/**
...
...
escheduler-server/src/main/java/cn/escheduler/server/zk/ZKWorkerClient.java
浏览文件 @
758da8b9
...
@@ -264,16 +264,6 @@ public class ZKWorkerClient extends AbstractZKClient {
...
@@ -264,16 +264,6 @@ public class ZKWorkerClient extends AbstractZKClient {
return
workerZNode
;
return
workerZNode
;
}
}
/**
* get zkclient
* @return
*/
public
CuratorFramework
getZkClient
()
{
return
zkClient
;
}
/**
/**
* get worker lock path
* get worker lock path
* @return
* @return
...
...
escheduler-server/src/test/java/cn/escheduler/server/zk/ZKWorkerClientTest.java
浏览文件 @
758da8b9
package
cn.escheduler.server.zk
;
package
cn.escheduler.server.zk
;
import
cn.escheduler.common.Constants
;
import
cn.escheduler.common.Constants
;
import
cn.escheduler.common.zk.AbstractZKClient
;
import
org.junit.Test
;
import
org.junit.Test
;
import
java.util.Arrays
;
import
java.util.Arrays
;
...
@@ -17,8 +18,8 @@ public class ZKWorkerClientTest {
...
@@ -17,8 +18,8 @@ public class ZKWorkerClientTest {
public
void
getZKWorkerClient
()
throws
Exception
{
public
void
getZKWorkerClient
()
throws
Exception
{
ZKWorkerClient
zkWorkerClient
=
ZKWorkerClient
.
getZKWorkerClient
();
//
ZKWorkerClient zkWorkerClient = ZKWorkerClient.getZKWorkerClient();
zkWorkerClient
.
removeDeadServerByHost
(
"127.0.0.1"
,
Constants
.
WORKER_PREFIX
);
//
zkWorkerClient.removeDeadServerByHost("127.0.0.1", Constants.WORKER_PREFIX);
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录