public int getColumnBitIndex(TblColRef col) { return getColDesc(col).getBitIndex(); }
private long getQueryFilterMask(Set<TblColRef> filterColumnD) { long filterMask = 0; logger.info("Filter column set for query: %s", filterColumnD); if (filterColumnD.isEmpty() == false) { RowKeyColDesc[] allColumns = cubeDesc.getRowkey().getRowKeyColumns(); for (int i = 0; i < allColumns.length; i++) { if (filterColumnD.contains(allColumns[i].getColRef())) { filterMask |= 1L << allColumns[i].getBitIndex(); } } } logger.info("Filter mask is: {0}", filterMask); return filterMask; }
private List<TblColRef> translateIdToColumns(long cuboidID) { List<TblColRef> dimesnions = new ArrayList<TblColRef>(); RowKeyColDesc[] allColumns = cubeDesc.getRowkey().getRowKeyColumns(); for (int i = 0; i < allColumns.length; i++) { // NOTE: the order of column in list!!! long bitmask = 1L << allColumns[i].getBitIndex(); if ((cuboidID & bitmask) != 0) { TblColRef colRef = allColumns[i].getColRef(); dimesnions.add(colRef); } } return dimesnions; }
public Set<Long> generateMandatoryCuboids(List<Set<String>> mandatoryDimensionSetList) { Map<String, RowKeyColDesc> rowKeyColDescMap = Maps.newHashMap(); for (RowKeyColDesc entry : getRowkey().getRowKeyColumns()) { rowKeyColDescMap.put(entry.getColumn(), entry); } Set<Long> mandatoryCuboids = Sets.newHashSetWithExpectedSize(mandatoryDimensionSetList.size()); for (Set<String> mandatoryDimensionSet : mandatoryDimensionSetList) { long cuboid = 0L; for (String columnName : mandatoryDimensionSet) { TblColRef tblColRef = model.findColumn(columnName); RowKeyColDesc rowKeyColDesc = rowKeyColDescMap.get(tblColRef.getIdentity()); // check if mandatory dimension set list is valid if (rowKeyColDesc == null) { logger.warn("Column " + columnName + " in " + mandatoryDimensionSet + " does not exist"); throw new IllegalStateException( "Column " + columnName + " in " + mandatoryDimensionSet + " does not exist"); } cuboid |= 1L << rowKeyColDesc.getBitIndex(); } mandatoryCuboids.add(cuboid); } return mandatoryCuboids; }
private void buildRowKey() { columnMap = new HashMap<>(); shardByColumns = new HashSet<>(); for (int i = 0; i < rowkeyColumns.length; i++) { RowKeyColDesc rowKeyColDesc = rowkeyColumns[i]; rowKeyColDesc.init(rowkeyColumns.length - i - 1, cubeDesc); columnMap.put(rowKeyColDesc.getColRef(), rowKeyColDesc); if (rowKeyColDesc.isShardBy()) { shardByColumns.add(rowKeyColDesc.getColRef()); } } this.fullMask = 0L; for (int i = 0; i < this.rowkeyColumns.length; i++) { int index = rowkeyColumns[i].getBitIndex(); this.fullMask |= 1L << index; } }
long cuboid = cuboidIterator.next(); for (int i = 0; i < rowKeyColDescList.length; i++) { if ((cuboid & (1L << rowKeyColDescList[i].getBitIndex())) > 0) { dimensionSet.add(rowKeyColDescList[i].getColumn());
public int getColumnBitIndex(TblColRef col) { return getColDesc(col).getBitIndex(); }
private List<TblColRef> translateIdToColumns(long cuboidID) { List<TblColRef> dimesnions = new ArrayList<TblColRef>(); RowKeyColDesc[] allColumns = cube.getRowkey().getRowKeyColumns(); for (int i = 0; i < allColumns.length; i++) { // NOTE: the order of column in list!!! long bitmask = 1L << allColumns[i].getBitIndex(); if ((cuboidID & bitmask) != 0) { TblColRef colRef = allColumns[i].getColRef(); dimesnions.add(colRef); } } return dimesnions; }
private void buildRowKey(Map<String, TblColRef> colNameAbbr) { columnMap = new HashMap<TblColRef, RowKeyColDesc>(); mandatoryColumnMask = 0; for (int i = 0; i < rowkeyColumns.length; i++) { RowKeyColDesc rowKeyColDesc = rowkeyColumns[i]; String column = rowKeyColDesc.getColumn(); rowKeyColDesc.setColumn(column.toUpperCase()); rowKeyColDesc.setBitIndex(rowkeyColumns.length - i - 1); rowKeyColDesc.setColRef(colNameAbbr.get(column)); if (rowKeyColDesc.getColRef() == null) { throw new IllegalArgumentException("Cannot find rowkey column " + column + " in cube " + cubeDesc); } columnMap.put(rowKeyColDesc.getColRef(), rowKeyColDesc); if (rowKeyColDesc.isMandatory()) { mandatoryColumnMask |= 1L << rowKeyColDesc.getBitIndex(); } } }
int index = rowkeyColumns[i].getBitIndex(); this.fullMask |= 1L << index;
public int getColumnBitIndex(TblColRef col) { return getColDesc(col).getBitIndex(); }
public int getColumnBitIndex(TblColRef col) { return getColDesc(col).getBitIndex(); }
private long getQueryFilterMask(Set<TblColRef> filterColumnD) { long filterMask = 0; logger.info("Filter column set for query: %s", filterColumnD); if (filterColumnD.isEmpty() == false) { RowKeyColDesc[] allColumns = cubeDesc.getRowkey().getRowKeyColumns(); for (int i = 0; i < allColumns.length; i++) { if (filterColumnD.contains(allColumns[i].getColRef())) { filterMask |= 1L << allColumns[i].getBitIndex(); } } } logger.info("Filter mask is: {0}", filterMask); return filterMask; }
private List<TblColRef> translateIdToColumns(long cuboidID) { List<TblColRef> dimesnions = new ArrayList<TblColRef>(); RowKeyColDesc[] allColumns = cube.getRowkey().getRowKeyColumns(); for (int i = 0; i < allColumns.length; i++) { // NOTE: the order of column in list!!! long bitmask = 1L << allColumns[i].getBitIndex(); if ((cuboidID & bitmask) != 0) { TblColRef colRef = allColumns[i].getColRef(); dimesnions.add(colRef); } } return dimesnions; }
private List<TblColRef> translateIdToColumns(long cuboidID) { List<TblColRef> dimesnions = new ArrayList<TblColRef>(); RowKeyColDesc[] allColumns = cubeDesc.getRowkey().getRowKeyColumns(); for (int i = 0; i < allColumns.length; i++) { // NOTE: the order of column in list!!! long bitmask = 1L << allColumns[i].getBitIndex(); if ((cuboidID & bitmask) != 0) { TblColRef colRef = allColumns[i].getColRef(); dimesnions.add(colRef); } } return dimesnions; }
private void buildRowKey() { columnMap = new HashMap<>(); shardByColumns = new HashSet<>(); for (int i = 0; i < rowkeyColumns.length; i++) { RowKeyColDesc rowKeyColDesc = rowkeyColumns[i]; rowKeyColDesc.init(rowkeyColumns.length - i - 1, cubeDesc); columnMap.put(rowKeyColDesc.getColRef(), rowKeyColDesc); if (rowKeyColDesc.isShardBy()) { shardByColumns.add(rowKeyColDesc.getColRef()); } } this.fullMask = 0L; for (int i = 0; i < this.rowkeyColumns.length; i++) { int index = rowkeyColumns[i].getBitIndex(); this.fullMask |= 1L << index; } }
public Set<Long> generateMandatoryCuboids(List<Set<String>> mandatoryDimensionSetList) { Map<String, RowKeyColDesc> rowKeyColDescMap = Maps.newHashMap(); for (RowKeyColDesc entry : getRowkey().getRowKeyColumns()) { rowKeyColDescMap.put(entry.getColumn(), entry); } Set<Long> mandatoryCuboids = Sets.newHashSetWithExpectedSize(mandatoryDimensionSetList.size()); for (Set<String> mandatoryDimensionSet : mandatoryDimensionSetList) { long cuboid = 0L; for (String columnName : mandatoryDimensionSet) { TblColRef tblColRef = model.findColumn(columnName); RowKeyColDesc rowKeyColDesc = rowKeyColDescMap.get(tblColRef.getIdentity()); // check if mandatory dimension set list is valid if (rowKeyColDesc == null) { logger.warn("Column " + columnName + " in " + mandatoryDimensionSet + " does not exist"); throw new IllegalStateException( "Column " + columnName + " in " + mandatoryDimensionSet + " does not exist"); } cuboid |= 1L << rowKeyColDesc.getBitIndex(); } mandatoryCuboids.add(cuboid); } return mandatoryCuboids; }
private void buildRowKey(Map<String, TblColRef> colNameAbbr) { columnMap = new HashMap<TblColRef, RowKeyColDesc>(); mandatoryColumnMask = 0; for (int i = 0; i < rowkeyColumns.length; i++) { RowKeyColDesc rowKeyColDesc = rowkeyColumns[i]; String column = rowKeyColDesc.getColumn(); rowKeyColDesc.setColumn(column.toUpperCase()); rowKeyColDesc.setBitIndex(rowkeyColumns.length - i - 1); rowKeyColDesc.setColRef(colNameAbbr.get(column)); if (rowKeyColDesc.getColRef() == null) { throw new IllegalArgumentException("Cannot find rowkey column " + column + " in cube " + cubeDesc); } columnMap.put(rowKeyColDesc.getColRef(), rowKeyColDesc); if (rowKeyColDesc.isMandatory()) { mandatoryColumnMask |= 1L << rowKeyColDesc.getBitIndex(); } } }
int index = rowkeyColumns[i].getBitIndex(); this.fullMask |= 1L << index;