/** * Notification that initialization is complete and all input and output ports are connected and * ready to receive and submit tuples. * * @throws Exception Operator failure, will cause the enclosing PE to terminate. */ @Override public synchronized void allPortsReady() throws Exception { // This method is commonly used by source operators. // Operators that process incoming tuples generally do not need this notification. OperatorContext context = getOperatorContext(); Logger.getLogger(this.getClass()) .trace( "Operator " + context.getName() + " all ports are ready in PE: " + context.getPE().getPEId() + " in Job: " + context.getPE().getJobId()); }
/** * Shutdown this operator. * * @throws Exception Operator failure, will cause the enclosing PE to terminate. */ public synchronized void shutdown() throws Exception { OperatorContext context = getOperatorContext(); Logger.getLogger(this.getClass()) .trace( "Operator " + context.getName() + " shutting down in PE: " + context.getPE().getPEId() + " in Job: " + context.getPE().getJobId()); // TODO: If needed, close connections or release resources related to any external system or // data store. // Must call super.shutdown() super.shutdown(); }
@Override public void shutdown() throws Exception { if (client != null) client.shutdown(); if (simpleClient != null) simpleClient.shutdown(); OperatorContext context = getOperatorContext(); trace.log( TraceLevel.ALL, "Operator " + context.getName() + " shutting down in PE: " + context.getPE().getPEId() + " in Job: " + context.getPE().getJobId()); // Must call super.shutdown() super.shutdown(); }
/** * Initialize this operator. Called once before any tuples are processed. * * @param context OperatorContext for this operator. * @throws Exception Operator failure, will cause the enclosing PE to terminate. */ @Override public synchronized void initialize(OperatorContext context) throws Exception { // Must call super.initialize(context) to correctly setup an operator. super.initialize(context); Logger.getLogger(this.getClass()) .trace( "Operator " + context.getName() + " initializing in PE: " + context.getPE().getPEId() + " in Job: " + context.getPE().getJobId()); // TODO: // If needed, insert code to establish connections or resources to communicate an external // system or data store. // The configuration information for this may come from parameters supplied to the operator // invocation, // or external configuration files or a combination of the two. }