本文整理汇总了Java中org.apache.ignite.cluster.ClusterNode.isClient方法的典型用法代码示例。如果您正苦于以下问题:Java ClusterNode.isClient方法的具体用法?Java ClusterNode.isClient怎么用?Java ClusterNode.isClient使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.ignite.cluster.ClusterNode
的用法示例。
在下文中一共展示了ClusterNode.isClient方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: checkClientQueueSize
import org.apache.ignite.cluster.ClusterNode; //导入方法依赖的package包/类
/**
* Checks client message queue size and initiates client drop if message queue size exceeds the configured limit.
*
* @param ses Node communication session.
* @param msgQueueSize Message queue size.
*/
private void checkClientQueueSize(GridNioSession ses, int msgQueueSize) {
if (slowClientQueueLimit > 0 && msgQueueSize > slowClientQueueLimit) {
ConnectionKey id = ses.meta(CONN_IDX_META);
if (id != null) {
ClusterNode node = getSpiContext().node(id.nodeId);
if (node != null && node.isClient()) {
String msg = "Client node outbound message queue size exceeded slowClientQueueLimit, " +
"the client will be dropped " +
"(consider changing 'slowClientQueueLimit' configuration property) " +
"[srvNode=" + getSpiContext().localNode().id() +
", clientNode=" + node +
", slowClientQueueLimit=" + slowClientQueueLimit + ']';
U.quietAndWarn(log, msg);
getSpiContext().failNode(id.nodeId(), msg);
}
}
}
}
示例2: segmented
import org.apache.ignite.cluster.ClusterNode; //导入方法依赖的package包/类
/** */
private boolean segmented(Collection<ClusterNode> nodes) {
ClusterNode prev = null;
for (ClusterNode node : nodes) {
if (node.isClient())
continue;
if (prev != null &&
!prev.attribute(DC_NODE_ATTR).equals(node.attribute(DC_NODE_ATTR)))
return false;
prev = node;
}
return true;
}
示例3: TcpDiscoveryNode
import org.apache.ignite.cluster.ClusterNode; //导入方法依赖的package包/类
/**
* IMPORTANT!
* Only purpose of this constructor is creating node which contains necessary data to store on disc only
* @param node to copy data from
*/
public TcpDiscoveryNode(
ClusterNode node
) {
this.id = node.id();
this.consistentId = node.consistentId();
this.addrs = node.addresses();
this.hostNames = node.hostNames();
this.order = node.order();
this.ver = node.version();
this.daemon = node.isDaemon();
this.clientRouterNodeId = node.isClient() ? node.id() : null;
attrs = Collections.singletonMap(ATTR_NODE_CONSISTENT_ID, consistentId);
}
示例4: validateHashIdResolvers
import org.apache.ignite.cluster.ClusterNode; //导入方法依赖的package包/类
/**
* @param node Joining node.
* @return Validation result or {@code null} in case of success.
*/
@Nullable private IgniteNodeValidationResult validateHashIdResolvers(ClusterNode node) {
if (!node.isClient()) {
for (DynamicCacheDescriptor desc : cacheDescriptors().values()) {
CacheConfiguration cfg = desc.cacheConfiguration();
if (cfg.getAffinity() instanceof RendezvousAffinityFunction) {
RendezvousAffinityFunction aff = (RendezvousAffinityFunction)cfg.getAffinity();
Object nodeHashObj = aff.resolveNodeHash(node);
for (ClusterNode topNode : ctx.discovery().allNodes()) {
Object topNodeHashObj = aff.resolveNodeHash(topNode);
if (nodeHashObj.hashCode() == topNodeHashObj.hashCode()) {
String errMsg = "Failed to add node to topology because it has the same hash code for " +
"partitioned affinity as one of existing nodes [cacheName=" +
cfg.getName() + ", existingNodeId=" + topNode.id() + ']';
String sndMsg = "Failed to add node to topology because it has the same hash code for " +
"partitioned affinity as one of existing nodes [cacheName=" +
cfg.getName() + ", existingNodeId=" + topNode.id() + ']';
return new IgniteNodeValidationResult(topNode.id(), errMsg, sndMsg);
}
}
}
}
}
return null;
}
示例5: checkMemoryConfiguration
import org.apache.ignite.cluster.ClusterNode; //导入方法依赖的package包/类
/**
* @param rmt Remote node to check.
* @throws IgniteCheckedException If check failed.
*/
private void checkMemoryConfiguration(ClusterNode rmt) throws IgniteCheckedException {
ClusterNode locNode = ctx.discovery().localNode();
if (ctx.config().isClientMode() || locNode.isDaemon() || rmt.isClient() || rmt.isDaemon())
return;
DataStorageConfiguration dsCfg = null;
Object dsCfgBytes = rmt.attribute(IgniteNodeAttributes.ATTR_DATA_STORAGE_CONFIG);
if (dsCfgBytes instanceof byte[])
dsCfg = new JdkMarshaller().unmarshal((byte[])dsCfgBytes, U.resolveClassLoader(ctx.config()));
if (dsCfg == null) {
// Try to use legacy memory configuration.
MemoryConfiguration memCfg = rmt.attribute(IgniteNodeAttributes.ATTR_MEMORY_CONFIG);
if (memCfg != null) {
dsCfg = new DataStorageConfiguration();
// All properties that are used in validation should be converted here.
dsCfg.setPageSize(memCfg.getPageSize());
}
}
if (dsCfg != null) {
DataStorageConfiguration locDsCfg = ctx.config().getDataStorageConfiguration();
if (dsCfg.getPageSize() != locDsCfg.getPageSize()) {
throw new IgniteCheckedException("Memory configuration mismatch (fix configuration or set -D" +
IGNITE_SKIP_CONFIGURATION_CONSISTENCY_CHECK + "=true system property) [rmtNodeId=" + rmt.id() +
", locPageSize = " + locDsCfg.getPageSize() + ", rmtPageSize = " + dsCfg.getPageSize() + "]");
}
}
}
示例6: setBaselineTopology
import org.apache.ignite.cluster.ClusterNode; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public void setBaselineTopology(long topVer) {
guard();
try {
if (isInMemoryMode())
return;
Collection<ClusterNode> top = topology(topVer);
if (top == null)
throw new IgniteException("Topology version does not exist: " + topVer);
Collection<BaselineNode> target = new ArrayList<>(top.size());
for (ClusterNode node : top) {
if (!node.isClient())
target.add(node);
}
validateBeforeBaselineChange(target);
ctx.state().changeGlobalState(true, target, true).get();
}
catch (IgniteCheckedException e) {
throw U.convertException(e);
}
finally {
unguard();
}
}
示例7: calculateNewBaselineTopology
import org.apache.ignite.cluster.ClusterNode; //导入方法依赖的package包/类
/**
*
*/
private BaselineTopology calculateNewBaselineTopology(final boolean activate,
Collection<? extends BaselineNode> baselineNodes,
boolean forceChangeBaselineTopology) {
BaselineTopology newBlt;
BaselineTopology currentBlt = globalState.baselineTopology();
int newBltId = 0;
if (currentBlt != null)
newBltId = activate ? currentBlt.id() + 1 : currentBlt.id();
if (baselineNodes != null && !baselineNodes.isEmpty()) {
List<BaselineNode> baselineNodes0 = new ArrayList<>();
for (BaselineNode node : baselineNodes) {
if (node instanceof ClusterNode) {
ClusterNode clusterNode = (ClusterNode) node;
if (!clusterNode.isClient() && !clusterNode.isDaemon())
baselineNodes0.add(node);
}
else
baselineNodes0.add(node);
}
baselineNodes = baselineNodes0;
}
if (forceChangeBaselineTopology)
newBlt = BaselineTopology.build(baselineNodes, newBltId);
else if (activate) {
if (baselineNodes == null)
baselineNodes = baselineNodes();
if (currentBlt == null)
newBlt = BaselineTopology.build(baselineNodes, newBltId);
else {
newBlt = currentBlt;
newBlt.updateHistory(baselineNodes);
}
}
else
newBlt = null;
return newBlt;
}
示例8: activator
import org.apache.ignite.cluster.ClusterNode; //导入方法依赖的package包/类
/**
* @param node Node.
* @return {@code True} if this is marker node.
*/
private boolean activator(ClusterNode node) {
return node.isClient() && node.attribute(ACTIVATOR_NODE_ATTR) != null;
}