Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,8 @@ public static Decoder getDecoderByType(TSEncoding encoding, TSDataType dataType)
case TIMESTAMP:
return new LongRLBEDecoder();
case FLOAT:
return new FloatRLBEDecoder();
case DOUBLE:
return new DoubleRLBEDecoder();
return new FloatDecoder(TSEncoding.valueOf(encoding.toString()), dataType);
default:
throw new TsFileDecodingException(String.format(ERROR_MSG, encoding, dataType));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,17 @@ public FloatDecoder(TSEncoding encodingType, TSDataType dataType) {
throw new TsFileDecodingException(
String.format("data type %s is not supported by FloatDecoder", dataType));
}
} else if (encodingType == TSEncoding.RLBE) {
if (dataType == TSDataType.FLOAT) {
decoder = new IntRLBEDecoder();
logger.debug("tsfile-encoding FloatDecoder: init decoder using int-rlbe and float");
} else if (dataType == TSDataType.DOUBLE) {
decoder = new LongRLBEDecoder();
logger.debug("tsfile-encoding FloatDecoder: init decoder using long-rlbe and double");
} else {
throw new TsFileDecodingException(
String.format("data type %s is not supported by FloatDecoder", dataType));
}
} else {
throw new TsFileDecodingException(
String.format("%s encoding is not supported by FloatDecoder", encodingType));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,15 @@ public FloatEncoder(TSEncoding encodingType, TSDataType dataType, int maxPointNu
throw new TsFileEncodingException(
String.format("data type %s is not supported by FloatEncoder", dataType));
}
} else if (encodingType == TSEncoding.RLBE) {
if (dataType == TSDataType.FLOAT) {
encoder = new IntRLBE();
} else if (dataType == TSDataType.DOUBLE) {
encoder = new LongRLBE();
} else {
throw new TsFileEncodingException(
String.format("data type %s is not supported by FloatEncoder", dataType));
}
} else {
throw new TsFileEncodingException(
String.format("%s encoding is not supported by FloatEncoder", encodingType));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,9 @@ public void initFromProps(Map<String, String> props) {
}

public static class RLBE extends TSEncodingBuilder {

private int maxPointNumber = 0;

@Override
public Encoder getEncoder(TSDataType type) {
switch (type) {
Expand All @@ -351,9 +354,8 @@ public Encoder getEncoder(TSDataType type) {
case TIMESTAMP:
return new LongRLBE();
case FLOAT:
return new FloatRLBE();
case DOUBLE:
return new DoubleRLBE();
return new FloatEncoder(TSEncoding.RLBE, type, maxPointNumber);
default:
throw new UnSupportedDataTypeException("RLBE doesn't support data type: " + type);
}
Expand Down