Search in sources :

Example 1 with AsterixStateDumpHandler

use of org.apache.asterix.hyracks.bootstrap.AsterixStateDumpHandler in project asterixdb by apache.

the class StartLifecycleComponentsTask method perform.

@Override
public void perform(IControllerService cs) throws HyracksDataException {
    INcApplicationContext applicationContext = (INcApplicationContext) cs.getApplicationContext();
    NCServiceContext serviceCtx = (NCServiceContext) cs.getContext();
    MetadataProperties metadataProperties = applicationContext.getMetadataProperties();
    if (LOGGER.isLoggable(Level.INFO)) {
        LOGGER.info("Starting lifecycle components");
    }
    Map<String, String> lifecycleMgmtConfiguration = new HashMap<>();
    String dumpPathKey = LifeCycleComponentManager.Config.DUMP_PATH_KEY;
    String dumpPath = metadataProperties.getCoredumpPath(serviceCtx.getNodeId());
    lifecycleMgmtConfiguration.put(dumpPathKey, dumpPath);
    if (LOGGER.isLoggable(Level.INFO)) {
        LOGGER.info("Coredump directory for NC is: " + dumpPath);
    }
    ILifeCycleComponentManager lccm = serviceCtx.getLifeCycleComponentManager();
    lccm.configure(lifecycleMgmtConfiguration);
    if (LOGGER.isLoggable(Level.INFO)) {
        LOGGER.info("Configured:" + lccm);
    }
    serviceCtx.setStateDumpHandler(new AsterixStateDumpHandler(serviceCtx.getNodeId(), lccm.getDumpPath(), lccm));
    lccm.startAll();
}
Also used : INcApplicationContext(org.apache.asterix.common.api.INcApplicationContext) NCServiceContext(org.apache.hyracks.control.nc.application.NCServiceContext) HashMap(java.util.HashMap) ILifeCycleComponentManager(org.apache.hyracks.api.lifecycle.ILifeCycleComponentManager) AsterixStateDumpHandler(org.apache.asterix.hyracks.bootstrap.AsterixStateDumpHandler) MetadataProperties(org.apache.asterix.common.config.MetadataProperties)

Aggregations

HashMap (java.util.HashMap)1 INcApplicationContext (org.apache.asterix.common.api.INcApplicationContext)1 MetadataProperties (org.apache.asterix.common.config.MetadataProperties)1 AsterixStateDumpHandler (org.apache.asterix.hyracks.bootstrap.AsterixStateDumpHandler)1 ILifeCycleComponentManager (org.apache.hyracks.api.lifecycle.ILifeCycleComponentManager)1 NCServiceContext (org.apache.hyracks.control.nc.application.NCServiceContext)1