Example #1
0
        public VectorNode CloneIndex(ulong keyHash)
        {
            long keyId;

            if (!SessionFactory.TryGetKeyId(keyHash, out keyId))
            {
                return(null);
            }

            VectorNode dirty;

            if (_dirty.TryGetValue(keyId, out dirty))
            {
                return(dirty);
            }

            var ixFileName  = Path.Combine(SessionFactory.Dir, string.Format("{0}.{1}.ix", CollectionId, keyId));
            var vecFileName = Path.Combine(SessionFactory.Dir, string.Format("{0}.vec", CollectionId));

            return(SessionFactory.DeserializeIndex(ixFileName, vecFileName));
        }