public MySQLBatchLoader(DataStoreConfig dataStoreConfig, AtomicBoolean stop, DataOutputQueue outputDataQueue, LinkedTransferQueue<ReadBatchRequest> batchReadOperations, String url, String user, String password, String table) { this.url = url; this.user = user; this.password = password; this.table = table; this.batchReadOperations = batchReadOperations; this.stop = stop; this.outputDataQueue = outputDataQueue; try { store = new SimpleStringKeyValueStoreMySQL(url, user, password, table, dataStoreConfig.sqlBatchWrite()); } catch (Exception ex) { store = StringKeyValueStoreNoOp.SINGLETON; if (debug) logger.warn(ex, "Unable to connect to MySQL, DS will not be sending data", ex.getMessage()); logger.error("Unable to connect to MySQL, DS will not be sending data", ex.getMessage()); } }
public MySQLDataStorePutManager(DataOutputQueue outputQueue, DataStoreConfig dataStoreConfig, AtomicBoolean stop, LinkedTransferQueue<Object> storeQueue, String url, String user, String password, String table) { this.outputQueue = outputQueue; this.url = url; this.user = user; this.password = password; this.table = table; this.storeQueue = storeQueue; this.stop = stop; this.dataStoreConfig = dataStoreConfig; try { store = new SimpleStringKeyValueStoreMySQL(url, user, password, table, dataStoreConfig.sqlBatchWrite()); } catch (Exception ex) { store = StringKeyValueStoreNoOp.SINGLETON; if (debug) logger.warn(ex, "Unable to connect to MySQL, DS will not be sending data", ex.getMessage()); logger.error("Unable to connect to MySQL, DS will not be sending data", ex.getMessage()); } }
public MySQLDataStoreLoader(DataStoreConfig dataStoreConfig, DataOutputQueue queueOut, AtomicBoolean stop, LinkedTransferQueue<Map<String, String>> loadedResultsFromDBQueue, LinkedTransferQueue<List<String>> loadQueue, String url, String user, String password, String table) { this.url = url; this.user = user; this.password = password; this.table = table; this.dataStoreConfig = dataStoreConfig; this.stop = stop; this.loadedResultsFromDBQueue = loadedResultsFromDBQueue; this.loadQueue = loadQueue; this.queueOut = queueOut; try { store = new SimpleStringKeyValueStoreMySQL(url, user, password, table, dataStoreConfig.sqlBatchWrite()); } catch (Exception ex) { store = StringKeyValueStoreNoOp.SINGLETON; if (debug) logger.warn(ex, "Unable to connect to MySQL, DS will not be sending data", ex.getMessage()); logger.error("Unable to connect to MySQL, DS will not be sending data", ex.getMessage()); } }
public void init(final DataStoreConfig config, DataOutputQueue queue, DataStore nextReaderDataStore) { super.init(config, queue, nextReaderDataStore); url = config.dbUrl(); user = config.dbUser(); password = config.dbPassword(); table = config.dbTable(); numReaders = config.dbReaderCount(); numWriters = config.dbWriterCount(); maxReadBatch = config.dbMaxReadBatch(); minReadBatch = config.dbMinReadBatch(); maxWriteBatch = config.dbMaxWriteBatch(); sqlBatchWrite = config.sqlBatchWrite(); flushQueueInterval = config.dbReadFlushQueueIntervalMS(); if (debug) { logger.info(config); } initBlackListSet(config); if (this.keyblackList.size() > 0) { this.hasBlackList = true; } }
Action.NONE, "CONFIG sqlBatchWrite", config.sqlBatchWrite());