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


Java SyncRequestProcessor.start方法代码示例

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


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

示例1: setupRequestProcessors

import org.apache.zookeeper.server.SyncRequestProcessor; //导入方法依赖的package包/类
/**
 * Set up the request processors for an Observer:
 * firstProcesor->commitProcessor->finalProcessor
 */
@Override
protected void setupRequestProcessors() {      
    // We might consider changing the processor behaviour of 
    // Observers to, for example, remove the disk sync requirements.
    // Currently, they behave almost exactly the same as followers.
    RequestProcessor finalProcessor = new FinalRequestProcessor(this);
    commitProcessor = new CommitProcessor(finalProcessor,
            Long.toString(getServerId()), true);
    commitProcessor.start();
    firstProcessor = new ObserverRequestProcessor(this, commitProcessor);
    ((ObserverRequestProcessor) firstProcessor).start();
    syncProcessor = new SyncRequestProcessor(this,
            new SendAckRequestProcessor(getObserver()));
    syncProcessor.start();
}
 
开发者ID:gerritjvv,项目名称:bigstreams,代码行数:20,代码来源:ObserverZooKeeperServer.java

示例2: setupRequestProcessors

import org.apache.zookeeper.server.SyncRequestProcessor; //导入方法依赖的package包/类
/**
 * Set up the request processors for an Observer:
 * firstProcesor->commitProcessor->finalProcessor
 */
@Override
protected void setupRequestProcessors() {      
    // We might consider changing the processor behaviour of 
    // Observers to, for example, remove the disk sync requirements.
    // Currently, they behave almost exactly the same as followers.
    RequestProcessor finalProcessor = new FinalRequestProcessor(this);
    commitProcessor = new CommitProcessor(finalProcessor,
            Long.toString(getServerId()), true);
    commitProcessor.start();
    firstProcessor = new ObserverRequestProcessor(this, commitProcessor);
    ((ObserverRequestProcessor) firstProcessor).start();

    /*
     * Observer should write to disk, so that the it won't request
     * too old txn from the leader which may lead to getting an entire
     * snapshot.
     *
     * However, this may degrade performance as it has to write to disk
     * and do periodic snapshot which may double the memory requirements
     */
    if (syncRequestProcessorEnabled) {
        syncProcessor = new SyncRequestProcessor(this, null);
        syncProcessor.start();
    }
}
 
开发者ID:wangyangjun,项目名称:StreamBench,代码行数:30,代码来源:ObserverZooKeeperServer.java

示例3: setupRequestProcessors

import org.apache.zookeeper.server.SyncRequestProcessor; //导入方法依赖的package包/类
@Override
protected void setupRequestProcessors() {
    RequestProcessor finalProcessor = new FinalRequestProcessor(this);
    commitProcessor = new CommitProcessor(finalProcessor,
            Long.toString(getServerId()), true,
            getZooKeeperServerListener());
    commitProcessor.start();
    firstProcessor = new FollowerRequestProcessor(this, commitProcessor);
    ((FollowerRequestProcessor) firstProcessor).start();
    syncProcessor = new SyncRequestProcessor(this,
            new SendAckRequestProcessor((Learner)getFollower()));
    syncProcessor.start();
}
 
开发者ID:maoling,项目名称:fuck_zookeeper,代码行数:14,代码来源:FollowerZooKeeperServer.java

示例4: setupRequestProcessors

import org.apache.zookeeper.server.SyncRequestProcessor; //导入方法依赖的package包/类
/**
 * Set up the request processors for an Observer:
 * firstProcesor->commitProcessor->finalProcessor
 */
@Override
protected void setupRequestProcessors() {      
    // We might consider changing the processor behaviour of 
    // Observers to, for example, remove the disk sync requirements.
    // Currently, they behave almost exactly the same as followers.
    RequestProcessor finalProcessor = new FinalRequestProcessor(this);
    commitProcessor = new CommitProcessor(finalProcessor,
            Long.toString(getServerId()), true,
            getZooKeeperServerListener());
    commitProcessor.start();
    firstProcessor = new ObserverRequestProcessor(this, commitProcessor);
    ((ObserverRequestProcessor) firstProcessor).start();

    /*
     * Observer should write to disk, so that the it won't request
     * too old txn from the leader which may lead to getting an entire
     * snapshot.
     *
     * However, this may degrade performance as it has to write to disk
     * and do periodic snapshot which may double the memory requirements
     */
    if (syncRequestProcessorEnabled) {
        syncProcessor = new SyncRequestProcessor(this, null);
        syncProcessor.start();
    }
}
 
开发者ID:maoling,项目名称:fuck_zookeeper,代码行数:31,代码来源:ObserverZooKeeperServer.java

示例5: setupRequestProcessors

import org.apache.zookeeper.server.SyncRequestProcessor; //导入方法依赖的package包/类
@Override
protected void setupRequestProcessors() {
    RequestProcessor finalProcessor = new FinalRequestProcessor(this);
    commitProcessor = new CommitProcessor(finalProcessor,
            Long.toString(getServerId()), true, getZooKeeperServerListener());
    commitProcessor.start();
    firstProcessor = new FollowerRequestProcessor(this, commitProcessor);
    ((FollowerRequestProcessor) firstProcessor).start();
    syncProcessor = new SyncRequestProcessor(this,
            new SendAckRequestProcessor((Learner)getFollower()));
    syncProcessor.start();
}
 
开发者ID:didichuxing2,项目名称:https-github.com-apache-zookeeper,代码行数:13,代码来源:FollowerZooKeeperServer.java

示例6: setupRequestProcessors

import org.apache.zookeeper.server.SyncRequestProcessor; //导入方法依赖的package包/类
@Override
protected void setupRequestProcessors() {
    RequestProcessor finalProcessor = new FinalRequestProcessor(this);
    commitProcessor = new CommitProcessor(finalProcessor,
            Long.toString(getServerId()), true);
    commitProcessor.start();
    firstProcessor = new FollowerRequestProcessor(this, commitProcessor);
    ((FollowerRequestProcessor) firstProcessor).start();
    syncProcessor = new SyncRequestProcessor(this,
            new SendAckRequestProcessor((Learner)getFollower()));
    syncProcessor.start();
}
 
开发者ID:gerritjvv,项目名称:bigstreams,代码行数:13,代码来源:FollowerZooKeeperServer.java


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