Skip to content

Commit

Permalink
check style fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Amit-CloudSufi committed Dec 6, 2024
1 parent 1cdadf7 commit 4cad117
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -117,4 +117,4 @@ private ProgramFailureException getProgramFailureException(NoSuchElementExceptio
errorMessage,
String.format(errorMessageFormat, errorContext.getPhase(), errorMessage), ErrorType.SYSTEM, false, e);
}
}
}
17 changes: 9 additions & 8 deletions src/main/java/io/cdap/plugin/http/sink/batch/HTTPSinkConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -400,7 +400,8 @@ public List<HttpErrorHandlerEntity> 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;
Expand Down Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,4 +132,4 @@ public void transform(KeyValue<NullWritable, PageEntry> input, Emitter<Structure
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,9 @@ public abstract class BaseHttpSourceConfig 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;

@Name(PROPERTY_ERROR_HANDLING)
Expand Down Expand Up @@ -536,7 +536,8 @@ public List<HttpErrorHandlerEntity> 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;
Expand All @@ -563,7 +564,7 @@ public List<String> getTransportProtocolsList() {
public String getReferenceNameOrNormalizedFQN() {
return Strings.isNullOrEmpty(referenceName) ? ReferenceNames.normalizeFqn(url) : referenceName;
}

public void validate(FailureCollector failureCollector) {
super.validate(failureCollector);

Expand Down Expand Up @@ -798,4 +799,4 @@ public static Map<String, String> getMapFromKeyValueString(String keyValueString
}
return result;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ public static Schema detectSchema(HttpBatchSourceConfig config, String delimiter
return null;
}
List<Schema.Field> 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);
}

Expand Down

0 comments on commit 4cad117

Please sign in to comment.