Exemple #1
0
 public SoftwareManager(IElasticsearchServiceSettings settings, string installer)
 {
     _Settings      = settings;
     _archiveRoot   = _Settings.DownloadDirectory;
     _logRoot       = _Settings.LogDirectory;
     _binaryArchive = Path.Combine(settings.DownloadDirectory, installer);
 }
 public SoftwareManager(IElasticsearchServiceSettings settings, string installer)
 {
     _Settings = settings;
     _archiveRoot = _Settings.DownloadDirectory;
     _logRoot = _Settings.LogDirectory;
     _binaryArchive = Path.Combine(settings.DownloadDirectory, installer);
 }
 public JavaManager(IElasticsearchServiceSettings settings)
     : base(settings, settings.JavaInstaller)
 {
     if (!string.IsNullOrWhiteSpace(settings.JavaDownloadType) && settings.JavaDownloadType == "storage")
     {
         _installer = new StorageArtifact(settings.JavaDownloadURL, settings.JavaInstaller, settings.StorageAccount);
     }
     else
     {
         _installer = new WebArtifact(settings.JavaDownloadURL, settings.JavaInstaller);
     }
 }
 public JavaManager(IElasticsearchServiceSettings settings )
     : base(settings,settings.JavaInstaller)
 {
     if (!string.IsNullOrWhiteSpace(settings.JavaDownloadType) && settings.JavaDownloadType == "storage")
     {
         _installer = new StorageArtifact(settings.JavaDownloadURL, settings.JavaInstaller, settings.StorageAccount);
     }
     else
     {
         _installer = new WebArtifact(settings.JavaDownloadURL, settings.JavaInstaller);
     }
 }
Exemple #5
0
        public static ElasticsearchService FromSettings(IElasticsearchServiceSettings settings)
        {
            var service = new ElasticsearchService()
            {
                _Settings         = settings,
                _Bridge           = new TcpRuntimeBridge(settings.EndpointName),
                _JavaManager      = new JavaManager(settings),
                _BootstrapService = new DataBootstrapService(settings)
            };

            string dataPath;

            //Use local storage for emulator and
            if (!settings.IsEmulated && settings.UseElasticLocalDataFolder.ToLower() != "true")
            {
                // Mount a drive for a CloudFileShare.
                Trace.WriteLine("Configuring file Share");
                var share = settings.StorageAccount.CreateCloudFileClient()
                            .GetShareReference(settings.DataShareName);
                share.CreateIfNotExists();

                Trace.WriteLine("Mapping Share to " + settings.DataShareDrive);
                share.Mount(settings.DataShareDrive);
                dataPath = settings.DataShareDrive;
            }
            else
            {
                dataPath = settings.DataDirectory;
            }

            service._ElasticsearchManager = new ElasticsearchManager(settings, dataPath, service._Bridge.Port);

            if (!string.IsNullOrWhiteSpace(settings.ElasticsearchPluginContainer))
            {
                service._ElasticsearchManager.AddPluginSource(settings.ElasticsearchPluginContainer, settings.StorageAccount);
            }


            return(service);
        }
        public static ElasticsearchService FromSettings(IElasticsearchServiceSettings settings)
        {
            var service = new ElasticsearchService()
            {
                _Settings = settings,
                _Bridge = new PipesRuntimeBridge(settings.EndpointName),
                _JavaManager = new JavaManager(settings),
                _BootstrapService = new DataBootstrapService(settings)
            };

            string dataPath;
            //Use local storage for emulator and
            if (!settings.IsEmulated && settings.UseElasticLocalDataFolder.ToLower() != "true")
            {
                // Mount a drive for a CloudFileShare.
                Trace.WriteLine("Configuring file Share");
                var share = settings.StorageAccount.CreateCloudFileClient()
                    .GetShareReference(settings.DataShareName);
                share.CreateIfNotExists();

                Trace.WriteLine("Mapping Share to " + settings.DataShareDrive);
                share.Mount(settings.DataShareDrive);
                dataPath = settings.DataShareDrive;

            }
            else
            {
                dataPath = settings.DataDirectory;
            }

            service._ElasticsearchManager = new ElasticsearchManager(settings, dataPath, service._Bridge.PipeName);

            if (!string.IsNullOrWhiteSpace(settings.ElasticsearchPluginContainer))
            {
                service._ElasticsearchManager.AddPluginSource(settings.ElasticsearchPluginContainer, settings.StorageAccount);
            }

            return service;
        }
        public ElasticsearchManager(IElasticsearchServiceSettings settings, string dataPath, string bridgeName)
            : base(settings, settings.ElasticsearchInstaller)
        {
            _InstallRoot    = settings.ElasticsearchDirectory;
            _DataPath       = dataPath;
            _BridgePipeName = bridgeName;

            //Maybe there is a less noisy way to do this?
            if (!string.IsNullOrWhiteSpace(settings.ElasticsearchDownloadType) && settings.ElasticsearchDownloadType == "storage")
            {
                _installer = new StorageArtifact(settings.ElasticsearchDownloadURL, settings.ElasticsearchInstaller, settings.StorageAccount);
            }
            else
            {
                _installer = new WebArtifact(settings.ElasticsearchDownloadURL, settings.ElasticsearchInstaller);
            }

            _PackagePluginPath     = Path.Combine(settings.RootDirectory, "plugins");
            _TemplateConfigFile    = Path.Combine(settings.RootDirectory, "config", ELASTICSEARCH_CONFIG_FILE);
            _TemplateLogConfigFile = Path.Combine(settings.RootDirectory, "config", ELASTICSEARCH_LOG_CONFIG_FILE);

            _ElasticRoot = Path.Combine(_InstallRoot, Path.GetFileNameWithoutExtension(_installer.Name));
            _PluginRoot  = Path.Combine(_ElasticRoot, ELASTICSEARCH_PLUGIN_DIR);
        }
        public ElasticsearchManager(IElasticsearchServiceSettings settings, string dataPath, string bridgeName)
            : base(settings,settings.ElasticsearchInstaller)
        {
            _InstallRoot = settings.ElasticsearchDirectory;
            _DataPath = dataPath;
            _BridgePipeName = bridgeName;

            //Maybe there is a less noisy way to do this?
            if (!string.IsNullOrWhiteSpace(settings.ElasticsearchDownloadType) && settings.ElasticsearchDownloadType == "storage")
            {
                _installer = new StorageArtifact(settings.ElasticsearchDownloadURL, settings.ElasticsearchInstaller, settings.StorageAccount);
            }
            else
            {
                _installer = new WebArtifact(settings.ElasticsearchDownloadURL, settings.ElasticsearchInstaller);
            }

            _PackagePluginPath = Path.Combine(settings.RootDirectory,"plugins");
            _TemplateConfigFile = Path.Combine(settings.RootDirectory,"config",ELASTICSEARCH_CONFIG_FILE);
            _TemplateLogConfigFile = Path.Combine(settings.RootDirectory, "config", ELASTICSEARCH_LOG_CONFIG_FILE);

            _ElasticRoot = Path.Combine(_InstallRoot, Path.GetFileNameWithoutExtension(_installer.Name));
            _PluginRoot = Path.Combine(_ElasticRoot, ELASTICSEARCH_PLUGIN_DIR);
        }
Exemple #9
0
 public DataBootstrapService(IElasticsearchServiceSettings settings)
 {
     _Settings           = settings;
     _InitTimer.Elapsed += _InitTimer_Elapsed;
 }
 public DataBootstrapService(IElasticsearchServiceSettings settings)
 {
     _Settings = settings;
     _InitTimer.Elapsed += _InitTimer_Elapsed;
 }