gaborgsomogyi commented on a change in pull request #26935:
URL: https://github.com/apache/spark/pull/26935#discussion_r512699722
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/state/HDFSBackedStateStoreProvider.scala
##########
@@ -79,6 +78,23 @@ private[state] class HDFSBackedStateStoreProvider extends
StateStoreProvider wit
// java.util.ConcurrentModificationException
type MapType = java.util.concurrent.ConcurrentHashMap[UnsafeRow, UnsafeRow]
+ class HDFSBackedReadStateStore(val version: Long, map: MapType)
+ extends ReadStateStore {
+
+ override def id: StateStoreId =
HDFSBackedStateStoreProvider.this.stateStoreId
+
+ override def get(key: UnsafeRow): UnsafeRow = map.get(key)
+
+ override def iterator(): Iterator[UnsafeRowPair] = {
+ val unsafeRowPair = new UnsafeRowPair()
+ map.entrySet.asScala.iterator.map { entry =>
+ unsafeRowPair.withRows(entry.getKey, entry.getValue)
+ }
+ }
+
+ override def abort(): Unit = {}
+ }
Review comment:
Nit: Just a final thing, don't we need a `toString` like
`HDFSBackedStateStore`?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]