Search in sources :

Example 1 with MutableDictionaryReader

use of com.linkedin.pinot.core.realtime.impl.dictionary.MutableDictionaryReader in project pinot by linkedin.

the class RealtimeSegmentImpl method getSortedBitmapIntIteratorsForLongColumn.

private IntIterator[] getSortedBitmapIntIteratorsForLongColumn(final String columnToSortOn) {
    final RealtimeInvertedIndex index = invertedIndexMap.get(columnToSortOn);
    final MutableDictionaryReader dictionary = dictionaryMap.get(columnToSortOn);
    final IntIterator[] intIterators = new IntIterator[dictionary.length()];
    final List<Long> rawValues = new ArrayList<Long>();
    for (int i = 0; i < dictionary.length(); i++) {
        rawValues.add((Long) dictionary.get(i));
    }
    long start = System.currentTimeMillis();
    Collections.sort(rawValues);
    LOGGER.info("Column {}, dictionary len : {}, time to sort : {} ", columnToSortOn, dictionary.length(), (System.currentTimeMillis() - start));
    for (int i = 0; i < rawValues.size(); i++) {
        intIterators[i] = index.getDocIdSetFor(dictionary.indexOf(rawValues.get(i))).getIntIterator();
    }
    return intIterators;
}
Also used : IntIterator(org.roaringbitmap.IntIterator) MutableDictionaryReader(com.linkedin.pinot.core.realtime.impl.dictionary.MutableDictionaryReader) RealtimeInvertedIndex(com.linkedin.pinot.core.realtime.impl.invertedIndex.RealtimeInvertedIndex) ArrayList(java.util.ArrayList)

Example 2 with MutableDictionaryReader

use of com.linkedin.pinot.core.realtime.impl.dictionary.MutableDictionaryReader in project pinot by linkedin.

the class RealtimeSegmentImpl method getSortedBitmapIntIteratorsForDoubleColumn.

private IntIterator[] getSortedBitmapIntIteratorsForDoubleColumn(final String columnToSortOn) {
    final RealtimeInvertedIndex index = invertedIndexMap.get(columnToSortOn);
    final MutableDictionaryReader dictionary = dictionaryMap.get(columnToSortOn);
    final IntIterator[] intIterators = new IntIterator[dictionary.length()];
    final List<Double> rawValues = new ArrayList<Double>();
    for (int i = 0; i < dictionary.length(); i++) {
        rawValues.add((Double) dictionary.get(i));
    }
    long start = System.currentTimeMillis();
    Collections.sort(rawValues);
    LOGGER.info("Column {}, dictionary len : {}, time to sort : {} ", columnToSortOn, dictionary.length(), (System.currentTimeMillis() - start));
    for (int i = 0; i < rawValues.size(); i++) {
        intIterators[i] = index.getDocIdSetFor(dictionary.indexOf(rawValues.get(i))).getIntIterator();
    }
    return intIterators;
}
Also used : IntIterator(org.roaringbitmap.IntIterator) MutableDictionaryReader(com.linkedin.pinot.core.realtime.impl.dictionary.MutableDictionaryReader) RealtimeInvertedIndex(com.linkedin.pinot.core.realtime.impl.invertedIndex.RealtimeInvertedIndex) ArrayList(java.util.ArrayList)

Example 3 with MutableDictionaryReader

use of com.linkedin.pinot.core.realtime.impl.dictionary.MutableDictionaryReader in project pinot by linkedin.

the class RealtimeSegmentImpl method getSortedBitmapIntIteratorsForFloatColumn.

private IntIterator[] getSortedBitmapIntIteratorsForFloatColumn(final String columnToSortOn) {
    final RealtimeInvertedIndex index = invertedIndexMap.get(columnToSortOn);
    final MutableDictionaryReader dictionary = dictionaryMap.get(columnToSortOn);
    final IntIterator[] intIterators = new IntIterator[dictionary.length()];
    final List<Float> rawValues = new ArrayList<Float>();
    for (int i = 0; i < dictionary.length(); i++) {
        rawValues.add((Float) dictionary.get(i));
    }
    long start = System.currentTimeMillis();
    Collections.sort(rawValues);
    LOGGER.info("Column {}, dictionary len : {}, time to sort : {} ", columnToSortOn, dictionary.length(), (System.currentTimeMillis() - start));
    for (int i = 0; i < rawValues.size(); i++) {
        intIterators[i] = index.getDocIdSetFor(dictionary.indexOf(rawValues.get(i))).getIntIterator();
    }
    return intIterators;
}
Also used : IntIterator(org.roaringbitmap.IntIterator) MutableDictionaryReader(com.linkedin.pinot.core.realtime.impl.dictionary.MutableDictionaryReader) RealtimeInvertedIndex(com.linkedin.pinot.core.realtime.impl.invertedIndex.RealtimeInvertedIndex) ArrayList(java.util.ArrayList)

Example 4 with MutableDictionaryReader

use of com.linkedin.pinot.core.realtime.impl.dictionary.MutableDictionaryReader in project pinot by linkedin.

the class RealtimeSegmentImpl method getSortedBitmapIntIteratorsForStringColumn.

private IntIterator[] getSortedBitmapIntIteratorsForStringColumn(final String columnToSortOn) {
    final RealtimeInvertedIndex index = invertedIndexMap.get(columnToSortOn);
    final MutableDictionaryReader dictionary = dictionaryMap.get(columnToSortOn);
    final IntIterator[] intIterators = new IntIterator[dictionary.length()];
    final List<String> rawValues = new ArrayList<String>();
    for (int i = 0; i < dictionary.length(); i++) {
        rawValues.add((String) dictionary.get(i));
    }
    long start = System.currentTimeMillis();
    Collections.sort(rawValues);
    LOGGER.info("Column {}, dictionary len : {}, time to sort : {} ", columnToSortOn, dictionary.length(), (System.currentTimeMillis() - start));
    for (int i = 0; i < rawValues.size(); i++) {
        intIterators[i] = index.getDocIdSetFor(dictionary.indexOf(rawValues.get(i))).getIntIterator();
    }
    return intIterators;
}
Also used : IntIterator(org.roaringbitmap.IntIterator) MutableDictionaryReader(com.linkedin.pinot.core.realtime.impl.dictionary.MutableDictionaryReader) RealtimeInvertedIndex(com.linkedin.pinot.core.realtime.impl.invertedIndex.RealtimeInvertedIndex) ArrayList(java.util.ArrayList)

Example 5 with MutableDictionaryReader

use of com.linkedin.pinot.core.realtime.impl.dictionary.MutableDictionaryReader in project pinot by linkedin.

the class RealtimeSegmentImpl method getSortedBitmapIntIteratorsForIntegerColumn.

private IntIterator[] getSortedBitmapIntIteratorsForIntegerColumn(final String columnToSortOn) {
    final RealtimeInvertedIndex index = invertedIndexMap.get(columnToSortOn);
    final MutableDictionaryReader dictionary = dictionaryMap.get(columnToSortOn);
    final IntIterator[] intIterators = new IntIterator[dictionary.length()];
    int[] rawValuesArr = new int[dictionary.length()];
    for (int i = 0; i < dictionary.length(); i++) {
        rawValuesArr[i] = (Integer) dictionary.get(i);
    }
    Arrays.sort(rawValuesArr);
    long start = System.currentTimeMillis();
    LOGGER.info("Column {}, dictionary len : {}, time to sort : {} ", columnToSortOn, dictionary.length(), (System.currentTimeMillis() - start));
    for (int i = 0; i < rawValuesArr.length; i++) {
        intIterators[i] = index.getDocIdSetFor(dictionary.indexOf(rawValuesArr[i])).getIntIterator();
    }
    return intIterators;
}
Also used : IntIterator(org.roaringbitmap.IntIterator) MutableDictionaryReader(com.linkedin.pinot.core.realtime.impl.dictionary.MutableDictionaryReader) RealtimeInvertedIndex(com.linkedin.pinot.core.realtime.impl.invertedIndex.RealtimeInvertedIndex)

Aggregations

MutableDictionaryReader (com.linkedin.pinot.core.realtime.impl.dictionary.MutableDictionaryReader)5 RealtimeInvertedIndex (com.linkedin.pinot.core.realtime.impl.invertedIndex.RealtimeInvertedIndex)5 IntIterator (org.roaringbitmap.IntIterator)5 ArrayList (java.util.ArrayList)4