Example #1
0
            public Task <Slice> GetKeyAsync(KeySelector selector)
            {
                EnsureCanRead();

                FdbKey.EnsureKeyIsValid(selector.Key);

#if DEBUG
                if (Logging.On && Logging.IsVerbose)
                {
                    Logging.Verbose(this, "GetKeyAsync", $"Getting key '{selector.ToString()}'");
                }
#endif

                return(m_parent.PerformGetKeyOperation(selector, snapshot: true));
            }
Example #2
0
            public async Task <Slice> GetKeyAsync(KeySelector selector)
            {
                EnsureCanRead();

                m_parent.m_database.EnsureKeyIsValid(selector.Key);

#if DEBUG
                if (Logging.On && Logging.IsVerbose)
                {
                    Logging.Verbose(this, "GetKeyAsync", $"Getting key '{selector.ToString()}'");
                }
#endif

                var key = await m_parent.m_handler.GetKeyAsync(selector, snapshot : true, ct : m_parent.m_cancellation).ConfigureAwait(false);

                // don't forget to truncate keys that would fall outside of the database's globalspace !
                return(m_parent.m_database.BoundCheck(key));
            }
        internal FdbRangeQuery <KeyValuePair <Slice, Slice> > GetRangeCore(KeySelector begin, KeySelector end, FdbRangeOptions options, bool snapshot)
        {
            this.Database.EnsureKeyIsValid(begin.Key);
            this.Database.EnsureKeyIsValid(end.Key, endExclusive: true);

            options = FdbRangeOptions.EnsureDefaults(options, null, null, FdbStreamingMode.Iterator, false);
            options.EnsureLegalValues();

#if DEBUG
            if (Logging.On && Logging.IsVerbose)
            {
                Logging.Verbose(this, "GetRangeCore", String.Format("Getting range '{0} <= x < {1}'", begin.ToString(), end.ToString()));
            }
#endif

            return(new FdbRangeQuery <KeyValuePair <Slice, Slice> >(this, begin, end, (kv) => kv, snapshot, options));
        }