Package com.rackspacecloud.blueflood.service

Examples of com.rackspacecloud.blueflood.service.RollupBatchWriter


        boolean running = true;
        while (running) {
            Map<Range,ConcurrentHashMap<Locator,Points>> dataToBeRolled = BuildStore.getEligibleData();
            try {
                if (dataToBeRolled != null && !dataToBeRolled.isEmpty()) {
                    final RollupBatchWriter batchWriter = new RollupBatchWriter(batchWriterPool, null);
                    Set<Range> ranges = dataToBeRolled.keySet();
                    for (Range range : ranges) {
                        // Remove the range from applicable range, so that we do not merge any more data for that range.
                        BuildStore.rangesStillApplicable.remove(range);
                        log.info("Removed range {} from applicable ranges", range);

                        Set<Locator> locators = dataToBeRolled.get(range).keySet();
                        for (Locator locator : locators) {
                            rollupExecutors.submit(new RollupValidatorAndComputer(locator, range, dataToBeRolled.get(range).get(locator), batchWriter));
                        }
                        //This will remove the entry from the backing map in buildstore as well. This is the operation that clears memory and prevents it from blowing up!
                        dataToBeRolled.remove(range);
                        log.info("Removed range {} from buildstore", range);
                        // Drain the remaining rollups
                        batchWriter.drainBatch();
                    }
                } else {
                    try {
                        Thread.sleep(10000);
                    } catch (InterruptedException e) {
View Full Code Here

TOP

Related Classes of com.rackspacecloud.blueflood.service.RollupBatchWriter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.