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


Java HintedHandOffManager类代码示例

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


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

示例1: excise

import org.apache.cassandra.db.HintedHandOffManager; //导入依赖的package包/类
private void excise(Collection<Token> tokens, InetAddress endpoint)
{
    logger.info("Removing tokens {} for {}", tokens, endpoint);
    HintedHandOffManager.instance.deleteHintsForEndpoint(endpoint);
    removeEndpoint(endpoint);
    tokenMetadata.removeEndpoint(endpoint);
    tokenMetadata.removeBootstrapTokens(tokens);

    if (!isClientMode)
    {
        for (IEndpointLifecycleSubscriber subscriber : lifecycleSubscribers)
            subscriber.onLeaveCluster(endpoint);
    }
    PendingRangeCalculatorService.instance.update();
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:16,代码来源:StorageService.java

示例2: onAlive

import org.apache.cassandra.db.HintedHandOffManager; //导入依赖的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

示例3: prepareToJoin

import org.apache.cassandra.db.HintedHandOffManager; //导入依赖的package包/类
private void prepareToJoin() throws ConfigurationException
{
    if (!joined)
    {
        Map<ApplicationState, VersionedValue> appStates = new HashMap<>();

        if (DatabaseDescriptor.isReplacing() && !(Boolean.parseBoolean(System.getProperty("cassandra.join_ring", "true"))))
            throw new ConfigurationException("Cannot set both join_ring=false and attempt to replace a node");
        if (DatabaseDescriptor.getReplaceTokens().size() > 0 || DatabaseDescriptor.getReplaceNode() != null)
            throw new RuntimeException("Replace method removed; use cassandra.replace_address instead");
        if (DatabaseDescriptor.isReplacing())
        {
            if (SystemKeyspace.bootstrapComplete())
                throw new RuntimeException("Cannot replace address with a node that is already bootstrapped");
            if (!DatabaseDescriptor.isAutoBootstrap())
                throw new RuntimeException("Trying to replace_address with auto_bootstrap disabled will not work, check your configuration");
            bootstrapTokens = prepareReplacementInfo();
            appStates.put(ApplicationState.TOKENS, valueFactory.tokens(bootstrapTokens));
            appStates.put(ApplicationState.STATUS, valueFactory.hibernate(true));
        }
        else if (shouldBootstrap())
        {
            checkForEndpointCollision();
        }

        // have to start the gossip service before we can see any info on other nodes.  this is necessary
        // for bootstrap to get the load info it needs.
        // (we won't be part of the storage ring though until we add a counterId to our state, below.)
        // Seed the host ID-to-endpoint map with our own ID.
        UUID localHostId = SystemKeyspace.getLocalHostId();
        getTokenMetadata().updateHostId(localHostId, FBUtilities.getBroadcastAddress());
        appStates.put(ApplicationState.NET_VERSION, valueFactory.networkVersion());
        appStates.put(ApplicationState.HOST_ID, valueFactory.hostId(localHostId));
        appStates.put(ApplicationState.RPC_ADDRESS, valueFactory.rpcaddress(DatabaseDescriptor.getBroadcastRpcAddress()));
        appStates.put(ApplicationState.RELEASE_VERSION, valueFactory.releaseVersion());
        logger.info("Starting up server gossip");
        Gossiper.instance.register(this);
        Gossiper.instance.start(SystemKeyspace.incrementAndGetGeneration(), appStates); // needed for node-ring gathering.
        // gossip snitch infos (local DC and rack)
        gossipSnitchInfo();
        // gossip Schema.emptyVersion forcing immediate check for schema updates (see MigrationManager#maybeScheduleSchemaPull)
        Schema.instance.updateVersionAndAnnounce(); // Ensure we know our own actual Schema UUID in preparation for updates

        if (!MessagingService.instance().isListening())
            MessagingService.instance().listen(FBUtilities.getLocalAddress());
        LoadBroadcaster.instance.startBroadcasting();

        HintedHandOffManager.instance.start();
        BatchlogManager.instance.start();
    }
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:52,代码来源:StorageService.java

示例4: deliverHints

import org.apache.cassandra.db.HintedHandOffManager; //导入依赖的package包/类
public final void deliverHints(String host) throws UnknownHostException
{
    HintedHandOffManager.instance.scheduleHintDelivery(host);
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:5,代码来源:StorageService.java

示例5: connect

import org.apache.cassandra.db.HintedHandOffManager; //导入依赖的package包/类
/**
 * Create a connection to the JMX agent and setup the M[X]Bean proxies.
 *
 * @throws IOException on connection failures
 */
private void connect() throws IOException
{
    JMXServiceURL jmxUrl = new JMXServiceURL(String.format(fmtUrl, host, port));
    Map<String,Object> env = new HashMap<String,Object>();
    if (username != null)
    {
        String[] creds = { username, password };
        env.put(JMXConnector.CREDENTIALS, creds);
    }
    jmxc = JMXConnectorFactory.connect(jmxUrl, env);
    mbeanServerConn = jmxc.getMBeanServerConnection();

    try
    {
        ObjectName name = new ObjectName(ssObjName);
        ssProxy = JMX.newMBeanProxy(mbeanServerConn, name, StorageServiceMBean.class);
        name = new ObjectName(MessagingService.MBEAN_NAME);
        msProxy = JMX.newMBeanProxy(mbeanServerConn, name, MessagingServiceMBean.class);
        name = new ObjectName(StreamManagerMBean.OBJECT_NAME);
        streamProxy = JMX.newMBeanProxy(mbeanServerConn, name, StreamManagerMBean.class);
        name = new ObjectName(CompactionManager.MBEAN_OBJECT_NAME);
        compactionProxy = JMX.newMBeanProxy(mbeanServerConn, name, CompactionManagerMBean.class);
        name = new ObjectName(FailureDetector.MBEAN_NAME);
        fdProxy = JMX.newMBeanProxy(mbeanServerConn, name, FailureDetectorMBean.class);
        name = new ObjectName(CacheService.MBEAN_NAME);
        cacheService = JMX.newMBeanProxy(mbeanServerConn, name, CacheServiceMBean.class);
        name = new ObjectName(StorageProxy.MBEAN_NAME);
        spProxy = JMX.newMBeanProxy(mbeanServerConn, name, StorageProxyMBean.class);
        name = new ObjectName(HintedHandOffManager.MBEAN_NAME);
        hhProxy = JMX.newMBeanProxy(mbeanServerConn, name, HintedHandOffManagerMBean.class);
        name = new ObjectName(GCInspector.MBEAN_NAME);
        gcProxy = JMX.newMBeanProxy(mbeanServerConn, name, GCInspectorMXBean.class);
    }
    catch (MalformedObjectNameException e)
    {
        throw new RuntimeException(
                "Invalid ObjectName? Please report this as a bug.", e);
    }

    memProxy = ManagementFactory.newPlatformMXBeanProxy(mbeanServerConn,
            ManagementFactory.MEMORY_MXBEAN_NAME, MemoryMXBean.class);
    runtimeProxy = ManagementFactory.newPlatformMXBeanProxy(
            mbeanServerConn, ManagementFactory.RUNTIME_MXBEAN_NAME, RuntimeMXBean.class);
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:50,代码来源:NodeProbe.java

示例6: connect

import org.apache.cassandra.db.HintedHandOffManager; //导入依赖的package包/类
/**
 * Create a connection to the JMX agent and setup the M[X]Bean proxies.
 *
 * @throws IOException on connection failures
 */
private void connect() throws IOException
{
    JMXServiceURL jmxUrl = new JMXServiceURL(String.format(fmtUrl, host, port));
    Map<String,Object> env = new HashMap<String,Object>();
    if (username != null)
    {
        String[] creds = { username, password };
        env.put(JMXConnector.CREDENTIALS, creds);
    }
    jmxc = JMXConnectorFactory.connect(jmxUrl, env);
    mbeanServerConn = jmxc.getMBeanServerConnection();

    try
    {
        ObjectName name = new ObjectName(ssObjName);
        ssProxy = JMX.newMBeanProxy(mbeanServerConn, name, StorageServiceMBean.class);
        name = new ObjectName(MessagingService.MBEAN_NAME);
        msProxy = JMX.newMBeanProxy(mbeanServerConn, name, MessagingServiceMBean.class);
        name = new ObjectName(StreamManagerMBean.OBJECT_NAME);
        streamProxy = JMX.newMBeanProxy(mbeanServerConn, name, StreamManagerMBean.class);
        name = new ObjectName(CompactionManager.MBEAN_OBJECT_NAME);
        compactionProxy = JMX.newMBeanProxy(mbeanServerConn, name, CompactionManagerMBean.class);
        name = new ObjectName(FailureDetector.MBEAN_NAME);
        fdProxy = JMX.newMBeanProxy(mbeanServerConn, name, FailureDetectorMBean.class);
        name = new ObjectName(CacheService.MBEAN_NAME);
        cacheService = JMX.newMBeanProxy(mbeanServerConn, name, CacheServiceMBean.class);
        name = new ObjectName(StorageProxy.MBEAN_NAME);
        spProxy = JMX.newMBeanProxy(mbeanServerConn, name, StorageProxyMBean.class);
        name = new ObjectName(HintedHandOffManager.MBEAN_NAME);
        hhProxy = JMX.newMBeanProxy(mbeanServerConn, name, HintedHandOffManagerMBean.class);
    } catch (MalformedObjectNameException e)
    {
        throw new RuntimeException(
                "Invalid ObjectName? Please report this as a bug.", e);
    }

    memProxy = ManagementFactory.newPlatformMXBeanProxy(mbeanServerConn,
            ManagementFactory.MEMORY_MXBEAN_NAME, MemoryMXBean.class);
    runtimeProxy = ManagementFactory.newPlatformMXBeanProxy(
            mbeanServerConn, ManagementFactory.RUNTIME_MXBEAN_NAME, RuntimeMXBean.class);
}
 
开发者ID:pgaref,项目名称:ACaZoo,代码行数:47,代码来源:NodeProbe.java

示例7: connect

import org.apache.cassandra.db.HintedHandOffManager; //导入依赖的package包/类
/**
 * Create a connection to the JMX agent and setup the M[X]Bean proxies.
 *
 * @throws IOException on connection failures
 */
private void connect() throws IOException
{
    JMXServiceURL jmxUrl = new JMXServiceURL(String.format(fmtUrl, host, port));
    Map<String,Object> env = new HashMap<String,Object>();
    if (username != null)
    {
        String[] creds = { username, password };
        env.put(JMXConnector.CREDENTIALS, creds);
    }

    env.put("com.sun.jndi.rmi.factory.socket", getRMIClientSocketFactory());

    jmxc = JMXConnectorFactory.connect(jmxUrl, env);
    mbeanServerConn = jmxc.getMBeanServerConnection();

    try
    {
        ObjectName name = new ObjectName(ssObjName);
        ssProxy = JMX.newMBeanProxy(mbeanServerConn, name, StorageServiceMBean.class);
        name = new ObjectName(MessagingService.MBEAN_NAME);
        msProxy = JMX.newMBeanProxy(mbeanServerConn, name, MessagingServiceMBean.class);
        name = new ObjectName(StreamManagerMBean.OBJECT_NAME);
        streamProxy = JMX.newMBeanProxy(mbeanServerConn, name, StreamManagerMBean.class);
        name = new ObjectName(CompactionManager.MBEAN_OBJECT_NAME);
        compactionProxy = JMX.newMBeanProxy(mbeanServerConn, name, CompactionManagerMBean.class);
        name = new ObjectName(FailureDetector.MBEAN_NAME);
        fdProxy = JMX.newMBeanProxy(mbeanServerConn, name, FailureDetectorMBean.class);
        name = new ObjectName(CacheService.MBEAN_NAME);
        cacheService = JMX.newMBeanProxy(mbeanServerConn, name, CacheServiceMBean.class);
        name = new ObjectName(StorageProxy.MBEAN_NAME);
        spProxy = JMX.newMBeanProxy(mbeanServerConn, name, StorageProxyMBean.class);
        name = new ObjectName(HintedHandOffManager.MBEAN_NAME);
        hhProxy = JMX.newMBeanProxy(mbeanServerConn, name, HintedHandOffManagerMBean.class);
        name = new ObjectName(GCInspector.MBEAN_NAME);
        gcProxy = JMX.newMBeanProxy(mbeanServerConn, name, GCInspectorMXBean.class);
        name = new ObjectName(Gossiper.MBEAN_NAME);
        gossProxy = JMX.newMBeanProxy(mbeanServerConn, name, GossiperMBean.class);
        name = new ObjectName(BatchlogManager.MBEAN_NAME);
        bmProxy = JMX.newMBeanProxy(mbeanServerConn, name, BatchlogManagerMBean.class);
    }
    catch (MalformedObjectNameException e)
    {
        throw new RuntimeException(
                "Invalid ObjectName? Please report this as a bug.", e);
    }

    memProxy = ManagementFactory.newPlatformMXBeanProxy(mbeanServerConn,
            ManagementFactory.MEMORY_MXBEAN_NAME, MemoryMXBean.class);
    runtimeProxy = ManagementFactory.newPlatformMXBeanProxy(
            mbeanServerConn, ManagementFactory.RUNTIME_MXBEAN_NAME, RuntimeMXBean.class);
}
 
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:57,代码来源:NodeProbe.java

示例8: connect

import org.apache.cassandra.db.HintedHandOffManager; //导入依赖的package包/类
/**
 * Create a connection to the JMX agent and setup the M[X]Bean proxies.
 *
 * @throws IOException on connection failures
 */
private void connect() throws IOException
{
    JMXServiceURL jmxUrl = new JMXServiceURL(String.format(fmtUrl, host, port));
    Map<String,Object> env = new HashMap<String,Object>();
    if (username != null)
    {
        String[] creds = { username, password };
        env.put(JMXConnector.CREDENTIALS, creds);
    }
    jmxc = JMXConnectorFactory.connect(jmxUrl, env);
    mbeanServerConn = jmxc.getMBeanServerConnection();

    try
    {
        ObjectName name = new ObjectName(ssObjName);
        ssProxy = JMX.newMBeanProxy(mbeanServerConn, name, StorageServiceMBean.class);
        name = new ObjectName(MessagingService.MBEAN_NAME);
        msProxy = JMX.newMBeanProxy(mbeanServerConn, name, MessagingServiceMBean.class);
        name = new ObjectName(StreamManagerMBean.OBJECT_NAME);
        streamProxy = JMX.newMBeanProxy(mbeanServerConn, name, StreamManagerMBean.class);
        name = new ObjectName(CompactionManager.MBEAN_OBJECT_NAME);
        compactionProxy = JMX.newMBeanProxy(mbeanServerConn, name, CompactionManagerMBean.class);
        name = new ObjectName(FailureDetector.MBEAN_NAME);
        fdProxy = JMX.newMBeanProxy(mbeanServerConn, name, FailureDetectorMBean.class);
        name = new ObjectName(CacheService.MBEAN_NAME);
        cacheService = JMX.newMBeanProxy(mbeanServerConn, name, CacheServiceMBean.class);
        name = new ObjectName(StorageProxy.MBEAN_NAME);
        spProxy = JMX.newMBeanProxy(mbeanServerConn, name, StorageProxyMBean.class);
        name = new ObjectName(HintedHandOffManager.MBEAN_NAME);
        hhProxy = JMX.newMBeanProxy(mbeanServerConn, name, HintedHandOffManagerMBean.class);
        name = new ObjectName(GCInspector.MBEAN_NAME);
        gcProxy = JMX.newMBeanProxy(mbeanServerConn, name, GCInspectorMXBean.class);
        name = new ObjectName(Gossiper.MBEAN_NAME);
        gossProxy = JMX.newMBeanProxy(mbeanServerConn, name, GossiperMBean.class);
    }
    catch (MalformedObjectNameException e)
    {
        throw new RuntimeException(
                "Invalid ObjectName? Please report this as a bug.", e);
    }

    memProxy = ManagementFactory.newPlatformMXBeanProxy(mbeanServerConn,
            ManagementFactory.MEMORY_MXBEAN_NAME, MemoryMXBean.class);
    runtimeProxy = ManagementFactory.newPlatformMXBeanProxy(
            mbeanServerConn, ManagementFactory.RUNTIME_MXBEAN_NAME, RuntimeMXBean.class);
}
 
开发者ID:daidong,项目名称:GraphTrek,代码行数:52,代码来源:NodeProbe.java

示例9: connect

import org.apache.cassandra.db.HintedHandOffManager; //导入依赖的package包/类
/**
 * Create a connection to the JMX agent and setup the M[X]Bean proxies.
 *
 * @throws IOException on connection failures
 */
private void connect() throws IOException
{
    JMXServiceURL jmxUrl = new JMXServiceURL(String.format(fmtUrl, host, port));
    Map<String,Object> env = new HashMap<String,Object>();
    if (username != null)
    {
        String[] creds = { username, password };
        env.put(JMXConnector.CREDENTIALS, creds);
    }
    jmxc = JMXConnectorFactory.connect(jmxUrl, env);
    mbeanServerConn = jmxc.getMBeanServerConnection();

    try
    {
        ObjectName name = new ObjectName(ssObjName);
        ssProxy = JMX.newMBeanProxy(mbeanServerConn, name, StorageServiceMBean.class);
        name = new ObjectName(PBSPredictor.MBEAN_NAME);
        PBSPredictorProxy = JMX.newMBeanProxy(mbeanServerConn, name, PBSPredictorMBean.class);
        name = new ObjectName(MessagingService.MBEAN_NAME);
        msProxy = JMX.newMBeanProxy(mbeanServerConn, name, MessagingServiceMBean.class);
        name = new ObjectName(StreamingService.MBEAN_OBJECT_NAME);
        streamProxy = JMX.newMBeanProxy(mbeanServerConn, name, StreamingServiceMBean.class);
        name = new ObjectName(CompactionManager.MBEAN_OBJECT_NAME);
        compactionProxy = JMX.newMBeanProxy(mbeanServerConn, name, CompactionManagerMBean.class);
        name = new ObjectName(FailureDetector.MBEAN_NAME);
        fdProxy = JMX.newMBeanProxy(mbeanServerConn, name, FailureDetectorMBean.class);
        name = new ObjectName(CacheService.MBEAN_NAME);
        cacheService = JMX.newMBeanProxy(mbeanServerConn, name, CacheServiceMBean.class);
        name = new ObjectName(StorageProxy.MBEAN_NAME);
        spProxy = JMX.newMBeanProxy(mbeanServerConn, name, StorageProxyMBean.class);
        name = new ObjectName(HintedHandOffManager.MBEAN_NAME);
        hhProxy = JMX.newMBeanProxy(mbeanServerConn, name, HintedHandOffManagerMBean.class);
    } catch (MalformedObjectNameException e)
    {
        throw new RuntimeException(
                "Invalid ObjectName? Please report this as a bug.", e);
    }

    memProxy = ManagementFactory.newPlatformMXBeanProxy(mbeanServerConn,
            ManagementFactory.MEMORY_MXBEAN_NAME, MemoryMXBean.class);
    runtimeProxy = ManagementFactory.newPlatformMXBeanProxy(
            mbeanServerConn, ManagementFactory.RUNTIME_MXBEAN_NAME, RuntimeMXBean.class);
}
 
开发者ID:dprguiuc,项目名称:Cassandra-Wasef,代码行数:49,代码来源:NodeProbe.java


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