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