/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.apache.pig.tools.pigstats;

import org.apache.pig.classification.InterfaceAudience;
import org.apache.pig.classification.InterfaceStability;

@InterfaceAudience.Public
@InterfaceStability.Evolving
public interface PigProgressNotificationListener extends java.util.EventListener {
    
    public void launchStartedNotification(int numJobsToLaunch);
    
    public void jobsSubmittedNotification(int numJobsSubmitted);
    
    public void jobStartedNotification(String assignedJobId);
    
    public void jobFinishedNotification(JobStats jobStats);
    
    public void jobFailedNotification(JobStats jobStats);
    
    public void outputCompletedNotification(OutputStats outputStats);
    
    public void progressUpdatedNotification(int progress);
    
    public void launchCompletedNotification(int numJobsSucceeded);
}

@@ -954,16 +954,159 @@
 ility;%0A%0A
+import org.apache.pig.PigRunner;%0A%0A/**%0A * Should be implemented by an object that wants to receive notifications%0A * from %7B@link PigRunner%7D.%0A */%0A
 @Interfa
@@ -1248,476 +1248,1683 @@
     
-public void launchStartedNotification(int numJobsToLaunch);%0A    %0A    public void jobsSubmittedNotification(int numJobsSubmitted);%0A    %0A    public void jobStartedNotification(String assignedJobId);%0A    %0A    public void jobFinishedNotification(JobStats jobStats);%0A    %0A    public void jobFailedNotification(JobStats jobStats);%0A    %0A    public void outputCompletedNotification(OutputStats outputStats);%0A    %0A    public void progressUpdatedNotification(int progress);%0A    
+/** %0A     * Invoked just before launching MR jobs spawned by the script.%0A     * %0A     * @param numJobsToLaunch the total number of MR jobs spawned by the script%0A     */%0A    public void launchStartedNotification(int numJobsToLaunch);%0A    %0A    /**%0A     * Invoked just before submitting a batch of MR jobs.%0A     * %0A     * @param numJobsSubmitted the number of MR jobs in the batch%0A     */%0A    public void jobsSubmittedNotification(int numJobsSubmitted);%0A    %0A    /**%0A     * Invoked after a MR job is started.%0A     * %0A     * @param assignedJobId the MR job id%0A     */%0A    public void jobStartedNotification(String assignedJobId);%0A    %0A    /**%0A     * Invoked just after a MR job is completed successfully. %0A     * %0A     * @param jobStats the %7B@link JobStats%7D object associated with the MR job%0A     */%0A    public void jobFinishedNotification(JobStats jobStats);%0A    %0A    /**%0A     * Invoked when a MR job fails.%0A     * %0A     * @param jobStats the %7B@link JobStats%7D object associated with the MR job%0A     */%0A    public void jobFailedNotification(JobStats jobStats);%0A    %0A    /**%0A     * Invoked just after an output is successfully written.%0A     * %0A     * @param outputStats the %7B@link OutputStats%7D object associated with the output%0A     */%0A    public void outputCompletedNotification(OutputStats outputStats);%0A    %0A    /**%0A     * Invoked to update the execution progress. %0A     * %0A     * @param progress the percentage of the execution progress%0A     */%0A    public void progressUpdatedNotification(int progress);%0A    %0A    /**%0A     * Invoked just after all MR jobs spawned by the script are completed.%0A     * %0A     * @param numJobsSucceeded the total number of MR jobs succeeded%0A     */
 %0A   

Add progress notification listener to PigRunner API