anishshri-db commented on code in PR #45002:
URL: https://github.com/apache/spark/pull/45002#discussion_r1481971683
##########
sql/api/src/main/scala/org/apache/spark/sql/streaming/StatefulProcessor.scala:
##########
@@ -60,4 +57,21 @@ private[sql] trait StatefulProcessor[K, I, O] extends
Serializable {
* any cleanup or teardown operations.
*/
def close (): Unit
+
+ /**
+ * Function to set the stateful processor handle that will be used to
interact with the state
+ * store and other stateful processor related operations.
+ * @param handle - instance of StatefulProcessorHandle
+ */
+ final def setStatefulProcessorHandle(handle: StatefulProcessorHandle): Unit
= {
+ statefulProcessorHandle = handle
+ }
+
+ /**
+ * Function to get the stateful processor handle that will be used to
interact with the state
+ * @return handle - instance of StatefulProcessorHandle
+ */
+ final def getStatefulProcessorHandle: StatefulProcessorHandle = {
+ statefulProcessorHandle
Review Comment:
Lets set the initial value to null. And if its null, then lets raise an
exception/error to say that handle is not available ?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]