Пример #1
0
        public IEnumerable <Triple> O(TripleObject o, Triple c)
        {
            if (c == null)
            {
                return(O(o));
            }

            var oh     = KeySegments.GetNameOKeyObject(_name, o);
            var startS = KeyConfig.ConcatBytes(oh, KeyConfig.ByteZero);
            var endS   = KeyConfig.ConcatBytes(oh, KeyConfig.ByteOne);

            var(_, _, oKey) = new KeySegments(_name, c).GetKeys();
            var continuation = KeyConfig.ConcatBytes(oKey, KeyConfig.ByteOne);

            if (KeyConfig.ByteCompare(continuation, startS) < 0)
            {
                throw new InvalidOperationException("Invalid continuation token. Before range");
            }
            else if (KeyConfig.ByteCompare(continuation, endS) > 0)
            {
                return(Enumerable.Empty <Triple>());
            }

            return(new RocksEnumerable(_db, continuation, endS, (Iterator it) => { return it.Next(); }));
        }
Пример #2
0
        public IEnumerable <Triple> O(TripleObject o)
        {
            var oh     = KeySegments.GetNameOKeyObject(_name, o);
            var startS = KeyConfig.ConcatBytes(oh, KeyConfig.ByteZero);
            var endS   = KeyConfig.ConcatBytes(oh, KeyConfig.ByteOne);

            return(new RocksEnumerable(_db, startS, endS, (Iterator it) => { return it.Next(); }));
        }