com.jolbox.bonecp.BoneCP.maybeSignalForMoreConnections()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(1.9k)|赞(0)|评价(0)|浏览(108)

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

BoneCP.maybeSignalForMoreConnections介绍

[英]Tests if this partition has hit a threshold and signal to the pool watch thread to create new connections
[中]测试此分区是否达到阈值,并向池监视线程发送信号以创建新连接

代码示例

代码示例来源:origin: org.apache.sentry/sentry-shaded-miscellaneous

@Override
public ConnectionHandle pollConnection(){
 ConnectionHandle result = null;
 int partition = (int) (Thread.currentThread().getId() % this.pool.partitionCount);
 ConnectionPartition connectionPartition = this.pool.partitions[partition];
 
 result = connectionPartition.getFreeConnections().poll();
 if (result == null) {
  // we ran out of space on this partition, pick another free one
  for (int i=0; i < this.pool.partitionCount; i++){
   if (i == partition) {
    continue; // we already determined it's not here
   }
   result = this.pool.partitions[i].getFreeConnections().poll(); // try our luck with this partition
      if (result != null) {
    connectionPartition = this.pool.partitions[i]; // we found it here
    break;  // we found a connection
   }
  }
 }
   
 if (!connectionPartition.isUnableToCreateMoreTransactions()){ // unless we can't create any more connections...
  this.pool.maybeSignalForMoreConnections(connectionPartition);  // see if we need to create more
 }
   
 return result;
}

代码示例来源:origin: org.apache.sentry/sentry-shaded-miscellaneous

postDestroyConnection(connectionHandle);
maybeSignalForMoreConnections(connectionPartition);
connectionHandle.clearStatementCaches(true);
return; // don't place back in queue - connection is broken or expired.

代码示例来源:origin: org.wisdom-framework/wisdom-jdbc-datasources

postDestroyConnection(connectionHandle);
maybeSignalForMoreConnections(connectionPartition);
connectionHandle.clearStatementCaches(true);
return; // don't place back in queue - connection is broken or expired.

相关文章