/** * Be default, this parses runtime argument "system.tx.timeout". Some program types may override this, * for example, in a flowlet, the more specific "flowlet.[name].system.tx.timeout" would prevail. * * @return the default transaction timeout, if specified in the runtime arguments. Otherwise returns the * default transaction timeout from the cConf. */ private int determineTransactionTimeout(CConfiguration cConf) { return SystemArguments.getTransactionTimeout(getRuntimeArguments(), cConf); }
/** * Validates the custom transaction timeout, if specified in the given arguments. * * @throws IllegalArgumentException if the transaction timeout exceeds the transaction timeout limit given in the * CConfiguration. */ public static void validateTransactionTimeout(Map<String, String> args, CConfiguration cConf) { validateTransactionTimeout(args, cConf, null, null); }
@Override public <T extends Dataset> T getDataset(String name, Map<String, String> arguments) throws DatasetInstantiationException { return getDataset(name, arguments, AccessType.UNKNOWN); }
/** * Run some code with the context class loader combined from the program class loader and the system class loader. */ public void execute(ThrowingRunnable runnable) throws Exception { ClassLoader oldClassLoader = ClassLoaders.setContextClassLoader(getProgramInvocationClassLoader()); try { runnable.run(); } finally { ClassLoaders.setContextClassLoader(oldClassLoader); } }
@Override public String getOption(String name, String defaultOption) { String value = getOption(name); return value == null ? defaultOption : value; }
/** * Children call this method to signal the program is completed. */ protected void complete() { complete(State.COMPLETED); }
@Override public Admin get() { return new DefaultAdmin(dsFramework, NamespaceId.SYSTEM, secureStoreManager, namespaceQueryAdmin); } }
@Override public void terminated(Service.State from) { closeAllQuietly(closeables); }
@Override public <T> T newPluginInstance(String pluginId) throws InstantiationException { return newPluginInstance(pluginId, null); }
@Override public void suspended() { execute(listener::suspended, "suspended"); }
@Override public void running() { started(); }
/** * Run some code with the context class loader combined from the program class loader and the system class loader. */ public void execute(ThrowingRunnable runnable) throws Exception { ClassLoader oldClassLoader = ClassLoaders.setContextClassLoader(getProgramInvocationClassLoader()); try { runnable.run(); } finally { ClassLoaders.setContextClassLoader(oldClassLoader); } }
/** * Be default, this parses runtime argument "system.tx.timeout". Some program types may override this, * for example, in a flowlet, the more specific "flowlet.[name].system.tx.timeout" would prevail. * * @return the default transaction timeout, if specified in the runtime arguments. Otherwise returns the * default transaction timeout from the cConf. */ private int determineTransactionTimeout(CConfiguration cConf) { return SystemArguments.getTransactionTimeout(getRuntimeArguments(), cConf); }
@Override public <T extends Dataset> T getDataset(String name, Map<String, String> arguments) throws DatasetInstantiationException { return getDataset(name, arguments, AccessType.UNKNOWN); }
/** * Validates the custom transaction timeout, if specified in the given arguments. * * @throws IllegalArgumentException if the transaction timeout exceeds the transaction timeout limit given in the * CConfiguration. */ public static void validateTransactionTimeout(Map<String, String> args, CConfiguration cConf) { validateTransactionTimeout(args, cConf, null, null); }
@Override public String getOption(String name, String defaultOption) { String value = getOption(name); return value == null ? defaultOption : value; }
/** * Children call this method to signal the program is completed. */ protected void complete() { complete(State.COMPLETED); }
@Override public Admin get() { return new DefaultAdmin(dsFramework, NamespaceId.SYSTEM, secureStoreManager); } }
@Override public <T extends Dataset> T getDataset(String namespace, String name, Map<String, String> arguments) throws DatasetInstantiationException { return getDataset(namespace, name, arguments, AccessType.UNKNOWN); }
@Override public <T extends Dataset> T getDataset(String namespace, String name, Map<String, String> arguments) throws DatasetInstantiationException { return getDataset(namespace, name, arguments, AccessType.UNKNOWN); }