IoT DAS Frameworks - IT Infra Monitoring and Analytics/IOT_Gateway/Ganglia_Event_Schema_Mapper_Framework/GangliaEventSchemaMapper/src/com/prokosha/ganglia/dataparser/GangliaCepEvent.java
public void nodeEnd(String nodeType) {
        log.debug("::Listener=" + this + "::NODE END:: Called on nodeType: " + nodeType);
        if (nodeType.equals(containerNode)) {

            setReady(); //event is complete and ready to send now
            String CEPEventData = getCepEvent();

            //If LoopControl is GANGLIA-LOG, just log the CEP events
            //If LoopControl is GANGLIA-LOG-CEP, log and send CEP events
            if (AdapterProperties.getLoopControl().toUpperCase().contains("LOG")) {
                //pretty print the CEP event
                log.info("\n\n----------- CEP EVENT FOUND-------------\n" + "{" + CEPEventData + "}\n---------------------------------\n");
            }

            String eventID = "";
            String statusId = "";

            if (AdapterProperties.getEnableRT()) {
                log.info("RT enabled");
                ETLAdapter etl = new ETLAdapter();
                statusId = etl.dumpCEPEvent(CEPEventData);
                etl = null;
                String id[] = statusId.split(":");
                eventID = id[0];
                statusId = id[1];
            }

            if (AdapterProperties.getEnableRT()) {
                CEPEventData = CEPEventData + ",eventID=" + eventID;
            } else {
                CEPEventData = CEPEventData + ",eventID=0";
                statusId="1";
            }
            //If loopControl is GANGLIA-CEP, simply send the CEP events
            if (AdapterProperties.getLoopControl().toUpperCase().contains("CEP")) {
                log.info("Sending Ganglia event (" + getEventName() + ") to CEP engine....");
                if (Integer.parseInt(statusId) > 0) {
                    GangliaAdapter.sendMessage(CEPEventData);
                }
            }
            //now clear the CEP event (field,value) hashmap to prepare for the next HOST nodes events
            cepFieldValueMap.clear();
            eventID = null;
            statusId = null;
            CEPEventData = null;
        }
    }
//    then send the event to CEP
then send the event to CEP
then send the event to CEP
public void nodeEnd(String nodeType) {
        log.debug("::Listener=" + this + "::NODE END:: Called on nodeType: " + nodeType);
        if (nodeType.equals(containerNode)) {
            setReady(); 
            String CEPEventData = getCepEvent();
            if (AdapterProperties.getLoopControl().toUpperCase().contains("LOG")) {
                log.info("\n\n----------- CEP EVENT FOUND-------------\n" + "{" + CEPEventData + "}\n---------------------------------\n");
            }
            String eventID = "";
            String statusId = "";
            if (AdapterProperties.getEnableRT()) {
                log.info("RT enabled");
                ETLAdapter etl = new ETLAdapter();
                statusId = etl.dumpCEPEvent(CEPEventData);
                etl = null;
                String id[] = statusId.split(":");
                eventID = id[0];
                statusId = id[1];
            }
            if (AdapterProperties.getEnableRT()) {
                CEPEventData = CEPEventData + ",eventID=" + eventID;
            } else {
                CEPEventData = CEPEventData + ",eventID=0";
                statusId="1";
            }
            if (AdapterProperties.getLoopControl().toUpperCase().contains("CEP")) {
                log.info("Sending Ganglia event (" + getEventName() + ") to CEP engine....");
                if (Integer.parseInt(statusId) > 0) {
                    GangliaAdapter.sendMessage(CEPEventData);
                }
            }
            cepFieldValueMap.clear();
            eventID = null;
            statusId = null;
            CEPEventData = null;
        }
    }
public void nodeEnd ( String nodeType ) { log . debug ( "::Listener=" + this + "::NODE END:: Called on nodeType: " + nodeType ) ; if ( nodeType . equals ( containerNode ) ) { setReady ( ) ; String CEPEventData = getCepEvent ( ) ; if ( AdapterProperties . getLoopControl ( ) . toUpperCase ( ) . contains ( "LOG" ) ) { log . info ( "\n\n----------- CEP EVENT FOUND-------------\n" + "{" + CEPEventData + "}\n---------------------------------\n" ) ; } String eventID = "" ; String statusId = "" ; if ( AdapterProperties . getEnableRT ( ) ) { log . info ( "RT enabled" ) ; ETLAdapter etl = new ETLAdapter ( ) ; statusId = etl . dumpCEPEvent ( CEPEventData ) ; etl = null ; String id [ ] = statusId . split ( ":" ) ; eventID = id [ 0 ] ; statusId = id [ 1 ] ; } if ( AdapterProperties . getEnableRT ( ) ) { CEPEventData = CEPEventData + ",eventID=" + eventID ; } else { CEPEventData = CEPEventData + ",eventID=0" ; statusId = "1" ; } if ( AdapterProperties . getLoopControl ( ) . toUpperCase ( ) . contains ( "CEP" ) ) { log . info ( "Sending Ganglia event (" + getEventName ( ) + ") to CEP engine...." ) ; if ( Integer . parseInt ( statusId ) > 0 ) { GangliaAdapter . sendMessage ( CEPEventData ) ; } } cepFieldValueMap . clear ( ) ; eventID = null ; statusId = null ; CEPEventData = null ; } }
then send the event to CEP
then send the event to CEP
//event is complete and ready to send now //If LoopControl is GANGLIA-LOG, just log the CEP events //If LoopControl is GANGLIA-LOG-CEP, log and send CEP events //pretty print the CEP event //If loopControl is GANGLIA-CEP, simply send the CEP events //now clear the CEP event (field,value) hashmap to prepare for the next HOST nodes events