blob: 20ae56aee48de5e68fed0796907b8225dbceb6b2 [file] [log] [blame]
package edu.uci.ics.hivesterix.runtime.factory.normalize;
import edu.uci.ics.hyracks.api.dataflow.value.INormalizedKeyComputer;
import edu.uci.ics.hyracks.api.dataflow.value.INormalizedKeyComputerFactory;
public class HiveLongDescNormalizedKeyComputerFactory implements
INormalizedKeyComputerFactory {
private static final long serialVersionUID = 1L;
private final INormalizedKeyComputerFactory ascNormalizedKeyComputerFactory = new HiveIntegerAscNormalizedKeyComputerFactory();
@Override
public INormalizedKeyComputer createNormalizedKeyComputer() {
return new INormalizedKeyComputer() {
private INormalizedKeyComputer nmkComputer = ascNormalizedKeyComputerFactory
.createNormalizedKeyComputer();
@Override
public int normalize(byte[] bytes, int start, int length) {
int nk = nmkComputer.normalize(bytes, start, length);
return (int) ((long) Integer.MAX_VALUE - (long) (nk - Integer.MIN_VALUE));
}
};
}
}