Beispiel #1
0
            public async Task <Slice> GetKeyAsync(FdbKeySelector selector)
            {
                EnsureCanRead();

                m_parent.m_database.EnsureKeyIsValid(selector.Key);

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

                var key = await m_parent.m_handler.GetKeyAsync(selector, snapshot : true, cancellationToken : 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(FdbKeySelector begin, FdbKeySelector 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, TaskHelpers.Cache <KeyValuePair <Slice, Slice> > .Identity, snapshot, options));
        }