当前位置: 首页>>代码示例>>Java>>正文


Java RemovalCause.SIZE属性代码示例

本文整理汇总了Java中com.google.common.cache.RemovalCause.SIZE属性的典型用法代码示例。如果您正苦于以下问题:Java RemovalCause.SIZE属性的具体用法?Java RemovalCause.SIZE怎么用?Java RemovalCause.SIZE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在com.google.common.cache.RemovalCause的用法示例。


在下文中一共展示了RemovalCause.SIZE属性的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onRemoval

@Override
public void onRemoval(RemovalNotification<CacheValue, NodeDocument> n) {
    //If removed explicitly then we clear from L2
    if (n.getCause() == RemovalCause.EXPLICIT
            || n.getCause() == RemovalCause.REPLACED) {
        offHeapCache.invalidate(n.getKey());
    }

    //If removed because of size then we move it to
    //L2
    if (n.getCause() == RemovalCause.SIZE) {
        NodeDocument doc = n.getValue();
        if (doc != NodeDocument.NULL) {
            offHeapCache.put(n.getKey(),
                    new NodeDocReference(n.getKey(), doc));
        }
    }
}
 
开发者ID:denismo,项目名称:jackrabbit-dynamodb-store,代码行数:18,代码来源:NodeDocOffHeapCache.java

示例2: onRemoval

@Override
public void onRemoval(RemovalNotification<Object, Object> notification) {
    if (notification.getCause() == RemovalCause.SIZE) {
        if (evictionCounter % logInterval == 0) {
            logger.log(LogLevel.INFO, "Cache entries evicted. In-memory cache of {}: Size{{}} MaxSize{{}}, {} {}", cacheId, cache.size(), maxSize, cache.stats(), EVICTION_MITIGATION_MESSAGE);
        }
        evictionCounter++;
    }
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:9,代码来源:LoggingEvictionListener.java

示例3: onRemoval

/**
 * Callback method for removal of items from the histories cache. Items removed from the cache need to be acked or failed
 * according to the reason they were removed
 */
@Override
public void onRemoval(RemovalNotification<CVParticle, String> notification) {
	// make sure the CVParticle object is removed from the history (even if removal was automatic!)
	history.clear(notification.getKey(), notification.getValue());
	if(notification.getCause() == RemovalCause.EXPIRED || notification.getCause() == RemovalCause.SIZE){
		// item removed automatically --> fail the tuple
		collector.fail(notification.getKey().getTuple());
	}else{
		// item removed explicitly --> ack the tuple
		collector.ack(notification.getKey().getTuple());
	}
}
 
开发者ID:sensorstorm,项目名称:StormCV,代码行数:16,代码来源:BatchInputBolt.java

示例4: onRemoval

@Override
public void onRemoval(RemovalNotification<BigInteger, ICursor> notification) {
	if (notification.getCause() == RemovalCause.SIZE) { 
		notification.getValue().close();
	}
}
 
开发者ID:markus1978,项目名称:emf-fragments,代码行数:6,代码来源:ScanningDataStore.java


注:本文中的com.google.common.cache.RemovalCause.SIZE属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。