Data Cube介绍

以下是转自SlidesShare.com上面的一份PPT,概念讲得很简单清晰。

转载于:https://www.cnblogs.com/mush0m/p/3633766.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
数据立方体是复杂计算的抽象。Datacube 是用 Java 实现的,可插入数据库后端支持的数据立方体。 datacube 是用来存储大数据点的聚合信息。数据立方体存储的是有趣输入数据点的子集。比如,你正在编写一个 web 服务器日志分析工具,你的输入点可能是日志行,你可能会计算每个浏览器的类型,每个浏览器的版本,操作系统类型,操作系统版本和其他属性。同时你可能会需要计算一个特定的组合计数(浏览器类型,浏览器版本,操作系统类型), (浏览器类型,浏览器版本,操作系统类型,操作系统版本),等等。 这对快速添加和修改计数是个很大的挑战,会浪费很多时间在数据库代码和重新用新计数器处理旧数据。而数据立方体就可以帮忙解决这些问题。 Urban Airship 使用 datacube 项目来支持他们的移动端应用的分析栈,每个节点每秒处理大约 10 K 的事件。 datacube 要求 JDK 1.6。 特性 性能: 高速异步 IO 后端处理 使用 Hadoop MapReduce 进行批量加载 可插入数据库接口 datacube 暂时只支持 HBase 数据库后端。 示例: IdService idService = new CachingIdService(5, new MapIdService()); ConcurrentMap backingMap =          new ConcurrentHashMap(); DbHarness dbHarness = new MapDbHarness(backingMap, LongOp.DESERIALIZER,          CommitType.READ_COMBINE_CAS, idService); HourDayMonthBucketer hourDayMonthBucketer = new HourDayMonthBucketer(); Dimension time = new Dimension("time", hourDayMonthBucketer, false, 8); Dimension zipcode = new Dimension("zipcode", new StringToBytesBucketer(),          true, 5); DataCubeIo cubeIo = null; DataCube cube; Rollup hourAndZipRollup = new Rollup(zipcode, time, HourDayMonthBucketer.hours); Rollup dayAndZipRollup = new Rollup(zipcode, time, HourDayMonthBucketer.days); Rollup hourRollup = new Rollup(time, HourDayMonthBucketer.hours); Rollup dayRollup = new Rollup(time, HourDayMonthBucketer.days); List dimensions =  ImmutableList.of(time, zipcode); List rollups = ImmutableList.of(hourAndZipRollup, dayAndZipRollup, hourRollup,         dayRollup); cube = new DataCube(dimensions, rollups); cubeIo = new DataCubeIo(cube, dbHarness, 1, Long.MAX_VALUE, SyncLevel.FULL_SYNC); DateTime now = new DateTime(DateTimeZone.UTC); // Do an increment of 5 for a certain time and zipcode cubeIo.writeSync(new LongOp(5), new WriteBuilder(cube)         .at(time, now)         .at(zipcode, "97201"))
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值