@@ -0,0 +1,3655 @@
+/*%0A * Licensed to the Apache Software Foundation (ASF) under one or more%0A * contributor license agreements.  See the NOTICE file distributed with%0A * this work for additional information regarding copyright ownership.%0A * The ASF licenses this file to You under the Apache License, Version 2.0%0A * (the %22License%22); you may not use this file except in compliance with%0A * the License.  You may obtain a copy of the License at%0A *%0A *    http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0A%0Apackage org.apache.spark;%0A%0Aimport org.apache.spark.scheduler.*;%0A%0A/**%0A * Class that allows users to receive all SparkListener events.%0A * Users should override the onEvent method.%0A *%0A * This is a concrete Java class in order to ensure that we don't forget to update it when adding%0A * new methods to SparkListener: forgetting to add a method will result in a compilation error (if%0A * this was a concrete Scala class, default implementations of new event handlers would be inherited%0A * from the SparkListener trait).%0A */%0Apublic class SparkFirehoseListener implements SparkListener %7B%0A%0A    public void onEvent(SparkListenerEvent event) %7B %7D%0A%0A    @Override%0A    public final void onStageCompleted(SparkListenerStageCompleted stageCompleted) %7B%0A        onEvent(stageCompleted);%0A    %7D%0A%0A    @Override%0A    public final void onStageSubmitted(SparkListenerStageSubmitted stageSubmitted) %7B%0A        onEvent(stageSubmitted);%0A    %7D%0A%0A    @Override%0A    public final void onTaskStart(SparkListenerTaskStart taskStart) %7B%0A        onEvent(taskStart);%0A    %7D%0A%0A    @Override%0A    public final void onTaskGettingResult(SparkListenerTaskGettingResult taskGettingResult) %7B%0A        onEvent(taskGettingResult);%0A    %7D%0A%0A    @Override%0A    public final void onTaskEnd(SparkListenerTaskEnd taskEnd) %7B%0A        onEvent(taskEnd);%0A    %7D%0A%0A    @Override%0A    public final void onJobStart(SparkListenerJobStart jobStart) %7B%0A        onEvent(jobStart);%0A    %7D%0A%0A    @Override%0A    public final void onJobEnd(SparkListenerJobEnd jobEnd) %7B%0A        onEvent(jobEnd);%0A    %7D%0A%0A    @Override%0A    public final void onEnvironmentUpdate(SparkListenerEnvironmentUpdate environmentUpdate) %7B%0A        onEvent(environmentUpdate);%0A    %7D%0A%0A    @Override%0A    public final void onBlockManagerAdded(SparkListenerBlockManagerAdded blockManagerAdded) %7B%0A        onEvent(blockManagerAdded);%0A    %7D%0A%0A    @Override%0A    public final void onBlockManagerRemoved(SparkListenerBlockManagerRemoved blockManagerRemoved) %7B%0A        onEvent(blockManagerRemoved);%0A    %7D%0A%0A    @Override%0A    public final void onUnpersistRDD(SparkListenerUnpersistRDD unpersistRDD) %7B%0A        onEvent(unpersistRDD);%0A    %7D%0A%0A    @Override%0A    public final void onApplicationStart(SparkListenerApplicationStart applicationStart) %7B%0A        onEvent(applicationStart);%0A    %7D%0A%0A    @Override%0A    public final void onApplicationEnd(SparkListenerApplicationEnd applicationEnd) %7B%0A        onEvent(applicationEnd);%0A    %7D%0A%0A    @Override%0A    public final void onExecutorMetricsUpdate(%0A            SparkListenerExecutorMetricsUpdate executorMetricsUpdate) %7B%0A        onEvent(executorMetricsUpdate);%0A    %7D%0A%0A    @Override%0A    public final void onExecutorAdded(SparkListenerExecutorAdded executorAdded) %7B%0A        onEvent(executorAdded);%0A    %7D%0A%0A    @Override%0A    public final void onExecutorRemoved(SparkListenerExecutorRemoved executorRemoved) %7B%0A        onEvent(executorRemoved);%0A    %7D%0A%7D%0A

Add SparkFirehoseListener class for consuming all SparkListener events