Ejemplo n.º 1
0
        /// <summary>
        /// Return an approximate count of key-value mappings in this store.
        /// The count is not guaranteed to be exact in order to accommodate stores
        /// where an exact count is expensive to calculate.
        /// </summary>
        /// <returns>an approximate count of key-value mappings in the store.</returns>
        public long ApproximateNumEntries()
        {
            CheckStateStoreOpen();
            long num = 0;

            try
            {
                num = DbAdapter.ApproximateNumEntries();
            }
            catch (RocksDbSharp.RocksDbException e)
            {
                throw new ProcessorStateException("Error while getting value for key from store {Name}", e);
            }

            return(num > 0 ? num : 0);
        }