• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java EndpointState类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.apache.cassandra.gms.EndpointState的典型用法代码示例。如果您正苦于以下问题:Java EndpointState类的具体用法?Java EndpointState怎么用?Java EndpointState使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



EndpointState类属于org.apache.cassandra.gms包,在下文中一共展示了EndpointState类的18个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getDatacenter

import org.apache.cassandra.gms.EndpointState; //导入依赖的package包/类
/**
 * Return the data center for which an endpoint resides in
 *
 * @param endpoint the endpoint to process
 * @return string of data center
 */
public String getDatacenter(InetAddress endpoint)
{
    if (endpoint.equals(FBUtilities.getBroadcastAddress()))
        return myDC;

    EndpointState epState = Gossiper.instance.getEndpointStateForEndpoint(endpoint);
    if (epState == null || epState.getApplicationState(ApplicationState.DC) == null)
    {
        if (psnitch == null)
        {
            if (savedEndpoints == null)
                savedEndpoints = SystemKeyspace.loadDcRackInfo();
            if (savedEndpoints.containsKey(endpoint))
                return savedEndpoints.get(endpoint).get("data_center");
            return DEFAULT_DC;
        }
        else
            return psnitch.getDatacenter(endpoint);
    }
    return epState.getApplicationState(ApplicationState.DC).value;
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:28,代码来源:GossipingPropertyFileSnitch.java


示例2: getRack

import org.apache.cassandra.gms.EndpointState; //导入依赖的package包/类
/**
 * Return the rack for which an endpoint resides in
 *
 * @param endpoint the endpoint to process
 * @return string of rack
 */
public String getRack(InetAddress endpoint)
{
    if (endpoint.equals(FBUtilities.getBroadcastAddress()))
        return myRack;

    EndpointState epState = Gossiper.instance.getEndpointStateForEndpoint(endpoint);
    if (epState == null || epState.getApplicationState(ApplicationState.RACK) == null)
    {
        if (psnitch == null)
        {
            if (savedEndpoints == null)
                savedEndpoints = SystemKeyspace.loadDcRackInfo();
            if (savedEndpoints.containsKey(endpoint))
                return savedEndpoints.get(endpoint).get("rack");
            return DEFAULT_RACK;
        }
        else
            return psnitch.getRack(endpoint);
    }
    return epState.getApplicationState(ApplicationState.RACK).value;
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:28,代码来源:GossipingPropertyFileSnitch.java


示例3: maybeSetApplicationState

import org.apache.cassandra.gms.EndpointState; //导入依赖的package包/类
/**
 * be careful about just blindly updating ApplicationState.INTERNAL_IP everytime we read the yaml file,
 * as that can cause connections to get unnecessarily reset (via IESCS.onChange()).
 */
private void maybeSetApplicationState()
{
    if (localNodeData.dcLocalAddress == null)
        return;
    final EndpointState es = Gossiper.instance.getEndpointStateForEndpoint(FBUtilities.getBroadcastAddress());
    if (es == null)
        return;
    final VersionedValue vv = es.getApplicationState(ApplicationState.INTERNAL_IP);
    if ((vv != null && !vv.value.equals(localNodeData.dcLocalAddress.getHostAddress()))
        || vv == null)
    {
        Gossiper.instance.addLocalApplicationState(ApplicationState.INTERNAL_IP,
            StorageService.instance.valueFactory.internalIP(localNodeData.dcLocalAddress.getHostAddress()));
    }
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:20,代码来源:YamlFileNetworkTopologySnitch.java


示例4: maybeSetApplicationState

import org.apache.cassandra.gms.EndpointState; //导入依赖的package包/类
/**
 * be careful about just blindly updating ApplicationState.INTERNAL_IP everytime we read the yaml file,
 * as that can cause connections to get unnecessarily reset (via IESCS.onChange()).
 */
private void maybeSetApplicationState()
{
    if (localNodeData.dcLocalAddress == null)
        return;
    final EndpointState es = Gossiper.instance.getEndpointStateForEndpoint(FBUtilities.getBroadcastAddress());
    if (es == null)
        return;
    final VersionedValue vv = es.getApplicationState(ApplicationState.INTERNAL_IP);
    if ((vv != null && !vv.value.equals(localNodeData.dcLocalAddress.toString()))
        || vv == null)
    {
        Gossiper.instance.addLocalApplicationState(ApplicationState.INTERNAL_IP,
            StorageService.instance.valueFactory.internalIP(localNodeData.dcLocalAddress.toString()));
    }
}
 
开发者ID:pgaref,项目名称:ACaZoo,代码行数:20,代码来源:YamlFileNetworkTopologySnitch.java


示例5: getDatacenter

import org.apache.cassandra.gms.EndpointState; //导入依赖的package包/类
/**
 * Return the data center for which an endpoint resides in
 *
 * @param endpoint the endpoint to process
 * @return string of data center
 */
public String getDatacenter(InetAddress endpoint)
{
    if (endpoint.equals(FBUtilities.getBroadcastAddress()))
        return myDC;

    EndpointState epState = Gossiper.instance.getEndpointStateForEndpoint(endpoint);
    if (epState == null || epState.getApplicationState(ApplicationState.DC) == null)
    {
        if (psnitch == null)
        {
            if (savedEndpoints == null)
                savedEndpoints = SystemTable.loadDcRackInfo();
            if (savedEndpoints.containsKey(endpoint))
                return savedEndpoints.get(endpoint).get("data_center");
            return DEFAULT_DC;
        }
        else
            return psnitch.getDatacenter(endpoint);
    }
    return epState.getApplicationState(ApplicationState.DC).value;
}
 
开发者ID:dprguiuc,项目名称:Cassandra-Wasef,代码行数:28,代码来源:GossipingPropertyFileSnitch.java


示例6: getRack

import org.apache.cassandra.gms.EndpointState; //导入依赖的package包/类
/**
 * Return the rack for which an endpoint resides in
 *
 * @param endpoint the endpoint to process
 * @return string of rack
 */
public String getRack(InetAddress endpoint)
{
    if (endpoint.equals(FBUtilities.getBroadcastAddress()))
        return myRack;

    EndpointState epState = Gossiper.instance.getEndpointStateForEndpoint(endpoint);
    if (epState == null || epState.getApplicationState(ApplicationState.RACK) == null)
    {
        if (psnitch == null)
        {
            if (savedEndpoints == null)
                savedEndpoints = SystemTable.loadDcRackInfo();
            if (savedEndpoints.containsKey(endpoint))
                return savedEndpoints.get(endpoint).get("rack");
            return DEFAULT_RACK;
        }
        else
            return psnitch.getRack(endpoint);
    }
    return epState.getApplicationState(ApplicationState.RACK).value;
}
 
开发者ID:dprguiuc,项目名称:Cassandra-Wasef,代码行数:28,代码来源:GossipingPropertyFileSnitch.java


示例7: getRack

import org.apache.cassandra.gms.EndpointState; //导入依赖的package包/类
public String getRack(InetAddress endpoint)
{
    if (endpoint.equals(FBUtilities.getBroadcastAddress()))
        return csZoneRack;
    EndpointState state = Gossiper.instance.getEndpointStateForEndpoint(endpoint);
    if (state == null || state.getApplicationState(ApplicationState.RACK) == null) 
    {
        if (savedEndpoints == null)
            savedEndpoints = SystemKeyspace.loadDcRackInfo();
        if (savedEndpoints.containsKey(endpoint))
            return savedEndpoints.get(endpoint).get("rack");
        return DEFAULT_RACK;
    }
    return state.getApplicationState(ApplicationState.RACK).value;
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:16,代码来源:CloudstackSnitch.java


示例8: getDatacenter

import org.apache.cassandra.gms.EndpointState; //导入依赖的package包/类
public String getDatacenter(InetAddress endpoint)
{
    if (endpoint.equals(FBUtilities.getBroadcastAddress()))
        return csZoneDc;
    EndpointState state = Gossiper.instance.getEndpointStateForEndpoint(endpoint);
    if (state == null || state.getApplicationState(ApplicationState.DC) == null) 
    {
        if (savedEndpoints == null)
            savedEndpoints = SystemKeyspace.loadDcRackInfo();
        if (savedEndpoints.containsKey(endpoint))
            return savedEndpoints.get(endpoint).get("data_center");
        return DEFAULT_DC;
    }
    return state.getApplicationState(ApplicationState.DC).value;
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:16,代码来源:CloudstackSnitch.java


示例9: getRack

import org.apache.cassandra.gms.EndpointState; //导入依赖的package包/类
public String getRack(InetAddress endpoint)
{
    if (endpoint.equals(FBUtilities.getBroadcastAddress()))
        return gceZone;
    EndpointState state = Gossiper.instance.getEndpointStateForEndpoint(endpoint);
    if (state == null || state.getApplicationState(ApplicationState.RACK) == null)
    {
        if (savedEndpoints == null)
            savedEndpoints = SystemKeyspace.loadDcRackInfo();
        if (savedEndpoints.containsKey(endpoint))
            return savedEndpoints.get(endpoint).get("rack");
        return DEFAULT_RACK;
    }
    return state.getApplicationState(ApplicationState.RACK).value;
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:16,代码来源:GoogleCloudSnitch.java


示例10: getDatacenter

import org.apache.cassandra.gms.EndpointState; //导入依赖的package包/类
public String getDatacenter(InetAddress endpoint)
{
    if (endpoint.equals(FBUtilities.getBroadcastAddress()))
        return gceRegion;
    EndpointState state = Gossiper.instance.getEndpointStateForEndpoint(endpoint);
    if (state == null || state.getApplicationState(ApplicationState.DC) == null)
    {
        if (savedEndpoints == null)
            savedEndpoints = SystemKeyspace.loadDcRackInfo();
        if (savedEndpoints.containsKey(endpoint))
            return savedEndpoints.get(endpoint).get("data_center");
        return DEFAULT_DC;
    }
    return state.getApplicationState(ApplicationState.DC).value;
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:16,代码来源:GoogleCloudSnitch.java


示例11: getRack

import org.apache.cassandra.gms.EndpointState; //导入依赖的package包/类
public String getRack(InetAddress endpoint)
{
    if (endpoint.equals(FBUtilities.getBroadcastAddress()))
        return ec2zone;
    EndpointState state = Gossiper.instance.getEndpointStateForEndpoint(endpoint);
    if (state == null || state.getApplicationState(ApplicationState.RACK) == null)
    {
        if (savedEndpoints == null)
            savedEndpoints = SystemKeyspace.loadDcRackInfo();
        if (savedEndpoints.containsKey(endpoint))
            return savedEndpoints.get(endpoint).get("rack");
        return DEFAULT_RACK;
    }
    return state.getApplicationState(ApplicationState.RACK).value;
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:16,代码来源:Ec2Snitch.java


示例12: getDatacenter

import org.apache.cassandra.gms.EndpointState; //导入依赖的package包/类
public String getDatacenter(InetAddress endpoint)
{
    if (endpoint.equals(FBUtilities.getBroadcastAddress()))
        return ec2region;
    EndpointState state = Gossiper.instance.getEndpointStateForEndpoint(endpoint);
    if (state == null || state.getApplicationState(ApplicationState.DC) == null)
    {
        if (savedEndpoints == null)
            savedEndpoints = SystemKeyspace.loadDcRackInfo();
        if (savedEndpoints.containsKey(endpoint))
            return savedEndpoints.get(endpoint).get("data_center");
        return DEFAULT_DC;
    }
    return state.getApplicationState(ApplicationState.DC).value;
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:16,代码来源:Ec2Snitch.java


示例13: getSeverity

import org.apache.cassandra.gms.EndpointState; //导入依赖的package包/类
public double getSeverity(InetAddress endpoint)
{
    VersionedValue event;
    EndpointState state = Gossiper.instance.getEndpointStateForEndpoint(endpoint);
    if (state != null && (event = state.getApplicationState(ApplicationState.SEVERITY)) != null)
        return Double.parseDouble(event.value);
    return 0.0;
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:9,代码来源:BackgroundActivityMonitor.java


示例14: checkForEndpointCollision

import org.apache.cassandra.gms.EndpointState; //导入依赖的package包/类
public synchronized void checkForEndpointCollision() throws ConfigurationException
{
    logger.debug("Starting shadow gossip round to check for endpoint collision");
    if (!MessagingService.instance().isListening())
        MessagingService.instance().listen(FBUtilities.getLocalAddress());
    Gossiper.instance.doShadowRound();
    EndpointState epState = Gossiper.instance.getEndpointStateForEndpoint(FBUtilities.getBroadcastAddress());
    if (epState != null && !Gossiper.instance.isDeadState(epState) && !Gossiper.instance.isFatClient(FBUtilities.getBroadcastAddress()))
    {
        throw new RuntimeException(String.format("A node with address %s already exists, cancelling join. " +
                                                 "Use cassandra.replace_address if you want to replace this node.",
                                                 FBUtilities.getBroadcastAddress()));
    }
    if (RangeStreamer.useStrictConsistency)
    {
        for (Map.Entry<InetAddress, EndpointState> entry : Gossiper.instance.getEndpointStates())
        {

            if (entry.getValue().getApplicationState(ApplicationState.STATUS) == null)
                    continue;
            String[] pieces = entry.getValue().getApplicationState(ApplicationState.STATUS).value.split(VersionedValue.DELIMITER_STR, -1);
            assert (pieces.length > 0);
            String state = pieces[0];
            if (state.equals(VersionedValue.STATUS_BOOTSTRAPPING) || state.equals(VersionedValue.STATUS_LEAVING) || state.equals(VersionedValue.STATUS_MOVING))
                throw new UnsupportedOperationException("Other bootstrapping/leaving/moving nodes detected, cannot bootstrap while cassandra.consistent.rangemovement is true");
        }
    }
    Gossiper.instance.resetEndpointStateMap();
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:30,代码来源:StorageService.java


示例15: updatePeerInfo

import org.apache.cassandra.gms.EndpointState; //导入依赖的package包/类
private void updatePeerInfo(InetAddress endpoint)
{
    EndpointState epState = Gossiper.instance.getEndpointStateForEndpoint(endpoint);
    for (Map.Entry<ApplicationState, VersionedValue> entry : epState.getApplicationStateMap().entrySet())
    {
        switch (entry.getKey())
        {
            case RELEASE_VERSION:
                SystemKeyspace.updatePeerInfo(endpoint, "release_version", entry.getValue().value);
                break;
            case DC:
                SystemKeyspace.updatePeerInfo(endpoint, "data_center", entry.getValue().value);
                break;
            case RACK:
                SystemKeyspace.updatePeerInfo(endpoint, "rack", entry.getValue().value);
                break;
            case RPC_ADDRESS:
                try
                {
                    SystemKeyspace.updatePeerInfo(endpoint, "rpc_address", InetAddress.getByName(entry.getValue().value));
                }
                catch (UnknownHostException e)
                {
                    throw new RuntimeException(e);
                }
                break;
            case SCHEMA:
                SystemKeyspace.updatePeerInfo(endpoint, "schema_version", UUID.fromString(entry.getValue().value));
                break;
            case HOST_ID:
                SystemKeyspace.updatePeerInfo(endpoint, "host_id", UUID.fromString(entry.getValue().value));
                break;
        }
    }
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:36,代码来源:StorageService.java


示例16: onJoin

import org.apache.cassandra.gms.EndpointState; //导入依赖的package包/类
public void onJoin(InetAddress endpoint, EndpointState epState)
{
    for (Map.Entry<ApplicationState, VersionedValue> entry : epState.getApplicationStateMap().entrySet())
    {
        onChange(endpoint, entry.getKey(), entry.getValue());
    }
    MigrationManager.instance.scheduleSchemaPull(endpoint, epState);
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:9,代码来源:StorageService.java


示例17: onAlive

import org.apache.cassandra.gms.EndpointState; //导入依赖的package包/类
public void onAlive(InetAddress endpoint, EndpointState state)
{
    MigrationManager.instance.scheduleSchemaPull(endpoint, state);

    if (isClientMode)
        return;

    if (tokenMetadata.isMember(endpoint))
    {
        HintedHandOffManager.instance.scheduleHintDelivery(endpoint, true);
        for (IEndpointLifecycleSubscriber subscriber : lifecycleSubscribers)
            subscriber.onUp(endpoint);
    }
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:15,代码来源:StorageService.java


示例18: onDead

import org.apache.cassandra.gms.EndpointState; //导入依赖的package包/类
public void onDead(InetAddress endpoint, EndpointState state)
{
    MessagingService.instance().convict(endpoint);
    if (!isClientMode)
    {
        for (IEndpointLifecycleSubscriber subscriber : lifecycleSubscribers)
            subscriber.onDown(endpoint);
    }
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:10,代码来源:StorageService.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ICompletionProposalExtension2类代码示例发布时间:2022-05-22
下一篇:
Java EventInfo类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap