1#
2# Licensed to the Apache Software Foundation (ASF) under one or more
3# contributor license agreements.  See the NOTICE file distributed with
4# this work for additional information regarding copyright ownership.
5# The ASF licenses this file to You under the Apache License, Version 2.0
6# (the "License"); you may not use this file except in compliance with
7# the License.  You may obtain a copy of the License at
8#
9#    http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS,
13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
16#
17
18__all__ = ["StreamingListener"]
19
20
21class StreamingListener(object):
22
23    def __init__(self):
24        pass
25
26    def onReceiverStarted(self, receiverStarted):
27        """
28        Called when a receiver has been started
29        """
30        pass
31
32    def onReceiverError(self, receiverError):
33        """
34        Called when a receiver has reported an error
35        """
36        pass
37
38    def onReceiverStopped(self, receiverStopped):
39        """
40        Called when a receiver has been stopped
41        """
42        pass
43
44    def onBatchSubmitted(self, batchSubmitted):
45        """
46        Called when a batch of jobs has been submitted for processing.
47        """
48        pass
49
50    def onBatchStarted(self, batchStarted):
51        """
52        Called when processing of a batch of jobs has started.
53        """
54        pass
55
56    def onBatchCompleted(self, batchCompleted):
57        """
58        Called when processing of a batch of jobs has completed.
59        """
60        pass
61
62    def onOutputOperationStarted(self, outputOperationStarted):
63        """
64        Called when processing of a job of a batch has started.
65        """
66        pass
67
68    def onOutputOperationCompleted(self, outputOperationCompleted):
69        """
70        Called when processing of a job of a batch has completed
71        """
72        pass
73
74    class Java:
75        implements = ["org.apache.spark.streaming.api.java.PythonStreamingListener"]
76