Skip to content

Commit

Permalink
fix: have a constant delay for schema checker. (#32)
Browse files Browse the repository at this point in the history
* bug: recreate connection when idle

* chore: cleanup

* chore: checkstyle

* chore: logging

* chore: typo in method name

* chore: version bump

* fixes: call fetch schema before conversion

* fix: check streamwriter new schema before convert

* refactor: only keep the lock while refreshing

* test: fix test

* fix: adding 60 second refresh even if no incoming traffic

* chore: fix name
  • Loading branch information
lavkesh authored Sep 28, 2023
1 parent 1b7ab60 commit 7f23e57
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@

public class BigQueryProtoStorageClient implements BigQueryStorageClient {

private static final long MESSAGE_PARSER_CHECKER_DELAY_MILLIS = 1000;
private static final long MESSAGE_PARSER_CHECKER_DELAY_SECONDS = 1;
private static final long MESSAGE_PARSER_CHECKER_FREQUENCY_SECONDS = 60;
private final BigQueryProtoWriter writer;
private final BigQuerySinkConfig config;
private final MessageParser parser;
Expand All @@ -50,9 +51,9 @@ public BigQueryProtoStorageClient(BigQueryWriter writer, BigQuerySinkConfig conf
? config.getSinkConnectorSchemaProtoMessageClass() : config.getSinkConnectorSchemaProtoKeyClass();
this.messageParserChecker.scheduleWithFixedDelay(
() -> parser.refresh(schemaClass),
MESSAGE_PARSER_CHECKER_DELAY_MILLIS,
config.getSchemaRegistryStencilCacheTtlMs(),
TimeUnit.MILLISECONDS);
MESSAGE_PARSER_CHECKER_DELAY_SECONDS,
MESSAGE_PARSER_CHECKER_FREQUENCY_SECONDS,
TimeUnit.SECONDS);
}


Expand Down

0 comments on commit 7f23e57

Please sign in to comment.