Skip to content

Commit

Permalink
Revert "flow*1.05" (apache#80)
Browse files Browse the repository at this point in the history
  • Loading branch information
wangtuanjie committed Mar 15, 2017
1 parent 9538783 commit 473aa5a
Showing 1 changed file with 2 additions and 4 deletions.
Expand Up @@ -118,9 +118,8 @@ object Main {
Mongo.ensureUniqueIndex(min5MgoCfg.getMongoColl, indexKeys)
Mongo.ensureUniqueIndex(dayMgoCfg.getMongoColl, indexKeys)

// 由于计费打点是TCP上层的统计,给用户计费的带宽添加5%
val r2 = r.map(x => {
((x.uid, x.hub, x.time / 300 * 300), (x.flow*1.05).toLong)
((x.uid, x.hub, x.time / 300 * 300), x.flow)
}).reduceByKey(_ + _)

val r3 = r2.map(x => {
Expand Down Expand Up @@ -157,9 +156,8 @@ object Main {
classOf[MongoOutputFormat[Object, BSONObject]],
min5Cfg)

// 由于计费打点是TCP上层的统计,给用户计费的带宽添加5%
val dayMgo = r.map(x => {
((x.uid, x.hub), (x.flow*1.05).toLong)
((x.uid, x.hub), x.flow)
}).reduceByKey(_ + _).map(x => {
val uid: Int = x._1._1
val hub: String = x._1._2
Expand Down

0 comments on commit 473aa5a

Please sign in to comment.