All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.hyperfoil.hotrod.parser.HotRodParser Maven / Gradle / Ivy

There is a newer version: 0.26
Show newest version
package io.hyperfoil.hotrod.parser;

import org.yaml.snakeyaml.events.SequenceStartEvent;

import io.hyperfoil.api.config.BenchmarkBuilder;
import io.hyperfoil.core.parser.Context;
import io.hyperfoil.core.parser.Parser;
import io.hyperfoil.core.parser.ParserException;
import io.hyperfoil.hotrod.config.HotRodClusterBuilder;
import io.hyperfoil.hotrod.config.HotRodPluginBuilder;

public class HotRodParser implements Parser {
   @Override
   public void parse(Context ctx, BenchmarkBuilder target) throws ParserException {
      HotRodPluginBuilder plugin = target.addPlugin(HotRodPluginBuilder::new);
      if (ctx.peek() instanceof SequenceStartEvent) {
         ctx.parseList(plugin, (ctx1, builder) -> {
            HotRodClusterBuilder hotRod = builder.addCluster();
            HotRodClusterParser.INSTANCE.parse(ctx1, hotRod);
         });
      } else {
         HotRodClusterParser.INSTANCE.parse(ctx, plugin.addCluster());
      }
   }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy