本文整理匯總了Java中org.elasticsearch.cluster.node.DiscoveryNode.clientNode方法的典型用法代碼示例。如果您正苦於以下問題:Java DiscoveryNode.clientNode方法的具體用法?Java DiscoveryNode.clientNode怎麽用?Java DiscoveryNode.clientNode使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.elasticsearch.cluster.node.DiscoveryNode
的用法示例。
在下文中一共展示了DiscoveryNode.clientNode方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: addNodeInfo
import org.elasticsearch.cluster.node.DiscoveryNode; //導入方法依賴的package包/類
public void addNodeInfo(NodeInfo nodeInfo) {
total++;
DiscoveryNode node = nodeInfo.getNode();
if (node.masterNode()) {
if (node.dataNode()) {
masterData++;
} else {
masterOnly++;
}
} else if (node.dataNode()) {
dataOnly++;
} else if (node.clientNode()) {
client++;
}
}
示例2: Wrapper
import org.elasticsearch.cluster.node.DiscoveryNode; //導入方法依賴的package包/類
public Wrapper(ESLogger logger, Settings settings, ThreadPool threadPool) {
this.logger = logger;
this.threadPool = threadPool;
// Should the action listener be threaded or not by default. Action listeners are automatically threaded for client
// nodes and transport client in order to make sure client side code is not executed on IO threads.
this.threadedListener = DiscoveryNode.clientNode(settings) || TransportClient.CLIENT_TYPE.equals(settings.get(Client.CLIENT_TYPE_SETTING));
}