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(); } }
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(); } }
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); }
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)); }
//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); }
//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); }
} // 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); }
public Lexicon(ushort nodeSize, HashCodeComparer <Word> hashComparer, SessionBase session) { wordSet = new BTreeSetOidShort <Word>(hashComparer, session, nodeSize, sizeof(int)); }
public Lexicon(ushort nodeSize, HashCodeComparer<Word> hashComparer, SessionBase session) { wordSet = new BTreeSetOidShort<Word>(hashComparer, session, nodeSize, sizeof(int)); }