public final class Worker extends Server
| 限定符和类型 | 类和说明 |
|---|---|
static class |
Worker.JacksonDeserializer
Custom deserialize Worker based jackson.
|
| 限定符和类型 | 方法和说明 |
|---|---|
static Worker |
current() |
static Worker |
deserialize(String text)
Deserialize from string.
|
boolean |
equals(Object o) |
String |
getGroup() |
String |
getWorkerId() |
int |
hashCode()
Extends
Object#hashCode() |
boolean |
matchesGroup(String taskGroup)
判断当前Worker机器的group是否匹配任务分配的group
|
boolean |
matchesWorker(Worker other)
判断当前Worker机器的group是否匹配任务分配的worker
|
static Worker |
of(Map<String,?> map) |
boolean |
sameWorker(Worker other)
判断是否同一台机器:worker-id可以不相等(机器重启)
|
String |
serialize()
Serialize to string
|
List<Worker> |
splitGroup() |
public int hashCode()
ServerObject#hashCode()public static Worker deserialize(String text)
text - the serialized text stringpublic String getGroup()
public String getWorkerId()
public boolean matchesGroup(String taskGroup)
taskGroup - the task grouptrue if matchedpublic boolean matchesWorker(Worker other)
other - the task assigned workertrue if matched workerpublic boolean sameWorker(Worker other)
other - the other workertrue if same workerpublic static Worker current()
Copyright © 2023. All rights reserved.