HeartSaVioR commented on code in PR #48232:
URL: https://github.com/apache/spark/pull/48232#discussion_r1774292485
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/state/RocksDB.scala:
##########
@@ -115,37 +115,35 @@ class RocksDB(
tableFormatConfig.setPinL0FilterAndIndexBlocksInCache(true)
}
- private[state] val columnFamilyOptions = new ColumnFamilyOptions()
+ private[state] val rocksDbOptions = new Options() // options to open the
RocksDB
+
+ rocksDbOptions.setCreateIfMissing(true)
// Set RocksDB options around MemTable memory usage. By default, we let
RocksDB
// use its internal default values for these settings.
if (conf.writeBufferSizeMB > 0L) {
- columnFamilyOptions.setWriteBufferSize(conf.writeBufferSizeMB * 1024 *
1024)
+ rocksDbOptions.setWriteBufferSize(conf.writeBufferSizeMB * 1024 * 1024)
}
if (conf.maxWriteBufferNumber > 0L) {
- columnFamilyOptions.setMaxWriteBufferNumber(conf.maxWriteBufferNumber)
+ rocksDbOptions.setMaxWriteBufferNumber(conf.maxWriteBufferNumber)
}
- columnFamilyOptions.setCompressionType(getCompressionType(conf.compression))
- columnFamilyOptions.setMergeOperator(new StringAppendOperator())
-
- private val dbOptions =
- new Options(new DBOptions(), columnFamilyOptions) // options to open the
RocksDB
+ rocksDbOptions.setCompressionType(getCompressionType(conf.compression))
+ rocksDbOptions.setMergeOperator(new StringAppendOperator())
Review Comment:
nit: seems to be done twice
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/state/RocksDB.scala:
##########
@@ -115,37 +115,35 @@ class RocksDB(
tableFormatConfig.setPinL0FilterAndIndexBlocksInCache(true)
}
- private[state] val columnFamilyOptions = new ColumnFamilyOptions()
+ private[state] val rocksDbOptions = new Options() // options to open the
RocksDB
+
+ rocksDbOptions.setCreateIfMissing(true)
// Set RocksDB options around MemTable memory usage. By default, we let
RocksDB
// use its internal default values for these settings.
if (conf.writeBufferSizeMB > 0L) {
- columnFamilyOptions.setWriteBufferSize(conf.writeBufferSizeMB * 1024 *
1024)
+ rocksDbOptions.setWriteBufferSize(conf.writeBufferSizeMB * 1024 * 1024)
}
if (conf.maxWriteBufferNumber > 0L) {
- columnFamilyOptions.setMaxWriteBufferNumber(conf.maxWriteBufferNumber)
+ rocksDbOptions.setMaxWriteBufferNumber(conf.maxWriteBufferNumber)
}
- columnFamilyOptions.setCompressionType(getCompressionType(conf.compression))
- columnFamilyOptions.setMergeOperator(new StringAppendOperator())
-
- private val dbOptions =
- new Options(new DBOptions(), columnFamilyOptions) // options to open the
RocksDB
+ rocksDbOptions.setCompressionType(getCompressionType(conf.compression))
+ rocksDbOptions.setMergeOperator(new StringAppendOperator())
Review Comment:
```suggestion
```
--
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]