private void addInternal(final Val[] values,
                             final int period) {
        SearchProgressLog.increment(queryKey, SearchPhase.LMDB_DATA_STORE_ADD);
        LOGGER.trace(() -> "add() called for " + values.length + " values");
        final boolean[][] groupIndicesByDepth = compiledDepths.getGroupIndicesByDepth();
        final boolean[][] valueIndicesByDepth = compiledDepths.getValueIndicesByDepth();

        // Get a reference to the current event so we can keep track of what we have stored data for.
        final CurrentDbState currentDbState = currentDbStateFactory.createCurrentDbState(values);

        ByteBuffer parentRowKey = null;
        final LmdbKV[] rows = new LmdbKV[groupIndicesByDepth.length];
        for (int depth = 0; depth < groupIndicesByDepth.length; depth++) {
            final StoredValues storedValues = valueReferenceIndex.createStoredValues();
            storedValues.setPeriod(period);
            final boolean[] valueIndices = valueIndicesByDepth[depth];

            for (int columnIndex = 0; columnIndex < compiledColumnArray.length; columnIndex++) {
                final CompiledColumn compiledColumn = compiledColumnArray[columnIndex];
                final Generator generator = compiledColumn.getGenerator();

                // If we need a value at this level then set the raw values.
                if (valueIndices[columnIndex] ||
                    columnIndex == keyFactoryConfig.getTimeColumnIndex()) {
                    generator.set(values, storedValues);
                }
            }

            final ByteBuffer rowKey = lmdbRowKeyFactory.create(depth, parentRowKey, storedValues);
            final ByteBuffer rowValue = lmdbRowValueFactory.create(storedValues);
            parentRowKey = rowKey;
            rows[depth] = new LmdbKV(currentDbState, rowKey, rowValue);
        }

        // We build rows first before putting to ensure that the byte buffers used for the parent row key are
        // not released and reused before we have read the values from them.
        for (final LmdbKV row : rows) {
            put(row);
        }
    }
Add some values to the data store.

@param values The values to add to the store.
stroom-query/stroom-query-common/src/main/java/stroom/query/common/v2/LmdbDataStore.java