Ejemplo n.º 1
0
 public async Task Init()
 {
     this.remTableManager = await RemindersTableManager.GetManager(
         this.clusterOptions.ServiceId,
         this.clusterOptions.ClusterId,
         this.loggerFactory,
         options : this.storageOptions);
 }
Ejemplo n.º 2
0
        public static async Task <AzureBasedReminderTable> GetAzureBasedReminderTable(Guid serviceId, string deploymentId, string connectionString)
        {
            var table = new AzureBasedReminderTable();

            table.remTableManager = await RemindersTableManager.GetManager(serviceId, deploymentId, connectionString);

            return(table);
        }
Ejemplo n.º 3
0
        public static async Task <RemindersTableManager> GetManager(string serviceId, string clusterId, ILoggerFactory loggerFactory, AzureStorageOperationOptions options)
        {
            var singleton = new RemindersTableManager(serviceId, clusterId, options, loggerFactory);

            try
            {
                singleton.Logger.LogInformation("Creating RemindersTableManager for service id {ServiceId} and clusterId {ClusterId}.", serviceId, clusterId);
                await singleton.InitTableAsync();
            }
            catch (Exception ex)
            {
                singleton.Logger.LogError((int)AzureReminderErrorCode.AzureTable_39, ex, "Exception trying to create or connect to the Azure table");
                throw new OrleansException("Exception trying to create or connect to the Azure table", ex);
            }
            return(singleton);
        }
Ejemplo n.º 4
0
        public static async Task <RemindersTableManager> GetManager(string serviceId, string clusterId, ILoggerFactory loggerFactory, AzureStorageOperationOptions options)
        {
            var singleton = new RemindersTableManager(serviceId, clusterId, options.ConnectionString, options.TableName, loggerFactory, options.StoragePolicyOptions);

            try
            {
                singleton.Logger.Info("Creating RemindersTableManager for service id {0} and clusterId {1}.", serviceId, clusterId);
                await singleton.InitTableAsync();
            }
            catch (Exception ex)
            {
                string errorMsg = $"Exception trying to create or connect to the Azure table: {ex.Message}";
                singleton.Logger.Error((int)AzureReminderErrorCode.AzureTable_39, errorMsg, ex);
                throw new OrleansException(errorMsg, ex);
            }
            return(singleton);
        }
Ejemplo n.º 5
0
        public static async Task <RemindersTableManager> GetManager(Guid serviceId, string deploymentId, string storageConnectionString)
        {
            var singleton = new RemindersTableManager(serviceId, deploymentId, storageConnectionString);

            try
            {
                singleton.Logger.Info("Creating RemindersTableManager for service id {0} and deploymentId {1}.", serviceId, deploymentId);
                await singleton.InitTableAsync().WithTimeout(initTimeout);
            }
            catch (TimeoutException)
            {
                singleton.Logger.Fail(ErrorCode.AzureTable_38, String.Format("Unable to create or connect to the Azure table in {0}", initTimeout));
            }
            catch (Exception ex)
            {
                singleton.Logger.Fail(ErrorCode.AzureTable_39, String.Format("Exception trying to create or connect to the Azure table: {0}", ex));
            }
            return(singleton);
        }
Ejemplo n.º 6
0
        public static async Task <RemindersTableManager> GetManager(Guid serviceId, string deploymentId, string storageConnectionString, ILoggerFactory loggerFactory)
        {
            var singleton = new RemindersTableManager(serviceId, deploymentId, storageConnectionString, loggerFactory);

            try
            {
                singleton.Logger.Info("Creating RemindersTableManager for service id {0} and deploymentId {1}.", serviceId, deploymentId);
                await singleton.InitTableAsync()
                .WithTimeout(initTimeout);
            }
            catch (TimeoutException te)
            {
                string errorMsg = $"Unable to create or connect to the Azure table in {initTimeout}";
                singleton.Logger.Error((int)AzureUtils.Utilities.ErrorCode.AzureTable_38, errorMsg, te);
                throw new OrleansException(errorMsg, te);
            }
            catch (Exception ex)
            {
                string errorMsg = $"Exception trying to create or connect to the Azure table: {ex.Message}";
                singleton.Logger.Error((int)AzureUtils.Utilities.ErrorCode.AzureTable_39, errorMsg, ex);
                throw new OrleansException(errorMsg, ex);
            }
            return(singleton);
        }
Ejemplo n.º 7
0
 public async Task Init(GlobalConfiguration config)
 {
     remTableManager = await RemindersTableManager.GetManager(config.ServiceId, config.ClusterId, config.DataConnectionStringForReminders, this.loggerFactory);
 }
Ejemplo n.º 8
0
 public async Task Init(GlobalConfiguration config, TraceLogger logger)
 {
     this.logger     = logger;
     remTableManager = await RemindersTableManager.GetManager(config.ServiceId, config.DeploymentId, config.DataConnectionStringForReminders);
 }
Ejemplo n.º 9
0
 public async Task Init()
 {
     this.remTableManager = await RemindersTableManager.GetManager(this.siloOptions.ServiceId, this.siloOptions.ClusterId, this.storageOptions.DataConnectionStringForReminders, this.loggerFactory);
 }
Ejemplo n.º 10
0
 public async Task Init()
 {
     this.remTableManager = await RemindersTableManager.GetManager(
         this.clusterOptions.ServiceId, this.clusterOptions.ClusterId, this.storageOptions.ConnectionString, this.storageOptions.TableName, this.loggerFactory);
 }
Ejemplo n.º 11
0
 public async Task Init(Guid serviceId, string deploymentId, string connectionString)
 {
     remTableManager = await RemindersTableManager.GetManager(serviceId, deploymentId, connectionString);
 }