gaborgsomogyi commented on a change in pull request #24922: [SPARK-28120][SS]  
Rocksdb state storage implementation
URL: https://github.com/apache/spark/pull/24922#discussion_r327574995
 
 

 ##########
 File path: 
sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/state/RocksDbStateStoreConf.scala
 ##########
 @@ -0,0 +1,52 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.spark.sql.execution.streaming.state
+
+import org.apache.spark.util.Utils
+
+class RocksDbStateStoreConf(@transient private val stateStoreConf: 
StateStoreConf)
+  extends Serializable {
+
+  import RocksDbStateStoreConf._
+
+  def this() = this(StateStoreConf.empty)
+
+  val blockSizeInKB: Int = stateStoreConf.confs
+    .getOrElse(BLOCK_SIZE_KEY, DEFAULT_BLOCKSIZE_IN_KB.toString).toInt
+
+  val memtableBudgetInMB: Int = stateStoreConf.confs
+    .getOrElse(MEMTABLE_BUDGET_KEY, 
DEFAULT_MEMTABLE_BUDGET_IN_MB.toString).toInt
+
+  val enableStats: Boolean = stateStoreConf.confs
+    .getOrElse(ENABLE_STATS_KEY, "false").toBoolean
+
+  val localDir: String = stateStoreConf.confs
+    .getOrElse(LOCAL_DIR_KEY, Utils.createTempDir().getAbsolutePath)
+}
+
+object RocksDbStateStoreConf {
+  val DEFAULT_BLOCKSIZE_IN_KB = 32
+  val DEFAULT_MEMTABLE_BUDGET_IN_MB = 1024
+  val DEFAULT_CACHE_SIZE_IN_MB = 512
+
+  val BLOCK_SIZE_KEY = "spark.sql.streaming.stateStore.rocksDb.blockSizeInKB"
 
 Review comment:
   That said `ConfigBuilder` can be used and `.internal()` can be added if it's 
not meant to users. Even if it's internal documentation needed.
   On the other hand pretty sure the users of Spark is diverse enough that 
these defaults will not fit to everybody.
   

----------------------------------------------------------------
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]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to