Exemple #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();
   }
 }
Exemple #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();
            }
        }
Exemple #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);
 }
Exemple #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));
    }
Exemple #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);
        }
Exemple #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);
    }
Exemple #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));
        }
 public InvertedIndex(SessionBase session, HashCodeComparer <TokenType <string> > hashCodeComparer)
 {
     m_stringLexicon = new Lexicon <string>(session, hashCodeComparer);
     session.Persist(m_stringLexicon);
 }
Exemple #9
0
 public Lexicon(ushort nodeSize, HashCodeComparer <Word> hashComparer, SessionBase session)
 {
     wordSet = new BTreeSetOidShort <Word>(hashComparer, session, nodeSize, sizeof(int));
 }
Exemple #10
0
 public Lexicon(ushort nodeSize, HashCodeComparer<Word> hashComparer, SessionBase session)
 {
   wordSet = new BTreeSetOidShort<Word>(hashComparer, session, nodeSize, sizeof(int));
 }