Exemplo n.º 1
0
        /// <summary>
        /// Initializes the indexing feature: starts the IndexingEngine, CommitManager and indexing activity organizer.
        /// If "consoleOut" is not null, writes progress and debug messages into it.
        /// </summary>
        /// <param name="consoleOut">A <see cref="TextWriter"/> instance or null.</param>
        /// <param name="cancellationToken">The token to monitor for cancellation requests. The default value is None.</param>
        /// <returns>A Task that represents the asynchronous operation.</returns>
        public static async STT.Task StartAsync(TextWriter consoleOut, CancellationToken cancellationToken)
        {
            await IndexingEngine.StartAsync(consoleOut, cancellationToken).ConfigureAwait(false);

            CommitManager = IndexingEngine.IndexIsCentralized
                ? (ICommitManager) new NoDelayCommitManager()
                : new NearRealTimeCommitManager();

            SnTrace.Index.Write("LM: {0} created.", CommitManager.GetType().Name);

            CommitManager.Start();

            if (IndexingEngine.IndexIsCentralized)
            {
                CentralizedIndexingActivityQueue.Startup(consoleOut);
            }
            else
            {
                DistributedIndexingActivityQueue.Startup(consoleOut);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Initializes the indexing feature: starts the IndexingEngine, CommitManager and indexing activity organizator.
        /// If "consoleOut" is not null, writes progress and debug messages into it.
        /// </summary>
        /// <param name="consoleOut">A <see cref="TextWriter"/> instance or null.</param>
        public static void Start(TextWriter consoleOut)
        {
            IndexingEngine.Start(consoleOut);

            CommitManager = IndexingEngine.IndexIsCentralized
                ? (ICommitManager) new NoDelayCommitManager()
                : new NearRealTimeCommitManager();

            SnTrace.Index.Write("LM: {0} created.", CommitManager.GetType().Name);

            CommitManager.Start();

            if (IndexingEngine.IndexIsCentralized)
            {
                CentralizedIndexingActivityQueue.Startup(consoleOut);
            }
            else
            {
                DistributedIndexingActivityQueue.Startup(consoleOut);
            }
        }