Beispiel #1
0
        public IEnumerable <Triple> OS(TripleObject o, string s)
        {
            var oh     = KeySegments.GetNameOKeyObjectSubject(_name, o, s);
            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(); }));
        }
Beispiel #2
0
        public IEnumerable <Triple> OS(TripleObject o, string s, Triple c)
        {
            if (c == null)
            {
                return(OS(o, s));
            }
            var oh     = KeySegments.GetNameOKeyObjectSubject(_name, o, s);
            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(); }));
        }