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


Java FinalRequestProcessor类代码示例

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


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

示例1: setupRequestProcessors

import org.apache.zookeeper.server.FinalRequestProcessor; //导入依赖的package包/类
@Override
protected void setupRequestProcessors() {
    RequestProcessor finalProcessor = new FinalRequestProcessor(this);
    RequestProcessor toBeAppliedProcessor = new Leader.ToBeAppliedRequestProcessor(finalProcessor, getLeader());
    commitProcessor = new CommitProcessor(toBeAppliedProcessor,
            Long.toString(getServerId()), false,
            getZooKeeperServerListener());
    commitProcessor.start();
    ProposalRequestProcessor proposalProcessor = new ProposalRequestProcessor(this,
            commitProcessor);
    proposalProcessor.initialize();
    prepRequestProcessor = new PrepRequestProcessor(this, proposalProcessor);
    prepRequestProcessor.start();
    firstProcessor = new LeaderRequestProcessor(this, prepRequestProcessor);

    setupContainerManager();
}
 
开发者ID:didichuxing2,项目名称:https-github.com-apache-zookeeper,代码行数:18,代码来源:LeaderZooKeeperServer.java

示例2: makeLeader

import org.apache.zookeeper.server.FinalRequestProcessor; //导入依赖的package包/类
@Override
protected Leader makeLeader(FileTxnSnapLog logFactory) throws IOException {
    LeaderZooKeeperServer zk = new LeaderZooKeeperServer(logFactory, this, this.getZkDb()) {
        @Override
        protected void setupRequestProcessors() {
            /**
             * This method is overridden to make a place to inject
             * MockSyncRequestProcessor
             */
            RequestProcessor finalProcessor = new FinalRequestProcessor(this);
            RequestProcessor toBeAppliedProcessor = new Leader.ToBeAppliedRequestProcessor(finalProcessor,
                    getLeader());
            commitProcessor = new CommitProcessor(toBeAppliedProcessor, Long.toString(getServerId()), false,
                    getZooKeeperServerListener());
            commitProcessor.start();
            ProposalRequestProcessor proposalProcessor = new MockProposalRequestProcessor(this,
                    commitProcessor);
            proposalProcessor.initialize();
            prepRequestProcessor = new PrepRequestProcessor(this, proposalProcessor);
            prepRequestProcessor.start();
            firstProcessor = new LeaderRequestProcessor(this, prepRequestProcessor);
        }

    };
    return new Leader(this, zk);
}
 
开发者ID:didichuxing2,项目名称:https-github.com-apache-zookeeper,代码行数:27,代码来源:RaceConditionTest.java

示例3: setupRequestProcessors

import org.apache.zookeeper.server.FinalRequestProcessor; //导入依赖的package包/类
@Override
protected void setupRequestProcessors() {
    RequestProcessor finalProcessor = new FinalRequestProcessor(zks);
    // ValidateProcessor is set up in a similar fashion to ToBeApplied
    // processor, so it can do pre/post validating of requests
    ValidateProcessor validateProcessor =
        new ValidateProcessor(finalProcessor);
    commitProcessor = new CommitProcessor(validateProcessor, "1", true, null);
    validateProcessor.setCommitProcessor(commitProcessor);
    commitProcessor.start();
    MockProposalRequestProcessor proposalProcessor =
        new MockProposalRequestProcessor(commitProcessor);
    proposalProcessor.start();
    firstProcessor = new PrepRequestProcessor(zks, proposalProcessor);
    getFirstProcessor().start();
}
 
开发者ID:didichuxing2,项目名称:https-github.com-apache-zookeeper,代码行数:17,代码来源:CommitProcessorTest.java

示例4: setupRequestProcessors

import org.apache.zookeeper.server.FinalRequestProcessor; //导入依赖的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

示例5: setupRequestProcessors

import org.apache.zookeeper.server.FinalRequestProcessor; //导入依赖的package包/类
@Override
protected void setupRequestProcessors() {
    RequestProcessor finalProcessor = new FinalRequestProcessor(zks);
    // ValidateProcessor is set up in a similar fashion to ToBeApplied
    // processor, so it can do pre/post validating of requests
    ValidateProcessor validateProcessor =
        new ValidateProcessor(finalProcessor);
    commitProcessor = new CommitProcessor(validateProcessor, "1", true,
            getZooKeeperServerListener());
    validateProcessor.setCommitProcessor(commitProcessor);
    commitProcessor.start();
    MockProposalRequestProcessor proposalProcessor =
        new MockProposalRequestProcessor(commitProcessor);
    proposalProcessor.start();
    firstProcessor = new PrepRequestProcessor(zks, proposalProcessor);
    firstProcessor.start();
}
 
开发者ID:sereca,项目名称:SecureKeeper,代码行数:18,代码来源:CommitProcessorTest.java

示例6: setupRequestProcessors

import org.apache.zookeeper.server.FinalRequestProcessor; //导入依赖的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

示例7: ToBeAppliedRequestProcessor

import org.apache.zookeeper.server.FinalRequestProcessor; //导入依赖的package包/类
/**
 * This request processor simply maintains the toBeApplied list. For
 * this to work next must be a FinalRequestProcessor and
 * FinalRequestProcessor.processRequest MUST process the request
 * synchronously!
 * 
 * @param next
 *                a reference to the FinalRequestProcessor
 */
ToBeAppliedRequestProcessor(RequestProcessor next,
        ConcurrentLinkedQueue<Proposal> toBeApplied) {
    if (!(next instanceof FinalRequestProcessor)) {
        throw new RuntimeException(ToBeAppliedRequestProcessor.class
                .getName()
                + " must be connected to "
                + FinalRequestProcessor.class.getName()
                + " not "
                + next.getClass().getName());
    }
    this.toBeApplied = toBeApplied;
    this.next = next;
}
 
开发者ID:maoling,项目名称:fuck_zookeeper,代码行数:23,代码来源:Leader.java

示例8: setupRequestProcessors

import org.apache.zookeeper.server.FinalRequestProcessor; //导入依赖的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

示例9: setupRequestProcessors

import org.apache.zookeeper.server.FinalRequestProcessor; //导入依赖的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

示例10: setupRequestProcessors

import org.apache.zookeeper.server.FinalRequestProcessor; //导入依赖的package包/类
@Override
protected void setupRequestProcessors() {
    RequestProcessor finalProcessor = new FinalRequestProcessor(this);
    RequestProcessor toBeAppliedProcessor = new Leader.ToBeAppliedRequestProcessor(
            finalProcessor, getLeader().toBeApplied);
    commitProcessor = new CommitProcessor(toBeAppliedProcessor,
            Long.toString(getServerId()), false,
            getZooKeeperServerListener());
    commitProcessor.start();
    ProposalRequestProcessor proposalProcessor = new ProposalRequestProcessor(this,
            commitProcessor);
    proposalProcessor.initialize();
    firstProcessor = new PrepRequestProcessor(this, proposalProcessor);
    ((PrepRequestProcessor)firstProcessor).start();
}
 
开发者ID:maoling,项目名称:fuck_zookeeper,代码行数:16,代码来源:LeaderZooKeeperServer.java

示例11: setupRequestProcessors

import org.apache.zookeeper.server.FinalRequestProcessor; //导入依赖的package包/类
@Override
protected void setupRequestProcessors() {
    RequestProcessor finalProcessor = new FinalRequestProcessor(this);
    RequestProcessor prepProcessor = new PrepRequestProcessor(this, finalProcessor);
    ((PrepRequestProcessor) prepProcessor).start();
    firstProcessor = new ReadOnlyRequestProcessor(this, prepProcessor);
    ((ReadOnlyRequestProcessor) firstProcessor).start();
}
 
开发者ID:maoling,项目名称:fuck_zookeeper,代码行数:9,代码来源:ReadOnlyZooKeeperServer.java

示例12: ToBeAppliedRequestProcessor

import org.apache.zookeeper.server.FinalRequestProcessor; //导入依赖的package包/类
/**
 * This request processor simply maintains the toBeApplied list. For
 * this to work next must be a FinalRequestProcessor and
 * FinalRequestProcessor.processRequest MUST process the request
 * synchronously!
 *
 * @param next
 *                a reference to the FinalRequestProcessor
 */
ToBeAppliedRequestProcessor(RequestProcessor next, Leader leader) {
    if (!(next instanceof FinalRequestProcessor)) {
        throw new RuntimeException(ToBeAppliedRequestProcessor.class
                .getName()
                + " must be connected to "
                + FinalRequestProcessor.class.getName()
                + " not "
                + next.getClass().getName());
    }
    this.leader = leader;
    this.next = next;
}
 
开发者ID:didichuxing2,项目名称:https-github.com-apache-zookeeper,代码行数:22,代码来源:Leader.java

示例13: setupRequestProcessors

import org.apache.zookeeper.server.FinalRequestProcessor; //导入依赖的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

示例14: setupRequestProcessors

import org.apache.zookeeper.server.FinalRequestProcessor; //导入依赖的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

示例15: setupRequestProcessors

import org.apache.zookeeper.server.FinalRequestProcessor; //导入依赖的package包/类
@Override
protected void setupRequestProcessors() {
    RequestProcessor finalProcessor = new FinalRequestProcessor(this);
    RequestProcessor toBeAppliedProcessor = new Leader.ToBeAppliedRequestProcessor(
            finalProcessor, getLeader().toBeApplied);
    commitProcessor = new CommitProcessor(toBeAppliedProcessor,
            Long.toString(getServerId()), false);
    commitProcessor.start();
    ProposalRequestProcessor proposalProcessor = new ProposalRequestProcessor(this,
            commitProcessor);
    proposalProcessor.initialize();
    firstProcessor = new PrepRequestProcessor(this, proposalProcessor);
    ((PrepRequestProcessor)firstProcessor).start();
}
 
开发者ID:gerritjvv,项目名称:bigstreams,代码行数:15,代码来源:LeaderZooKeeperServer.java


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