public static async Task <FdbSystemStatus> GetStatusAsync([NotNull] IFdbReadOnlyTransaction trans)
            {
                Contract.NotNull(trans, nameof(trans));

                Slice data = await trans.GetAsync(StatusJsonKey).ConfigureAwait(false);

                if (data.IsNullOrEmpty)
                {
                    return(null);
                }

                string jsonText = data.ToUnicode();

                var doc = TinyJsonParser.ParseObject(jsonText);

                if (doc == null)
                {
                    return(null);
                }

                long rv = 0;

                if (doc.ContainsKey("cluster"))
                {
                    rv = await trans.GetReadVersionAsync();
                }

                return(new FdbSystemStatus(doc, rv, jsonText));
            }
            public static async Task <FdbSystemStatus?> GetStatusAsync(IFdbReadOnlyTransaction trans)
            {
                Contract.NotNull(trans);

                var data = await trans.GetAsync(StatusJsonKey).ConfigureAwait(false);

                if (data.IsNullOrEmpty)
                {
                    return(null);
                }

                var doc = TinyJsonParser.ParseObject(data);

                if (doc == null)
                {
                    return(null);
                }

                long rv = 0;

                if (doc.ContainsKey("cluster"))
                {
                    rv = await trans.GetReadVersionAsync();
                }

                return(new FdbSystemStatus(doc, rv, data));
            }
            public static async Task <List <Slice> > GetBoundaryKeysAsync([NotNull] IFdbReadOnlyTransaction trans, Slice beginInclusive, Slice endExclusive)
            {
                Contract.NotNull(trans, nameof(trans));
                Contract.Requires(trans.Context?.Database != null);

                using (var shadow = trans.Context.Database.BeginReadOnlyTransaction(trans.Cancellation))
                {
                    // We don't want to change the state of the transaction, so we will create another one at the same read version
                    var readVersion = await trans.GetReadVersionAsync().ConfigureAwait(false);

                    shadow.SetReadVersion(readVersion);

                    //TODO: we may need to also copy options like RetryLimit and Timeout ?

                    return(await GetBoundaryKeysInternalAsync(shadow, beginInclusive, endExclusive).ConfigureAwait(false));
                }
            }
 public virtual Task <long> GetReadVersionAsync()
 {
     return(m_transaction.GetReadVersionAsync());
 }