Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Batch execution time. #811

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ private boolean executePreparedStatement(String insertQuery, String topicName,
BlockMetaData bmd, ClickHouseSinkConnectorConfig config,
ClickHouseConnection conn, String tableName, Map<String, String> columnToDataTypeMap,
DBMetadata.TABLE_ENGINE engine) throws RuntimeException {

long batchStartTime = System.currentTimeMillis();
AtomicBoolean result = new AtomicBoolean(false);
long maxRecordsInBatch = config.getLong(ClickHouseSinkConnectorConfigVariables.BUFFER_MAX_RECORDS.toString());
List<ClickHouseStruct> failedRecords = new ArrayList<>();
Expand Down Expand Up @@ -158,13 +158,13 @@ private boolean executePreparedStatement(String insertQuery, String topicName,

// ToDo: should we check for EXECUTE_FAILED
int[] batchResult = ps.executeBatch();

long batchExecutionTime = System.currentTimeMillis() - batchStartTime;
long taskId = config.getLong(ClickHouseSinkConnectorConfigVariables.TASK_ID.toString());
log.info("*************** EXECUTED BATCH Successfully " + "Records: " + batch.size() + "************** " +
"task(" + taskId + ")" + " Thread ID: " +
Thread.currentThread().getName() + " Result: " +
batchResult.toString() + " Database: "
+ databaseName + " Table: " + tableName);
+ databaseName + " Table: " + tableName + " Time: " + batchExecutionTime + " ms");
result.set(true);


Expand Down
Loading