本文整理了Java中com.carrotsearch.hppc.ObjectIntHashMap.remove()
方法的一些代码示例,展示了ObjectIntHashMap.remove()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ObjectIntHashMap.remove()
方法的具体详情如下:
包路径:com.carrotsearch.hppc.ObjectIntHashMap
类名称:ObjectIntHashMap
方法名:remove
暂无
代码示例来源:origin: org.elasticsearch/elasticsearch
/**
* Releases an index commit that acquired by {@link #acquireIndexCommit(boolean)}.
*
* @return true if the snapshotting commit can be clean up.
*/
synchronized boolean releaseCommit(final IndexCommit snapshotCommit) {
final IndexCommit releasingCommit = ((SnapshotIndexCommit) snapshotCommit).delegate;
assert snapshottedCommits.containsKey(releasingCommit) : "Release non-snapshotted commit;" +
"snapshotted commits [" + snapshottedCommits + "], releasing commit [" + releasingCommit + "]";
final int refCount = snapshottedCommits.addTo(releasingCommit, -1); // release refCount
assert refCount >= 0 : "Number of snapshots can not be negative [" + refCount + "]";
if (refCount == 0) {
snapshottedCommits.remove(releasingCommit);
}
// The commit can be clean up only if no pending snapshot and it is neither the safe commit nor last commit.
return refCount == 0 && releasingCommit.equals(safeCommit) == false && releasingCommit.equals(lastCommit) == false;
}
代码示例来源:origin: clir/clearnlp
public int remove(T key)
{
return g_map.remove(key);
}
代码示例来源:origin: carrotsearch/hppc
this.remove((KType) c.value);
代码示例来源: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: 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: mikvor/hashmapTest
@Override
public int test() {
final ObjectIntHashMap<Integer> m_map = new ObjectIntHashMap<>( m_keys.length / 2 + 1, m_fillFactor );
int add = 0, remove = 0;
while ( add < m_keys.length )
{
m_map.put( m_keys[ add ], add );
++add;
m_map.put( m_keys[ add ], add );
++add;
m_map.remove( m_keys[ remove++ ] );
}
return m_map.size();
}
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.elasticsearch
/**
* Releases an index commit that acquired by {@link #acquireIndexCommit(boolean)}.
*
* @return true if the snapshotting commit can be clean up.
*/
synchronized boolean releaseCommit(final IndexCommit snapshotCommit) {
final IndexCommit releasingCommit = ((SnapshotIndexCommit) snapshotCommit).delegate;
assert snapshottedCommits.containsKey(releasingCommit) : "Release non-snapshotted commit;" +
"snapshotted commits [" + snapshottedCommits + "], releasing commit [" + releasingCommit + "]";
final int refCount = snapshottedCommits.addTo(releasingCommit, -1); // release refCount
assert refCount >= 0 : "Number of snapshots can not be negative [" + refCount + "]";
if (refCount == 0) {
snapshottedCommits.remove(releasingCommit);
}
// The commit can be clean up only if no pending snapshot and it is neither the safe commit nor last commit.
return refCount == 0 && releasingCommit.equals(safeCommit) == false && releasingCommit.equals(lastCommit) == false;
}
代码示例来源:origin: apache/servicemix-bundles
/**
* Releases an index commit that acquired by {@link #acquireIndexCommit(boolean)}.
*
* @return true if the snapshotting commit can be clean up.
*/
synchronized boolean releaseCommit(final IndexCommit snapshotCommit) {
final IndexCommit releasingCommit = ((SnapshotIndexCommit) snapshotCommit).delegate;
assert snapshottedCommits.containsKey(releasingCommit) : "Release non-snapshotted commit;" +
"snapshotted commits [" + snapshottedCommits + "], releasing commit [" + releasingCommit + "]";
final int refCount = snapshottedCommits.addTo(releasingCommit, -1); // release refCount
assert refCount >= 0 : "Number of snapshots can not be negative [" + refCount + "]";
if (refCount == 0) {
snapshottedCommits.remove(releasingCommit);
}
// The commit can be clean up only if no pending snapshot and it is neither the safe commit nor last commit.
return refCount == 0 && releasingCommit.equals(safeCommit) == false && releasingCommit.equals(lastCommit) == false;
}
代码示例来源:origin: harbby/presto-connectors
this.remove((KType) c.value);
内容来源于网络,如有侵权,请联系作者删除!