in java/tsfile/src/main/java/org/apache/tsfile/read/reader/page/ValuePageReader.java [113:172]
public BatchData nextBatch(long[] timeBatch, boolean ascending, Filter filter)
throws IOException {
uncompressDataIfNecessary();
BatchData pageData = BatchDataFactory.createBatchData(dataType, ascending, false);
for (int i = 0; i < timeBatch.length; i++) {
if (((bitmap[i / 8] & 0xFF) & (MASK >>> (i % 8))) == 0) {
continue;
}
long timestamp = timeBatch[i];
switch (dataType) {
case BOOLEAN:
boolean aBoolean = valueDecoder.readBoolean(valueBuffer);
if (!isDeleted(timestamp)
&& (filter == null || filter.satisfyBoolean(timestamp, aBoolean))) {
pageData.putBoolean(timestamp, aBoolean);
}
break;
case INT32:
case DATE:
int anInt = valueDecoder.readInt(valueBuffer);
if (!isDeleted(timestamp)
&& (filter == null || filter.satisfyInteger(timestamp, anInt))) {
pageData.putInt(timestamp, anInt);
}
break;
case INT64:
case TIMESTAMP:
long aLong = valueDecoder.readLong(valueBuffer);
if (!isDeleted(timestamp) && (filter == null || filter.satisfyLong(timestamp, aLong))) {
pageData.putLong(timestamp, aLong);
}
break;
case FLOAT:
float aFloat = valueDecoder.readFloat(valueBuffer);
if (!isDeleted(timestamp) && (filter == null || filter.satisfyFloat(timestamp, aFloat))) {
pageData.putFloat(timestamp, aFloat);
}
break;
case DOUBLE:
double aDouble = valueDecoder.readDouble(valueBuffer);
if (!isDeleted(timestamp)
&& (filter == null || filter.satisfyDouble(timestamp, aDouble))) {
pageData.putDouble(timestamp, aDouble);
}
break;
case TEXT:
case BLOB:
case STRING:
Binary aBinary = valueDecoder.readBinary(valueBuffer);
if (!isDeleted(timestamp)
&& (filter == null || filter.satisfyBinary(timestamp, aBinary))) {
pageData.putBinary(timestamp, aBinary);
}
break;
default:
throw new UnSupportedDataTypeException(String.valueOf(dataType));
}
}
return pageData.flip();
}