本文整理汇总了Java中org.apache.cassandra.config.RequestSchedulerOptions类的典型用法代码示例。如果您正苦于以下问题:Java RequestSchedulerOptions类的具体用法?Java RequestSchedulerOptions怎么用?Java RequestSchedulerOptions使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RequestSchedulerOptions类属于org.apache.cassandra.config包,在下文中一共展示了RequestSchedulerOptions类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: RoundRobinScheduler
import org.apache.cassandra.config.RequestSchedulerOptions; //导入依赖的package包/类
public RoundRobinScheduler(RequestSchedulerOptions options)
{
defaultWeight = options.default_weight;
weights = options.weights;
// the task count is acquired for the first time _after_ releasing a thread, so we pre-decrement
taskCount = new Semaphore(options.throttle_limit - 1);
queues = new NonBlockingHashMap<String, WeightedQueue>();
Runnable runnable = new Runnable()
{
public void run()
{
while (true)
{
schedule();
}
}
};
Thread scheduler = new Thread(runnable, "REQUEST-SCHEDULER");
scheduler.start();
logger.info("Started the RoundRobin Request Scheduler");
}
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:24,代码来源:RoundRobinScheduler.java
示例2: RoundRobinScheduler
import org.apache.cassandra.config.RequestSchedulerOptions; //导入依赖的package包/类
public RoundRobinScheduler(RequestSchedulerOptions options)
{
assert !started;
defaultWeight = options.default_weight;
weights = options.weights;
taskCount = new Semaphore(options.throttle_limit);
queues = new NonBlockingHashMap<String, Pair<Integer, SynchronousQueue<Thread>>>();
Runnable runnable = new Runnable()
{
public void run()
{
while (true)
{
schedule();
}
}
};
Thread scheduler = new Thread(runnable, "REQUEST-SCHEDULER");
scheduler.start();
logger.info("Started the RoundRobin Request Scheduler");
started = true;
}
开发者ID:devdattakulkarni,项目名称:Cassandra-KVPM,代码行数:25,代码来源:RoundRobinScheduler.java
示例3: NoScheduler
import org.apache.cassandra.config.RequestSchedulerOptions; //导入依赖的package包/类
public NoScheduler(RequestSchedulerOptions options) {}
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:2,代码来源:NoScheduler.java
注:本文中的org.apache.cassandra.config.RequestSchedulerOptions类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论