Esempio n. 1
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);
        }
Esempio n. 2
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);
        }
Esempio n. 3
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);
        }
Esempio n. 4
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);
        }