java.util.concurrent.ThreadPoolExecutor.getQueue()方法的使用及代码示例

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

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

ThreadPoolExecutor.getQueue介绍

[英]Returns the task queue used by this executor. Access to the task queue is intended primarily for debugging and monitoring. This queue may be in active use. Retrieving the task queue does not prevent queued tasks from executing.
[中]返回此执行器使用的任务队列。对任务队列的访问主要用于调试和监视。此队列可能正在使用中。检索任务队列不会阻止已排队的任务执行。

代码示例

代码示例来源:origin: PipelineAI/pipeline

/**
 * Current size of {@link BlockingQueue} used by the thread-pool
 * 
 * @return Number
 */
public Number getCurrentQueueSize() {
  return threadPool.getQueue().size();
}

代码示例来源:origin: apache/incubator-dubbo

private void checkQueueLength() {
    if (connectionExecutor.getQueue().size() > queuewarninglimit) {
      logger.warn(new IllegalThreadStateException("connectionordered channel handler `queue size: " + connectionExecutor.getQueue().size() + " exceed the warning limit number :" + queuewarninglimit));
    }
  }
}

代码示例来源:origin: apache/incubator-dubbo

private void checkQueueLength() {
    if (connectionExecutor.getQueue().size() > queuewarninglimit) {
      logger.warn(new IllegalThreadStateException("connectionordered channel handler `queue size: " + connectionExecutor.getQueue().size() + " exceed the warning limit number :" + queuewarninglimit));
    }
  }
}

代码示例来源:origin: SonarSource/sonarqube

@Override
public int getQueueSize() {
 return delegate.getQueue().size();
}

代码示例来源:origin: apache/hbase

/**
 * Returns the current size of the queue containing regions that are
 * processed.
 *
 * @return The current size of the regions queue.
 */
public int getCompactionQueueSize() {
 return longCompactions.getQueue().size() + shortCompactions.getQueue().size();
}

代码示例来源:origin: apache/hbase

@Override
public String toString() {
 return "compactionQueue=(longCompactions="
   + longCompactions.getQueue().size() + ":shortCompactions="
   + shortCompactions.getQueue().size() + ")"
   + ", splitQueue=" + splits.getQueue().size();
}

代码示例来源:origin: alipay/sofa-rpc

@Override
  public Integer value() {
    return threadPoolExecutor.getQueue().size();
  }
});

代码示例来源:origin: alipay/sofa-rpc

@Override
  public Integer value() {
    return threadPoolExecutor.getQueue().size();
  }
});

代码示例来源:origin: apache/hbase

@Override
public int getQueueSize() {
 return pool.getQueue().size();
}

代码示例来源:origin: apache/hbase

@Override
public int getGeneralQueueLength() {
 return executor.getQueue().size() + rsReportExecutor.getQueue().size();
}

代码示例来源:origin: apache/hbase

@Override
public int getGeneralQueueLength() {
 return executor.getQueue().size();
}

代码示例来源:origin: igniterealtime/Openfire

/**
   * Returns the current number of ChannelMessage objects waiting to be processed by
   * the channel.
   *
   * @return the current number of elements in the processing queue.
   */
  public int getQueueSize() {
    return executor.getQueue().size();
  }
}

代码示例来源:origin: apache/ignite

/** {@inheritDoc} */
@Override public int getQueueSize() {
  return exec instanceof ThreadPoolExecutor ? ((ThreadPoolExecutor)exec).getQueue().size() : -1;
}

代码示例来源:origin: apache/hbase

public int getLargeCompactionQueueSize() {
 return longCompactions.getQueue().size();
}

代码示例来源:origin: apache/hbase

public int getSplitQueueSize() {
 return splits.getQueue().size();
}

代码示例来源:origin: stagemonitor/stagemonitor

@Override
  public Integer getNumTasksPending() {
    return threadPool.getQueue().size();
  }
}

代码示例来源:origin: apache/hbase

public int getSmallCompactionQueueSize() {
 return shortCompactions.getQueue().size();
}

代码示例来源:origin: jmxtrans/jmxtrans

@Override
public int workQueueSize() {
  return executor.getQueue().size();
}

代码示例来源:origin: Netflix/Priam

@Override
  public int getDownloadTasksQueued() {
    return fileDownloadExecutor.getQueue().size();
  }
}

代码示例来源:origin: opentripplanner/OpenTripPlanner

/** log queue status */
private void logQueueStatus() {
  LOG.info("Waiting tasks: high priority: {}, batch: {}", highPriorityExecutor.getQueue().size(), batchExecutor.getQueue().size());
}

相关文章

ThreadPoolExecutor类方法