From 4cad1178f56e3ce0e51c064540c53ac80ed7b6b5 Mon Sep 17 00:00:00 2001 From: Amit Kumar Singh Date: Fri, 6 Dec 2024 08:48:07 +0000 Subject: [PATCH] check style fixes --- .../http/common/HttpErrorDetailsProvider.java | 2 +- .../plugin/http/sink/batch/HTTPSinkConfig.java | 17 +++++++++-------- .../http/source/batch/HttpBatchSource.java | 2 +- .../source/common/BaseHttpSourceConfig.java | 13 +++++++------ .../source/common/DelimitedSchemaDetector.java | 3 ++- 5 files changed, 20 insertions(+), 17 deletions(-) diff --git a/src/main/java/io/cdap/plugin/http/common/HttpErrorDetailsProvider.java b/src/main/java/io/cdap/plugin/http/common/HttpErrorDetailsProvider.java index 74de0e25..f16dccf0 100644 --- a/src/main/java/io/cdap/plugin/http/common/HttpErrorDetailsProvider.java +++ b/src/main/java/io/cdap/plugin/http/common/HttpErrorDetailsProvider.java @@ -117,4 +117,4 @@ private ProgramFailureException getProgramFailureException(NoSuchElementExceptio errorMessage, String.format(errorMessageFormat, errorContext.getPhase(), errorMessage), ErrorType.SYSTEM, false, e); } -} \ No newline at end of file +} diff --git a/src/main/java/io/cdap/plugin/http/sink/batch/HTTPSinkConfig.java b/src/main/java/io/cdap/plugin/http/sink/batch/HTTPSinkConfig.java index 595df362..1e278af8 100644 --- a/src/main/java/io/cdap/plugin/http/sink/batch/HTTPSinkConfig.java +++ b/src/main/java/io/cdap/plugin/http/sink/batch/HTTPSinkConfig.java @@ -85,8 +85,8 @@ public class HTTPSinkConfig extends BaseHttpConfig { @Name(URL) @Description("The URL to post data to. Additionally, a placeholder like #columnName can be added to the URL that " + - "can be substituted with column value at the runtime. E.g. https://customer-url/user/#user_id. Here user_id " + - "column should exist in input schema. (Macro Enabled)") + "can be substituted with column value at the runtime. E.g. https://customer-url/user/#user_id. " + + "Here user_id column should exist in input schema. (Macro Enabled)") @Macro private final String url; @@ -159,9 +159,9 @@ public class HTTPSinkConfig extends BaseHttpConfig { @Nullable @Name(PROPERTY_HTTP_ERROR_HANDLING) @Description("Defines the error handling strategy to use for certain HTTP response codes." + - "The left column contains a regular expression for HTTP status code. The right column contains an action which" + - "is done in case of match. If HTTP status code matches multiple regular expressions, " + - "the first specified in mapping is matched.") + "The left column contains a regular expression for HTTP status code. " + + "The right column contains an action which is done in case of match. " + + "If HTTP status code matches multiple regular expressions, the first specified in mapping is matched.") protected String httpErrorsHandling; @Nullable @@ -400,7 +400,8 @@ public List getHttpErrorHandlingEntries() { // We embed causing exception message into this one. Since this message is shown on UI when validation fails. throw new InvalidConfigPropertyException( String.format( - "Error handling regex '%s' is not valid. %s", regex, e.getMessage()), PROPERTY_HTTP_ERROR_HANDLING); + "Error handling regex '%s' is not valid. %s", regex, e.getMessage()), + PROPERTY_HTTP_ERROR_HANDLING); } } return results; @@ -450,8 +451,8 @@ public void validate(FailureCollector collector) { if (!containsMacro(METHOD) && !METHODS.contains(method.toUpperCase())) { collector.addFailure( - String.format("Invalid request method %s, must be one of %s.", method, Joiner.on(',').join(METHODS)), null) - .withConfigProperty(METHOD); + String.format("Invalid request method %s, must be one of %s.", method, Joiner.on(',') + .join(METHODS)), null).withConfigProperty(METHOD); } if (!containsMacro(BATCH_SIZE) && batchSize != null && batchSize < 1) { diff --git a/src/main/java/io/cdap/plugin/http/source/batch/HttpBatchSource.java b/src/main/java/io/cdap/plugin/http/source/batch/HttpBatchSource.java index 1e7b02dd..3171f094 100644 --- a/src/main/java/io/cdap/plugin/http/source/batch/HttpBatchSource.java +++ b/src/main/java/io/cdap/plugin/http/source/batch/HttpBatchSource.java @@ -132,4 +132,4 @@ public void transform(KeyValue input, Emitter getHttpErrorHandlingEntries() { // We embed causing exception message into this one. Since this message is shown on UI when validation fails. throw new InvalidConfigPropertyException( String.format( - "Error handling regex '%s' is not valid. %s", regex, e.getMessage()), PROPERTY_HTTP_ERROR_HANDLING); + "Error handling regex '%s' is not valid. %s", regex, e.getMessage()), + PROPERTY_HTTP_ERROR_HANDLING); } } return results; @@ -563,7 +564,7 @@ public List getTransportProtocolsList() { public String getReferenceNameOrNormalizedFQN() { return Strings.isNullOrEmpty(referenceName) ? ReferenceNames.normalizeFqn(url) : referenceName; } - + public void validate(FailureCollector failureCollector) { super.validate(failureCollector); @@ -798,4 +799,4 @@ public static Map getMapFromKeyValueString(String keyValueString } return result; } -} \ No newline at end of file +} diff --git a/src/main/java/io/cdap/plugin/http/source/common/DelimitedSchemaDetector.java b/src/main/java/io/cdap/plugin/http/source/common/DelimitedSchemaDetector.java index 7ece051c..f78478eb 100644 --- a/src/main/java/io/cdap/plugin/http/source/common/DelimitedSchemaDetector.java +++ b/src/main/java/io/cdap/plugin/http/source/common/DelimitedSchemaDetector.java @@ -63,7 +63,8 @@ public static Schema detectSchema(HttpBatchSourceConfig config, String delimiter return null; } List fields = DataTypeDetectorUtils.detectDataTypeOfEachDatasetColumn( - new HashMap<>(), (Objects.nonNull(columnNames) ? columnNames : new String[0]), dataTypeDetectorStatusKeeper); + new HashMap<>(), (Objects.nonNull(columnNames) ? columnNames : new String[0]), + dataTypeDetectorStatusKeeper); return Schema.recordOf("text", fields); }