Tabnine Logo
TwillRunnable.initialize
Code IndexAdd Tabnine to your IDE (free)

How to use
initialize
method
in
org.apache.twill.api.TwillRunnable

Best Java code snippets using org.apache.twill.api.TwillRunnable.initialize (Showing top 2 results out of 315)

origin: apache/twill

@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);
}
origin: org.apache.twill/twill-yarn

@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);
}
org.apache.twill.apiTwillRunnableinitialize

Javadoc

Called when the container process starts. Executed in container machine. If any exception is thrown from this method, this runnable won't get retry.

Popular methods of TwillRunnable

  • configure
    Called at submission time. Executed on the client side.
  • destroy
    Called when the TwillRunnable#run() completed. Useful for doing resource cleanup. This method would
  • handleCommand
    Called when a command is received. A normal return denotes the command has been processed successful
  • run
  • stop
    Requests to stop the running service.

Popular in Java

  • Running tasks concurrently on multiple threads
  • getSystemService (Context)
  • setRequestProperty (URLConnection)
  • putExtra (Intent)
  • GridBagLayout (java.awt)
    The GridBagLayout class is a flexible layout manager that aligns components vertically and horizonta
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • Queue (java.util)
    A collection designed for holding elements prior to processing. Besides basic java.util.Collection o
  • UUID (java.util)
    UUID is an immutable representation of a 128-bit universally unique identifier (UUID). There are mul
  • Modifier (javassist)
    The Modifier class provides static methods and constants to decode class and member access modifiers
  • HttpServletRequest (javax.servlet.http)
    Extends the javax.servlet.ServletRequest interface to provide request information for HTTP servlets.
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now