Skip to content

Commit

Permalink
Merge pull request #24 from dylanmei/decompose_configuration
Browse files Browse the repository at this point in the history
Decompose and test connector configuration
  • Loading branch information
dylanmei authored Sep 23, 2019
2 parents 0ece5c1 + d2590aa commit 58e461f
Show file tree
Hide file tree
Showing 19 changed files with 1,085 additions and 982 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,15 @@ private void verifyNotNullOrEmpty(final String field, final String fieldName) {
}
}

String getExternalId() {
public String getExternalId() {
return this.externalId;
}

String getRoleArn() {
public String getRoleArn() {
return this.roleArn;
}

String getSessionName() {
public String getSessionName() {
return this.sessionName;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,6 @@
import static java.util.Collections.emptyMap;

public class JsonPayloadFormatter implements PayloadFormatter, Configurable {
enum SchemaVisibility {
ALL,
MIN,
NONE
}

private final ObjectWriter recordWriter = new ObjectMapper().writerFor(Payload.class);
private final ObjectWriter recordsWriter = new ObjectMapper().writerFor(Payload[].class);
private final JsonConverter converter = new JsonConverter();
Expand All @@ -44,8 +38,8 @@ public JsonPayloadFormatter() {

@Override
public void configure(Map<String, ?> configs) {
keySchemaVisibility = configureSchemaVisibility(configs, "formatter.key.schema.visibility");
valueSchemaVisibility = configureSchemaVisibility(configs, "formatter.value.schema.visibility");
keySchemaVisibility = configureSchemaVisibility(configs, "key.schema.visibility");
valueSchemaVisibility = configureSchemaVisibility(configs, "value.schema.visibility");
}

private SchemaVisibility configureSchemaVisibility(final Map<String, ?> configs, final String key) {
Expand All @@ -68,6 +62,14 @@ private SchemaVisibility configureSchemaVisibility(final Map<String, ?> configs,
return viz;
}

public SchemaVisibility getKeySchemaVisibility() {
return keySchemaVisibility;
}

public SchemaVisibility getValueSchemaVisibility() {
return valueSchemaVisibility;
}

public String format(final SinkRecord record) {
try {
return recordWriter.writeValueAsString(recordToPayload(record));
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package com.nordstrom.kafka.connect.formatters;

public enum SchemaVisibility {
ALL,
MIN,
NONE
}
181 changes: 0 additions & 181 deletions src/main/java/com/nordstrom/kafka/connect/lambda/AwsLambdaUtil.java

This file was deleted.

Loading

0 comments on commit 58e461f

Please sign in to comment.