Java Code Examples for org.apache.kylin.cube.model.RowKeyDesc#getTailMask()

The following examples show how to use org.apache.kylin.cube.model.RowKeyDesc#getTailMask() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CuboidCLI.java    From Kylin with Apache License 2.0 5 votes vote down vote up
public static int mathCalcCuboidCount(CubeDesc cube) {
    int result = 1; // 1 for base cuboid

    RowKeyDesc rowkey = cube.getRowkey();
    AggrGroupMask[] aggrGroupMasks = rowkey.getAggrGroupMasks();
    for (int i = 0; i < aggrGroupMasks.length; i++) {
        boolean hasTail = i < aggrGroupMasks.length - 1 || rowkey.getTailMask() > 0;
        result += mathCalcCuboidCount_aggrGroup(rowkey, aggrGroupMasks[i], hasTail);
    }

    return result;
}
 
Example 2
Source File: Cuboid.java    From Kylin with Apache License 2.0 5 votes vote down vote up
private static boolean checkAggregationGroup(RowKeyDesc rowkey, long cuboidID) {
    long cuboidWithoutMandatory = cuboidID & ~rowkey.getMandatoryColumnMask();
    long leftover;
    for (AggrGroupMask mask : rowkey.getAggrGroupMasks()) {
        if ((cuboidWithoutMandatory & mask.uniqueMask) != 0) {
            leftover = cuboidWithoutMandatory & ~mask.groupMask;
            return leftover == 0 || leftover == mask.leftoverMask;
        }
    }

    leftover = cuboidWithoutMandatory & rowkey.getTailMask();
    return leftover == 0 || leftover == rowkey.getTailMask();
}