[Mondrian] New configuration parameter: mondrian.rolap.RolapMember.PropertyValueMap.class

Eric McDermid mcdermid at stonecreek.com
Fri Jul 17 03:13:40 EDT 2009


An update:  as of change 12953, the  
"mondrian 
.rolap.RolapMember.PropertyValueMap.class" (PropertyValueMapClass) is  
now  
"mondrian 
.rolap 
.RolapMember 
.PropertyValueMapFacotry.class" (PropertyValueMapFactoryClass).  This  
allows a lot more flexibility in choosing exactly the right Map  
implementation.  As previously discussed, the default if unset will  
create a HashMap if it detects more than 3 declared member properties  
or if the member is a measure.  Otherwise, it will use a Flat3Map.

I've made a similar change to  
"mondrian 
.rolap 
.SqlMemberSource.ValuePool.class" (SqlMemberSourceValuePoolClass); it  
is now  
"mondrian 
.rolap 
.SqlMemberSource 
.ValuePoolFactory.class" (SqlMemberSourceValuePoolFactoryClass).  In  
this case, however, no value pool is created unless the property is  
explicitly set.

   -- Eric

On Jul 9, 2009, at 1:46 PM, Julian Hyde wrote:

> This is an interesting change. Flat3Map is an implementation of
> java.util.Map which is very memory and CPU efficient if the map  
> contains 3
> or fewer values. That is, the member has 3 or fewer properties. If  
> members
> have more than 3 properties, the map will automatically delegate to a
> regular hashmap.
>
> Since mondrian caches large numbers of members, I believe that this  
> change
> will make mondrian faster and more efficient in the average case.  
> Let me
> know what you find. This may not be the case for levels with large  
> numbers
> of member properties, so you may wish to experiment with the
> "mondrian 
> .rolap.RolapMember.PropertyValueMap.class" (PropertyValueMapClass)
> configuration parameter.
>
> Julian
>
> -----Original Message-----
> From: Eric McDermid [mailto:mcdermid at stonecreek.com]
> Sent: Thursday, July 09, 2009 12:32 PM
> To: Ajit Joglekar; Aaron Phillips; Andreas Voss; Bart Pappyn; Ezequiel
> Cuellar; Julian Hyde; John V. Sichi; Mat Lowery; Matt Campbell;  
> Rushan Chen;
> Robin Tharappel; Will Gorman
> Subject: Eigenbase perforce change 12921 for review
>
> http://p4web.eigenbase.org/@md=d&c=6PU@//12921?ac=10
>
> Change 12921 by eric at eric.wednesday.mondrian.dev on 2009/07/09  
> 12:30:11
>
> 	MONDRIAN: Change RolapMember to use a factorized Map to store member
> property values, defaulting to  
> org.apache.commons.collections.map.Flat3Map
>
> Affected files ...
>
> ... //open/mondrian/doc/configuration.html#53 edit
> ... //open/mondrian/src/main/mondrian/olap/ 
> MondrianProperties.java#109 edit
> ... //open/mondrian/src/main/mondrian/rolap/RolapMember.java#85 edit
>
> Differences ...
>
> ==== //open/mondrian/doc/configuration.html#53 (ktext) ====
>
> 3c3
> <   == $Id: //open/mondrian/doc/configuration.html#52 $
> ---
>>  == $Id: //open/mondrian/doc/configuration.html#53 $
> 1102a1103,1116
>>    <tr>
>>      <td><code>
>>      <a
> href="api/mondrian/rolap/RolapMember/ 
> MondrianProperties.html#PropertyValueMa
> pClass">
>>      mondrian.rolap.RolapMember.PropertyValueMap.class
>>      </a></code></td>
>>
>>      <td>string</td>
>>      <td>-</td>
>>      <td>
>>      If set, the specified class is used to store member property
>>      values in mondrian.rolap.RolapMember.  Defaults to
>>      org.apache.commons.collections.map.Flat3Map
>>      </td>
>>    </tr>
> 1514c1528
> <     Version: $Id: //open/mondrian/doc/configuration.html#52 $
> ---
>>    Version: $Id: //open/mondrian/doc/configuration.html#53 $
>
> ==== //open/mondrian/src/main/mondrian/olap/ 
> MondrianProperties.java#109
> (ktext) ====
>
> 2c2
> < // $Id: //open/mondrian/src/main/mondrian/olap/ 
> MondrianProperties.java#108
> $
> ---
>> // $Id: //open/mondrian/src/main/mondrian/olap/ 
>> MondrianProperties.java#109
> $
> 52c52
> <  * @version $Id:
> //open/mondrian/src/main/mondrian/olap/MondrianProperties.java#108 $
> ---
>> * @version $Id:
> //open/mondrian/src/main/mondrian/olap/MondrianProperties.java#109 $
> 974a975,987
>>     * the name of the class used for mapping member properties
>>     * to their respective values.
>>     *
>>     * <p>If the value is
>>     * non-null, it is used by the <code>PropertyValueFactory</code>
>>     * to create the implementation.
>>     */
>>    public transient final StringProperty PropertyValueMapClass =
>>        new StringProperty(
>>            this, "mondrian.rolap.RolapMember.PropertyValueMap.class",
> null);
>>
>>    /**
>>     * Property that defines
>
> ==== //open/mondrian/src/main/mondrian/rolap/RolapMember.java#85  
> (ktext)
> ====
>
> 2c2
> < // $Id: //open/mondrian/src/main/mondrian/rolap/ 
> RolapMember.java#84 $
> ---
>> // $Id: //open/mondrian/src/main/mondrian/rolap/RolapMember.java#85 $
> 16a17,18
>> import mondrian.util.ObjectFactory;
>> import mondrian.util.CreationException;
> 18a21,23
>> import org.apache.commons.collections.map.Flat3Map;
>> import org.eigenbase.util.property.StringProperty;
>>
> 27c32
> <  * @version $Id:
> //open/mondrian/src/main/mondrian/rolap/RolapMember.java#84 $
> ---
>> * @version $Id:
> //open/mondrian/src/main/mondrian/rolap/RolapMember.java#85 $
> 508c513,514
> <             mapPropertyNameToValue = new HashMap<String, Object>();
> ---
>>            mapPropertyNameToValue =
>>                PropertyValueMapFactory.getPropertyValueMap();
> 822a829,871
>>    public static final class PropertyValueMapFactory
>>    extends ObjectFactory<Map>
>>    {
>>
>>        /**
>>         * Single instance of the <code>PropertyValueMapFactory</ 
>> code>.
>>         */
>>        private static final PropertyValueMapFactory factory;
>>        static {
>>            factory = new PropertyValueMapFactory();
>>        }
>>
>>        /**
>>         * Access the <code>PropertyValueMapFactory</code> instance.
>>         *
>>         * @return the <code>Map</code>.
>>         */
>>        public static Map getPropertyValueMap() {
>>            return factory.getObject();
>>        }
>>
>>        /**
>>         * The constructor for the <code>PropertyValueMapFactory</ 
>> code>.
> This
>>         * passes the <code>Map</code> class to the
> <code>ObjectFactory</code>
>>         * base class.
>>         */
>>        private PropertyValueMapFactory() {
>>            super(Map.class);
>>        }
>>
>>
>>        protected StringProperty getStringProperty() {
>>            return  
>> MondrianProperties.instance().PropertyValueMapClass;
>>        }
>>
>>        protected Map getDefault(
>>            Class[] parameterTypes,
>>            Object[] parameterValues)
>>            throws CreationException
>>        {
>>            return new Flat3Map();
>>        }
>>    }
>
>
> _______________________________________________
> Mondrian mailing list
> Mondrian at pentaho.org
> http://lists.pentaho.org/mailman/listinfo/mondrian
>





More information about the Mondrian mailing list