public override bool OnStart() { // Not sure what this should be. Hopefully storage over smb doesn't open a million connections ServicePointManager.DefaultConnectionLimit = 12; var settings = CassandraServiceSettings.FromStorage(storage); service = CassandraService.FromSettings(settings); bool result = base.OnStart(); Trace.TraceInformation("CassandraRole has been started"); return result; }
public static CassandraService FromSettings(ICassandraServiceSettings settings) { var service = new CassandraService() { _Settings = settings, _JavaManager = new JavaManager(settings) }; string dataPath; //Use local storage for emulator and if (!settings.IsEmulated && settings.UseCassandraLocalDataFolder.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._CassandraManager = new CassandraManager(settings, dataPath); if (!string.IsNullOrWhiteSpace(settings.CassandraLibContainer)) { service._CassandraManager.AddPluginSource(settings.CassandraLibContainer, settings.StorageAccount); } return service; }