@Override
    public void write(final WriteBatchInterface batch) throws RocksDBException {
        if (batch instanceof WriteBatch) {
            db.write(wOptions, (WriteBatch) batch);
        } else if (batch instanceof WriteBatchWithIndex) {
            db.write(wOptions, (WriteBatchWithIndex) batch);
        } else {
            log.error("Unknown type of batch {}. This is a bug in Kafka Streams. " +
                    "Please file a bug report at https://issues.apache.org/jira/projects/KAFKA.",
                    batch.getClass().getCanonicalName());
            throw new IllegalStateException("Unknown type of batch " + batch.getClass().getCanonicalName());
        }
    }
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