• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java GerritServerConfig类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: Factory

import com.google.gerrit.server.config.GerritServerConfig; //导入依赖的package包/类
@Inject
Factory(
    @GerritServerConfig Config cfg,
    Provider<InternalAccountQuery> accountQueryProvider,
    IdentifiedUser.GenericFactory userFactory,
    @CanonicalWebUrl String webUrl) {
  this.accountQueryProvider = accountQueryProvider;
  this.webUrl = webUrl;
  this.userFactory = userFactory;
  this.maxTrustDepth = cfg.getInt("receive", null, "maxTrustDepth", 0);

  String[] strs = cfg.getStringList("receive", null, "trustedKey");
  if (strs.length != 0) {
    Map<Long, Fingerprint> fps = Maps.newHashMapWithExpectedSize(strs.length);
    for (String str : strs) {
      str = CharMatcher.whitespace().removeFrom(str).toUpperCase();
      Fingerprint fp = new Fingerprint(BaseEncoding.base16().decode(str));
      fps.put(fp.getId(), fp);
    }
    trusted = ImmutableMap.copyOf(fps);
  } else {
    trusted = null;
  }
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:25,代码来源:GerritPublicKeyChecker.java


示例2: GerritServer

import com.google.gerrit.server.config.GerritServerConfig; //导入依赖的package包/类
private GerritServer(
    Description desc,
    @Nullable Path sitePath,
    Injector testInjector,
    Daemon daemon,
    @Nullable ExecutorService daemonService) {
  this.desc = checkNotNull(desc);
  this.sitePath = sitePath;
  this.testInjector = checkNotNull(testInjector);
  this.daemon = checkNotNull(daemon);
  this.daemonService = daemonService;

  Config cfg = testInjector.getInstance(Key.get(Config.class, GerritServerConfig.class));
  url = cfg.getString("gerrit", null, "canonicalWebUrl");
  URI uri = URI.create(url);

  sshdAddress = SocketUtil.resolve(cfg.getString("sshd", null, "listenAddress"), 0);
  httpAddress = new InetSocketAddress(uri.getHost(), uri.getPort());
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:20,代码来源:GerritServer.java


示例3: LuceneProjectIndex

import com.google.gerrit.server.config.GerritServerConfig; //导入依赖的package包/类
@Inject
LuceneProjectIndex(
    @GerritServerConfig Config cfg,
    SitePaths sitePaths,
    Provider<ProjectCache> projectCache,
    @Assisted Schema<ProjectData> schema)
    throws IOException {
  super(
      schema,
      sitePaths,
      dir(schema, cfg, sitePaths),
      PROJECTS,
      null,
      new GerritIndexWriterConfig(cfg, PROJECTS),
      new SearcherFactory());
  this.projectCache = projectCache;

  indexWriterConfig = new GerritIndexWriterConfig(cfg, PROJECTS);
  queryBuilder = new QueryBuilder<>(schema, indexWriterConfig.getAnalyzer());
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:21,代码来源:LuceneProjectIndex.java


示例4: CommandFactoryProvider

import com.google.gerrit.server.config.GerritServerConfig; //导入依赖的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


示例5: ChangeIndexer

import com.google.gerrit.server.config.GerritServerConfig; //导入依赖的package包/类
@AssistedInject
ChangeIndexer(
    @GerritServerConfig Config cfg,
    SchemaFactory<ReviewDb> schemaFactory,
    NotesMigration notesMigration,
    ChangeNotes.Factory changeNotesFactory,
    ChangeData.Factory changeDataFactory,
    ThreadLocalRequestContext context,
    DynamicSet<ChangeIndexedListener> indexedListeners,
    StalenessChecker stalenessChecker,
    @IndexExecutor(BATCH) ListeningExecutorService batchExecutor,
    @Assisted ListeningExecutorService executor,
    @Assisted ChangeIndex index) {
  this.executor = executor;
  this.schemaFactory = schemaFactory;
  this.notesMigration = notesMigration;
  this.changeNotesFactory = changeNotesFactory;
  this.changeDataFactory = changeDataFactory;
  this.context = context;
  this.indexedListeners = indexedListeners;
  this.stalenessChecker = stalenessChecker;
  this.batchExecutor = batchExecutor;
  this.autoReindexIfStale = autoReindexIfStale(cfg);
  this.index = index;
  this.indexes = null;
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:27,代码来源:ChangeIndexer.java


示例6: Globals

import com.google.gerrit.server.config.GerritServerConfig; //导入依赖的package包/类
@Inject
Globals(
    Provider<CurrentUser> currentUser,
    DynamicItem<WebSession> webSession,
    Provider<ParameterParser> paramParser,
    PermissionBackend permissionBackend,
    AuditService auditService,
    RestApiMetrics metrics,
    @GerritServerConfig Config cfg) {
  this.currentUser = currentUser;
  this.webSession = webSession;
  this.paramParser = paramParser;
  this.permissionBackend = permissionBackend;
  this.auditService = auditService;
  this.metrics = metrics;
  allowOrigin = makeAllowOrigin(cfg);
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:18,代码来源:RestApiServlet.java


示例7: LuceneGroupIndex

import com.google.gerrit.server.config.GerritServerConfig; //导入依赖的package包/类
@Inject
LuceneGroupIndex(
    @GerritServerConfig Config cfg,
    SitePaths sitePaths,
    Provider<GroupCache> groupCache,
    @Assisted Schema<InternalGroup> schema)
    throws IOException {
  super(
      schema,
      sitePaths,
      dir(schema, cfg, sitePaths),
      GROUPS,
      null,
      new GerritIndexWriterConfig(cfg, GROUPS),
      new SearcherFactory());
  this.groupCache = groupCache;

  indexWriterConfig = new GerritIndexWriterConfig(cfg, GROUPS);
  queryBuilder = new QueryBuilder<>(schema, indexWriterConfig.getAnalyzer());
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:21,代码来源:LuceneGroupIndex.java


示例8: getRobotsTxtServlet

import com.google.gerrit.server.config.GerritServerConfig; //导入依赖的package包/类
@Provides
@Singleton
@Named(ROBOTS_TXT_SERVLET)
HttpServlet getRobotsTxtServlet(
    @GerritServerConfig Config cfg,
    SitePaths sitePaths,
    @Named(CACHE) Cache<Path, Resource> cache) {
  Path configPath = sitePaths.resolve(cfg.getString("httpd", null, "robotsFile"));
  if (configPath != null) {
    if (exists(configPath) && isReadable(configPath)) {
      return new SingleFileServlet(cache, configPath, true);
    }
    log.warn("Cannot read httpd.robotsFile, using default");
  }
  Paths p = getPaths();
  if (p.warFs != null) {
    return new SingleFileServlet(cache, p.warFs.getPath("/robots.txt"), false);
  }
  return new SingleFileServlet(cache, webappSourcePath("robots.txt"), true);
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:21,代码来源:StaticModule.java


示例9: IntraLineLoader

import com.google.gerrit.server.config.GerritServerConfig; //导入依赖的package包/类
@Inject
IntraLineLoader(
    @DiffExecutor ExecutorService diffExecutor,
    @GerritServerConfig Config cfg,
    @Assisted IntraLineDiffKey key,
    @Assisted IntraLineDiffArgs args) {
  this.diffExecutor = diffExecutor;
  timeoutMillis =
      ConfigUtil.getTimeUnit(
          cfg,
          "cache",
          PatchListCacheImpl.INTRA_NAME,
          "timeout",
          TimeUnit.MILLISECONDS.convert(5, TimeUnit.SECONDS),
          TimeUnit.MILLISECONDS);
  this.key = key;
  this.args = args;
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:19,代码来源:IntraLineLoader.java


示例10: PatchListLoader

import com.google.gerrit.server.config.GerritServerConfig; //导入依赖的package包/类
@Inject
PatchListLoader(
    GitRepositoryManager mgr,
    PatchListCache plc,
    @GerritServerConfig Config cfg,
    @DiffExecutor ExecutorService de,
    AutoMerger am,
    @Assisted PatchListKey k,
    @Assisted Project.NameKey p) {
  repoManager = mgr;
  patchListCache = plc;
  mergeStrategy = MergeUtil.getMergeStrategy(cfg);
  diffExecutor = de;
  autoMerger = am;
  key = k;
  project = p;
  timeoutMillis =
      ConfigUtil.getTimeUnit(
          cfg,
          "cache",
          PatchListCacheImpl.FILE_NAME,
          "timeout",
          TimeUnit.MILLISECONDS.convert(5, TimeUnit.SECONDS),
          TimeUnit.MILLISECONDS);
  save = AutoMerger.cacheAutomerge(cfg);
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:27,代码来源:PatchListLoader.java


示例11: AbstractElasticIndex

import com.google.gerrit.server.config.GerritServerConfig; //导入依赖的package包/类
AbstractElasticIndex(
    @GerritServerConfig Config cfg,
    SitePaths sitePaths,
    Schema<V> schema,
    JestClientBuilder clientBuilder,
    String indexName) {
  this.sitePaths = sitePaths;
  this.schema = schema;
  this.gson = new GsonBuilder().setFieldNamingPolicy(LOWER_CASE_WITH_UNDERSCORES).create();
  this.queryBuilder = new ElasticQueryBuilder();
  this.indexName =
      String.format(
          "%s%s%04d",
          Strings.nullToEmpty(cfg.getString("elasticsearch", null, "prefix")),
          indexName,
          schema.getVersion());
  this.client = clientBuilder.build();
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:19,代码来源:AbstractElasticIndex.java


示例12: createChangeUpdateExecutor

import com.google.gerrit.server.config.GerritServerConfig; //导入依赖的package包/类
@Provides
@Singleton
@ChangeUpdateExecutor
public ListeningExecutorService createChangeUpdateExecutor(@GerritServerConfig Config config) {
  int poolSize = config.getInt("receive", null, "changeUpdateThreads", 1);
  if (poolSize <= 1) {
    return MoreExecutors.newDirectExecutorService();
  }
  return MoreExecutors.listeningDecorator(
      MoreExecutors.getExitingExecutorService(
          new ThreadPoolExecutor(
              1,
              poolSize,
              10,
              TimeUnit.MINUTES,
              new ArrayBlockingQueue<Runnable>(poolSize),
              new ThreadFactoryBuilder().setNameFormat("ChangeUpdate-%d").setDaemon(true).build(),
              new ThreadPoolExecutor.CallerRunsPolicy())));
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:20,代码来源:ReceiveCommitsExecutorModule.java


示例13: MergeUtil

import com.google.gerrit.server.config.GerritServerConfig; //导入依赖的package包/类
@AssistedInject
MergeUtil(
    @GerritServerConfig Config serverConfig,
    Provider<ReviewDb> db,
    IdentifiedUser.GenericFactory identifiedUserFactory,
    @CanonicalWebUrl @Nullable Provider<String> urlProvider,
    ApprovalsUtil approvalsUtil,
    @Assisted ProjectState project,
    PluggableCommitMessageGenerator commitMessageGenerator,
    @Assisted boolean useContentMerge) {
  this.db = db;
  this.identifiedUserFactory = identifiedUserFactory;
  this.urlProvider = urlProvider;
  this.approvalsUtil = approvalsUtil;
  this.project = project;
  this.useContentMerge = useContentMerge;
  this.useRecursiveMerge = useRecursiveMerge(serverConfig);
  this.commitMessageGenerator = commitMessageGenerator;
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:20,代码来源:MergeUtil.java


示例14: ReviewerRecommender

import com.google.gerrit.server.config.GerritServerConfig; //导入依赖的package包/类
@Inject
ReviewerRecommender(
    ChangeQueryBuilder changeQueryBuilder,
    DynamicMap<ReviewerSuggestion> reviewerSuggestionPluginMap,
    Provider<InternalChangeQuery> queryProvider,
    WorkQueue workQueue,
    Provider<ReviewDb> dbProvider,
    ApprovalsUtil approvalsUtil,
    @GerritServerConfig Config config) {
  Set<FillOptions> fillOptions = EnumSet.of(FillOptions.SECONDARY_EMAILS);
  fillOptions.addAll(AccountLoader.DETAILED_OPTIONS);
  this.changeQueryBuilder = changeQueryBuilder;
  this.config = config;
  this.queryProvider = queryProvider;
  this.reviewerSuggestionPluginMap = reviewerSuggestionPluginMap;
  this.workQueue = workQueue;
  this.dbProvider = dbProvider;
  this.approvalsUtil = approvalsUtil;
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:20,代码来源:ReviewerRecommender.java


示例15: EmailSettings

import com.google.gerrit.server.config.GerritServerConfig; //导入依赖的package包/类
@Inject
EmailSettings(@GerritServerConfig Config cfg) {
  // Send
  html = cfg.getBoolean(SEND_EMAL, "html", true);
  includeDiff = cfg.getBoolean(SEND_EMAL, "includeDiff", false);
  maximumDiffSize = cfg.getInt(SEND_EMAL, "maximumDiffSize", 256 << 10);
  // Receive
  protocol = cfg.getEnum(RECEIVE_EMAL, null, "protocol", Protocol.NONE);
  host = cfg.getString(RECEIVE_EMAL, null, "host");
  port = cfg.getInt(RECEIVE_EMAL, "port", 0);
  username = cfg.getString(RECEIVE_EMAL, null, "username");
  password = cfg.getString(RECEIVE_EMAL, null, "password");
  encryption = cfg.getEnum(RECEIVE_EMAL, null, "encryption", Encryption.NONE);
  fetchInterval =
      cfg.getTimeUnit(
          RECEIVE_EMAL,
          null,
          "fetchInterval",
          TimeUnit.MILLISECONDS.convert(60, TimeUnit.SECONDS),
          TimeUnit.MILLISECONDS);
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:22,代码来源:EmailSettings.java


示例16: LuceneAccountIndex

import com.google.gerrit.server.config.GerritServerConfig; //导入依赖的package包/类
@Inject
LuceneAccountIndex(
    @GerritServerConfig Config cfg,
    SitePaths sitePaths,
    Provider<AccountCache> accountCache,
    @Assisted Schema<AccountState> schema)
    throws IOException {
  super(
      schema,
      sitePaths,
      dir(schema, cfg, sitePaths),
      ACCOUNTS,
      null,
      new GerritIndexWriterConfig(cfg, ACCOUNTS),
      new SearcherFactory());
  this.accountCache = accountCache;

  indexWriterConfig = new GerritIndexWriterConfig(cfg, ACCOUNTS);
  queryBuilder = new QueryBuilder<>(schema, indexWriterConfig.getAnalyzer());
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:21,代码来源:LuceneAccountIndex.java


示例17: getInteractiveIndexExecutor

import com.google.gerrit.server.config.GerritServerConfig; //导入依赖的package包/类
@Provides
@Singleton
@IndexExecutor(INTERACTIVE)
ListeningExecutorService getInteractiveIndexExecutor(
    @GerritServerConfig Config config, WorkQueue workQueue) {
  if (interactiveExecutor != null) {
    return interactiveExecutor;
  }
  int threads = this.threads;
  if (threads <= 0) {
    threads = config.getInt("index", null, "threads", 0);
  }
  if (threads <= 0) {
    threads = Runtime.getRuntime().availableProcessors() / 2 + 1;
  }
  return MoreExecutors.listeningDecorator(workQueue.createQueue(threads, "Index-Interactive"));
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:18,代码来源:IndexModule.java


示例18: ChangeUpdate

import com.google.gerrit.server.config.GerritServerConfig; //导入依赖的package包/类
@AssistedInject
private ChangeUpdate(
    @GerritServerConfig Config cfg,
    @GerritPersonIdent PersonIdent serverIdent,
    @AnonymousCowardName String anonymousCowardName,
    NotesMigration migration,
    AccountCache accountCache,
    NoteDbUpdateManager.Factory updateManagerFactory,
    ChangeDraftUpdate.Factory draftUpdateFactory,
    RobotCommentUpdate.Factory robotCommentUpdateFactory,
    DeleteCommentRewriter.Factory deleteCommentRewriterFactory,
    @Assisted ChangeNotes notes,
    @Assisted CurrentUser user,
    @Assisted Date when,
    @Assisted Comparator<String> labelNameComparator,
    ChangeNoteUtil noteUtil) {
  super(cfg, migration, notes, user, serverIdent, anonymousCowardName, noteUtil, when);
  this.accountCache = accountCache;
  this.updateManagerFactory = updateManagerFactory;
  this.draftUpdateFactory = draftUpdateFactory;
  this.robotCommentUpdateFactory = robotCommentUpdateFactory;
  this.deleteCommentRewriterFactory = deleteCommentRewriterFactory;
  this.approvals = approvals(labelNameComparator);
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:25,代码来源:ChangeUpdate.java


示例19: RobotCommentUpdate

import com.google.gerrit.server.config.GerritServerConfig; //导入依赖的package包/类
@AssistedInject
private RobotCommentUpdate(
    @GerritServerConfig Config cfg,
    @GerritPersonIdent PersonIdent serverIdent,
    @AnonymousCowardName String anonymousCowardName,
    NotesMigration migration,
    ChangeNoteUtil noteUtil,
    @Assisted Change change,
    @Assisted("effective") Account.Id accountId,
    @Assisted("real") Account.Id realAccountId,
    @Assisted PersonIdent authorIdent,
    @Assisted Date when) {
  super(
      cfg,
      migration,
      noteUtil,
      serverIdent,
      anonymousCowardName,
      null,
      change,
      accountId,
      realAccountId,
      authorIdent,
      when);
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:26,代码来源:RobotCommentUpdate.java


示例20: QueryAccounts

import com.google.gerrit.server.config.GerritServerConfig; //导入依赖的package包/类
@Inject
QueryAccounts(
    AccountLoader.Factory accountLoaderFactory,
    AccountQueryBuilder queryBuilder,
    AccountQueryProcessor queryProcessor,
    @GerritServerConfig Config cfg) {
  this.accountLoaderFactory = accountLoaderFactory;
  this.queryBuilder = queryBuilder;
  this.queryProcessor = queryProcessor;
  this.suggestFrom = cfg.getInt("suggest", null, "from", 0);
  this.options = EnumSet.noneOf(ListAccountsOption.class);

  if ("off".equalsIgnoreCase(cfg.getString("suggest", null, "accounts"))) {
    suggestConfig = false;
  } else {
    boolean suggest;
    try {
      AccountVisibility av = cfg.getEnum("suggest", null, "accounts", AccountVisibility.ALL);
      suggest = (av != AccountVisibility.NONE);
    } catch (IllegalArgumentException err) {
      suggest = cfg.getBoolean("suggest", null, "accounts", true);
    }
    this.suggestConfig = suggest;
  }
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:26,代码来源:QueryAccounts.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Compare类代码示例发布时间:2022-05-22
下一篇:
Java Vec2f类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap