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


Java CardinalityMergeException.printStackTrace方法代码示例

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


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

示例1: combine

import com.clearspring.analytics.stream.cardinality.CardinalityMergeException; //导入方法依赖的package包/类
@Override
public HyperLogLog combine(HyperLogLog one, HyperLogLog other) {
    try {
        // logger.trace("Combine called  merging now " + one.cardinality() + " cardinality of other " + other.cardinality());
        return (HyperLogLog) one.merge(other);
    } catch (CardinalityMergeException e) {
        logger.fatal("Cardinality merge exception " + e.getMessage());
        e.printStackTrace();
    }

    return zero();
}
 
开发者ID:sumanthn,项目名称:SketchOnStorm,代码行数:13,代码来源:HLLCombineAggregator.java

示例2: testMerge

import com.clearspring.analytics.stream.cardinality.CardinalityMergeException; //导入方法依赖的package包/类
@Test
    public void testMerge() {

        HyperLogLog hll = new HyperLogLog(16);

        for (int i = 0; i < 10; i++) {
            hll.offer(i);
        }

        HyperLogLog hll2 = new HyperLogLog(16);
        for (int i = 1000; i < (1000 + 10); i++) {
            hll2.offer(i);
        }

        HyperLogLog hll3 = new HyperLogLog(16);

        assertEquals(hll.cardinality(), 10);
        assertEquals(hll2.cardinality(), 10);
        assertEquals(hll3.cardinality(), 0);

        try {
            ICardinality hllMerged = hll.merge(hll2);
            hllMerged = hllMerged.merge(hll3);
//            System.out.println(hllMerged.cardinality());

            assertEquals(hllMerged.cardinality(), 20);
        } catch (CardinalityMergeException e) {
            e.printStackTrace();
        }
    }
 
开发者ID:sumanthn,项目名称:SketchOnStorm,代码行数:31,代码来源:HLLTest.java


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