本文整理了Java中org.apache.hyracks.storage.am.rtree.linearize.ZCurveIntComparatorFactory
类的一些代码示例,展示了ZCurveIntComparatorFactory
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZCurveIntComparatorFactory
类的具体详情如下:
包路径:org.apache.hyracks.storage.am.rtree.linearize.ZCurveIntComparatorFactory
类名称:ZCurveIntComparatorFactory
暂无
代码示例来源:origin: apache/asterixdb
public static ZCurveIntComparatorFactory get(int dim) {
return new ZCurveIntComparatorFactory(dim);
}
代码示例来源:origin: apache/asterixdb
@SuppressWarnings("squid:S1172") // unused parameter
public static IJsonSerializable fromJson(IPersistedResourceRegistry registry, JsonNode json) {
return get(json.get("dim").asInt());
}
}
代码示例来源: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 + ".");
}
}
内容来源于网络,如有侵权,请联系作者删除!