private void genNamespace()

in src/main/java/com/amazonaws/mskdatagen/core/CompileGeneratorStrategies.java [44:70]


    private void genNamespace(Context context, GeneratorsConfigs generatorsConfig, Map<List<String>, List<Generator>> namespaces, String ns) {
        if (namespaces.containsKey(Collections.emptyList())) {
            List<Generator> generators = namespaces.get(Collections.emptyList());

            Generator generator = compileGeneratorStrategy(generators);
            Predicate<DepsParameters> verifyDepsFunction = VerifyDepsFunctions.getVerifyDepsFunction(Objects.requireNonNull(generator));
            RateFunction genValueFunction = GenValueFunctions.getGenValueFunction(context, generator);
            Function<DepsParameters, ResultGen> depsResultGenFunction = compileSoloGen(verifyDepsFunction, genValueFunction);

            Function<DepsParameters, ResultGen> maybeTombstone = maybeTombstone(context, generatorsConfig.getTopic(), ns, depsResultGenFunction);
            setFuncInGenConfig(generatorsConfig, ns, maybeTombstone);
        } else if (!namespaces.keySet().isEmpty()) {
            Map<List<String>, AttrFunctionPair> attrFns = new HashMap<>();
            for (Map.Entry<List<String>, List<Generator>> attrsList : namespaces.entrySet()) {
                Generator generator = compileGeneratorStrategy(attrsList.getValue());
                Predicate<DepsParameters> verifyDepsFunction = VerifyDepsFunctions.getVerifyDepsFunction(Objects.requireNonNull(generator));
                RateFunction genValueFunction = GenValueFunctions.getGenValueFunction(context, generator);

                AttrFunctionPair attrFunctionPair = new AttrFunctionPair(verifyDepsFunction, genValueFunction);
                attrFns.put(attrsList.getKey(), attrFunctionPair);
            }

            Function<DepsParameters, ResultGen> depsResultGenFunction = compileAttrsGen(attrFns);
            Function<DepsParameters, ResultGen> maybeTombstone = maybeTombstone(context, generatorsConfig.getTopic(), ns, depsResultGenFunction);
            setFuncInGenConfig(generatorsConfig, ns, maybeTombstone);
        }
    }