本文整理汇总了Java中com.aerospike.client.Host.equals方法的典型用法代码示例。如果您正苦于以下问题:Java Host.equals方法的具体用法?Java Host.equals怎么用?Java Host.equals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.aerospike.client.Host
的用法示例。
在下文中一共展示了Host.equals方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: findAlias
import com.aerospike.client.Host; //导入方法依赖的package包/类
private final static boolean findAlias(List<Host> friends, Host alias) {
for (Host host : friends) {
if (host.equals(alias)) {
return true;
}
}
return false;
}
示例2: findSeed
import com.aerospike.client.Host; //导入方法依赖的package包/类
private final boolean findSeed(Host search) {
for (Host seed : seeds) {
if (seed.equals(search)) {
return true;
}
}
return false;
}
示例3: seedNodes
import com.aerospike.client.Host; //导入方法依赖的package包/类
private final void seedNodes() {
// Must copy array reference for copy on write semantics to work.
Host[] seedArray = seeds;
// Add all nodes at once to avoid copying entire array multiple times.
ArrayList<Node> list = new ArrayList<Node>();
for (Host seed : seedArray) {
try {
NodeValidator seedNodeValidator = new NodeValidator(seed, connectionTimeout);
// Seed host may have multiple aliases in the case of round-robin dns configurations.
for (Host alias : seedNodeValidator.aliases) {
NodeValidator nv;
if (alias.equals(seed)) {
nv = seedNodeValidator;
}
else {
nv = new NodeValidator(alias, connectionTimeout);
}
if (! findNodeName(list, nv.name)) {
Node node = createNode(nv);
addAliases(node);
list.add(node);
}
}
}
catch (Exception e) {
// Try next host
if (Log.debugEnabled()) {
Log.debug("Seed " + seed + " failed: " + Util.getErrorMessage(e));
}
}
}
if (list.size() > 0) {
addNodesCopy(list);
}
}