コード例 #1
0
        public IEnumerable <Triple> SP(string s, string p)
        {
            var sh     = KeySegments.GetNameSKeySubjectPredicate(_name, s, p);
            var startS = KeyConfig.ConcatBytes(sh, KeyConfig.ByteZero);
            var endS   = KeyConfig.ConcatBytes(sh, KeyConfig.ByteOne);

            return(new RocksEnumerable(_db, startS, endS, (Iterator it) => { return it.Next(); }));
        }
コード例 #2
0
        public IEnumerable <Triple> SP(string s, string p, Triple c)
        {
            var sh     = KeySegments.GetNameSKeySubjectPredicate(_name, s, p);
            var startS = KeyConfig.ConcatBytes(sh, KeyConfig.ByteZero);
            var endS   = KeyConfig.ConcatBytes(sh, KeyConfig.ByteOne);

            // todo: optimize
            var(sKey, _, _) = new KeySegments(_name, c).GetKeys();
            var continuation = KeyConfig.ConcatBytes(sKey, 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(); }));
        }