public override IPersister <T> BuildPersister() { int poolSize = GlobalPluginArgumentHelper.GetPersisterPoolSize(pluginRequest); int batchSize = GlobalPluginArgumentHelper.GetPersisterBatchSize(pluginRequest); return(new ConcurrentBatchPersister <T>(dbConnectionFactory, poolSize, batchSize, persistedRecordJournal)); }
public ConcurrentCustomPersister(IPluginRequest pluginRequest, IDbConnectionFactory connectionFactory, InsertionMethod customInsertionMethod, IDictionary <Type, long> recordsPersisted = null) : base(recordsPersisted) { int poolSize = GlobalPluginArgumentHelper.GetPersisterPoolSize(pluginRequest); while (insertionThreadPool.Count < poolSize) { insertionThreadPool.Add(new CustomInsertionThread <T>(pluginRequest, connectionFactory.OpenDbConnection(), customInsertionMethod)); } }
protected ConcurrentCustomPersister <T> GetConcurrentCustomPersister <T>(ConcurrentCustomPersister <T> .InsertionMethod insertionMethod, IPluginRequest request = null) where T : new() { if (request == null) { return(new ConcurrentCustomPersister <T>(OutputDatabaseConnectionFactory, insertionMethod, recordsPersisted: RecordsPersisted)); } else { int poolSize = GlobalPluginArgumentHelper.GetPersisterPoolSize(request); return(new ConcurrentCustomPersister <T>(OutputDatabaseConnectionFactory, insertionMethod, poolSize, RecordsPersisted)); } }
protected ConcurrentBatchPersister <T> GetConcurrentBatchPersister <T>(IPluginRequest request = null) where T : new() { if (request == null) { return(new ConcurrentBatchPersister <T>(OutputDatabaseConnectionFactory, recordsPersisted: RecordsPersisted)); } else { int poolSize = GlobalPluginArgumentHelper.GetPersisterPoolSize(request); int batchSize = GlobalPluginArgumentHelper.GetPersisterBatchSize(request); return(new ConcurrentBatchPersister <T>(OutputDatabaseConnectionFactory, poolSize, batchSize, RecordsPersisted)); } }