/// <summary>
        /// Return the AzureDirectory.
        /// It stores the master index in Blob storage.
        /// Only a master server can write to it.
        /// For each slave server, the blob storage index files are synced to the local machine.
        /// </summary>
        /// <param name="luceneIndexFolder">
        /// The lucene index folder.
        /// </param>
        /// <returns>
        /// The <see cref="Lucene.Net.Store.Directory"/>.
        /// </returns>
        public override Lucene.Net.Store.Directory CreateDirectory(DirectoryInfo luceneIndexFolder)
        {
            var directory = new RemoteSyncDirectory(
                new S3RemoteDirectory(GetStorageCredentials(), GetContainerName(), luceneIndexFolder.Name),
                GetLocalCacheDirectory(luceneIndexFolder));

            directory.SetMergePolicyAction(e => new NoMergePolicy(e));
            directory.SetMergeScheduler(new NoMergeSheduler());
            directory.SetDeletion(new NoDeletionPolicy());
            return(directory);
        }
Example #2
0
        /// <summary>
        /// Return the AzureDirectory.
        /// It stores the master index in Blob storage.
        /// Only a master server can write to it.
        /// For each slave server, the blob storage index files are synced to the local machine.
        /// </summary>
        /// <param name="luceneIndexFolder">
        /// The lucene index folder.
        /// </param>
        /// <returns>
        /// The <see cref="Lucene.Net.Store.Directory"/>.
        /// </returns>
        public override Lucene.Net.Store.Directory CreateDirectory(DirectoryInfo luceneIndexFolder)
        {
            var directory = new RemoteSyncDirectory(
                new AzureRemoteDirectory(GetStorageAccountConnectionString(), GetContainerName(),
                                         luceneIndexFolder.Name, _loggingService),
                GetLocalCacheDirectory(luceneIndexFolder), _loggingService);

            directory.SetMergePolicyAction(e => new NoMergePolicy(e));
            directory.SetMergeScheduler(new NoMergeSheduler());
            directory.SetDeletion(new NoDeletionPolicy());
            return(directory);
        }