Skip to content

Commit

Permalink
store env-var response (#21327)
Browse files Browse the repository at this point in the history
* store env-var response

* fix formatting

* fix pmd issue

* change log message to debug

* fix file change error
  • Loading branch information
colesnodgrass authored Jan 12, 2023
1 parent c6b8279 commit 440a5e4
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public class DefaultAirbyteSource implements AirbyteSource {
private Process sourceProcess = null;
private Iterator<AirbyteMessage> messageIterator = null;
private Integer exitValue = null;
private final FeatureFlags featureFlags;
private final boolean featureFlagLogConnectorMsgs;

public DefaultAirbyteSource(final IntegrationLauncher integrationLauncher, final FeatureFlags featureFlags) {
this(integrationLauncher, new DefaultAirbyteStreamFactory(CONTAINER_LOG_MDC_BUILDER), featureFlags);
Expand All @@ -76,7 +76,7 @@ public DefaultAirbyteSource(final IntegrationLauncher integrationLauncher,
this.integrationLauncher = integrationLauncher;
this.streamFactory = streamFactory;
this.heartbeatMonitor = heartbeatMonitor;
this.featureFlags = featureFlags;
this.featureFlagLogConnectorMsgs = featureFlags.logConnectorMessages();
}

@Trace(operationName = WORKER_OPERATION_NAME)
Expand Down Expand Up @@ -171,7 +171,7 @@ public void cancel() throws Exception {
}

private void logInitialStateAsJSON(final WorkerSourceConfig sourceConfig) {
if (!featureFlags.logConnectorMessages()) {
if (!featureFlagLogConnectorMsgs) {
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ public class AirbyteMessageTracker implements MessageTracker {
private final List<AirbyteTraceMessage> sourceErrorTraceMessages;
private final StateAggregator stateAggregator;
private final FeatureFlags featureFlags;
private final boolean featureFlagLogConnectorMsgs;

// These variables support SYNC level estimates and are meant for sources where stream level
// estimates are not possible e.g. CDC sources.
Expand Down Expand Up @@ -118,6 +119,7 @@ protected AirbyteMessageTracker(final StateDeltaTracker stateDeltaTracker,
this.sourceErrorTraceMessages = new ArrayList<>();
this.stateAggregator = stateAggregator;
this.featureFlags = featureFlags;
this.featureFlagLogConnectorMsgs = featureFlags.logConnectorMessages();
}

@Trace(operationName = WORKER_OPERATION_NAME)
Expand Down Expand Up @@ -545,7 +547,7 @@ public Boolean getUnreliableStateTimingMetrics() {
}

private void logMessageAsJSON(final String caller, final AirbyteMessage message) {
if (!featureFlags.logConnectorMessages()) {
if (!featureFlagLogConnectorMsgs) {
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public <T> T getEnvOrDefault(final String key, final T defaultValue, final Funct
if (value != null && !value.isEmpty()) {
return parser.apply(value);
} else {
log.info("Using default value for environment variable {}: '{}'", key, defaultValue);
log.debug("Using default value for environment variable {}: '{}'", key, defaultValue);
return defaultValue;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -441,4 +441,4 @@
dockerRepository: airbyte/destination-weaviate
dockerImageTag: 0.1.0
documentationUrl: https://docs.airbyte.com/integrations/destinations/weaviate
releaseStage: alpha
releaseStage: alpha

0 comments on commit 440a5e4

Please sign in to comment.