Something is possible. Right now RollupTool and AstyanaxReaders keep their
own private metadata caches, which is one reason I worked to keep that
logic in the reader (otherwise, RollupTool and AR would have duplicate
caches).

We would probably need to refactor RollupTool to use
AR.getDatapointsForRange() to get some better code sharing going on.


On Wed, Feb 5, 2014 at 5:02 PM, Lakshmi Kannan <notifications@github.com>wrote:

> In
> blueflood-core/src/main/java/com/rackspacecloud/blueflood/outputs/handlers/RollupHandler.java:
>
> > @@ -74,10 +74,11 @@ protected MetricData getRollupByGranularity(
> >                  for (Range r : Range.rangesForInterval(g, latest + g.milliseconds(), to)) {
> >                      try {
> >                          MetricData data = AstyanaxReader.getInstance().getDatapointsForRange(locator, r, Granularity.FULL);
> > -                        Points<SimpleNumber> dataToRoll = data.getData();
> > -                        BasicRollup rollup = Rollup.BasicFromRaw.compute(dataToRoll);
> > -                        if (rollup.getCount() > 0) {
> > -                            metricData.getData().add(new Points.Point<BasicRollup>(r.getStart(), rollup));
> > +                        Points dataToRoll = data.getData();
>
> I really think all this logic can be replace by using Chinmay's re-roll
> tool which works out of band and computes (partial) rollups at all
> granularities. We can then return the data at appropriate granularity.
> Another PR is fine but just wanted to get that thought out.
>
> --
> Reply to this email directly or view it on GitHub<https://github.com/rackerlabs/blueflood/pull/234/files#r9483017>
> .
>