|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
com.sas.storage.olap.sasmdx.Metadata
public class Metadata
Contains the client side implementation for com.sas.storage.olap.MetadataInterface. This implementation uses the IOM/OLAP interfaces provided by the SAS OLAP server. This class uses a cache by default to decrease the calls to the server and increase the response time. The cache can be turned on and off, can be sized and can be emptied too. A getMembers() call stores into the cache only the returned Members as long there's enough room in the cache, while any call different from getMembers() will store into the cache all the available info for the involved cube except the Members. The default cache parameter values (sizes) are
bufferSize = 1024 lookAhead = 1024 maxFilters = 5
where
maxFilters is the maximum number of getMembers() call results storable in the cache
bufferSize is the max number of members storable in the cache for each getMembers() call
lookAhead is the max number of members that a getMembers() call gets from the server if you requested less than lookAhead
To set the cache properties you use a com.sas.storage.olap.MetadataPerfomanceTuning object
To turn the cache off
MetadataPerfomanceTuning pf = metadata.getPerformanceTuning(); pf.useCache(false); metadata.setPerformanceTuning(pf);
if you want to change the bufferSize leaving the other parameters unchanged
MetadataPerfomanceTuning pf = metadata.getPerformanceTuning(); pf.setCacheParms(2048,-1,-1); metadata.setPerformanceTuning(pf);
if you want to change the lookAhead leaving the other parameters unchanged
MetadataPerfomanceTuning pf = metadata.getPerformanceTuning(); pf.setCacheParms(-1,2048,-1); metadata.setPerformanceTuning(pf);
if you want to change the maxFilters leaving the other parameters unchanged
MetadataPerfomanceTuning pf = metadata.getPerformanceTuning(); pf.setCacheParms(-1,-1,10); metadata.setPerformanceTuning(pf);
To empty the cache you can:
Empty all the caches
metadata.clearCache(iSession, metadata.ALL_CACHE);
Empty all the cache related to getMembers() calls
metadata.clearCache(iSession, metadata.MEMBER_CACHE);
Empty all the cache not related to getMembers() calls
metadata.clearCache(iSession, metadata.NON_MEMBER_CACHE);
Empty all the caches that match a specific Filter
metadata.clearCache( filter, iSession, metadata.ALL_CACHE);
Empty the cache related to getMembers() calls that matches a specific Filter
metadata.clearCache(filter, iSession, metadata.MEMBER_CACHE);
Empty the cache not related to getMembers() calls that matches a specific Filter
metadata.clearCache(filter, iSession, metadata.NON_MEMBER_CACHE);
Notes
The cache is shared among the users of the same VM.
Jan 28, 05 - Because of security issues, the cache was changed to be OLAP session based. So all the clear cache methods now require a session object or null if session is not known
lookAhead <= bufferSize, there's no point in having lookAhead > bufferSize because the cache would store less items than the ones got from the server
getMembers() calls requesting many members You will typically increase both the lookAhead and the bufferSize to minimize the server accesses Given a getMembers() call, if the bufferSize is large enough to hold all the members coming from the server you usually get the best response times.
When the cache is completely filled, it takes 3145728 bytes (for each accessed cube) + maxFilters*bufferSize*24576 bytes
Few users and high member cardinality You will typically decrease the maxFilters and increase the bufferSize
Many users and low member cardinality You will typically increase the maxFilters and decrease the bufferSize
Many users and high member cardinality You will typically increase both the maxFilters and the bufferSize
Field Summary | |
---|---|
static int |
ALL_CACHE
|
static int |
MEMBER_CACHE
|
static int |
NON_MEMBER_CACHE
|
Constructor Summary | |
---|---|
Metadata()
|
|
Metadata(com.sas.iom.SASMDX.IMDXServer connection)
|
|
Metadata(com.sas.iom.SASMDX.IMDXServer connection,
java.util.Locale locale)
|
|
Metadata(com.sas.iom.SASMDX.ISession session)
|
|
Metadata(java.lang.String host,
int port,
java.lang.String username,
java.lang.String password)
|
|
Metadata(java.lang.String host,
int port,
java.lang.String username,
java.lang.String password,
java.util.Locale locale)
|
Method Summary | |
---|---|
static void |
clearCache(Filter filter,
java.lang.Object connObject,
int cacheType)
Clear the cache that matches the filter and cache type. |
static void |
clearCache(java.lang.Object connObject,
int cacheType)
Clear either member cache, non member cache or all caches. |
java.lang.Object |
getConnection()
The connection returned will be an com.sas.iom.SASMDX.IMDXServer IMDXServer or com.sas.iom.SASMDX.ISession. |
CubeInterface |
getCube(Filter filter)
Returns the cube(s) with the appropriate restrictions |
CubeInterface[] |
getCubes(Filter filter)
Returns the cube(s) with the appropriate restrictions |
DimensionInterface |
getDimension(Filter filter)
Returns the dimension with the appropriate restrictions |
DimensionInterface[] |
getDimensions(Filter filter)
Returns the dimension(s) with the appropriate restrictions |
HierarchyInterface[] |
getHierarchies(Filter filter)
Returns the hierarchies(s) with the appropriate restrictions |
HierarchyInterface |
getHierarchy(Filter filter)
Returns the hierarchy with the appropriate restrictions |
LevelInterface |
getLevel(Filter filter)
Returns the level with the appropriate restrictions |
LevelInterface[] |
getLevels(Filter filter)
Returns the level(s) with the appropriate restrictions |
java.util.Locale |
getLocale()
Return the locale used to create a session object |
MeasureInterface |
getMeasure(Filter filter)
Returns the measure(s) with the appropriate restrictions |
MeasureInterface[] |
getMeasures(Filter filter)
Returns the measure(s) with the appropriate restrictions |
MemberInterface[] |
getMembers(Filter filter,
int start,
int count)
Returns a count number of members(s) with the appropriate restrictions |
MetadataPerformanceTuning |
getPerformanceTuning()
Return a performanceTuning object that can be used to improve the performance of a metadata query. |
PropertyInterface[] |
getProperties(Filter filter)
Returns the properties with the appropriate restrictions |
PropertyInterface |
getProperty(Filter filter)
Returns the properties with the appropriate restrictions |
SchemaInterface |
getSchema(Filter filter)
Return the schema that match the filter restriction |
SchemaInterface[] |
getSchemas()
Return all the schemas for this connection |
SchemaInterface[] |
getSchemas(Filter filter)
Return the schemas that match the filter restriction |
void |
setConnection(java.lang.Object con)
The connection type for this implementation is the com.sas.iom.SASMDX.IMDXServer or the connection type is com.sas.iom.ISession. |
void |
setLocale(java.util.Locale locale)
Set the Locale used to create the session. |
void |
setPerformanceTuning(MetadataPerformanceTuning performanceTuning)
Set the performance tuning object on the metadata. |
Field Detail |
---|
public static final int MEMBER_CACHE
public static final int NON_MEMBER_CACHE
public static final int ALL_CACHE
Constructor Detail |
---|
public Metadata() throws OLAPException
OLAPException
public Metadata(com.sas.iom.SASMDX.IMDXServer connection) throws OLAPException
OLAPException
public Metadata(java.lang.String host, int port, java.lang.String username, java.lang.String password) throws OLAPException
OLAPException
public Metadata(com.sas.iom.SASMDX.ISession session) throws OLAPException
OLAPException
public Metadata(com.sas.iom.SASMDX.IMDXServer connection, java.util.Locale locale) throws OLAPException
OLAPException
public Metadata(java.lang.String host, int port, java.lang.String username, java.lang.String password, java.util.Locale locale) throws OLAPException
OLAPException
Method Detail |
---|
public MetadataPerformanceTuning getPerformanceTuning() throws OLAPException
OLAPException
public void setPerformanceTuning(MetadataPerformanceTuning performanceTuning) throws OLAPException
performanceTuning
- object to tune this metadata
OLAPException
public static void clearCache(java.lang.Object connObject, int cacheType) throws OLAPException
connObject
- ISession object that was used o create this metadata or
null if not known. The cache will clear the cache for matching session or all the items
that match the cacheType if null specified.cacheType
- the types of cache are MEMBER_CACHE,
NON_MEMBER_CACHE and ALL_CACHE.
OLAPException
public static void clearCache(Filter filter, java.lang.Object connObject, int cacheType) throws OLAPException
filter
- the filter used to query the metadata or a filter
that matches all the condition set on the filterconnObject
- ISession object that was used to create this metadata or
null if not known. This will clear the cache of items that match the session or
all the items (based on cacheType and filter) if null specified.cacheType
- clear the specified type of cache. The types can
be either member, non member or all.
OLAPException
public java.lang.Object getConnection() throws OLAPException
getConnection
in interface MetadataInterface
OLAPException
- if a database error occurspublic void setConnection(java.lang.Object con) throws OLAPException
setConnection
in interface MetadataInterface
con
- an object that can be a session or the connection to the server.
OLAPException
- if a database error occurspublic void setLocale(java.util.Locale locale) throws OLAPException
setLocale
in interface MetadataInterface
locale
- the locale used to create the session
OLAPException
- if a database error occurspublic java.util.Locale getLocale() throws OLAPException
getLocale
in interface MetadataInterface
OLAPException
- if a database error occurspublic SchemaInterface[] getSchemas() throws OLAPException
getSchemas
in interface MetadataInterface
OLAPException
- if a database error occurspublic SchemaInterface[] getSchemas(Filter filter) throws OLAPException
getSchemas
in interface MetadataInterface
filter
- a set of restriction
OLAPException
- if a database error occurspublic SchemaInterface getSchema(Filter filter) throws OLAPException
getSchema
in interface MetadataInterface
filter
- a set of restriction
OLAPException
- if a database error occurspublic CubeInterface[] getCubes(Filter filter) throws OLAPException
getCubes
in interface MetadataInterface
filter
- a set of restriction
OLAPException
- if a database error occursMetadataInterface
public CubeInterface getCube(Filter filter) throws OLAPException
getCube
in interface MetadataInterface
filter
- a set of restriction
OLAPException
- if a database error occursMetadataInterface
public DimensionInterface[] getDimensions(Filter filter) throws OLAPException
getDimensions
in interface MetadataInterface
filter
- a set of restriction
OLAPException
- if a database error occursMetadataInterface
public DimensionInterface getDimension(Filter filter) throws OLAPException
MetadataInterface
getDimension
in interface MetadataInterface
filter
- The filter defines the restrictions to be applied for this metadata query. The following restrictions
are applicable for this type of Metadata object:OLAPException
- if a database error occurspublic HierarchyInterface[] getHierarchies(Filter filter) throws OLAPException
getHierarchies
in interface MetadataInterface
filter
- a set of restriction
OLAPException
- if a database error occursMetadataInterface
public HierarchyInterface getHierarchy(Filter filter) throws OLAPException
MetadataInterface
getHierarchy
in interface MetadataInterface
filter
- The filter defines the restrictions to be applied for this metadata query. The following restrictions
are applicable for this type of Metadata object:OLAPException
- if a database error occurspublic LevelInterface[] getLevels(Filter filter) throws OLAPException
getLevels
in interface MetadataInterface
filter
- a set of restriction
OLAPException
- if a database error occursMetadataInterface
public LevelInterface getLevel(Filter filter) throws OLAPException
MetadataInterface
getLevel
in interface MetadataInterface
filter
- The filter defines the restrictions to be applied for this metadata query. The following restrictions
are applicable for this type of Metadata object:OLAPException
- if a database error occurspublic MeasureInterface[] getMeasures(Filter filter) throws OLAPException
getMeasures
in interface MetadataInterface
filter
- a set of restriction
OLAPException
- if a database error occursMetadataInterface
public MeasureInterface getMeasure(Filter filter) throws OLAPException
getMeasure
in interface MetadataInterface
filter
- a set of restriction
OLAPException
- if a database error occursMetadataInterface
public PropertyInterface[] getProperties(Filter filter) throws OLAPException
getProperties
in interface MetadataInterface
filter
- a set of restriction
OLAPException
- if a database error occursMetadataInterface
public PropertyInterface getProperty(Filter filter) throws OLAPException
getProperty
in interface MetadataInterface
filter
- a set of restriction
OLAPException
- if a database error occursMetadataInterface
public MemberInterface[] getMembers(Filter filter, int start, int count) throws OLAPException
getMembers
in interface MetadataInterface
filter
- a set of restrictionstart
- start indexcount
- The number of members to return from the resulting set of members, where -1 returns
all members meeting the above criteria.
OLAPException
- if a database error occursMetadataInterface
|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |