public class Worker extends Server
JsonCreator,
JsonProperty,
序列化表格| 限定符和类型 | 类和说明 |
|---|---|
static class |
Worker.Current |
static class |
Worker.JacksonDeserializer
Custom deserialize Worker based jackson.
|
static class |
Worker.JacksonSerializer
Custom serialize Worker based jackson.
|
| 限定符和类型 | 方法和说明 |
|---|---|
static Worker.Current |
current() |
static Worker |
deserialize(byte[] bytes,
Charset charset) |
static Worker |
deserialize(String text)
Deserialize from string.
|
boolean |
equals(Object o) |
boolean |
equalsGroup(String group)
判断当前Worker的group是否等于任务分派的Worker的group
|
String |
getGroup() |
String |
getWorkerId() |
int |
hashCode()
Extends
Object#hashCode() |
boolean |
sameWorker(Worker other)
判断是否同一台机器:其它属性相同但worker-id不同
Worker机器宕机重启后,Supervisor一段时间内仍缓存着旧的Worker,导致http通过ip:port派发的任务参数中Worker是旧的,但是新Worker接收该任务
|
String |
serialize()
Serialize to string
|
buildHttpsUrlPrefix, buildHttpUrlPrefix, sameServer, toStringpublic int hashCode()
ServerObject#hashCode()public String getGroup()
public String getWorkerId()
public boolean equalsGroup(String group)
group - the grouptrue if matchedpublic boolean sameWorker(Worker other)
other - the other workertrue if same workerpublic static Worker deserialize(String text)
text - the serialized text stringpublic static Worker.Current current()
Copyright © 2024. All rights reserved.