本文整理汇总了Java中com.google.gerrit.server.git.WorkQueue.createQueue方法的典型用法代码示例。如果您正苦于以下问题:Java WorkQueue.createQueue方法的具体用法?Java WorkQueue.createQueue怎么用?Java WorkQueue.createQueue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.gerrit.server.git.WorkQueue
的用法示例。
在下文中一共展示了WorkQueue.createQueue方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: CommandExecutorQueueProvider
import com.google.gerrit.server.git.WorkQueue; //导入方法依赖的package包/类
@Inject
public CommandExecutorQueueProvider(
@GerritServerConfig Config config,
ThreadSettingsConfig threadsSettingsConfig,
WorkQueue queues) {
poolSize = threadsSettingsConfig.getSshdThreads();
batchThreads =
config.getInt("sshd", "batchThreads", threadsSettingsConfig.getSshdBatchTreads());
if (batchThreads > poolSize) {
poolSize += batchThreads;
}
int interactiveThreads = Math.max(1, poolSize - batchThreads);
interactiveExecutor =
queues.createQueue(interactiveThreads, "SSH-Interactive-Worker", Thread.MIN_PRIORITY);
if (batchThreads != 0) {
batchExecutor = queues.createQueue(batchThreads, "SSH-Batch-Worker", Thread.MIN_PRIORITY);
} else {
batchExecutor = interactiveExecutor;
}
}
示例2: CommandFactoryProvider
import com.google.gerrit.server.git.WorkQueue; //导入方法依赖的package包/类
@Inject
CommandFactoryProvider(
@CommandName(Commands.ROOT) DispatchCommandProvider d,
@GerritServerConfig Config cfg,
WorkQueue workQueue,
SshLog l,
SshScope s,
SchemaFactory<ReviewDb> sf) {
dispatcher = d;
log = l;
sshScope = s;
schemaFactory = sf;
int threads = cfg.getInt("sshd", "commandStartThreads", 2);
startExecutor = workQueue.createQueue(threads, "SshCommandStart");
destroyExecutor =
Executors.newSingleThreadExecutor(
new ThreadFactoryBuilder()
.setNameFormat("SshCommandDestroy-%s")
.setDaemon(true)
.build());
}
示例3: createReceiveCommitsExecutor
import com.google.gerrit.server.git.WorkQueue; //导入方法依赖的package包/类
@Provides
@Singleton
@ReceiveCommitsExecutor
public ExecutorService createReceiveCommitsExecutor(
@GerritServerConfig Config config, WorkQueue queues) {
int poolSize =
config.getInt(
"receive", null, "threadPoolSize", Runtime.getRuntime().availableProcessors());
return queues.createQueue(poolSize, "ReceiveCommits");
}
示例4: createSendEmailExecutor
import com.google.gerrit.server.git.WorkQueue; //导入方法依赖的package包/类
@Provides
@Singleton
@SendEmailExecutor
public ExecutorService createSendEmailExecutor(
@GerritServerConfig Config config, WorkQueue queues) {
int poolSize = config.getInt("sendemail", null, "threadPoolSize", 1);
if (poolSize == 0) {
return MoreExecutors.newDirectExecutorService();
}
return queues.createQueue(poolSize, "SendEmail");
}
示例5: start
import com.google.gerrit.server.git.WorkQueue; //导入方法依赖的package包/类
public void start(WorkQueue workQueue) {
String poolName = "ReplicateTo-" + config.getRemoteConfig().getName();
pool = workQueue.createQueue(config.getPoolThreads(), poolName);
}