public class ClusterBuilderSlot extends AbstractLinkedProcessorSlot<DefaultNode>
This slot maintains resource running statistics (response time, qps, thread
count, exception), and a list of callers as well which is marked by
ContextUtil.enter(String origin)
One resource has only one cluster node, while one resource can have multiple default nodes.
| Constructor and Description |
|---|
ClusterBuilderSlot() |
| Modifier and Type | Method and Description |
|---|---|
void |
entry(Context context,
ResourceWrapper resourceWrapper,
DefaultNode node,
int count,
boolean prioritized,
Object... args)
Entrance of this slot.
|
void |
exit(Context context,
ResourceWrapper resourceWrapper,
int count,
Object... args)
Exit of this slot.
|
static ClusterNode |
getClusterNode(String id)
Get
ClusterNode of the resource name. |
static ClusterNode |
getClusterNode(String id,
EntryType type)
Get
ClusterNode of the resource of the specific type. |
static Map<ResourceWrapper,ClusterNode> |
getClusterNodeMap()
Get
ClusterNodes map, this map holds all ClusterNodes, it's key is resource name,
value is the related ClusterNode. |
static void |
resetClusterNodes()
Reset all
ClusterNodes. |
fireEntry, fireExit, getNext, setNextpublic void entry(Context context, ResourceWrapper resourceWrapper, DefaultNode node, int count, boolean prioritized, Object... args) throws Throwable
ProcessorSlotpublic void exit(Context context, ResourceWrapper resourceWrapper, int count, Object... args)
ProcessorSlotcontext - current ContextresourceWrapper - current resourcecount - tokens neededargs - parameters of the original callpublic static ClusterNode getClusterNode(String id, EntryType type)
ClusterNode of the resource of the specific type.id - resource name.type - invoke type.ClusterNodepublic static ClusterNode getClusterNode(String id)
ClusterNode of the resource name.id - resource name.ClusterNode.public static Map<ResourceWrapper,ClusterNode> getClusterNodeMap()
ClusterNodes map, this map holds all ClusterNodes, it's key is resource name,
value is the related ClusterNode. ClusterNodespublic static void resetClusterNodes()
ClusterNodes. Reset is needed when IntervalProperty.INTERVAL or
SampleCountProperty.SAMPLE_COUNT is changed.Copyright © 2019 Alibaba Group. All rights reserved.