Exemplo n.º 1
0
            public long Walk(Func <byte[], byte[], bool> callback)
            {
                using TikvConnection connection = new TikvConnection(Database.DatabaseUrl);
                connection.Open();
                using TikvTransaction transaction = connection.BeginTransaction();
                long result = Tikv.Driver.Scan(transaction.TransactionId, KeyPrefix, callback);

                transaction.Commit();
                return(result);
            }
Exemplo n.º 2
0
            public ByteBuffer Find(ByteBuffer key)
            {
                using TikvConnection connection = new TikvConnection(Database.DatabaseUrl);
                connection.Open();
                using TikvTransaction transaction = connection.BeginTransaction();
                var result = Tikv.Driver.Get(transaction.TransactionId, WithKeyspace(key));

                transaction.Commit();
                return(result);
            }