本文整理汇总了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;
}
}
示例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();
}
示例3: getDruidService
import com.metamx.tranquility.tranquilizer.Tranquilizer; //导入依赖的package包/类
public Tranquilizer getDruidService() {
return TranquilitySink.this.buildDruidService();
}
示例4: getDruidService
import com.metamx.tranquility.tranquilizer.Tranquilizer; //导入依赖的package包/类
@Override
public Tranquilizer getDruidService() {
return _mockDruidService;
}