package com.yfd.platform.utils;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;


public class GroupAndProcessParallel {

    public static Map<String, String> data = new ConcurrentHashMap<>();


    public static List<List<Map<String, Object>>> distributeToTenCollections1(Map<String, List<Map<String, Object>>> groupedByCode) {
        List<List<Map<String, Object>>> collections = new ArrayList<>(6);
        for (int i = 0; i < 6; i++) {
            collections.add(new ArrayList<>());
        }

        // 负载均衡策略：轮询分配
        int index = 0;
        for (List<Map<String, Object>> objects : groupedByCode.values()) {
            collections.get(index++ % 6).addAll(objects);
        }

        return collections;
    }


}
