@SuppressWarnings("unchecked") @Override protected void doStart() throws Exception { for (Map.Entry<String, String> entry : containerLiveNodeData.getLogLevels().entrySet()) { String loggerName = entry.getKey(); String oldLogLevel = setLogLevel(loggerName, entry.getValue()); if (!defaultLogLevels.containsKey(loggerName)) { oldLogLevels.put(loggerName, oldLogLevel); } } commandExecutor = Executors.newSingleThreadExecutor( Threads.createDaemonThreadFactory("runnable-command-executor")); Class<?> runnableClass = classLoader.loadClass(specification.getClassName()); Preconditions.checkArgument(TwillRunnable.class.isAssignableFrom(runnableClass), "Class %s is not instance of TwillRunnable.", specification.getClassName()); runnable = Instances.newInstance((Class<TwillRunnable>) runnableClass); runnable.initialize(context); }
@Override public JsonElement serialize(TwillRunnableSpecification src, Type typeOfSrc, JsonSerializationContext context) { JsonObject json = new JsonObject(); json.addProperty("classname", src.getClassName()); json.addProperty("name", src.getName()); json.add("arguments", context.serialize(src.getConfigs(), new TypeToken<Map<String, String>>() { }.getType())); return json; }
@SuppressWarnings("unchecked") @Override protected void doStart() throws Exception { for (Map.Entry<String, String> entry : containerLiveNodeData.getLogLevels().entrySet()) { String loggerName = entry.getKey(); String oldLogLevel = setLogLevel(loggerName, entry.getValue()); if (!defaultLogLevels.containsKey(loggerName)) { oldLogLevels.put(loggerName, oldLogLevel); } } commandExecutor = Executors.newSingleThreadExecutor( Threads.createDaemonThreadFactory("runnable-command-executor")); Class<?> runnableClass = classLoader.loadClass(specification.getClassName()); Preconditions.checkArgument(TwillRunnable.class.isAssignableFrom(runnableClass), "Class %s is not instance of TwillRunnable.", specification.getClassName()); runnable = Instances.newInstance((Class<TwillRunnable>) runnableClass); runnable.initialize(context); }
@Override public JsonElement serialize(TwillRunnableSpecification src, Type typeOfSrc, JsonSerializationContext context) { JsonObject json = new JsonObject(); json.addProperty("classname", src.getClassName()); json.addProperty("name", src.getName()); json.add("arguments", context.serialize(src.getConfigs(), new TypeToken<Map<String, String>>() { }.getType())); return json; }
getJvmOptions().getRunnableExtraOptions(runnableName), RemoteLauncher.class.getName(), runtimeSpec.getRunnableSpecification().getClassName(), logsDir, logsDir);
getJvmOptions().getRunnableExtraOptions(runnableName), RemoteLauncher.class.getName(), runtimeSpec.getRunnableSpecification().getClassName(), logsDir, logsDir);
ClassLoader classLoader = getClassLoader(); for (RuntimeSpecification spec : twillSpec.getRunnables().values()) { classes.add(classLoader.loadClass(spec.getRunnableSpecification().getClassName()));
ClassLoader classLoader = getClassLoader(); for (RuntimeSpecification spec : twillSpec.getRunnables().values()) { classes.add(classLoader.loadClass(spec.getRunnableSpecification().getClassName()));
classes.add(classLoader.loadClass(spec.getRunnableSpecification().getClassName()));
classes.add(classLoader.loadClass(spec.getRunnableSpecification().getClassName()));