Example #1
0
 public Writer(Index index)
 {
     this.index = index;
     pool = new MiscUtil.Threading.CustomThreadPool(index.Path);
     pool.SetMinMaxThreads(0, 5);
     pool.IdlePeriod = 10;
     pool.WorkerThreadPriority = ThreadPriority.BelowNormal;
     pool.WorkerThreadsAreBackground = false;
     pool.BeforeWorkItem += new BeforeWorkItemHandler(pool_BeforeWorkItem);
     pool.AfterWorkItem += new AfterWorkItemHandler(pool_AfterWorkItem);
     pool.WorkerException += new ThreadPoolExceptionHandler(pool_WorkerException);
 }
Example #2
0
 static Index Create(string path)
 {
     indexCollectionLock.EnterWriteLock();
     try
     {
         if (indexes.ContainsKey(path))
         {
             return indexes[path];
         }
         else
         {
             var index = new Index(path);
             indexes.Add(path, index);
             return index;
         }
     }
     finally
     {
         indexCollectionLock.ExitWriteLock();
     }
 }
Example #3
0
 public Searcher(Index index)
 {
     this.index = index;
     this.index.Changed += ResetSearcher;
     this.ResetSearcher();
 }
Example #4
0
 public SchemaManager(Index index)
 {
     this.index = index;
     this.schemaLock = new ReaderWriterLockSlim();
     this.cache = new Dictionary<string, Schema>(StringComparer.CurrentCultureIgnoreCase);
 }
Example #5
0
 public Schema GetSchema(Index index)
 {
     return index.GetSchema(this.Name, this.Version);
 }
Example #6
0
 public Database(Index index, Settings settings)
 {
     this.index = index;
     this.settings = settings;
 }