@@ -30,7 +30,6 @@ import org.rocksdb.{RocksDB => NativeRocksDB, _}
3030import org .apache .spark .TaskContext
3131import org .apache .spark .internal .Logging
3232import org .apache .spark .sql .catalyst .util .CaseInsensitiveMap
33- import org .apache .spark .sql .util .RocksDBLoader
3433import org .apache .spark .util .{NextIterator , Utils }
3534
3635/**
@@ -42,13 +41,13 @@ import org.apache.spark.util.{NextIterator, Utils}
4241 * @see [[RocksDBFileManager ]] to see how the files are laid out in local disk and DFS.
4342 * @param dfsRootDir Remote directory where checkpoints are going to be written
4443 * @param conf Configuration for RocksDB
45- * @param localRootDir Root directory in local disk that is used to working and checkpoing dirs
44+ * @param localRootDir Root directory in local disk that is used to working and checkpointing dirs
4645 * @param hadoopConf Hadoop configuration for talking to the remote file system
4746 * @param loggingId Id that will be prepended in logs for isolating concurrent RocksDBs
4847 */
4948class RocksDB (
5049 dfsRootDir : String ,
51- val conf : RocksDBConf = RocksDBConf () ,
50+ val conf : RocksDBConf ,
5251 localRootDir : File = Utils .createTempDir(),
5352 hadoopConf : Configuration = new Configuration ,
5453 loggingId : String = " " ) extends Logging {
@@ -82,7 +81,9 @@ class RocksDB(
8281
8382 @ volatile private var db : NativeRocksDB = _
8483 @ volatile private var loadedVersion = - 1L // -1 = nothing valid is loaded
84+ // number of keys in all committed versions before
8585 @ volatile private var numCommittedKeys = 0L
86+ // number of keys which will be committed in the next version
8687 @ volatile private var numUncommittedKeys = 0L
8788 @ volatile private var acquiredThreadInfo : AcquiredThreadInfo = _
8889
@@ -305,10 +306,6 @@ class RocksDB(
305306 acquireLock.notifyAll()
306307 }
307308
308- private def getDBProperty (property : String ): Long = {
309- db.getProperty(property).toLong
310- }
311-
312309 private def openDB (): Unit = {
313310 assert(db == null )
314311 db = NativeRocksDB .open(dbOptions, workingDir.toString)
@@ -437,9 +434,10 @@ object RocksDBConf {
437434 def apply (): RocksDBConf = apply(new StateStoreConf ())
438435}
439436
440- case class AcquiredThreadInfo (
441- threadRef : WeakReference [Thread ] = new WeakReference [Thread ](Thread .currentThread()),
442- tc : TaskContext = TaskContext .get()) {
437+ case class AcquiredThreadInfo () {
438+ val threadRef : WeakReference [Thread ] = new WeakReference [Thread ](Thread .currentThread())
439+ val tc : TaskContext = TaskContext .get()
440+
443441 override def toString (): String = {
444442 val taskStr = if (tc != null ) {
445443 val taskDetails =
0 commit comments