Search in sources :

Example 1 with FastMap

use of io.questdb.cairo.map.FastMap in project Mycat2 by MyCATApache.

the class MapFactory method createMap.

public static Map createMap(IntInnerType[] keys, InnerType[] values) {
    ColumnTypes keyTypes = getKeyTypes(keys);
    int[] valueTypes = Arrays.stream(values).mapToInt(i -> toQuestDbType(i)).toArray();
    int MB = 1024 * 1024;
    return new FastMap(16 * MB, keyTypes, new ColumnTypes() {

        @Override
        public int getColumnCount() {
            return valueTypes.length;
        }

        @Override
        public int getColumnType(int columnIndex) {
            return valueTypes[columnIndex];
        }
    }, 128, 0.5, 64);
}
Also used : ColumnType(io.questdb.cairo.ColumnType) ColumnTypes(io.questdb.cairo.ColumnTypes) Arrays(java.util.Arrays) InnerType(io.ordinate.engine.schema.InnerType) IntInnerType(io.ordinate.engine.schema.IntInnerType) FastMap(io.questdb.cairo.map.FastMap) MapValue(io.questdb.cairo.map.MapValue) NotNull(org.jetbrains.annotations.NotNull) MapKey(io.questdb.cairo.map.MapKey) Map(io.questdb.cairo.map.Map) FastMap(io.questdb.cairo.map.FastMap) ColumnTypes(io.questdb.cairo.ColumnTypes)

Aggregations

InnerType (io.ordinate.engine.schema.InnerType)1 IntInnerType (io.ordinate.engine.schema.IntInnerType)1 ColumnType (io.questdb.cairo.ColumnType)1 ColumnTypes (io.questdb.cairo.ColumnTypes)1 FastMap (io.questdb.cairo.map.FastMap)1 Map (io.questdb.cairo.map.Map)1 MapKey (io.questdb.cairo.map.MapKey)1 MapValue (io.questdb.cairo.map.MapValue)1 Arrays (java.util.Arrays)1 NotNull (org.jetbrains.annotations.NotNull)1