public interface TwillController extends ServiceController
ServiceController.TerminationStatus
Modifier and Type | Method and Description |
---|---|
void |
addLogHandler(LogHandler handler)
Adds a
LogHandler for receiving application log. |
Future<Integer> |
changeInstances(String runnable,
int newCount)
Changes the number of running instances of a given runnable.
|
ServiceDiscovered |
discoverService(String serviceName)
Discovers the set of
Discoverable endpoints that provides service for the given service name. |
ResourceReport |
getResourceReport()
Get a snapshot of the resources used by the application, broken down by each runnable.
|
Future<String[]> |
resetLogLevels(String... loggerNames)
Reset the log levels of all runnables.
|
Future<String[]> |
resetRunnableLogLevels(String runnableName,
String... loggerNames)
Reset the log levels of the given runnable.
|
Future<String> |
restartAllInstances(String runnable)
Restart all instances of a particular
TwillRunnable . |
Future<Set<String>> |
restartInstances(Map<String,? extends Set<Integer>> runnableToInstanceIds)
Restart instances of some
TwillRunnable . |
Future<String> |
restartInstances(String runnable,
int instanceId,
int... moreInstanceIds)
Restart instances of some
TwillRunnable . |
Future<String> |
restartInstances(String runnable,
Set<Integer> instanceIds)
Restart instances of some
TwillRunnable . |
Future<Map<String,LogEntry.Level>> |
updateLogLevels(Map<String,LogEntry.Level> logLevels)
Update the log levels for requested logger names for Twill applications running in a container.
|
Future<Map<String,LogEntry.Level>> |
updateLogLevels(String runnableName,
Map<String,LogEntry.Level> logLevelsForRunnable)
Update the log levels for requested logger names for a
TwillRunnable . |
awaitTerminated, awaitTerminated, getRunId, getTerminationStatus, kill, onRunning, onTerminated, sendCommand, sendCommand, terminate
void addLogHandler(LogHandler handler)
LogHandler
for receiving application log.handler
- The handler to add.ServiceDiscovered discoverService(String serviceName)
Discoverable
endpoints that provides service for the given service name.serviceName
- Name of the service to discovery.ServiceDiscovered
object representing the result.Future<Integer> changeInstances(String runnable, int newCount)
runnable
- The name of the runnable.newCount
- Number of instances for the given runnable.Future
that will be completed when the number running instances has been
successfully changed. The future will carry the new count as the result. If there is any error
while changing instances, it'll be reflected in the future.@Nullable ResourceReport getResourceReport()
ResourceReport
containing information about resources used by the application or
null in case the user calls this before the application completely starts.Future<String> restartAllInstances(String runnable)
TwillRunnable
.runnable
- The name of the runnable to restart.Future
that will be completed when the restart operation has been done.Future<Set<String>> restartInstances(Map<String,? extends Set<Integer>> runnableToInstanceIds)
TwillRunnable
.runnableToInstanceIds
- A map of runnable ID to list of instance IDs to be restarted.Future
that will be completed when the restart operation has been done.Future<String> restartInstances(String runnable, int instanceId, int... moreInstanceIds)
TwillRunnable
.runnable
- The name of the runnable to restart.instanceId
- The main instance id to be restarted.moreInstanceIds
- The optional instance ids.Future
that will be completed when the restart operation has been done.Future<String> restartInstances(String runnable, Set<Integer> instanceIds)
TwillRunnable
.runnable
- The name of the runnable to restart.instanceIds
- Instances to be restartedFuture
that will be completed when the restart operation has been done.Future<Map<String,LogEntry.Level>> updateLogLevels(Map<String,LogEntry.Level> logLevels)
null
except for the root logger, which will reset the log level for
the specified logger.Future<Map<String,LogEntry.Level>> updateLogLevels(String runnableName, Map<String,LogEntry.Level> logLevelsForRunnable)
TwillRunnable
.
The log level for a logger name can be null
except for the root logger,
which will reset the log level for
the specified logger.runnableName
- The name of the runnable to update the log level.logLevelsForRunnable
- The Map
contains the requested logger name and log level that
need to be updated.Future
that will be completed when the log level update has been done. It will carry the
Map
of log levels as the result.Future<String[]> resetLogLevels(String... loggerNames)
loggerNames
- The optional logger names to be reset for all runnables, if not provided, all log levels will
be reset.Future
that will be completed when the set log level operation has been done. The future result
is the logger names provided in the parameter.Future<String[]> resetRunnableLogLevels(String runnableName, String... loggerNames)
loggerNames
- The optional logger names to be reset for the runnable, if not provided, all log levels will
be reset.Future
that will be completed when the set log level operation has been done. The future result
is the logger names provided in the parameter.Copyright © 2013-2016 The Apache Software Foundation. All rights reserved.