public class ChukwaAgent extends Object implements AdaptorManager
The agent will start an HTTP REST interface listening on port. Configs for the agent are:
chukwaAgent.http.port
Port to listen on (default=9090).chukwaAgent.http.rest.controller.packages
Java packages to
inspect for JAX-RS annotated classes to be added as servlets to the REST
server.Modifier and Type | Class and Description |
---|---|
static class |
ChukwaAgent.AlreadyRunningException |
static class |
ChukwaAgent.Offset |
Modifier and Type | Field and Description |
---|---|
Connector |
connector |
NULL
Modifier and Type | Method and Description |
---|---|
int |
adaptorCount() |
Adaptor |
getAdaptor(String name) |
Map<String,String> |
getAdaptorList()
Expose the adaptor list.
|
String |
getAdaptorName(Adaptor initiator) |
OffsetStatsManager<Adaptor> |
getAdaptorStatsManager() |
static ChukwaAgent |
getAgent() |
static ChukwaAgent |
getAgent(org.apache.hadoop.conf.Configuration conf) |
org.apache.hadoop.conf.Configuration |
getConfiguration() |
Connector |
getConnector() |
int |
getControllerPort() |
static org.apache.hadoop.conf.Configuration |
getStaticConfiguration() |
static void |
main(String[] args) |
ChukwaAgent.Offset |
offset(Adaptor a) |
String |
processAddCommand(String cmd)
Most of the Chukwa wire protocol is implemented in @link{AgentControlSocketListener}
Unlike the rest of the chukwa wire protocol, add commands can appear in
initial_adaptors and checkpoint files.
|
String |
processAddCommandE(String cmd) |
String |
reportCommit(Adaptor src,
long uuid)
Called to update the Agent status table.
|
void |
shutdown() |
void |
shutdown(boolean force)
Triggers agent shutdown.
|
void |
start() |
long |
stopAdaptor(String name,
AdaptorShutdownPolicy shutdownMode)
Stop the adaptor with given ID number.
|
long |
stopAdaptor(String name,
boolean gracefully) |
public Connector connector
public static ChukwaAgent getAgent()
public static ChukwaAgent getAgent(org.apache.hadoop.conf.Configuration conf)
public void start() throws ChukwaAgent.AlreadyRunningException
public int getControllerPort()
public OffsetStatsManager<Adaptor> getAdaptorStatsManager()
public static void main(String[] args) throws AdaptorException
args
- is command line arguementsAdaptorException
- if error registering adaptorspublic int adaptorCount()
adaptorCount
in interface AdaptorManager
public String processAddCommand(String cmd)
processAddCommand
in interface AdaptorManager
public String processAddCommandE(String cmd) throws AdaptorException
AdaptorException
public String reportCommit(Adaptor src, long uuid)
AdaptorManager
reportCommit
in interface AdaptorManager
src
- the adaptor in questionuuid
- the number to record as checkpoint. Must be monotonically increasing.public Map<String,String> getAdaptorList()
getAdaptorList
in interface AdaptorManager
public long stopAdaptor(String name, boolean gracefully)
stopAdaptor
in interface AdaptorManager
public long stopAdaptor(String name, AdaptorShutdownPolicy shutdownMode)
stopAdaptor
in interface AdaptorManager
name
- the adaptor to stopshutdownMode
- if true, shutdown, if false, hardStoppublic org.apache.hadoop.conf.Configuration getConfiguration()
getConfiguration
in interface AdaptorManager
public static org.apache.hadoop.conf.Configuration getStaticConfiguration()
public Adaptor getAdaptor(String name)
getAdaptor
in interface AdaptorManager
public ChukwaAgent.Offset offset(Adaptor a)
public Connector getConnector()
public void shutdown()
public void shutdown(boolean force)
force
- sets flag to exit forcefullyCopyright © 2016 Apache Software Foundation. All Rights Reserved.