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


Java Tranquilizer类代码示例

本文整理汇总了Java中com.metamx.tranquility.tranquilizer.Tranquilizer的典型用法代码示例。如果您正苦于以下问题:Java Tranquilizer类的具体用法?Java Tranquilizer怎么用?Java Tranquilizer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: buildDruidService

import com.metamx.tranquility.tranquilizer.Tranquilizer; //导入依赖的package包/类
private Tranquilizer<Map<String, Object>> buildDruidService() {
    curatorFramework = buildCuratorFramework();
    final TimestampSpec timestampSpec = new TimestampSpec(timestampField, timestampFormat, null);
    final Timestamper<Map<String, Object>> timestamper = getTimestamper();
    if (timestamper != null) {
        final DruidLocation druidLocation = DruidLocation.create(indexService, firehosePattern, dataSource);
        final DruidRollup druidRollup = DruidRollup
                .create(DruidDimensions.specific(dimensions), aggregators, queryGranularity);
        final ClusteredBeamTuning clusteredBeamTuning = ClusteredBeamTuning.builder()
                .segmentGranularity(segmentGranularity)
                .windowPeriod(new Period(windowPeriod)).partitions(partitions).replicants(replicants).build();

        return DruidBeams.builder(timestamper).curator(curatorFramework).discoveryPath(discoveryPath).location(
                druidLocation).timestampSpec(timestampSpec).rollup(druidRollup).tuning(clusteredBeamTuning)
                .buildTranquilizer();
    } else {
        LOG.error("Building druid service error.");
        return null;
    }

}
 
开发者ID:KonkerLabs,项目名称:flume-ng-druid-sink,代码行数:22,代码来源:TranquilitySink.java

示例2: runBeforeTests

import com.metamx.tranquility.tranquilizer.Tranquilizer; //导入依赖的package包/类
@Before
public void runBeforeTests() {
    boolean result = false;
    _channel = Mockito.mock(AbstractChannel.class);
    _channel.setName("memoryChannel-" + UUID.randomUUID());
    _mockDruidService = Mockito.mock(Tranquilizer.class);
    try {
        _tranquilitySink = new TranquilitySink();

        TestSinkStrategy testSinkStrategy = new TestSinkStrategy();
        _tranquilitySink.setSinkStrategy(testSinkStrategy);
        _parameters = new HashMap<String, String>();
        _properties = PropertiesReader.getProperties();

        if (!_properties.isEmpty()) {
            mapPropertiesToParameters(_properties);
            Context context = new Context(_parameters);

            _tranquilitySink.configure(context);

            result = Configurables.configure(_channel, context);
            if (result) {
                _tranquilitySink.setChannel(_channel);
                _tranquilitySink.start();
            }
        }
    } catch (Exception exception) {
        assertTrue(result);
    }

    assertTrue(result);
    setFlumeEventParser();
}
 
开发者ID:KonkerLabs,项目名称:flume-ng-druid-sink,代码行数:34,代码来源:TranquilitySinkTest.java

示例3: getDruidService

import com.metamx.tranquility.tranquilizer.Tranquilizer; //导入依赖的package包/类
public Tranquilizer getDruidService() {
    return TranquilitySink.this.buildDruidService();
}
 
开发者ID:KonkerLabs,项目名称:flume-ng-druid-sink,代码行数:4,代码来源:TranquilitySink.java

示例4: getDruidService

import com.metamx.tranquility.tranquilizer.Tranquilizer; //导入依赖的package包/类
@Override
public Tranquilizer getDruidService() {
    return _mockDruidService;
}
 
开发者ID:KonkerLabs,项目名称:flume-ng-druid-sink,代码行数:5,代码来源:TranquilitySinkTest.java


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