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


Java EndpointState.getApplicationState方法代码示例

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


在下文中一共展示了EndpointState.getApplicationState方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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.toString()))
        || vv == null)
    {
        Gossiper.instance.addLocalApplicationState(ApplicationState.INTERNAL_IP,
            StorageService.instance.valueFactory.internalIP(localNodeData.dcLocalAddress.toString()));
    }
}
 
开发者ID:pgaref,项目名称:ACaZoo,代码行数:20,代码来源:YamlFileNetworkTopologySnitch.java

示例4: 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:scylladb,项目名称:scylla-tools-java,代码行数:16,代码来源:GoogleCloudSnitch.java

示例5: 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

示例6: 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:scylladb,项目名称:scylla-tools-java,代码行数:16,代码来源:Ec2Snitch.java

示例7: 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

示例8: 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

示例9: 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:scylladb,项目名称:scylla-tools-java,代码行数:16,代码来源:CloudstackSnitch.java

示例10: 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:Stratio,项目名称:stratio-cassandra,代码行数:16,代码来源:GoogleCloudSnitch.java

示例11: 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)
        return DEFAULT_DC;
    return state.getApplicationState(ApplicationState.DC).value;
}
 
开发者ID:jackliu8722,项目名称:cassandra-1.2.16,代码行数:10,代码来源:Ec2Snitch.java

示例12: 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)
        return DEFAULT_RACK;
    return state.getApplicationState(ApplicationState.RACK).value;
}
 
开发者ID:wso2,项目名称:wso2-cassandra,代码行数:10,代码来源:Ec2Snitch.java

示例13: onJoin

import org.apache.cassandra.gms.EndpointState; //导入方法依赖的package包/类
public void onJoin(InetAddress endpoint, EndpointState epState)
{
    if (preferLocal && epState.getApplicationState(ApplicationState.INTERNAL_IP) != null)
        reconnect(endpoint, epState.getApplicationState(ApplicationState.INTERNAL_IP));
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:6,代码来源:ReconnectableSnitchHelper.java

示例14: onAlive

import org.apache.cassandra.gms.EndpointState; //导入方法依赖的package包/类
public void onAlive(InetAddress endpoint, EndpointState state)
{
    if (preferLocal && state.getApplicationState(ApplicationState.INTERNAL_IP) != null)
        reconnect(endpoint, state.getApplicationState(ApplicationState.INTERNAL_IP));
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:6,代码来源:ReconnectableSnitchHelper.java


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