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); }
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(); } }
public Searcher(Index index) { this.index = index; this.index.Changed += ResetSearcher; this.ResetSearcher(); }
public SchemaManager(Index index) { this.index = index; this.schemaLock = new ReaderWriterLockSlim(); this.cache = new Dictionary<string, Schema>(StringComparer.CurrentCultureIgnoreCase); }
public Schema GetSchema(Index index) { return index.GetSchema(this.Name, this.Version); }
public Database(Index index, Settings settings) { this.index = index; this.settings = settings; }