コード例 #1
0
        /// <summary>Extract a chunk of result from a completed Future</summary>
        /// <param name="h">Handle to the completed Future</param>
        /// <param name="more">Receives true if there are more result, or false if all results have been transmitted</param>
        /// <param name="first">Receives the first key in the page, or default if page is empty</param>
        /// <param name="last">Receives the last key in the page, or default if page is empty</param>
        /// <returns>Array of key/value pairs, or an exception</returns>
        private static KeyValuePair <Slice, Slice>[] GetKeyValueArrayResultKeysOnly(FutureHandle h, out bool more, out Slice first, out Slice last)
        {
            var err = FdbNative.FutureGetKeyValueArrayKeysOnly(h, out var result, out more);

            Fdb.DieOnError(err);
            //note: result can only be null if an error occured!
            Contract.Ensures(result != null);
            first = result.Length > 0 ? result[0].Key : default;
            last  = result.Length > 0 ? result[result.Length - 1].Key : default;
            return(result);
        }