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

x33g5p2x  于2022-02-05 转载在 其他  
字(2.2k)|赞(0)|评价(0)|浏览(102)

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

ZCurveIntComparatorFactory.<init>介绍

暂无

代码示例

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

public static ZCurveIntComparatorFactory get(int dim) {
  return new ZCurveIntComparatorFactory(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 + ".");
  }
}

相关文章

ZCurveIntComparatorFactory类方法