def handle(self, data: DStream):
     """
     Stream Handler
     :param data: input dstream
     :return: None
     """
     try:
         dataStream = data.transform(lambda time, rdd: self.transformer(time, rdd))
         # process rdds of each batch
         dataStream.foreachRDD(self.processor)
     except Exception as e:
         logging.error(e)
         print(e)
         return
    def handle(self, data: DStream):
        """
        Stream Handler
        :param data: input dstream
        :return: None
        """
        try:
            data = data.transform(self.transformer)
            # process rdds of each batch
        except Exception as e:
            logging.error(e)
            print(e)

        return data