public void setValues(Statistics readerStatistics, Statistics writerStatistics, boolean isSuccess) { if (readerStatistics != null) { byteCount = readerStatistics.get(DataReaderStatistics.READ_BYTE_COUNT); } if (writerStatistics != null) { filterMillis = writerStatistics.get(DataWriterStatisticConstants.FILTERMILLIS); databaseMillis = writerStatistics.get(DataWriterStatisticConstants.DATABASEMILLIS); statementCount = writerStatistics.get(DataWriterStatisticConstants.STATEMENTCOUNT); fallbackInsertCount = writerStatistics .get(DataWriterStatisticConstants.FALLBACKINSERTCOUNT); fallbackUpdateCount = writerStatistics .get(DataWriterStatisticConstants.FALLBACKUPDATECOUNT); missingDeleteCount = writerStatistics .get(DataWriterStatisticConstants.MISSINGDELETECOUNT); ignoreCount = writerStatistics.get(DataWriterStatisticConstants.IGNORECOUNT); lastUpdatedTime = new Date(); if (!isSuccess) { failedRowNumber = statementCount; failedLineNumber = writerStatistics.get(DataWriterStatisticConstants.LINENUMBER); } } }
public void end(Table table) { if (this.currentDataWriter != null) { this.currentDataWriter.end(table); Statistics stats = this.currentDataWriter.getStatistics().get(batch); this.outgoingBatch.setByteCount(stats.get(DataWriterStatisticConstants.BYTECOUNT)); } }
public void write(CsvData data) { this.outgoingBatch.incrementDataEventCount(); this.outgoingBatch.incrementInsertEventCount(); this.currentDataWriter.write(data); if (this.outgoingBatch.getDataEventCount() >= maxBatchSize && this.batches.size() > 0) { this.currentDataWriter.end(table); this.currentDataWriter.end(batch, false); Statistics stats = this.currentDataWriter.getStatistics().get(batch); this.outgoingBatch.setByteCount(stats.get(DataWriterStatisticConstants.BYTECOUNT)); this.currentDataWriter.close(); startNewBatch(); } }
Statistics stats = dataWriter.getStatistics().values().iterator().next(); statisticManager.incrementDataSent(currentBatch.getChannelId(), stats.get(DataWriterStatisticConstants.STATEMENTCOUNT)); long byteCount = stats.get(DataWriterStatisticConstants.BYTECOUNT); statisticManager.incrementDataBytesSent(currentBatch.getChannelId(), byteCount); } else {
Conflict conflict = writerSettings.pickConflict(writer.getTargetTable(), writer.getBatch()); Statistics statistics = writer.getStatistics().get(writer.getBatch()); long statementCount = statistics.get(DataWriterStatisticConstants.STATEMENTCOUNT); long lineNumber = statistics.get(DataWriterStatisticConstants.LINENUMBER); ResolvedData resolvedData = writerSettings.getResolvedData(statementCount);