public class DuccRmAdmin
extends org.apache.uima.ducc.common.component.AbstractDuccComponent
main
class, the specified functions emit a string which is
easily parsable by scripting. Specifically, the qoccupancy and qload interfaces return a
string that can be converted to List and Dictionary objects in Python via Python's
eval
function.
When invoked via Java the response is returned in Java objects, as described below.
The use of this class's Java API is intended for DUCC System programming, and requires
the Camel, Spring, ActiveMQ, and Log4j classes in the classpath, as well as the DUCC
Transport and Common jars.
Requests that are destined for the RM are routed through the OR for recording in the
system-events.log using ducc.rm.via.or.admin.endpoint specified in default.ducc.properties.org.apache.uima.ducc.common.component.AbstractDuccComponent.AdminEventProcessor, org.apache.uima.ducc.common.component.AbstractDuccComponent.ErrorProcessor, org.apache.uima.ducc.common.component.AbstractDuccComponent.RMIServerSocketFactoryImpl
Modifier and Type | Field and Description |
---|---|
(package private) byte[] |
cypheredMessage |
static String |
FileSeparator |
(package private) String |
user |
Constructor and Description |
---|
DuccRmAdmin(org.apache.camel.CamelContext context,
String epname)
Creates a new instance of the RM administrative interface.
|
Modifier and Type | Method and Description |
---|---|
RmAdminReply |
dispatchAndWaitForReply(DuccAdminEvent duccEvent)
Marshall and transmit the request to RM, waiting for the response.
|
org.apache.uima.ducc.common.utils.DuccLogger |
getLogger()
This provides direct access to the logger for the class.
|
static void |
main(String[] args) |
RmAdminQLoadReply |
qload()
This queries the current workload demand and resource supply in RM.
|
RmAdminQOccupancyReply |
qoccupancy()
This queries details on each host the RM is scheduling to.
|
RmAdminReply |
reconfigure()
Send a reconfigure event to RM.
|
int |
run(String[] args)
This is called from
main in response to a CLI request. |
org.apache.uima.ducc.common.admin.event.RmAdminVaryReply |
varyoff(String[] args)
This causes the RM to "vary off" a set of hosts.
|
org.apache.uima.ducc.common.admin.event.RmAdminVaryReply |
varyon(String[] args)
This causes the RM to "vary on" a set of hosts.
|
adjustTransportEndpoint, cleanup, getContext, getLogLevel, getProcessJmxUrl, handleAdminEvent, handleUncaughtException, handleUncaughtException, isStopping, loadProperties, onDuccAdminKillEvent, quiesceAndStop, reloadProperties, setContext, setLogLevel, setLogLevel, start, start, startJmxAgent, stop, uncaughtException, validateAdministrator
public static final String FileSeparator
String user
byte[] cypheredMessage
public DuccRmAdmin(org.apache.camel.CamelContext context, String epname)
context
- This is the Camel context to use. Usually it is sufficient to simply provide
new DefaultCamelContext()
.epname
- This is the RM JMS endpoint as configured in ducc.properties. Usually it is
sufficient to provide ducc.rm.via.or.admin.endpoint
.public org.apache.uima.ducc.common.utils.DuccLogger getLogger()
public RmAdminReply dispatchAndWaitForReply(DuccAdminEvent duccEvent) throws Exception
duccEvent
- A DuccAdminEvent appropriate to the desired function.RmAdminReply
appropriate to the response. See the specific replies
for details.Exception
- if anything goes wrong in transmission or receipt of the request.public org.apache.uima.ducc.common.admin.event.RmAdminVaryReply varyoff(String[] args) throws Exception
args
- This is an array of hostnames indicating the hosts to be varied offline.RmAdminVaryReply
with success or failure status and if failure, the list of
hosts that could not be varied off.Exception
- if anything goes wrong in transmission or receipt of the request.public org.apache.uima.ducc.common.admin.event.RmAdminVaryReply varyon(String[] args) throws Exception
args
- This is an array of hostnames indicating the hosts to be varied online.RmAdminVaryReply
with success or failure status and if failure, the list of
hosts that could not be varied on.Exception
- if anything goes wrong in transmission or receipt of the request.public RmAdminQLoadReply qload() throws Exception
RmAdminQLoadReply
containing data regarding the current
class and nodepool state.Exception
- if anything goes wrong in transmission or receipt of the request.public RmAdminQOccupancyReply qoccupancy() throws Exception
RmAdminQOccupancyReply
containing data regarding the current
hosts.Exception
- if anything goes wrong in transmission or receipt of the request.public RmAdminReply reconfigure() throws Exception
RmAdminReply
. The message must be Reconfiguration complete.
;
any other response indicates failure. Failure occurs when the new configuration is invalid. If this
occurs use check_ducc -cv
to read and validate the current configuration.Exception
- if anything goes wrong in transmission or receipt of the request.public int run(String[] args) throws Exception
main
in response to a CLI request.args
- the command line arguments. See the usage method below for details.Exception
- if anything goes wrong in transmission or receipt of the request.public static void main(String[] args)
Copyright © 2012–2019 The Apache Software Foundation. All rights reserved.