[Mondrian] RolapStar ThreadLocal<List<BitKey>> localAggregationRequests

Richard Emberson remberson at edgedynamics.com
Tue Apr 3 18:55:49 EDT 2007


In RolapStar, should

     private final ThreadLocal<List<BitKey>> localAggregationRequests =
         new ThreadLocal<List<BitKey>>() {
             protected List<BitKey> initialValue() {
                 return new ArrayList<BitKey>();
             }
         };

actually be:

     private final ThreadLocal<Set<BitKey>> localAggregationRequests =
         new ThreadLocal<Set<BitKey>>() {
             protected Set<BitKey> initialValue() {
                 return new HashSet<BitKey>();
             }
         };

and then RolapStar clearAggregationRequests() would change from:

     Set<BitKey> localAggregationRequestSet =
         new HashSet<BitKey>(localAggregationRequests.get());
     Iterator<BitKey> iter = aggregationRequests.iterator();
     while (iter.hasNext()) {
         BitKey bitKey = iter.next();
         if (localAggregationRequestSet.contains(bitKey)) {
             iter.remove();
             // Make sure that bitKey is not removed more than once:
             // other occurrences might exist for other threads.
             localAggregationRequestSet.remove(bitKey);
             if (localAggregationRequestSet.isEmpty()) {
                 // Nothing further to do
                 break;
             }
         }
     }

to:

     Iterator<BitKey> iter = aggregationRequests.iterator();
     while (iter.hasNext()) {
         BitKey bitKey = iter.next();
         if (localAggregationRequests.contains(bitKey)) {
             iter.remove();
             // Make sure that bitKey is not removed more than once:
             // other occurrences might exist for other threads.
             localAggregationRequests.remove(bitKey);
             if (localAggregationRequests.isEmpty()) {
                 // Nothing further to do
                 break;
             }
         }
     }

Yes?

Richard


-- 
Quis custodiet ipsos custodes:
This email message is for the sole use of the intended recipient(s) and
may contain confidential information.  Any unauthorized review, use,
disclosure or distribution is prohibited.  If you are not the intended
recipient, please contact the sender by reply email and destroy all
copies of the original message.



More information about the Mondrian mailing list