Search in sources :

Example 1 with FixedByteSingleValueMultiColReader

use of com.linkedin.pinot.core.io.reader.impl.FixedByteSingleValueMultiColReader in project pinot by linkedin.

the class FixedByteSingleColumnMultiValueReaderWriter method getStringArray.

@Override
public int getStringArray(int row, String[] stringArray) {
    int bufferIndex = headerReader.getInt(row, 1);
    int startIndex = headerReader.getInt(row, 1);
    int length = headerReader.getInt(row, 2);
    FixedByteSingleValueMultiColReader dataReader = dataReaders.get(bufferIndex);
    for (int i = 0; i < length; i++) {
        stringArray[i] = dataReader.getString(startIndex + i, 0);
    }
    return length;
}
Also used : FixedByteSingleValueMultiColReader(com.linkedin.pinot.core.io.reader.impl.FixedByteSingleValueMultiColReader)

Example 2 with FixedByteSingleValueMultiColReader

use of com.linkedin.pinot.core.io.reader.impl.FixedByteSingleValueMultiColReader in project pinot by linkedin.

the class FixedByteSingleColumnMultiValueReaderWriter method getShortArray.

@Override
public int getShortArray(int row, short[] shortsArray) {
    int bufferIndex = headerReader.getInt(row, 1);
    int startIndex = headerReader.getInt(row, 1);
    int length = headerReader.getInt(row, 2);
    FixedByteSingleValueMultiColReader dataReader = dataReaders.get(bufferIndex);
    for (int i = 0; i < length; i++) {
        shortsArray[i] = dataReader.getShort(startIndex + i, 0);
    }
    return length;
}
Also used : FixedByteSingleValueMultiColReader(com.linkedin.pinot.core.io.reader.impl.FixedByteSingleValueMultiColReader)

Example 3 with FixedByteSingleValueMultiColReader

use of com.linkedin.pinot.core.io.reader.impl.FixedByteSingleValueMultiColReader in project pinot by linkedin.

the class FixedByteSingleColumnMultiValueReaderWriter method getFloatArray.

@Override
public int getFloatArray(int row, float[] floatArray) {
    int bufferIndex = headerReader.getInt(row, 1);
    int startIndex = headerReader.getInt(row, 1);
    int length = headerReader.getInt(row, 2);
    FixedByteSingleValueMultiColReader dataReader = dataReaders.get(bufferIndex);
    for (int i = 0; i < length; i++) {
        floatArray[i] = dataReader.getFloat(startIndex + i, 0);
    }
    return length;
}
Also used : FixedByteSingleValueMultiColReader(com.linkedin.pinot.core.io.reader.impl.FixedByteSingleValueMultiColReader)

Example 4 with FixedByteSingleValueMultiColReader

use of com.linkedin.pinot.core.io.reader.impl.FixedByteSingleValueMultiColReader in project pinot by linkedin.

the class FixedByteSingleColumnMultiValueReaderWriter method getDoubleArray.

@Override
public int getDoubleArray(int row, double[] doubleArray) {
    int bufferIndex = headerReader.getInt(row, 1);
    int startIndex = headerReader.getInt(row, 1);
    int length = headerReader.getInt(row, 2);
    FixedByteSingleValueMultiColReader dataReader = dataReaders.get(bufferIndex);
    for (int i = 0; i < length; i++) {
        doubleArray[i] = dataReader.getDouble(startIndex + i, 0);
    }
    return length;
}
Also used : FixedByteSingleValueMultiColReader(com.linkedin.pinot.core.io.reader.impl.FixedByteSingleValueMultiColReader)

Example 5 with FixedByteSingleValueMultiColReader

use of com.linkedin.pinot.core.io.reader.impl.FixedByteSingleValueMultiColReader in project pinot by linkedin.

the class FixedByteSingleColumnMultiValueReaderWriter method getCharArray.

@Override
public int getCharArray(int row, char[] charArray) {
    int bufferIndex = headerReader.getInt(row, 1);
    int startIndex = headerReader.getInt(row, 1);
    int length = headerReader.getInt(row, 2);
    FixedByteSingleValueMultiColReader dataReader = dataReaders.get(bufferIndex);
    for (int i = 0; i < length; i++) {
        charArray[i] = dataReader.getChar(startIndex + i, 0);
    }
    return length;
}
Also used : FixedByteSingleValueMultiColReader(com.linkedin.pinot.core.io.reader.impl.FixedByteSingleValueMultiColReader)

Aggregations

FixedByteSingleValueMultiColReader (com.linkedin.pinot.core.io.reader.impl.FixedByteSingleValueMultiColReader)20 PinotDataBuffer (com.linkedin.pinot.core.segment.memory.PinotDataBuffer)11 FixedByteSingleValueMultiColWriter (com.linkedin.pinot.core.io.writer.impl.FixedByteSingleValueMultiColWriter)9 File (java.io.File)9 Test (org.testng.annotations.Test)8 Random (java.util.Random)7 DataOutputStream (java.io.DataOutputStream)2 FileOutputStream (java.io.FileOutputStream)2 RandomAccessFile (java.io.RandomAccessFile)2 SortedForwardIndexReader (com.linkedin.pinot.core.io.reader.impl.SortedForwardIndexReader)1 SortedValueReaderContext (com.linkedin.pinot.core.io.reader.impl.SortedValueReaderContext)1 IOException (java.io.IOException)1