本文整理汇总了Java中org.apache.lucene.util.Accountable.ramBytesUsed方法的典型用法代码示例。如果您正苦于以下问题:Java Accountable.ramBytesUsed方法的具体用法?Java Accountable.ramBytesUsed怎么用?Java Accountable.ramBytesUsed使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.lucene.util.Accountable
的用法示例。
在下文中一共展示了Accountable.ramBytesUsed方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: guardedRamBytesUsed
import org.apache.lucene.util.Accountable; //导入方法依赖的package包/类
/** Returns 0 in the case where accountable is null, otherwise returns {@code ramBytesUsed()} */
protected static long guardedRamBytesUsed(Accountable a) {
if (a == null) {
return 0;
}
return a.ramBytesUsed();
}
示例2: onCache
import org.apache.lucene.util.Accountable; //导入方法依赖的package包/类
@Override
public void onCache(ShardId shardId, Accountable accountable) {
if (shardId != null) {
final IndexShard shard = indexService.getShardOrNull(shardId.id());
if (shard != null) {
long ramBytesUsed = accountable != null ? accountable.ramBytesUsed() : 0L;
shard.shardBitsetFilterCache().onCached(ramBytesUsed);
}
}
}
示例3: onRemoval
import org.apache.lucene.util.Accountable; //导入方法依赖的package包/类
@Override
public void onRemoval(ShardId shardId, Accountable accountable) {
if (shardId != null) {
final IndexShard shard = indexService.getShardOrNull(shardId.id());
if (shard != null) {
long ramBytesUsed = accountable != null ? accountable.ramBytesUsed() : 0L;
shard.shardBitsetFilterCache().onRemoval(ramBytesUsed);
}
}
}
示例4: onRemoval
import org.apache.lucene.util.Accountable; //导入方法依赖的package包/类
public void onRemoval(Accountable key, Accountable value, boolean evicted) {
if (evicted) {
evictionsMetric.inc();
}
long dec = 0;
if (key != null) {
dec += key.ramBytesUsed();
}
if (value != null) {
dec += value.ramBytesUsed();
}
totalMetric.dec(dec);
}
示例5: onCache
import org.apache.lucene.util.Accountable; //导入方法依赖的package包/类
@Override
public void onCache(ShardId shardId, Accountable accountable) {
if (shardId != null) {
final IndexShard shard = indexService.shard(shardId.id());
if (shard != null) {
long ramBytesUsed = accountable != null ? accountable.ramBytesUsed() : 0l;
shard.shardBitsetFilterCache().onCached(ramBytesUsed);
}
}
}
示例6: onRemoval
import org.apache.lucene.util.Accountable; //导入方法依赖的package包/类
@Override
public void onRemoval(ShardId shardId, Accountable accountable) {
if (shardId != null) {
final IndexShard shard = indexService.shard(shardId.id());
if (shard != null) {
long ramBytesUsed = accountable != null ? accountable.ramBytesUsed() : 0l;
shard.shardBitsetFilterCache().onRemoval(ramBytesUsed);
}
}
}