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


Java Logger.isTraceEnabled方法代码示例

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


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

示例1: buildShardLevelInfo

import org.apache.logging.log4j.Logger; //导入方法依赖的package包/类
static void buildShardLevelInfo(Logger logger, ShardStats[] stats, ImmutableOpenMap.Builder<String, Long> newShardSizes,
                                ImmutableOpenMap.Builder<ShardRouting, String> newShardRoutingToDataPath, ClusterState state) {
    MetaData meta = state.getMetaData();
    for (ShardStats s : stats) {
        IndexMetaData indexMeta = meta.index(s.getShardRouting().index());
        newShardRoutingToDataPath.put(s.getShardRouting(), s.getDataPath());
        long size = s.getStats().getStore().sizeInBytes();
        String sid = ClusterInfo.shardIdentifierFromRouting(s.getShardRouting());
        if (logger.isTraceEnabled()) {
            logger.trace("shard: {} size: {}", sid, size);
        }
        if (indexMeta != null && indexMeta.isIndexUsingShadowReplicas()) {
            // Shards on a shared filesystem should be considered of size 0
            if (logger.isTraceEnabled()) {
                logger.trace("shard: {} is using shadow replicas and will be treated as size 0", sid);
            }
            size = 0;
        }
        newShardSizes.put(sid, size);
    }
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:22,代码来源:InternalClusterInfoService.java

示例2: ChildMemoryCircuitBreaker

import org.apache.logging.log4j.Logger; //导入方法依赖的package包/类
/**
 * Create a circuit breaker that will break if the number of estimated
 * bytes grows above the limit. All estimations will be multiplied by
 * the given overheadConstant. Uses the given oldBreaker to initialize
 * the starting offset.
 * @param settings settings to configure this breaker
 * @param parent parent circuit breaker service to delegate tripped breakers to
 * @param name the name of the breaker
 * @param oldBreaker the previous circuit breaker to inherit the used value from (starting offset)
 */
public ChildMemoryCircuitBreaker(BreakerSettings settings, ChildMemoryCircuitBreaker oldBreaker,
                                 Logger logger, HierarchyCircuitBreakerService parent, String name) {
    this.name = name;
    this.settings = settings;
    this.memoryBytesLimit = settings.getLimit();
    this.overheadConstant = settings.getOverhead();
    if (oldBreaker == null) {
        this.used = new AtomicLong(0);
        this.trippedCount = new AtomicLong(0);
    } else {
        this.used = oldBreaker.used;
        this.trippedCount = oldBreaker.trippedCount;
    }
    this.logger = logger;
    if (logger.isTraceEnabled()) {
        logger.trace("creating ChildCircuitBreaker with settings {}", this.settings);
    }
    this.parent = parent;
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:30,代码来源:ChildMemoryCircuitBreaker.java

示例3: MemoryCircuitBreaker

import org.apache.logging.log4j.Logger; //导入方法依赖的package包/类
/**
 * Create a circuit breaker that will break if the number of estimated
 * bytes grows above the limit. All estimations will be multiplied by
 * the given overheadConstant. Uses the given oldBreaker to initialize
 * the starting offset.
 * @param limit circuit breaker limit
 * @param overheadConstant constant multiplier for byte estimations
 * @param oldBreaker the previous circuit breaker to inherit the used value from (starting offset)
 */
public MemoryCircuitBreaker(ByteSizeValue limit, double overheadConstant, MemoryCircuitBreaker oldBreaker, Logger logger) {
    this.memoryBytesLimit = limit.getBytes();
    this.overheadConstant = overheadConstant;
    if (oldBreaker == null) {
        this.used = new AtomicLong(0);
        this.trippedCount = new AtomicLong(0);
    } else {
        this.used = oldBreaker.used;
        this.trippedCount = oldBreaker.trippedCount;
    }
    this.logger = logger;
    if (logger.isTraceEnabled()) {
        logger.trace("Creating MemoryCircuitBreaker with a limit of {} bytes ({}) and a overhead constant of {}",
                this.memoryBytesLimit, limit, this.overheadConstant);
    }
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:26,代码来源:MemoryCircuitBreaker.java

示例4: MergePolicyConfig

import org.apache.logging.log4j.Logger; //导入方法依赖的package包/类
MergePolicyConfig(Logger logger, IndexSettings indexSettings) {
    this.logger = logger;
    double forceMergeDeletesPctAllowed = indexSettings.getValue(INDEX_MERGE_POLICY_EXPUNGE_DELETES_ALLOWED_SETTING); // percentage
    ByteSizeValue floorSegment = indexSettings.getValue(INDEX_MERGE_POLICY_FLOOR_SEGMENT_SETTING);
    int maxMergeAtOnce = indexSettings.getValue(INDEX_MERGE_POLICY_MAX_MERGE_AT_ONCE_SETTING);
    int maxMergeAtOnceExplicit = indexSettings.getValue(INDEX_MERGE_POLICY_MAX_MERGE_AT_ONCE_EXPLICIT_SETTING);
    // TODO is this really a good default number for max_merge_segment, what happens for large indices, won't they end up with many segments?
    ByteSizeValue maxMergedSegment = indexSettings.getValue(INDEX_MERGE_POLICY_MAX_MERGED_SEGMENT_SETTING);
    double segmentsPerTier = indexSettings.getValue(INDEX_MERGE_POLICY_SEGMENTS_PER_TIER_SETTING);
    double reclaimDeletesWeight = indexSettings.getValue(INDEX_MERGE_POLICY_RECLAIM_DELETES_WEIGHT_SETTING);
    this.mergesEnabled = indexSettings.getSettings()
        .getAsBooleanLenientForPreEs6Indices(indexSettings.getIndexVersionCreated(), INDEX_MERGE_ENABLED, true, new DeprecationLogger(logger));
    if (mergesEnabled == false) {
        logger.warn("[{}] is set to false, this should only be used in tests and can cause serious problems in production environments", INDEX_MERGE_ENABLED);
    }
    maxMergeAtOnce = adjustMaxMergeAtOnceIfNeeded(maxMergeAtOnce, segmentsPerTier);
    mergePolicy.setNoCFSRatio(indexSettings.getValue(INDEX_COMPOUND_FORMAT_SETTING));
    mergePolicy.setForceMergeDeletesPctAllowed(forceMergeDeletesPctAllowed);
    mergePolicy.setFloorSegmentMB(floorSegment.getMbFrac());
    mergePolicy.setMaxMergeAtOnce(maxMergeAtOnce);
    mergePolicy.setMaxMergeAtOnceExplicit(maxMergeAtOnceExplicit);
    mergePolicy.setMaxMergedSegmentMB(maxMergedSegment.getMbFrac());
    mergePolicy.setSegmentsPerTier(segmentsPerTier);
    mergePolicy.setReclaimDeletesWeight(reclaimDeletesWeight);
    if (logger.isTraceEnabled()) {
        logger.trace("using [tiered] merge mergePolicy with expunge_deletes_allowed[{}], floor_segment[{}], max_merge_at_once[{}], max_merge_at_once_explicit[{}], max_merged_segment[{}], segments_per_tier[{}], reclaim_deletes_weight[{}]",
            forceMergeDeletesPctAllowed, floorSegment, maxMergeAtOnce, maxMergeAtOnceExplicit, maxMergedSegment, segmentsPerTier, reclaimDeletesWeight);
    }
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:30,代码来源:MergePolicyConfig.java

示例5: trace

import org.apache.logging.log4j.Logger; //导入方法依赖的package包/类
public static void trace(Class<?> clazz, String msg, Throwable t) {

		final Logger logger = LogManager.getLogger(clazz);
		if (logger.isTraceEnabled()) {
			logger.trace(msg, t);
		}

	}
 
开发者ID:EonTechnology,项目名称:server,代码行数:9,代码来源:Loggers.java


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