当前位置: 首页>>代码示例>>Java>>正文


Java ClusterNode.isClient方法代码示例

本文整理汇总了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);
            }
        }
    }
}
 
开发者ID:apache,项目名称:ignite,代码行数:29,代码来源:TcpCommunicationSpi.java

示例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;
}
 
开发者ID:apache,项目名称:ignite,代码行数:18,代码来源:IgniteTopologyValidatorGridSplitCacheTest.java

示例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);
}
 
开发者ID:apache,项目名称:ignite,代码行数:20,代码来源:TcpDiscoveryNode.java

示例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;
}
 
开发者ID:apache,项目名称:ignite,代码行数:36,代码来源:GridCacheProcessor.java

示例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() + "]");
        }
    }
}
 
开发者ID:apache,项目名称:ignite,代码行数:40,代码来源:GridCacheProcessor.java

示例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();
    }
}
 
开发者ID:apache,项目名称:ignite,代码行数:32,代码来源:IgniteClusterImpl.java

示例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;
}
 
开发者ID:apache,项目名称:ignite,代码行数:52,代码来源:GridClusterStateProcessor.java

示例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;
}
 
开发者ID:apache,项目名称:ignite,代码行数:8,代码来源:IgniteTopologyValidatorGridSplitCacheTest.java


注:本文中的org.apache.ignite.cluster.ClusterNode.isClient方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。