本文整理了Java中com.carrotsearch.hppc.ObjectIntHashMap.get()
方法的一些代码示例,展示了ObjectIntHashMap.get()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ObjectIntHashMap.get()
方法的具体详情如下:
包路径:com.carrotsearch.hppc.ObjectIntHashMap
类名称:ObjectIntHashMap
方法名:get
暂无
代码示例来源:origin: apache/drill
public static int getIndex(String timezone) {
return timezoneMap.get(timezone);
}
代码示例来源:origin: com.strapdata.elasticsearch/elasticsearch
String[] cols = parentMapper.pkColumns().split(",");
if (cols.length == 1) {
parent = (String) values[fieldsToIdx.get(cols[0])];
} else {
Object parentValues[] = new Object[cols.length];
for(int i = 0; i < cols.length; i++)
parentValues[i] = values[fieldsToIdx.get(cols[i])];
parent = ClusterService.stringify(parentValues, cols.length);
代码示例来源:origin: carrotsearch/hppc
/**
* Return true if all keys of some other container exist in this container.
* Equality comparison is performed with this object's {@link #equals(Object, Object)}
* method.
*/
protected boolean equalElements(ObjectIntHashMap<?> other) {
if (other.size() != size()) {
return false;
}
for (ObjectIntCursor<?> c : other) {
KType key = (KType) c.key;
if (!containsKey(key) ||
!((get(key)) == (c.value))) {
return false;
}
}
return true;
}
代码示例来源:origin: mikvor/hashmapTest
@Override
public int test() {
int res = 0;
for ( int i = 0; i < m_keys.length; ++i )
res = res ^ m_map.get( m_keys[ i ] );
return res;
}
}
代码示例来源:origin: clir/clearnlp
public int get(T key)
{
return g_map.get(key);
}
代码示例来源:origin: org.apache.arrow/arrow-vector
public static int getIndex(String timezone) {
return timezoneMap.get(timezone);
}
代码示例来源:origin: org.apache.drill.exec/vector
public static int getIndex(String timezone) {
return timezoneMap.get(timezone);
}
代码示例来源:origin: org.elasticsearch/elasticsearch
int currentNodeCount = shardPerAttribute.get(node.node().getAttributes().get(awarenessAttribute));
代码示例来源:origin: org.apache.drill.exec/drill-java-exec
private int getFieldIndex(final String name, final InstructionModifier mv) {
if (!fieldMap.containsKey(name)) {
throw new IllegalArgumentException(String.format(
"Unknown name '%s' on line %d.", name, mv.getLastLineNumber()));
}
return fieldMap.get(name); // using lget() is not thread-safe
}
代码示例来源:origin: dremio/dremio-oss
private void releaseViewExpansionToken(ViewExpansionToken token) {
final String viewOwner = token.viewOwner;
if (Objects.equals(queryUser, viewOwner)) {
// If the token owner and queryUser are same, no need to track the token release.
return;
}
Preconditions.checkState(userTokens.containsKey(token.viewOwner),
"Given user doesn't exist in User Token store. Make sure token for this user is obtained first.");
final int userTokenCount = userTokens.get(viewOwner);
if (userTokenCount == 1) {
// Remove the user from collection, when there are no more tokens issued to the user.
userTokens.remove(viewOwner);
} else {
userTokens.put(viewOwner, userTokenCount - 1);
}
logger.debug("Released view expansion token issued for user '{}'", viewOwner);
}
代码示例来源:origin: dremio/dremio-oss
/**
* Reserve a token for expansion of view owned by given user name.
*
* @param viewOwner Name of the user who owns the view.
* @return An instance of {@link com.dremio.exec.ops.ViewExpansionContext.ViewExpansionToken} which must be
* released when done using the token.
*/
public ViewExpansionToken reserveViewExpansionToken(String viewOwner) {
int totalTokens = 1;
if (!Objects.equals(queryUser, viewOwner)) {
// We want to track the tokens only if the "viewOwner" is not same as the "queryUser".
if (userTokens.containsKey(viewOwner)) {
totalTokens += userTokens.get(viewOwner);
}
userTokens.put(viewOwner, totalTokens);
logger.debug("Issued view expansion token for user '{}'", viewOwner);
}
return new ViewExpansionToken(viewOwner);
}
代码示例来源:origin: harbby/presto-connectors
/**
* If <code>key</code> exists, <code>putValue</code> is inserted into the map,
* otherwise any existing value is incremented by <code>additionValue</code>.
*
* @param key
* The key of the value to adjust.
* @param putValue
* The value to put if <code>key</code> does not exist.
* @param incrementValue
* The value to add to the existing value if <code>key</code> exists.
* @return Returns the current value associated with <code>key</code> (after
* changes).
*/
@Override
public int putOrAdd(KType key, int putValue, int incrementValue) {
assert assigned < mask + 1;
if (containsKey(key)) {
putValue = get(key);
putValue = (int) (((putValue) + (incrementValue)));
}
put(key, putValue);
return putValue;
}
代码示例来源:origin: org.apache.drill.exec/drill-java-exec
private void releaseViewExpansionToken(ViewExpansionToken token) {
final String viewOwner = token.viewOwner;
if (viewOwner.equals(queryUser)) {
// If the token owner and queryUser are same, no need to track the token release.
return;
}
Preconditions.checkState(userTokens.containsKey(token.viewOwner),
"Given user doesn't exist in User Token store. Make sure token for this user is obtained first.");
final int userTokenCount = userTokens.get(viewOwner);
if (userTokenCount == 1) {
// Remove the user from collection, when there are no more tokens issued to the user.
userTokens.remove(viewOwner);
} else {
userTokens.put(viewOwner, userTokenCount - 1);
}
logger.debug("Released view expansion token issued for user '{}'", viewOwner);
}
代码示例来源:origin: harbby/presto-connectors
/**
* Return true if all keys of some other container exist in this container.
* Equality comparison is performed with this object's {@link #equals(Object, Object)}
* method.
*/
protected boolean equalElements(ObjectIntHashMap<?> other) {
if (other.size() != size()) {
return false;
}
for (ObjectIntCursor<?> c : other) {
KType key = (KType) c.key;
if (!containsKey(key) ||
!((get(key)) == (c.value))) {
return false;
}
}
return true;
}
代码示例来源:origin: org.elasticsearch.client/elasticsearch-rest-high-level-client
void toXContent(XContentBuilder builder, Params params, ObjectIntHashMap<Vertex> vertexNumbers) throws IOException {
builder.field(SOURCE.getPreferredName(), vertexNumbers.get(from));
builder.field(TARGET.getPreferredName(), vertexNumbers.get(to));
builder.field(WEIGHT.getPreferredName(), weight);
builder.field(DOC_COUNT.getPreferredName(), docCount);
}
代码示例来源:origin: org.apache.drill.exec/drill-java-exec
totalTokens += userTokens.get(viewOwner);
} else {
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.elasticsearch
int currentNodeCount = shardPerAttribute.get(node.node().getAttributes().get(awarenessAttribute));
代码示例来源:origin: apache/servicemix-bundles
int currentNodeCount = shardPerAttribute.get(node.node().getAttributes().get(awarenessAttribute));
代码示例来源:origin: com.strapdata.elasticsearch/elasticsearch
int currentNodeCount = shardPerAttribute.get(node.node().getAttributes().get(awarenessAttribute));
代码示例来源:origin: harbby/presto-connectors
int currentNodeCount = shardPerAttribute.get(node.node().attributes().get(awarenessAttribute));
内容来源于网络,如有侵权,请联系作者删除!