本文整理汇总了Java中org.apache.kylin.cube.model.RowKeyDesc.getRowKeyColumns方法的典型用法代码示例。如果您正苦于以下问题:Java RowKeyDesc.getRowKeyColumns方法的具体用法?Java RowKeyDesc.getRowKeyColumns怎么用?Java RowKeyDesc.getRowKeyColumns使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.kylin.cube.model.RowKeyDesc
的用法示例。
在下文中一共展示了RowKeyDesc.getRowKeyColumns方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: validate
import org.apache.kylin.cube.model.RowKeyDesc; //导入方法依赖的package包/类
@Override
public void validate(CubeDesc cube, ValidateContext context) {
RowKeyDesc row = cube.getRowkey();
if (row == null) {
context.addResult(ResultLevel.ERROR, "Rowkey does not exist");
return;
}
RowKeyColDesc[] rcd = row.getRowKeyColumns();
if (rcd == null || rcd.length == 0) {
context.addResult(ResultLevel.ERROR, "Rowkey columns do not exist");
return;
}
for (int i = 0; i < rcd.length; i++) {
RowKeyColDesc rd = rcd[i];
if (rd.getColumn() == null || rd.getColumn().length() == 0) {
context.addResult(ResultLevel.ERROR, "Rowkey column empty");
}
}
}
示例2: validate
import org.apache.kylin.cube.model.RowKeyDesc; //导入方法依赖的package包/类
@Override
public void validate(CubeDesc cube, ValidateContext context) {
RowKeyDesc row = cube.getRowkey();
if (row == null) {
context.addResult(ResultLevel.ERROR, "Rowkey does not exist");
return;
}
RowKeyColDesc[] rcd = row.getRowKeyColumns();
if (rcd == null) {
context.addResult(ResultLevel.ERROR, "Rowkey columns do not exist");
return;
}
if(rcd.length == 0){
context.addResult(ResultLevel.ERROR, "Rowkey columns is empty");
return;
}
for (int i = 0; i < rcd.length; i++) {
RowKeyColDesc rd = rcd[i];
if (rd.getLength() != 0 && (!StringUtils.isEmpty(rd.getDictionary())&&!rd.getDictionary().equals("false"))) {
context.addResult(ResultLevel.ERROR, "Rowkey column " + rd.getColumn() + " must not have both 'length' and 'dictionary' attribute");
}
if (rd.getLength() == 0 && (StringUtils.isEmpty(rd.getDictionary())||rd.getDictionary().equals("false"))) {
context.addResult(ResultLevel.ERROR, "Rowkey column " + rd.getColumn() + " must not have both 'length' and 'dictionary' empty");
}
}
}
示例3: estimateRowKeyColSpace
import org.apache.kylin.cube.model.RowKeyDesc; //导入方法依赖的package包/类
private static int[] estimateRowKeyColSpace(RowKeyDesc rowKeyDesc, long[] cardinality) {
RowKeyColDesc[] rowKeyColDescs = rowKeyDesc.getRowKeyColumns();
int[] ret = new int[rowKeyColDescs.length];
for (int i = 0; i < rowKeyColDescs.length; ++i) {
RowKeyColDesc rowKeyColDesc = rowKeyColDescs[rowKeyColDescs.length - 1 - i];
if (rowKeyColDesc.getDictionary() == null) {
if (rowKeyColDesc.getLength() == 0)
throw new IllegalStateException("The non-dictionary col " + rowKeyColDesc.getColumn() + " has length of 0");
ret[i] = rowKeyColDesc.getLength();
} else {
ret[i] = estimateDictionaryColSpace(cardinality[i]);
}
}
return ret;
}
示例4: extractRowKeyInfo
import org.apache.kylin.cube.model.RowKeyDesc; //导入方法依赖的package包/类
private static RowKeyColInfo extractRowKeyInfo(CubeDesc cubeDesc) {
RowKeyDesc rowKeyDesc = cubeDesc.getRowkey();
RowKeyColInfo info = new RowKeyColInfo();
info.hierachyColBitIndice = new ArrayList<List<Integer>>();
info.nonHierachyColBitIndice = new ArrayList<Integer>();
HashSet<Integer> heirachyIndexSet = new HashSet<Integer>();
for (DimensionDesc dim : cubeDesc.getDimensions()) {
if (dim.getHierarchy() != null) {
LinkedList<Integer> hlist = new LinkedList<Integer>();
for (HierarchyDesc hierarchyDesc : dim.getHierarchy()) {
int index = rowKeyDesc.getColumnBitIndex(hierarchyDesc.getColumnRef());
hlist.add(index);
heirachyIndexSet.add(index);
}
info.hierachyColBitIndice.add(hlist);
}
}
for (int i = 0; i < rowKeyDesc.getRowKeyColumns().length; ++i) {
if (!heirachyIndexSet.contains(i)) {
info.nonHierachyColBitIndice.add(i);
}
}
return info;
}
示例5: updateRowkeyDictionary
import org.apache.kylin.cube.model.RowKeyDesc; //导入方法依赖的package包/类
private void updateRowkeyDictionary(CubeDesc oldModel, org.apache.kylin.cube.model.CubeDesc newModel) {
RowKeyDesc rowKey = newModel.getRowkey();
for (RowKeyColDesc rowkeyCol : rowKey.getRowKeyColumns()) {
if (rowkeyCol.getDictionary() != null && rowkeyCol.getDictionary().length() > 0)
rowkeyCol.setDictionary("true");
}
}