com.addthis.hydra.data.query.Query.getParameter()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(4.2k)|赞(0)|评价(0)|浏览(260)

本文整理了Java中com.addthis.hydra.data.query.Query.getParameter方法的一些代码示例,展示了Query.getParameter的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Query.getParameter方法的具体详情如下:
包路径:com.addthis.hydra.data.query.Query
类名称:Query
方法名:getParameter

Query.getParameter介绍

暂无

代码示例

代码示例来源:origin: addthis/hydra

  1. public String getParameter(String key) {
  2. return getParameter(key, null);
  3. }

代码示例来源:origin: addthis/hydra

  1. QueryEntry(Query query, String[] opsLog, TrackerHandler trackerHandler, MeshSourceAggregator aggregator) {
  2. this.query = query;
  3. this.opsLog = opsLog;
  4. this.trackerHandler = trackerHandler;
  5. this.preOpLines = new AtomicInteger();
  6. this.postOpLines = new AtomicInteger();
  7. this.aggregator = aggregator;
  8. final String timeoutInSeconds = query.getParameter("timeout");
  9. this.startTime = System.currentTimeMillis();
  10. if (timeoutInSeconds != null) {
  11. waitTime = Integer.parseInt(timeoutInSeconds);
  12. } else {
  13. waitTime = -1;
  14. }
  15. }

代码示例来源:origin: addthis/hydra

  1. private static AutoField getSourceField(Query query) {
  2. String sourceFieldName = query.getParameter("injectSource");
  3. if (sourceFieldName != null) {
  4. try {
  5. return Configs.decodeObject(AutoField.class, sourceFieldName);
  6. } catch (IOException e) {
  7. throw new UncheckedIOException(e);
  8. }
  9. } else {
  10. return null;
  11. }
  12. }

代码示例来源:origin: addthis/hydra

  1. public QueryEntryInfo getStat() {
  2. QueryEntryInfo stat = new QueryEntryInfo();
  3. stat.paths = query.getPaths();
  4. stat.uuid = query.queryId();
  5. stat.ops = opsLog;
  6. stat.job = query.getJob();
  7. stat.sources = query.getParameter("sources");
  8. stat.remoteip = query.getParameter("remoteip");
  9. stat.sender = query.getParameter("sender");
  10. stat.lines = preOpLines.get();
  11. stat.sentLines = postOpLines.get();
  12. stat.runTime = getRunTime();
  13. stat.startTime = startTime;
  14. stat.tasks = lastSourceInfo;
  15. stat.state = queryState;
  16. return stat;
  17. }

代码示例来源:origin: addthis/hydra

  1. private Supplier<List<QueryTaskSource>> createQueryTaskSourceSupplier(MeshSourceAggregator sourceAggregator) {
  2. Query query = sourceAggregator.query;
  3. int totalTasks = sourceAggregator.totalTasks;
  4. int maxSimul = getMaxSimul(query.getParameter("maxSimul"), totalTasks);
  5. if (maxSimul == totalTasks) {
  6. return new DefaultQueryTaskSourceSupplier(sourceAggregator);
  7. } else {
  8. return new MaxSimulQueryTaskSourceSupplier(sourceAggregator, maxSimul);
  9. }
  10. }

代码示例来源:origin: addthis/hydra

  1. public void allocateQueryTasks(Query query, QueryTaskSource[] taskSources, ChannelMaster meshy,
  2. Map<String, String> queryOptions) {
  3. String queryAllocator = query.getParameter("allocator", DEFAULT_ALLOCATOR).toLowerCase();
  4. switch (queryAllocator) {
  5. case "parallel":
  6. PARALLEL_ALLOCATOR.allocateTasks(taskSources, meshy, queryOptions);
  7. break;
  8. case "lazy":
  9. LAZY_ALLOCATOR.allocateTasks(taskSources, meshy, queryOptions);
  10. break;
  11. case "balanced":
  12. balancedAllocator.allocateTasks(taskSources, meshy, queryOptions);
  13. break;
  14. case "legacy":
  15. default:
  16. PER_QUERY_RR_ALLOCATOR.allocateTasks(taskSources, meshy, queryOptions);
  17. break;
  18. }
  19. }
  20. }

代码示例来源:origin: addthis/hydra

  1. boolean allowPartial = Boolean.valueOf(query.getParameter("allowPartial"));
  2. Set<Integer> tasks = parseTasks(query.getParameter("tasks"));
  3. List<QueryTaskSource[]> sourcesPerDir = new ArrayList<>(2);
  4. for (String combinedUnresolved : JOB_SPLITTER.split(query.getJob())) {

代码示例来源:origin: addthis/hydra

  1. .put("type", "query.starting")
  2. .put("query.path", query.getPaths()[0])
  3. .put("query.hosts", query.getParameter("hosts"))
  4. .put("query.ops", query.getOps())
  5. .put("trace", query.isTraced())
  6. .put("sources", query.getParameter("sources"))
  7. .put("time", System.currentTimeMillis())
  8. .put("job.id", query.getJob())
  9. .put("query.id", query.uuid())
  10. .put("sender", query.getParameter("sender"))
  11. .put("format", format)
  12. .put("filename", filename)
  13. .put("originalrequest", query.getParameter("originalrequest"))
  14. .put("timeout", query.getParameter("timeout"))
  15. .put("requestIP", query.getParameter("remoteip"))
  16. .put("allocator", query.getParameter("allocator"))
  17. .put("allowPartial", query.getParameter("allowPartial"))
  18. .put("tasks", query.getParameter("tasks")).createKVPairs().toString());

相关文章