private long eliminateHierarchyAggregation(long id) { long finalId = id; for (AggregationGroup agg : cubeDesc.getAggregationGroups()) { long temp = id; List<HierarchyMask> hierarchyMaskList = agg.getHierarchyMasks(); if (hierarchyMaskList != null && hierarchyMaskList.size() > 0) { for (HierarchyMask hierMask : hierarchyMaskList) { long[] allMasks = hierMask.allMasks; for (int i = allMasks.length - 1; i > 0; i--) { long bit = allMasks[i] ^ allMasks[i - 1]; if ((inputID & bit) != 0) { temp &= ~allMasks[i - 1]; if (temp < finalId) finalId = temp; } } } } } return finalId; }
for (HierarchyMask hierarchyMask : getHierarchyMasks()) { long fullMask = hierarchyMask.fullMask; long intersect = cuboidID & fullMask; if (nonJointDims != 0) { long nonJointNonHierarchy = removeBits(nonJointDims, Collections2.transform(getHierarchyMasks(), new Function<HierarchyMask, Long>() { @Override public Long apply(HierarchyMask input) { for (HierarchyMask hierarchyMask : getHierarchyMasks()) { long dim = hierarchyMask.allMasks[0]; if ((dim & allJointDims) == 0) {
private Set<Long> getOnTreeParents(long child, AggregationGroup agg) { Set<Long> parentCandidate = new HashSet<>(); long tmpChild = child; if (tmpChild == agg.getPartialCubeFullMask()) { return parentCandidate; } if (agg.getMandatoryColumnMask() != 0L) { if (agg.isMandatoryOnlyValid()) { if (fillBit(tmpChild, agg.getMandatoryColumnMask(), parentCandidate)) { return parentCandidate; } } else { tmpChild |= agg.getMandatoryColumnMask(); } } for (Long normal : agg.getNormalDims()) { fillBit(tmpChild, normal, parentCandidate); } for (Long joint : agg.getJoints()) { fillBit(tmpChild, joint, parentCandidate); } for (AggregationGroup.HierarchyMask hierarchy : agg.getHierarchyMasks()) { for (long mask : hierarchy.allMasks) { if (fillBit(tmpChild, mask, parentCandidate)) { break; } } } return parentCandidate; }
private long eliminateHierarchyAggregation(long id) { long finalId = id; for (AggregationGroup agg : cubeDesc.getAggregationGroups()) { long temp = id; List<HierarchyMask> hierarchyMaskList = agg.getHierarchyMasks(); if (hierarchyMaskList != null && hierarchyMaskList.size() > 0) { for (HierarchyMask hierMask : hierarchyMaskList) { long[] allMasks = hierMask.allMasks; for (int i = allMasks.length - 1; i > 0; i--) { long bit = allMasks[i] ^ allMasks[i - 1]; if ((inputID & bit) != 0) { temp &= ~allMasks[i - 1]; if (temp < finalId) finalId = temp; } } } } } return finalId; }
for (HierarchyMask hierarchyMask : getHierarchyMasks()) { long fullMask = hierarchyMask.fullMask; long intersect = cuboidID & fullMask; if (nonJointDims != 0) { long nonJointNonHierarchy = removeBits(nonJointDims, Collections2.transform(getHierarchyMasks(), new Function<HierarchyMask, Long>() { @Override public Long apply(HierarchyMask input) { for (HierarchyMask hierarchyMask : getHierarchyMasks()) { long dim = hierarchyMask.allMasks[0]; if ((dim & allJointDims) == 0) {
private Set<Long> getOnTreeParents(long child, AggregationGroup agg) { Set<Long> parentCandidate = new HashSet<>(); long tmpChild = child; if (tmpChild == agg.getPartialCubeFullMask()) { return parentCandidate; } if (agg.getMandatoryColumnMask() != 0L) { if (agg.isMandatoryOnlyValid()) { if (fillBit(tmpChild, agg.getMandatoryColumnMask(), parentCandidate)) { return parentCandidate; } } else { tmpChild |= agg.getMandatoryColumnMask(); } } for (Long normal : agg.getNormalDims()) { fillBit(tmpChild, normal, parentCandidate); } for (Long joint : agg.getJoints()) { fillBit(tmpChild, joint, parentCandidate); } for (AggregationGroup.HierarchyMask hierarchy : agg.getHierarchyMasks()) { for (long mask : hierarchy.allMasks) { if (fillBit(tmpChild, mask, parentCandidate)) { break; } } } return parentCandidate; }