本文整理汇总了Java中io.druid.data.input.impl.TimestampSpec类的典型用法代码示例。如果您正苦于以下问题:Java TimestampSpec类的具体用法?Java TimestampSpec怎么用?Java TimestampSpec使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TimestampSpec类属于io.druid.data.input.impl包,在下文中一共展示了TimestampSpec类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: buildDruidService
import io.druid.data.input.impl.TimestampSpec; //导入依赖的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: makeBeam
import io.druid.data.input.impl.TimestampSpec; //导入依赖的package包/类
@Override
public Beam<Map<String, Object>> makeBeam(Map<?, ?> conf, IMetricsContext metrics) {
List<AggregatorFactory> aggregator = getAggregatorList();
// Tranquility needs to be able to extract timestamps from your object type (in this case, Map<String, Object>).
final Timestamper<Map<String, Object>> timestamper = new StreamlineTimestamper(timestampField);
// Tranquility uses ZooKeeper (through Curator) for coordination.
final CuratorFramework curator = CuratorFrameworkFactory
.builder()
.connectString(tranquilityZKconnect) // we can use Storm conf to get config values
.retryPolicy(new ExponentialBackoffRetry(1000, 20, 30000))
.build();
curator.start();
// The JSON serialization of your object must have a timestamp field in a format that Druid understands. By default,
// Druid expects the field to be called "timestamp" and to be an ISO8601 timestamp.
final TimestampSpec timestampSpec = new TimestampSpec(timestampField, "auto", null);
// Tranquility needs to be able to serialize your object type to JSON for transmission to Druid. By default this is
// done with Jackson. If you want to provide an alternate serializer, you can provide your own via ```.objectWriter(...)```.
// In this case, we won't provide one, so we're just using Jackson.
final Beam<Map<String, Object>> beam = DruidBeams
.builder(timestamper)
.curator(curator)
.discoveryPath(discoveryPath)
.location(DruidLocation.create(indexService, dataSource))
.timestampSpec(timestampSpec)
.rollup(DruidRollup.create(DruidDimensions.specific(getTrimmedDimensions(dimensions)), aggregator, getQueryGranularity()))
.tuning(
ClusteredBeamTuning
.builder()
.segmentGranularity(getSegmentGranularity())
.windowPeriod(new Period(windowPeriod))
.partitions(clusterPartitions)
.replicants(clusterReplication)
.build()
)
.druidBeamConfig(
DruidBeamConfig
.builder()
.indexRetryPeriod(new Period(indexRetryPeriod))
.build())
.buildBeam();
return beam;
}
开发者ID:hortonworks,项目名称:streamline,代码行数:49,代码来源:DruidBeamFactoryImpl.java
示例3: buildDruidService
import io.druid.data.input.impl.TimestampSpec; //导入依赖的package包/类
private Service buildDruidService() {
curator = buildCurator();
final TimestampSpec timestampSpec = new TimestampSpec(timestampField, "auto");
final Timestamper<Map<String, Object>> timestamper = getTimestamper();
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(period)).partitions(partitions).replicants(replicants).build();//TODO revise
return DruidBeams.builder(timestamper).curator(curator).discoveryPath(discoveryPath).location(
druidLocation).timestampSpec(timestampSpec).rollup(druidRollup).tuning(clusteredBeamTuning)
.buildJavaService();
}
开发者ID:Stratio,项目名称:ingestion,代码行数:16,代码来源:DruidSink.java
注:本文中的io.druid.data.input.impl.TimestampSpec类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论