Sha256: d0b7524c966f70091a13fbc9c0a02b3fd083f48b3af461000349aa57e10b8495

Contents?: true

Size: 699 Bytes

Versions: 3

Compression:

Stored size: 699 Bytes

Contents

module Druid
  module Writer
    module Tranquilizer
      module Rollup
        class << self
          java_import com.metamx.tranquility.druid.DruidRollup

          def build(config, datapoint)
            dimensions = Druid::Writer::Tranquilizer::Dimensions.build(datapoint.dimensions)
            aggregators = Druid::Writer::Tranquilizer::Aggregators.build(datapoint.metrics)
            DruidRollup.create(dimensions, aggregators, get_granularity(config.rollup_granularity))
          end

          private

          def get_granularity(granularity)
            "Java::IoDruidGranularity::QueryGranularity::#{granularity}".constantize
          end
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
jruby-druid-1.0.0.pre.rc4 lib/druid/writer/tranquilizer/rollup.rb
jruby-druid-1.0.0.pre.rc3 lib/druid/writer/tranquilizer/rollup.rb
jruby-druid-1.0.0.pre.rc2 lib/druid/writer/tranquilizer/rollup.rb