public boolean isGlobalSnapshotTable(String tableName) { SnapshotTableDesc desc = getSnapshotTableDesc(tableName); if (desc == null) { return false; } return desc.isGlobal(); }
public boolean isExtSnapshotTable(String tableName) { SnapshotTableDesc desc = getSnapshotTableDesc(tableName); if (desc == null) { return false; } return desc.isExtSnapshotTable(); }
public TblColRef getColumnByBitIndex(int bitIndex) { RowKeyColDesc[] rowKeyColumns = this.getRowkey().getRowKeyColumns(); return rowKeyColumns[rowKeyColumns.length - 1 - bitIndex].getColRef(); }
private void buildMandatoryColumnMask(RowKeyDesc rowKeyDesc) { mandatoryColumnMask = 0L; String[] mandatory_dims = this.selectRule.mandatoryDims; if (mandatory_dims == null || mandatory_dims.length == 0) { return; } for (String dim : mandatory_dims) { TblColRef hColumn = cubeDesc.getModel().findColumn(dim); Integer index = rowKeyDesc.getColumnBitIndex(hColumn); mandatoryColumnMask |= (1L << index); } }
public static long getBaseCuboidId(CubeDesc cube) { return cube.getRowkey().getFullMask(); }
public Set<TblColRef> getShardByColumns() { return getRowkey().getShardByColumns(); }
/** Returns the key for what this cuboid scheduler responsible for. */ public String getCuboidCacheKey() { return cubeDesc.getName(); }
@Override public IJoinedFlatTableDesc getJoinedFlatTableDesc(CubeSegment newSegment) { return new CubeJoinedFlatTableDesc(newSegment); }
public int getColumnBitIndex(TblColRef col) { return getColDesc(col).getBitIndex(); }
public void init(CubeDesc cubeDesc) { setCubeDesc(cubeDesc); buildRowKey(); initColumnsNeedIndex(); }
public boolean isUseDictionary(TblColRef col) { return getColDesc(col).isUsingDictionary(); }
public DoggedCubeBuilder(CuboidScheduler cuboidScheduler, IJoinedFlatTableDesc flatDesc, Map<TblColRef, Dictionary<String>> dictionaryMap) { super(cuboidScheduler, flatDesc, dictionaryMap); // check memory more often if a single row is big if (cubeDesc.hasMemoryHungryMeasures()) unitRows /= 10; }
public boolean isOnTree(long cuboidID) { if (cuboidID <= 0) { return false; //cuboid must be greater than 0 } if ((cuboidID & ~partialCubeFullMask) != 0) { return false; //a cuboid's parent within agg is at most partialCubeFullMask } return checkMandatoryColumns(cuboidID) && checkHierarchy(cuboidID) && checkJoint(cuboidID); }
private CubeJoinedFlatTableDesc(CubeDesc cubeDesc, CubeSegment cubeSegment /* can be null */, boolean includingDerived) { this.cubeDesc = cubeDesc; this.cubeSegment = cubeSegment; this.tableName = makeTableName(cubeDesc, cubeSegment); this.includingDerived = includingDerived; initParseCubeDesc(); }
public static DictionaryDesc create(String column, String reuseColumn, String builderClass) { DictionaryDesc desc = new DictionaryDesc(); desc.column = column; desc.reuseColumn = reuseColumn; desc.builderClass = builderClass; return desc; } }
public void loadCubeMeasureArray(Object[] result) { int[] measureIndex = hbaseColumn.getMeasureIndex(); for (int i = 0; i < measureIndex.length; i++) { result[measureIndex[i]] = values[i]; } }
private void buildNormalDimsMask() { //no joint, no hierarchy, no mandatory long leftover = partialCubeFullMask & ~mandatoryColumnMask; leftover &= ~this.jointDimsMask; for (HierarchyMask hierarchyMask : this.hierarchyMasks) { leftover &= ~hierarchyMask.fullMask; } this.normalDimsMask = leftover; this.normalDims = bits(leftover); }
@Override public TblColRef getClusterBy() { return cubeDesc.getClusteredByColumn(); }
@Override public IJoinedFlatTableDesc getJoinedFlatTableDesc(CubeDesc cubeDesc) { return new CubeJoinedFlatTableDesc(cubeDesc); }
@Override public IJoinedFlatTableDesc getJoinedFlatTableDesc(CubeDesc cubeDesc) { return new CubeJoinedFlatTableDesc(cubeDesc); }