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


Java WorkQueue.createQueue方法代码示例

本文整理汇总了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;
  }
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:21,代码来源:CommandExecutorQueueProvider.java

示例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());
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:23,代码来源:CommandFactoryProvider.java

示例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");
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:11,代码来源:ReceiveCommitsExecutorModule.java

示例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");
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:12,代码来源:ReceiveCommitsExecutorModule.java

示例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);
}
 
开发者ID:GerritCodeReview,项目名称:plugins_replication,代码行数:5,代码来源:Destination.java


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