Skip to content

Commit

Permalink
Tweak logging levels for several trace lines; remove NB notation in c…
Browse files Browse the repository at this point in the history
…omments.
  • Loading branch information
seananthonywilliams committed Jul 16, 2019
1 parent 2d18713 commit ad43ed7
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
</resource>
</resources>

<!-- NB: pluginManagement defines configurations for plugins, but DOES
<!-- PluginManagement defines configurations for plugins, but DOES
NOT force execution -->
<pluginManagement>
<plugins>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
//import org.slf4j.LoggerFactory;

public class AWSAssumeRoleCredentialsProvider implements AWSCredentialsProvider, Configurable {
//NB: uncomment slf4j imports and field declaration to enable logging.
// Uncomment slf4j imports and field declaration to enable logging.
// private static final Logger log = LoggerFactory.getLogger(AWSAssumeRoleCredentialsProvider.class);

public static final String EXTERNAL_ID_CONFIG = "external.id";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public class AwsLambdaUtil {
private final InvocationFailure failureMode;

public AwsLambdaUtil(final Configuration optConfigs, final Map<String, ?> bareAssumeRoleConfigs) {
LOGGER.info("AwsLambdaUtil.ctor:bareAssumeRoleConfigs={}", bareAssumeRoleConfigs);
LOGGER.debug("AwsLambdaUtil.ctor:bareAssumeRoleConfigs={}", bareAssumeRoleConfigs);
Guard.verifyNotNull(optConfigs, "optConfigs");

final AWSLambdaAsyncClientBuilder builder = AWSLambdaAsyncClientBuilder.standard();
Expand Down Expand Up @@ -165,23 +165,23 @@ public AWSCredentialsProvider getCredentialsProvider(Map<String, ?> roleConfigs)
if (providerField != null) {
providerClass = providerField.toString();
}
LOGGER.info(".get-credentials-provider:field={}, class={}", providerField, providerClass);
LOGGER.debug(".get-credentials-provider:field={}, class={}", providerField, providerClass);
AWSCredentialsProvider provider = ((Class<? extends AWSCredentialsProvider>)
getClass(providerClass)).newInstance();

if (provider instanceof Configurable) {
((Configurable) provider).configure(roleConfigs);
}

LOGGER.info(".get-credentials-provider:provider={}", provider);
LOGGER.debug(".get-credentials-provider:provider={}", provider);
return provider;
} catch (IllegalAccessException | InstantiationException e) {
throw new ConnectException("Invalid class for: " + LambdaSinkConnectorConfig.ConfigurationKeys.CREDENTIALS_PROVIDER_CLASS_CONFIG, e);
}
}

public Class<?> getClass(String className) {
LOGGER.info(".get-class:class={}",className);
LOGGER.debug(".get-class:class={}",className);
try {
return Class.forName(className);
} catch (ClassNotFoundException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ enum ConfigurationKeys {
// AWS assume role support options
CREDENTIALS_PROVIDER_CLASS_CONFIG("lambda.credentials.provider.class", "REQUIRED Class providing cross-account role assumption"),
CREDENTIALS_PROVIDER_CLASS_DEFAULT("com.amazonaws.auth.DefaultAWSCredentialsProviderChain", "Default provider chain if lambda.credentials.provider.class is not passed in"),
CREDENTIALS_PROVIDER_CONFIG_PREFIX("aws.credentials.provider.", "NB: trailing '.'"),
CREDENTIALS_PROVIDER_CONFIG_PREFIX("aws.credentials.provider.", "Note trailing '.'"),
ROLE_ARN_CONFIG("lambda.credentials.provider.role.arn", " REQUIRED AWS Role ARN providing the access"),
SESSION_NAME_CONFIG("lambda.credentials.provider.session.name", "REQUIRED Session name"),
EXTERNAL_ID_CONFIG("lambda.credentials.provider.external.id", "OPTIONAL (but recommended) External identifier used by the kafka-connect-lambda when assuming the role");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public void start(final Map<String, String> props) {
@Override
public void put(final Collection<SinkRecord> records) {
if (records == null || records.isEmpty()) {
LOGGER.info("No records to process. connector=\"{}\" task=\"{}\"",
LOGGER.debug("No records to process. connector=\"{}\" task=\"{}\"",
this.configuration.getConnectorName(),
this.configuration.getTaskId());
return;
Expand All @@ -81,7 +81,7 @@ public void put(final Collection<SinkRecord> records) {
this.batchRecords.addAll(records);
final int batchLength = this.getPayload(this.batchRecords).getBytes().length;
if (batchLength >= this.configuration.getMaxBatchSizeBytes()) {
LOGGER.info("Batch size reached {} bytes within {} records. connector=\"{}\" task=\"{}\"",
LOGGER.warn("Batch size reached {} bytes within {} records. connector=\"{}\" task=\"{}\"",
batchLength,
this.batchRecords.size(),
this.configuration.getConnectorName(),
Expand Down

0 comments on commit ad43ed7

Please sign in to comment.