gpt4 book ai didi

org.apache.hyracks.storage.am.rtree.linearize.ZCurveDoubleComparatorFactory.()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-20 14:12:31 28 4
gpt4 key购买 nike

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

ZCurveDoubleComparatorFactory.<init>介绍

暂无

代码示例

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

public static ZCurveDoubleComparatorFactory get(int dim) {
  return new ZCurveDoubleComparatorFactory(dim);
}

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

public static ILinearizeComparatorFactory proposeBestLinearizer(ITypeTraits[] typeTraits, int numKeyFields)
      throws HyracksDataException {
    for (int i = 0; i < numKeyFields; i++) {
      if (!(typeTraits[i].getClass().equals(typeTraits[0].getClass()))) {
        throw HyracksDataException.create(ErrorCode.CANNOT_PROPOSE_LINEARIZER_DIFF_DIMENSIONS);
      }
    }

    if (numKeyFields / 2 == 2 && (typeTraits[0].getClass() == DoublePointable.TYPE_TRAITS.getClass())) {
      return new HilbertDoubleComparatorFactory(2);
    } else if (typeTraits[0].getClass() == DoublePointable.TYPE_TRAITS.getClass()) {
      return new ZCurveDoubleComparatorFactory(numKeyFields / 2);
    } else if (typeTraits[0].getClass() == IntegerPointable.TYPE_TRAITS.getClass()) {
      return new ZCurveIntComparatorFactory(numKeyFields / 2);
    }

    throw HyracksDataException.create(ErrorCode.CANNOT_PROPOSE_LINEARIZER_FOR_TYPE,
        typeTraits[0].getClass().getSimpleName());
  }
}

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

@Override
public ILinearizeComparatorFactory getLinearizeComparatorFactory(Object type, boolean ascending, int dimension)
    throws AlgebricksException {
  ATypeTag typeTag = (ATypeTag) type;
  if (dimension == 2 && (typeTag == ATypeTag.DOUBLE)) {
    return addOffset(new HilbertDoubleComparatorFactory(2), ascending);
  } else if (typeTag == ATypeTag.DOUBLE) {
    return addOffset(new ZCurveDoubleComparatorFactory(dimension), ascending);
  } else if (typeTag == ATypeTag.TINYINT || typeTag == ATypeTag.SMALLINT || typeTag == ATypeTag.INTEGER
      || typeTag == ATypeTag.BIGINT) {
    return addOffset(new ZCurveIntComparatorFactory(dimension), ascending);
  } else {
    throw new AlgebricksException(
        "Cannot propose linearizer for key with type " + typeTag + " and dimension " + dimension + ".");
  }
}

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com