public static class RolapCubeHierarchy.RolapCubeSqlMemberSource extends Object
Modifier and Type | Class and Description |
---|---|
static class |
SqlMemberSource.NullValuePoolFactory
Default
SqlMemberSource.ValuePoolFactory
implementation, used if
MondrianProperties.SqlMemberSourceValuePoolFactoryClass
is not set. |
static interface |
SqlMemberSource.ValuePoolFactory
Interface definition for the pluggable factory used to decide
which implementation of
Map to use to pool
reusable values. |
static class |
SqlMemberSource.ValuePoolFactoryFactory
Creates the ValuePoolFactory which is in turn used
to create property-value maps for member properties.
|
Constructor and Description |
---|
RolapCubeSqlMemberSource(RolapCubeHierarchy.RolapCubeHierarchyMemberReader memberReader,
RolapCubeHierarchy hierarchy,
MemberCacheHelper memberSourceCacheHelper,
Object memberCacheLock) |
Modifier and Type | Method and Description |
---|---|
RolapMember |
allMember()
Returns the 'all' member of the hierarchy.
|
int |
compare(RolapMember m1,
RolapMember m2,
boolean siblingsAreEqual)
Compares two members according to their order in a prefix ordered
traversal.
|
RolapMember |
desubstitute(RolapMember member)
Returns the member which was substituted.
|
RolapMember |
getDefaultMember() |
RolapHierarchy |
getHierarchy()
Returns the hierarchy that this source is reading for.
|
RolapMember |
getLeadMember(RolapMember member,
int n)
Returns the member
n after member in the same
level (or before, if n is negative). |
int |
getLevelMemberCount(RolapLevel level)
Returns the number of members in this level.
|
TupleReader.MemberBuilder |
getMemberBuilder() |
RolapMember |
getMemberByKey(RolapLevel level,
List<Comparable> keyValues)
Looks up a member by its key value.
|
mondrian.rolap.MemberCache |
getMemberCache()
Returns the
MemberCache to look up members before
creating them. |
Object |
getMemberCacheLock()
use the same lock in the RolapCubeMemberSource as the
RolapCubeHiearchyMemberReader to avoid deadlocks
|
void |
getMemberChildren(List<RolapMember> parentMembers,
List<RolapMember> children)
Returns all members which are a child of one of the members in
parentMembers , sorted by ordinal. |
Map<? extends Member,Access> |
getMemberChildren(List<RolapMember> parentMembers,
List<RolapMember> children,
MemberChildrenConstraint mcc)
Populates a list of the children of a given set of Members, optionally
applying a constraint.
|
void |
getMemberChildren(RolapMember parentMember,
List<RolapMember> children)
Writes all children
parentMember to children . |
Map<? extends Member,Access> |
getMemberChildren(RolapMember parentMember,
List<RolapMember> children,
MemberChildrenConstraint constraint)
Populates a list of the children of a Member, optionally applying a
constraint.
|
int |
getMemberCount()
Returns an estimate of number of members in this hierarchy.
|
RolapMember |
getMemberParent(RolapMember member) |
void |
getMemberRange(RolapLevel level,
RolapMember startMember,
RolapMember endMember,
List<RolapMember> memberList)
Writes all members between
startMember and
endMember into list . |
List<RolapMember> |
getMembers()
Returns all members of this hierarchy, sorted by ordinal.
|
List<RolapMember> |
getMembersInLevel(RolapLevel level)
Returns all of the members in
level whose ordinal lies
between startOrdinal and endOrdinal . |
List<RolapMember> |
getMembersInLevel(RolapLevel level,
TupleConstraint constraint)
Returns the members in the given Level, optionally applying a constraint.
|
List<RolapMember> |
getRootMembers()
Returns all members of this hierarchy which do not have a parent,
sorted by ordinal.
|
static boolean |
isLevelCollapsed(AggStar aggStar,
RolapCubeLevel level)
Determine if the given aggregate table has the dimension level
specified within in (AggStar.FactTable) it, aka collapsed,
or associated with foreign keys (AggStar.DimTable)
|
static boolean |
levelContainsMultipleColumns(RolapLevel level)
Determine if a level contains more than a single column for its
data, such as an ordinal column or property column
|
RolapMember |
lookupMember(List<Id.Segment> uniqueNameParts,
boolean failIfNotFound)
Finds a member based upon its unique name.
|
RolapMember |
makeMember(RolapMember parentMember,
RolapLevel childLevel,
Object value,
Object captionValue,
boolean parentChild,
SqlStatement stmt,
Object key,
int columnOffset)
Creates a new member (together with its properties).
|
boolean |
setCache(mondrian.rolap.MemberCache cache)
Sets the cache which this
MemberSource will write to. |
RolapMember |
substitute(RolapMember member)
Substitutes a given member.
|
public RolapCubeSqlMemberSource(RolapCubeHierarchy.RolapCubeHierarchyMemberReader memberReader, RolapCubeHierarchy hierarchy, MemberCacheHelper memberSourceCacheHelper, Object memberCacheLock)
public RolapMember makeMember(RolapMember parentMember, RolapLevel childLevel, Object value, Object captionValue, boolean parentChild, SqlStatement stmt, Object key, int columnOffset) throws SQLException
TupleReader.MemberBuilder
makeMember
in interface TupleReader.MemberBuilder
parentMember
- Parent memberchildLevel
- Child levelvalue
- Member valuecaptionValue
- CaptionparentChild
- Whether a parent-child hierarchystmt
- SQL statementkey
- Member keycolumnOffset
- Column ordinal (0-based)SQLException
- on errorpublic mondrian.rolap.MemberCache getMemberCache()
TupleReader.MemberBuilder
MemberCache
to look up members before
creating them.getMemberCache
in interface TupleReader.MemberBuilder
public Object getMemberCacheLock()
getMemberCacheLock
in interface TupleReader.MemberBuilder
public RolapMember allMember()
TupleReader.MemberBuilder
allMember
in interface TupleReader.MemberBuilder
public RolapHierarchy getHierarchy()
MemberSource
public boolean setCache(mondrian.rolap.MemberCache cache)
MemberSource
MemberSource
will write to.
Cache-writeback is optional (for example, SqlMemberSource
supports it, and ArrayMemberSource
does not), and the return
value from this method indicates whether this object supports it.
If this method returns true
, the MemberSource.getMembers()
,
MemberSource.getRootMembers()
and MemberSource.getMemberChildren(mondrian.rolap.RolapMember, java.util.List<mondrian.rolap.RolapMember>)
methods must
write to the cache, in addition to returning members as a return value.
cache
- The MemberCache
which the caller would like
this MemberSource
to write to.MemberSource
supports cache-writeback.public int getMemberCount()
MemberSource
public RolapMember substitute(RolapMember member)
This method is called whenever a member is returned from the wrapped member reader and is to be returned to the caller. You could say that it translates 'to caller space'.
member
- Memberpublic RolapMember desubstitute(RolapMember member)
This method is called whenever the caller passes a member into a method and needs to be passed to a method on the wrapped member reader. You could say that it translates 'from caller space'.
member
- Memberpublic RolapMember getMemberByKey(RolapLevel level, List<Comparable> keyValues)
level
- LevelkeyValues
- Key valuespublic RolapMember lookupMember(List<Id.Segment> uniqueNameParts, boolean failIfNotFound)
MemberSource
public int getLevelMemberCount(RolapLevel level)
level
- Levelpublic List<RolapMember> getMembers()
MemberSource
If this object supports cache-writeaback
, also
writes these members to the cache.
public List<RolapMember> getMembersInLevel(RolapLevel level)
level
whose ordinal lies
between startOrdinal
and endOrdinal
.
If this object
supports cache-writeback
, also
writes these members to the cache.
List
of RolapMember
public List<RolapMember> getMembersInLevel(RolapLevel level, TupleConstraint constraint)
level
- Levelconstraint
- Constraintpublic List<RolapMember> getRootMembers()
MemberSource
If this object supports cache-writeback
, also
writes these members to the cache.
List
of RolapMember
spublic static boolean levelContainsMultipleColumns(RolapLevel level)
level
- the level to checkpublic static boolean isLevelCollapsed(AggStar aggStar, RolapCubeLevel level)
aggStar
- aggregate star if existslevel
- levelpublic void getMemberChildren(List<RolapMember> parentMembers, List<RolapMember> children)
MemberSource
parentMembers
, sorted by ordinal.
If this object supports cache-writeaback
, also
writes these members to the cache.
public Map<? extends Member,Access> getMemberChildren(List<RolapMember> parentMembers, List<RolapMember> children, MemberChildrenConstraint mcc)
parentMembers
- List of members whose children to findchildren
- List to populate with membersmcc
- Constraintnull
values.public void getMemberChildren(RolapMember parentMember, List<RolapMember> children)
MemberSource
parentMember
to children
.
If this object supports cache-writeback
, also
writes these members to the cache.
public Map<? extends Member,Access> getMemberChildren(RolapMember parentMember, List<RolapMember> children, MemberChildrenConstraint constraint)
parentMember
- Members whose children to findchildren
- List to populate with membersconstraint
- Constraintnull
values.public RolapMember getLeadMember(RolapMember member, int n)
n
after member
in the same
level (or before, if n
is negative).
Returns Hierarchy.getNullMember()
if we run off the beginning or
end of the level.public void getMemberRange(RolapLevel level, RolapMember startMember, RolapMember endMember, List<RolapMember> memberList)
startMember
and
endMember
into list
.public int compare(RolapMember m1, RolapMember m2, boolean siblingsAreEqual)
siblingsAreEqual
, then two members with the
same parent will compare equal.siblingsAreEqual
and
m1 and m2 have the same parentpublic TupleReader.MemberBuilder getMemberBuilder()
public RolapMember getDefaultMember()
public RolapMember getMemberParent(RolapMember member)
Copyright © 2020 Hitachi Vantara. All rights reserved.