示例#1
0
 public void hashCodeComparerStringTest()
 {
   Oid id;
   using (SessionNoServer session = new SessionNoServer(systemDir))
   {
     Placement place = new Placement(223, 1, 1, UInt16.MaxValue, UInt16.MaxValue);
     session.Compact();
     session.BeginUpdate();
     HashCodeComparer<string> hashCodeComparer = new HashCodeComparer<string>();
     BTreeSet<string> bTree = new BTreeSet<string>(hashCodeComparer, session);
     bTree.Persist(place, session);
     id = bTree.Oid;
     for (int i = 0; i < 100000; i++)
     {
       bTree.Add(i.ToString());
     }
     session.Commit();
   }
   using (SessionNoServer session = new SessionNoServer(systemDir))
   {
     session.BeginRead();
     BTreeSet<string> bTree= (BTreeSet<string>)session.Open(id);
     int count = 0;
     foreach (string str in bTree)
     {
       count++;
     }
     Assert.True(100000 == count);
     session.Commit();
   }
 }
示例#2
0
        public void hashCodeComparerStringTest()
        {
            Oid id;

            using (SessionNoServer session = new SessionNoServer(systemDir))
            {
                Placement place = new Placement(223, 1, 1, UInt16.MaxValue, UInt16.MaxValue);
                session.Compact();
                session.BeginUpdate();
                HashCodeComparer <string> hashCodeComparer = new HashCodeComparer <string>();
                BTreeSet <string>         bTree            = new BTreeSet <string>(hashCodeComparer, session);
                bTree.Persist(place, session);
                id = bTree.Oid;
                for (int i = 0; i < 100000; i++)
                {
                    bTree.Add(i.ToString());
                }
                session.Commit();
            }
            using (SessionNoServer session = new SessionNoServer(systemDir))
            {
                session.BeginRead();
                BTreeSet <string> bTree = (BTreeSet <string>)session.Open(id);
                int count = 0;
                foreach (string str in bTree)
                {
                    count++;
                }
                Assert.True(100000 == count);
                session.Commit();
            }
        }
示例#3
0
 public Lexicon(SessionBase session, HashCodeComparer <TokenType <T> > hashCodeComparer)
 {
     _valueToId = new BTreeMap <T, UInt32>(null, session);
     _IdToValue = new BTreeMap <UInt32, T>(null, session);
     _nextId    = 0;
     _tokenMap  = new BTreeMap <UInt32, BTreeSet <StoreBase> >(null, session);
 }
示例#4
0
    public Document(UInt64 id): base(id) {} // for lookups

    public Document(string url, IndexRoot indexRoot, SessionBase session)
    {
      this.url = url;
      HashCodeComparer<Word> hashCodeComparer = new HashCodeComparer<Word>();
      m_wordHit = new BTreeMapOidShort<Word, WordHit>(null, session);
      m_wordHit.TransientBatchSize = 10000;
      wordSet = new BTreeSetOidShort<Word>(hashCodeComparer, session, 1500, sizeof(int));
    }
示例#5
0
        //public BTreeMap<Word, UInt32> globalWordCount;

        public IndexRoot(ushort nodeSize, SessionBase session)
        {
            hashCodeComparer = new HashCodeComparer <Word>();
            lexicon          = new Lexicon(nodeSize, hashCodeComparer, session);
            lexicon.Persist(session, lexicon);
            repository = new Repository(nodeSize, session);
            repository.Persist(session, repository, true);
            //globalWordCount = new BTreeMap<Word, uint>(null, session);
        }
示例#6
0
    //public BTreeMap<Word, UInt32> globalWordCount;

    public IndexRoot(ushort nodeSize, SessionBase session)
    {
      hashCodeComparer = new HashCodeComparer<Word>();
      lexicon = new Lexicon(nodeSize, hashCodeComparer, session);
      lexicon.Persist(session, lexicon);
      repository = new Repository(nodeSize, session);
      repository.Persist(session, repository, true);
      //globalWordCount = new BTreeMap<Word, uint>(null, session);
    }
示例#7
0
        }                                   // for lookups

        public Document(string url, IndexRoot indexRoot, SessionBase session)
        {
            this.url = url;
            HashCodeComparer <Word> hashCodeComparer = new HashCodeComparer <Word>();

            m_wordHit = new BTreeMapOidShort <Word, WordHit>(null, session);
            m_wordHit.TransientBatchSize = 10000;
            wordSet = new BTreeSetOidShort <Word>(hashCodeComparer, session, 1500, sizeof(int));
        }
示例#8
0
 public InvertedIndex(SessionBase session, HashCodeComparer <TokenType <string> > hashCodeComparer)
 {
     m_stringLexicon = new Lexicon <string>(session, hashCodeComparer);
     session.Persist(m_stringLexicon);
 }
示例#9
0
 public Lexicon(ushort nodeSize, HashCodeComparer <Word> hashComparer, SessionBase session)
 {
     wordSet = new BTreeSetOidShort <Word>(hashComparer, session, nodeSize, sizeof(int));
 }
示例#10
0
 public Lexicon(ushort nodeSize, HashCodeComparer<Word> hashComparer, SessionBase session)
 {
   wordSet = new BTreeSetOidShort<Word>(hashComparer, session, nodeSize, sizeof(int));
 }