public MorphlineCompilationException(String msg, Config config, Throwable th, CommandBuilder builder) { this(msg + " for command: " + builder.getNames() + " with builder: " + builder.getClass().getName(), config, th); }
Command cmd = builder.build(cmdConfig.getConfig(cmdName), currentParent, finalChild, getContext()); return cmd;
Command cmd = builder.build(cmdConfig.getConfig(cmdName), currentParent, finalChild, getContext()); return cmd;
public MorphlineCompilationException(String msg, Config config, Throwable th, CommandBuilder builder) { this(msg + " for command: " + builder.getNames() + " with builder: " + builder.getClass().getName(), config, th); }
/** * Using the given <code>builder</code>, constructs a command rooted at the given morphline JSON * <code>config</code>. * * The command will feed records into <code>child</code>. The command will have * <code>parent</code> as it's parent. Additional parameters can be passed via the morphline * <code>context</code>. */ protected AbstractCommand(CommandBuilder builder, Config config, Command parent, Command child, MorphlineContext context) { Preconditions.checkNotNull(builder); Preconditions.checkNotNull(config); Preconditions.checkNotNull(parent); Preconditions.checkNotNull(child); Preconditions.checkNotNull(context); this.config = config; this.parent = parent; this.child = child; this.context = context; Preconditions.checkArgument(builder.getNames().size() > 0); this.name = "morphline." + builder.getNames().iterator().next(); this.configs = new Configs(); this.numProcessCallsMeter = getMeter(Metrics.NUM_PROCESS_CALLS); this.numNotifyCallsMeter = getMeter(Metrics.NUM_NOTIFY_CALLS); }
/** * Using the given <code>builder</code>, constructs a command rooted at the given morphline JSON * <code>config</code>. * * The command will feed records into <code>child</code>. The command will have * <code>parent</code> as it's parent. Additional parameters can be passed via the morphline * <code>context</code>. */ protected AbstractCommand(CommandBuilder builder, Config config, Command parent, Command child, MorphlineContext context) { Preconditions.checkNotNull(builder); Preconditions.checkNotNull(config); Preconditions.checkNotNull(parent); Preconditions.checkNotNull(child); Preconditions.checkNotNull(context); this.config = config; this.parent = parent; this.child = child; this.context = context; Preconditions.checkArgument(builder.getNames().size() > 0); this.name = "morphline." + builder.getNames().iterator().next(); this.configs = new Configs(); this.numProcessCallsMeter = getMeter(Metrics.NUM_PROCESS_CALLS); this.numNotifyCallsMeter = getMeter(Metrics.NUM_NOTIFY_CALLS); }
public void importCommandBuilders(Collection<String> importSpecs) { if (commandBuilders == Collections.EMPTY_MAP) { // intentionally effective no more than once commandBuilders = Maps.newHashMap(); if (LOG.isDebugEnabled()) { LOG.debug("Importing commands from Java classpath: {}", System.getProperty("java.class.path")); } else { LOG.info("Importing commands"); } Collection<Class<CommandBuilder>> builderClasses = getTopLevelClasses(importSpecs, CommandBuilder.class); for (Class<CommandBuilder> builderClass : builderClasses) { try { CommandBuilder builder = builderClass.newInstance(); for (String builderName : builder.getNames()) { LOG.debug("Importing command: {} from class: {}", builderName, builderClass.getName()); if (builderName.contains(".")) { LOG.warn("Command name should not contain a period character: " + builderName); } commandBuilders.put(builderName, builderClass); } } catch (Exception e) { throw new MorphlineRuntimeException(e); } } LOG.info("Done importing commands"); } }
public void importCommandBuilders(Collection<String> importSpecs) { if (commandBuilders == Collections.EMPTY_MAP) { // intentionally effective no more than once commandBuilders = Maps.newHashMap(); if (LOG.isDebugEnabled()) { LOG.debug("Importing commands from Java classpath: {}", System.getProperty("java.class.path")); } else { LOG.info("Importing commands"); } Collection<Class<CommandBuilder>> builderClasses = getTopLevelClasses(importSpecs, CommandBuilder.class); for (Class<CommandBuilder> builderClass : builderClasses) { try { CommandBuilder builder = builderClass.newInstance(); for (String builderName : builder.getNames()) { LOG.debug("Importing command: {} from class: {}", builderName, builderClass.getName()); if (builderName.contains(".")) { LOG.warn("Command name should not contain a period character: " + builderName); } commandBuilders.put(builderName, builderClass); } } catch (Exception e) { throw new MorphlineRuntimeException(e); } } LOG.info("Done importing commands"); } }