コード例 #1
0
        public BaseSqlJobQueuePurger(IJobQueueDataConnectionFactory jobQueueConnectionFactory,
                                     ISqlDbJobQueueTableConfiguration tableConfig)
        {
            _jobQueueConnectionFactory = jobQueueConnectionFactory;

            _mappingSchema = Mapping.BuildMappingSchema(tableConfig);
        }
コード例 #2
0
 public QueueNameBasedJobAdderQueueTableResolver(
     Dictionary <string, ISqlDbJobQueueTableConfiguration> queueTableConfigurations,
     ISqlDbJobQueueTableConfiguration defaultTableConfiguration)
 {
     _queueTableMappings        = queueTableConfigurations;
     _defaultTableConfiguration = defaultTableConfiguration;
 }
コード例 #3
0
        public static string SuggestedIndexes(ISqlDbJobQueueTableConfiguration config)
        {
            return(string.Format(@"
create index {2}_jobguid_idx on {2}(JobGuid);
create index {1}_jobguid_idx on {1}(JobGuid);
create unique  index {0}_jobguid_idx on {0}(JobGuid);
", config.QueueTableName, config.ParamTableName, config.JobMethodGenericParamTableName));
        }
コード例 #4
0
        public BaseSqlJobQueueManager(IJobQueueDataConnectionFactory jobQueueConnectionFactory,
                                      ISqlDbJobQueueTableConfiguration jobQueueTableConfiguration, IJobTypeResolver typeResolver)
        {
            _jobQueueConnectionFactory = jobQueueConnectionFactory;

            _jobQueueTableConfiguration = jobQueueTableConfiguration;
            _typeResolver = typeResolver;

            _mappingSchema = MappingSchema.Default.GetFluentMappingBuilder();
        }
コード例 #5
0
        public static string JobQueueJobMethodGenericParamTableCreateScript(ISqlDbJobQueueTableConfiguration config)
        {
            return(string.Format(@"
create table {0}
(
Id INTEGER primary key,
JobGuid UniqueIdentifier not null,
ParamOrder int not null,
ParamTypeName text not null
)", config.JobMethodGenericParamTableName));
        }
コード例 #6
0
        public static string JobQueueJobMethodGenericParamTableCreateScript(ISqlDbJobQueueTableConfiguration config)
        {
            return(string.Format(@"
create table {0}
(
Id bigint not null identity(1,1) primary key,
JobGuid UniqueIdentifier not null,
ParamOrder int not null,
ParamTypeName nvarchar(255) not null,
)", config.JobMethodGenericParamTableName));
        }
コード例 #7
0
        public static string JobQueueParamTableCreateScript(ISqlDbJobQueueTableConfiguration config)
        {
            return(string.Format(@"
Create table {0}
(
Id INTEGER PRIMARY KEY,
JobGuid uniqueidentifier not null, 
ParamOrdinal int not null,
SerializedValue text null,
SerializedType nvarchar(255) null,
ParameterName nvarchar(255) null
)", config.ParamTableName));
        }
コード例 #8
0
        public static string JobQueueParamTableCreateScript(ISqlDbJobQueueTableConfiguration config)
        {
            return(string.Format(@"
Create table {0}
(
Id bigint not null identity(1,1) primary key,
JobGuid uniqueidentifier not null, 
ParamOrdinal int not null,
SerializedValue nvarchar(max) null,
SerializedType nvarchar(255) null,
ParameterName nvarchar(255) null
)", config.ParamTableName));
        }
コード例 #9
0
        public static string JobTableCreateScript(ISqlDbJobQueueTableConfiguration configuration)
        {
            return(string.Format(@"

create Table {0}
(
Id INTEGER PRIMARY KEY,
QueueName NVarchar(255) not null,
TypeExecutedOn NVarChar(255) not null,
MethodName NVarChar(255) not null,
DoNotExecuteBefore datetime null,
JobGuid uniqueidentifier not null,
Status NVarChar(32) not null,
MaxRetries int,
MinRetryWait int,
RetryCount int,
LockClaimTime datetime null,
LockGuid uniqueidentifier null,
LastAttempt datetime null,
CreatedDate datetime not null)
", configuration.QueueTableName));
        }
コード例 #10
0
        public static FluentMappingBuilder BuildMappingSchema(ISqlDbJobQueueTableConfiguration _jobQueueTableConfiguration)
        {
            var mapper = new LinqToDB.Mapping.FluentMappingBuilder(MappingSchema.Default);

            mapper.Entity <SqlCommonDbOddJobMetaData>().HasAttribute(
                new TableAttribute(_jobQueueTableConfiguration.QueueTableName)
            {
                IsColumnAttributeRequired = false, Name = _jobQueueTableConfiguration.QueueTableName
            });
            mapper.Entity <SqlCommonOddJobParamMetaData>().HasAttribute(
                new TableAttribute(_jobQueueTableConfiguration.ParamTableName)
            {
                IsColumnAttributeRequired = false, Name = _jobQueueTableConfiguration.ParamTableName
            });
            mapper.Entity <SqlDbOddJobMethodGenericInfo>().HasAttribute(
                new TableAttribute(_jobQueueTableConfiguration.JobMethodGenericParamTableName)
            {
                IsColumnAttributeRequired = false,
                Name = _jobQueueTableConfiguration.JobMethodGenericParamTableName
            });

            return(mapper);
        }
コード例 #11
0
 public DefaultJobAdderQueueTableResolver(ISqlDbJobQueueTableConfiguration tableConfiguration) : base(
         new Dictionary <string, ISqlDbJobQueueTableConfiguration>(), tableConfiguration)
 {
 }
コード例 #12
0
 public SQLiteJobQueueManager(SQLiteJobQueueDataConnectionFactory jobQueueDataConnectionFactory,
                              ISqlDbJobQueueTableConfiguration tableConfiguration, IJobTypeResolver typeResolver) : base(
         jobQueueDataConnectionFactory, tableConfiguration, typeResolver)
 {
 }
コード例 #13
0
 public SqlServerJobQueueManager(SqlServerDataConnectionFactory jobQueueConnectionFactory,
                                 ISqlDbJobQueueTableConfiguration tableConfig, IJobTypeResolver typeResolver) : base(jobQueueConnectionFactory,
                                                                                                                     tableConfig, typeResolver)
 {
 }