private void mergeStrings(DictStruct[] structs, DirectBitMap bitmap) throws IOException {
        int structSize = structs.length;
        int[] dictEntryCounts = new int[structSize];
        long[] dictEntryAddrs = new long[structSize];
        for (int i = 0; i < structSize; i++) {
            dictEntryCounts[i] = structs[i].dictEntryCount();
            dictEntryAddrs[i] = structs[i].dictEntriesAddr();
        }

        ByteBuffer bitmapMemory = (ByteBuffer) bitmap.attach;
        int[] dictOffsets = new int[structSize];

        OffheapBytes curEntry = new OffheapBytes();

        OffheapBytes e = new OffheapBytes();
        OffheapBytes minEntry = new OffheapBytes();

        while (true) {
            minEntry.set(0, 0);

            int structId = -1;
            for (int i = 0; i < structSize; i++) {
                int offset = dictOffsets[i];
                if (offset >= dictEntryCounts[i]) {
                    continue;
                }
                structs[i].stringDictEntries().getString(offset, e);
                if (minEntry.addr() == 0
                        || BytesUtil.compareBytes(e.addr(), e.len(), minEntry.addr(), minEntry.len()) <= 0) {
                    minEntry.set(e);
                    structId = i;
                }
            }
            if (structId == -1) {
                break;
            }

            // Forward offset
            dictOffsets[structId]++;

            assert curEntry.addr() == 0
                    || BytesUtil.compareBytes(minEntry.addr(), minEntry.len(), curEntry.addr(), curEntry.len()) >= 0;

            if (curEntry.addr() == 0
                    || BytesUtil.compareBytes(minEntry.addr(), minEntry.len(), curEntry.addr(), curEntry.len()) == 0) {
                bitmap.set(structId);
                curEntry.set(minEntry);
            } else {
                saveEntryString(curEntry, false);
                saveBitmap(bitmapMemory, false);

                curEntry.set(minEntry);
                bitmap.clear();
                bitmap.set(structId);
            }
        }
        saveEntryString(curEntry, true);
        saveBitmap(bitmapMemory, true);
    }
Delete all files generated by this class.
indexr-vlt-segment/src/main/java/io/indexr/vlt/segment/index/DictMerge.java