Convert this object from PoolInfoStrings for Thrift
@param poolInfoStrings Thrift representation of a {@link PoolInfo}
@return Converted {@link PoolInfo}
433868
public static PoolInfo createPoolInfo(PoolInfoStrings poolInfoStrings) {
    if (poolInfoStrings == null) {
      return null;
    }

    return new PoolInfo(poolInfoStrings.getPoolGroupName(),
                        poolInfoStrings.getPoolName());
  }
1102209
@SuppressWarnings("unchecked")
    public static <T> ClientOption<T> valueOf(String name) {
        return (ClientOption<T>) pool.valueOf(name);
    }
1361799
public Map<String, KrakenLedger> getKrakenLedgerInfo() throws IOException {

    return getKrakenLedgerInfo(null, null, null, null);
  }
351295
public static PoolParams get() {
    // This pool supports only one bucket size: DEFAULT_IO_BUFFER_SIZE
    SparseIntArray defaultBuckets = new SparseIntArray();
    defaultBuckets.put(DEFAULT_IO_BUFFER_SIZE, DEFAULT_BUCKET_SIZE);
    return new PoolParams(
        MAX_SIZE_SOFT_CAP,
        MAX_SIZE_HARD_CAP,
        defaultBuckets);
  }
397137
public ConnectionPool getPool() throws ConnectionPoolNotFoundException {
        ConnectionPool connectionPool = null;

        try {
            if (h_ConnectionPools.containsKey(defaultPoolName)) {
                connectionPool = h_ConnectionPools.get(defaultPoolName);
            } else {
                // Error: default pool was never initialized or could not be found
                throw new ConnectionPoolNotFoundException("Default connection pool "
                        + "not found: " + defaultPoolName);
            }

        } catch (Throwable th) {
            throw new ConnectionPoolNotFoundException("The default connection "
                    + "pool \"" + defaultPoolName
                    + "\" could not be found. The " + "underlying error was a "
                    + th.getClass().getName() + "The message was \""
                    + th.getMessage() + "\".");
        }

        return connectionPool;
    }
813725
public static String details(String method, String poolName, int inUse, int max)
   {
      StringBuilder sb = new StringBuilder(1024);

      sb.append(poolName).append(": ");
      sb.append(method).append(" ");
      sb.append("[");
      sb.append(Integer.toString(inUse));
      sb.append("/");
      sb.append(Integer.toString(max));
      sb.append("]");

      return sb.toString();
   }
423951
private Object convert(JsonNode node, TypeInformation<?> info) {
		if (info == Types.VOID || node.isNull()) {
			return null;
		} else if (info == Types.BOOLEAN) {
			return node.asBoolean();
		} else if (info == Types.STRING) {
			return node.asText();
		} else if (info == Types.BIG_DEC) {
			return node.decimalValue();
		} else if (info == Types.BIG_INT) {
			return node.bigIntegerValue();
		} else if (info == Types.SQL_DATE) {
			return Date.valueOf(node.asText());
		} else if (info == Types.SQL_TIME) {
			// according to RFC 3339 every full-time must have a timezone;
			// until we have full timezone support, we only support UTC;
			// users can parse their time as string as a workaround
			final String time = node.asText();
			if (time.indexOf('Z') < 0 || time.indexOf('.') >= 0) {
				throw new IllegalStateException(
					"Invalid time format. Only a time in UTC timezone without milliseconds is supported yet. " +
						"Format: HH:mm:ss'Z'");
			}
			return Time.valueOf(time.substring(0, time.length() - 1));
		} else if (info == Types.SQL_TIMESTAMP) {
			// according to RFC 3339 every date-time must have a timezone;
			// until we have full timezone support, we only support UTC;
			// users can parse their time as string as a workaround
			final String timestamp = node.asText();
			if (timestamp.indexOf('Z') < 0) {
				throw new IllegalStateException(
					"Invalid timestamp format. Only a timestamp in UTC timezone is supported yet. " +
						"Format: yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");
			}
			return Timestamp.valueOf(timestamp.substring(0, timestamp.length() - 1).replace('T', ' '));
		} else if (info instanceof RowTypeInfo) {
			return convertRow(node, (RowTypeInfo) info);
		} else if (info instanceof ObjectArrayTypeInfo) {
			return convertObjectArray(node, ((ObjectArrayTypeInfo) info).getComponentInfo());
		} else if (info instanceof BasicArrayTypeInfo) {
			return convertObjectArray(node, ((BasicArrayTypeInfo) info).getComponentInfo());
		} else if (info instanceof PrimitiveArrayTypeInfo &&
				((PrimitiveArrayTypeInfo) info).getComponentType() == Types.BYTE) {
			return convertByteArray(node);
		} else {
			// for types that were specified without JSON schema
			// e.g. POJOs
			try {
				return objectMapper.treeToValue(node, info.getTypeClass());
			} catch (JsonProcessingException e) {
				throw new IllegalStateException("Unsupported type information '" + info + "' for node: " + node);
			}
		}
	}
3824
public List<PoolInfo> getPoolInfos() {
    Set<PoolInfo> poolInfos = new HashSet<PoolInfo>();
    for (ResourceType type : types) {
      poolInfos.addAll(getPoolInfoMetrics(type).keySet());
    }
    List<PoolInfo> result = new ArrayList<PoolInfo>();
    result.addAll(poolInfos);
    Collections.sort(result);
    return result;
  }
897081
static public EntryInfoPool createEntryInfoPool(String poolName, int size){
       final String methodName = "createEntryInfoPool()";
       EntryInfoPool pool = new EntryInfoPool(poolName, size);
       //pools.add(pool);
       if (tc.isDebugEnabled())
          Tr.debug(tc, methodName+" poolName=" + poolName);
       return pool;
   }
1150572
public synchronized double getWeight(PoolInfo poolInfo) {
    Double weight = (poolInfoToWeight == null) ? null :
        poolInfoToWeight.get(poolInfo);
    return weight == null ? 1.0 : weight;
  }
441739
public V put(ResourceType type, String poolGroupName, V value) {
    Map<String, V> poolGroupNameMap = typePoolGroupNameMap.get(type);
    if (poolGroupNameMap == null) {
      poolGroupNameMap = new HashMap<String, V>();
      typePoolGroupNameMap.put(type, poolGroupNameMap);
    }
    return poolGroupNameMap.put(poolGroupName, value);
  }
1077842
@Override
	public ThriftServer getThriftServer(String serverName, int serverPort, TProcessor processor) {
		return new ThreadPoolThriftServerImpl(serverName, serverPort, thriftServerConfiguration, processor);
	}
694996
@SuppressWarnings("unchecked")
    public static <D> Mapping<D, String> toStringMapping() {
        return (Mapping<D, String>) TOSTRING_MAPPING;
    }
530115
public static PoolInfo createPoolInfo(String poolInfoString) {
    if (poolInfoString == null || poolInfoString.isEmpty()) {
      LOG.warn("createPoolInfo: Null or empty input " + poolInfoString);
      return null;
    }

    String[] poolInfoSplitString = poolInfoString.split("[.]");
    if (poolInfoSplitString.length != 2) {
      LOG.warn("createPoolInfo: Couldn't parse " + poolInfoString);
      return null;
    }

    return new PoolInfo(poolInfoSplitString[0], poolInfoSplitString[1]);
  }
592574
public String convertListToString(Object listOrString) {

		if (listOrString == null) {
			return null;
		}

		if (listOrString instanceof Collection) {
			List<String> list = (List<String>) listOrString;

			return StringUtils.join(list, ",");

		}

		return listOrString.toString();

	}
1138572
private StringPool readStrings(long[] offsets) {
        // read strings.
        // buffer some apk, the strings' offsets may not well ordered. we sort it first

        StringPoolEntry[] entries = new StringPoolEntry[offsets.length];
        for (int i = 0; i < offsets.length; i++) {
            entries[i] = new StringPoolEntry(i, offsets[i]);
        }

        String lastStr = null;
        long lastOffset = -1;
        StringPool stringpool = new StringPool(offsets.length);
        for (StringPoolEntry entry : entries) {
            if (entry.getOffset() == lastOffset) {
                stringpool.set(entry.getIdx(), lastStr);
                continue;
            }
            Buffers.position(buffer, entry.getOffset());
            lastOffset = entry.getOffset();
            String str = readString();
            lastStr = str;
            stringpool.set(entry.getIdx(), str);
        }
        return stringpool;
    }
1110667
public static ProviderInfo convertProviderToProviderInfo(ProviderConfig config, ServerConfig server) {
        ProviderInfo providerInfo = new ProviderInfo()
            .setPort(server.getPort())
            .setWeight(config.getWeight())
            .setSerializationType(config.getSerialization())
            .setProtocolType(server.getProtocol())
            .setPath(server.getContextPath());
        String host = server.getHost();
        if (NetUtils.isLocalHost(host) || NetUtils.isAnyHost(host)) {
            host = SystemInfo.getLocalHost();
        }
        providerInfo.setHost(host);
        return providerInfo;
    }