org.apache.kylin.common.util.Dictionary.getMaxId()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(6.9k)|赞(0)|评价(0)|浏览(121)

本文整理了Java中org.apache.kylin.common.util.Dictionary.getMaxId()方法的一些代码示例,展示了Dictionary.getMaxId()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Dictionary.getMaxId()方法的具体详情如下:
包路径:org.apache.kylin.common.util.Dictionary
类名称:Dictionary
方法名:getMaxId

Dictionary.getMaxId介绍

暂无

代码示例

代码示例来源:origin: apache/kylin

public int getSize() {
  return getMaxId() - getMinId() + 1;
}

代码示例来源:origin: apache/kylin

@Override
public boolean moveNext() throws IOException {
  String minValue = null;
  int curDictIndex = 0;
  // multi-merge dictionary forest
  for (int i = 0; i < dictionaryList.size(); i++) {
    Dictionary<String> dict = dictionaryList.get(i);
    if (dict == null)
      continue;
    int curKey = curKeys.get(i);
    if (curKey > dict.getMaxId())
      continue;
    String curValue = dict.getValueFromId(curKey);
    if (minValue == null || dataType.compare(minValue, curValue) > 0) {
      minValue = curValue;
      curDictIndex = i;
    }
  }
  if (minValue == null) {
    curValue = null;
    return false;
  }
  curValue = minValue;
  curKeys.set(curDictIndex, curKeys.get(curDictIndex) + 1);
  return true;
}

代码示例来源:origin: apache/kylin

public List<T> enumeratorValues() {
  List<T> ret = Lists.newArrayListWithExpectedSize(getSize());
  for (int i = getMinId(); i <= getMaxId(); i++) {
    ret.add(getValueFromId(i));
  }
  return ret;
}

代码示例来源:origin: apache/kylin

public ShrunkenDictionary<T> build(ValueSerializer<T> valueSerializer) {
    return new ShrunkenDictionary<>(valueSerializer, fullDict.getMinId(), fullDict.getMaxId(),
        fullDict.getSizeOfId(), fullDict.getSizeOfValue(), valueToIdMap);
  }
}

代码示例来源:origin: apache/kylin

@Override
public boolean contains(Dictionary other) {
  if (other.getSize() > this.getSize()) {
    return false;
  }
  for (int i = other.getMinId(); i <= other.getMaxId(); ++i) {
    T v = (T) other.getValueFromId(i);
    if (!this.containsValue(v)) {
      return false;
    }
  }
  return true;
}

代码示例来源:origin: apache/kylin

@Override
public boolean contains(Dictionary other) {
  if (other.getSize() > this.getSize()) {
    return false;
  }
  for (int i = other.getMinId(); i <= other.getMaxId(); ++i) {
    T v = (T) other.getValueFromId(i);
    if (!this.containsValue(v)) {
      return false;
    }
  }
  return true;
}

代码示例来源:origin: apache/kylin

for (int i = dict.getMinId(); i <= dict.getMaxId(); i++) {
  Object dictVal = dict.getValueFromId(i);
  Object computedVal = builtInFunctionTupleFilter.invokeFunction(dictVal);

代码示例来源:origin: apache/kylin

private TupleFilter translateFunctionTupleFilter(BuiltInFunctionTupleFilter builtInFunctionTupleFilter) {
  if (!builtInFunctionTupleFilter.isValid())
    return null;
  TblColRef columnRef = builtInFunctionTupleFilter.getColumn();
  Dictionary<?> dict = dimEncMap.getDictionary(columnRef);
  if (dict == null)
    return null;
  CompareTupleFilter translated = new CompareTupleFilter(builtInFunctionTupleFilter.isReversed() ? FilterOperatorEnum.NOTIN : FilterOperatorEnum.IN);
  translated.addChild(new ColumnTupleFilter(columnRef));
  try {
    int translatedInClauseMaxSize = KylinConfig.getInstanceFromEnv().getTranslatedInClauseMaxSize();
    for (int i = dict.getMinId(); i <= dict.getMaxId(); i++) {
      Object dictVal = dict.getValueFromId(i);
      if ((Boolean) builtInFunctionTupleFilter.invokeFunction(dictVal)) {
        translated.addChild(new ConstantTupleFilter(dictVal));
        if (translated.getChildren().size() > translatedInClauseMaxSize) {
          return null;
        }
      }
    }
    logger.debug("getting a in clause with {} children", translated.getChildren().size());
  } catch (Exception e) {
    logger.debug(e.getMessage());
    return null;
  }
  return translated;
}

代码示例来源:origin: org.apache.kylin/kylin-core-common

public int getSize() {
  return getMaxId() - getMinId() + 1;
}

代码示例来源:origin: org.apache.kylin/kylin-common

public int getSize() {
  return getMaxId() - getMinId() + 1;
}

代码示例来源:origin: org.apache.kylin/kylin-core-dictionary

@Override
public boolean moveNext() throws IOException {
  String minValue = null;
  int curDictIndex = 0;
  // multi-merge dictionary forest
  for (int i = 0; i < dictionaryList.size(); i++) {
    Dictionary<String> dict = dictionaryList.get(i);
    if (dict == null)
      continue;
    int curKey = curKeys.get(i);
    if (curKey > dict.getMaxId())
      continue;
    String curValue = dict.getValueFromId(curKey);
    if (minValue == null || dataType.compare(minValue, curValue) > 0) {
      minValue = curValue;
      curDictIndex = i;
    }
  }
  if (minValue == null) {
    curValue = null;
    return false;
  }
  curValue = minValue;
  curKeys.set(curDictIndex, curKeys.get(curDictIndex) + 1);
  return true;
}

代码示例来源:origin: org.apache.kylin/kylin-core-common

public List<T> enumeratorValues() {
  List<T> ret = Lists.newArrayListWithExpectedSize(getSize());
  for (int i = getMinId(); i <= getMaxId(); i++) {
    ret.add(getValueFromId(i));
  }
  return ret;
}

代码示例来源:origin: org.apache.kylin/kylin-dictionary

@Override
public boolean moveNext() throws IOException {
  if (curDictIndex < dictionaryList.size() && curKey <= curDict.getMaxId()) {
    byte[] buffer = new byte[curDict.getSizeOfValue()];
    int size = curDict.getValueBytesFromId(curKey, buffer, 0);
    curValue = Bytes.copy(buffer, 0, size);
    if (++curKey > curDict.getMaxId()) {
      if (++curDictIndex < dictionaryList.size()) {
        curDict = dictionaryList.get(curDictIndex);
        curKey = curDict.getMinId();
      }
    }
    return true;
  }
  curValue = null;
  return false;
}

代码示例来源:origin: org.apache.kylin/kylin-core-dictionary

public ShrunkenDictionary<T> build(ValueSerializer<T> valueSerializer) {
    return new ShrunkenDictionary<>(valueSerializer, fullDict.getMinId(), fullDict.getMaxId(),
        fullDict.getSizeOfId(), fullDict.getSizeOfValue(), valueToIdMap);
  }
}

代码示例来源:origin: org.apache.kylin/kylin-core-dictionary

@Override
public boolean contains(Dictionary other) {
  if (other.getSize() > this.getSize()) {
    return false;
  }
  for (int i = other.getMinId(); i <= other.getMaxId(); ++i) {
    T v = (T) other.getValueFromId(i);
    if (!this.containsValue(v)) {
      return false;
    }
  }
  return true;
}

代码示例来源:origin: org.apache.kylin/kylin-core-dictionary

@Override
public boolean contains(Dictionary other) {
  if (other.getSize() > this.getSize()) {
    return false;
  }
  for (int i = other.getMinId(); i <= other.getMaxId(); ++i) {
    T v = (T) other.getValueFromId(i);
    if (!this.containsValue(v)) {
      return false;
    }
  }
  return true;
}

代码示例来源:origin: org.apache.kylin/kylin-core-dictionary

private TupleFilter translateFunctionTupleFilter(BuiltInFunctionTupleFilter builtInFunctionTupleFilter) {
  if (!builtInFunctionTupleFilter.isValid())
    return null;
  TblColRef columnRef = builtInFunctionTupleFilter.getColumn();
  Dictionary<?> dict = dimEncMap.getDictionary(columnRef);
  if (dict == null)
    return null;
  CompareTupleFilter translated = new CompareTupleFilter(builtInFunctionTupleFilter.isReversed() ? FilterOperatorEnum.NOTIN : FilterOperatorEnum.IN);
  translated.addChild(new ColumnTupleFilter(columnRef));
  try {
    int translatedInClauseMaxSize = KylinConfig.getInstanceFromEnv().getTranslatedInClauseMaxSize();
    for (int i = dict.getMinId(); i <= dict.getMaxId(); i++) {
      Object dictVal = dict.getValueFromId(i);
      if ((Boolean) builtInFunctionTupleFilter.invokeFunction(dictVal)) {
        translated.addChild(new ConstantTupleFilter(dictVal));
        if (translated.getChildren().size() > translatedInClauseMaxSize) {
          return null;
        }
      }
    }
    logger.debug("getting a in clause with {} children", translated.getChildren().size());
  } catch (Exception e) {
    logger.debug(e.getMessage());
    return null;
  }
  return translated;
}

代码示例来源:origin: org.apache.kylin/kylin-core-dictionary

for (int i = dict.getMinId(); i <= dict.getMaxId(); i++) {
  Object dictVal = dict.getValueFromId(i);
  Object computedVal = builtInFunctionTupleFilter.invokeFunction(dictVal);

相关文章