@Override
    public synchronized void close() {
        if (!open) {
            return;
        }

        open = false;
        closeOpenIterators();

        if (configSetter != null) {
            configSetter.close(name, userSpecifiedOptions);
            configSetter = null;
        }

        metricsRecorder.removeValueProviders(name);

        // Important: do not rearrange the order in which the below objects are closed!
        // Order of closing must follow: ColumnFamilyHandle > RocksDB > DBOptions > ColumnFamilyOptions
        cfAccessor.close();
        dbAccessor.close();
        db.close();
        userSpecifiedOptions.close();
        wOptions.close();
        fOptions.close();
        filter.close();
        cache.close();
        if (statistics != null) {
            statistics.close();
        }

        cfAccessor = null;
        dbAccessor = null;
        userSpecifiedOptions = null;
        wOptions = null;
        fOptions = null;
        db = null;
        filter = null;
        cache = null;
        statistics = null;
    }
Return an approximate count of key-value mappings in this store.

<code>RocksDB</code> cannot return an exact entry count without doing a
full scan, so this method relies on the <code>rocksdb.estimate-num-keys</code>
property to get an approximate count. The returned size also includes
a count of dirty keys in the store's in-memory cache, which may lead to some
double-counting of entries and inflate the estimate.

@return an approximate count of key-value mappings in the store.
streams/src/main/java/org/apache/kafka/streams/state/internals/RocksDBStore.java