Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,11 @@ public enum TimeScale {
public String format(final long milliseconds) {
return String.format("%s %s", milliseconds, unitName());
}
},
SECONDS(MILLISECONDS.milliseconds * 1000), MINUTES(SECONDS.milliseconds * 60), HOURS(
MINUTES.milliseconds * 60), DAYS(HOURS.milliseconds * 24);
}, //
SECONDS(MILLISECONDS.milliseconds * 1000), //
MINUTES(SECONDS.milliseconds * 60), //
HOURS(MINUTES.milliseconds * 60), //
DAYS(HOURS.milliseconds * 24);

/**
* The Decimal format for the TimeUnit displays.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,13 +175,14 @@ final Collection<ConfigValue> multiValidateValues(final Map<String, String> prop
}

@Override
@SuppressWarnings("PMD.AvoidCatchingGenericException")
public final List<ConfigValue> validate(final Map<String, String> props) {
final Map<String, ConfigValue> valueMap = validateAll(props);

try {
return new ArrayList<>(multiValidate(valueMap).values());
} catch (RuntimeException e) { // NOPMD AvoidCatchingGenericException
// any exceptions thrown in the above block are accounted for in the super.validate(props) call.
} catch (RuntimeException e) {
// any exceptions thrown in the above block are accounted for in the validateAll(props) call.
return new ArrayList<>(valueMap.values());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ public final class FileNameFragment extends ConfigFragment {
@VisibleForTesting
static final String FILE_MAX_RECORDS = "file.max.records";
@VisibleForTesting
static final String FILE_NAME_TIMESTAMP_TIMEZONE = "file.name.timestamp.timezone";
public static final String FILE_NAME_TIMESTAMP_TIMEZONE = "file.name.timestamp.timezone";
@VisibleForTesting
static final String FILE_NAME_TIMESTAMP_SOURCE = "file.name.timestamp.source";
public static final String FILE_NAME_TIMESTAMP_SOURCE = "file.name.timestamp.source";
@VisibleForTesting
public static final String FILE_NAME_TEMPLATE_CONFIG = "file.name.template";
@VisibleForTesting
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
*/
public final class OutputFormatFragment extends ConfigFragment {
@VisibleForTesting
static final String GROUP_FORMAT = "Format";
public static final String GROUP_NAME = "Format";
@VisibleForTesting
static public final String FORMAT_OUTPUT_FIELDS_CONFIG = "format.output.fields";
@VisibleForTesting
Expand Down Expand Up @@ -90,25 +90,25 @@ public static int update(final ConfigDef configDef, final OutputFieldType defaul
int formatGroupCounter = 0;

configDef.define(FORMAT_OUTPUT_TYPE_CONFIG, ConfigDef.Type.STRING, FormatType.CSV.name, OUTPUT_TYPE_VALIDATOR,
ConfigDef.Importance.MEDIUM, "The format type of output content.", GROUP_FORMAT, ++formatGroupCounter,
ConfigDef.Importance.MEDIUM, "The format type of output content.", GROUP_NAME, ++formatGroupCounter,
ConfigDef.Width.NONE, FORMAT_OUTPUT_TYPE_CONFIG,
FixedSetRecommender.ofSupportedValues(FormatType.names()));

configDef.define(FORMAT_OUTPUT_FIELDS_CONFIG, ConfigDef.Type.LIST,
Objects.isNull(defaultFieldType) ? null : defaultFieldType.name, // NOPMD NullAssignment
OUTPUT_FIELDS_VALIDATOR, ConfigDef.Importance.MEDIUM, "Fields to put into output files.", GROUP_FORMAT,
OUTPUT_FIELDS_VALIDATOR, ConfigDef.Importance.MEDIUM, "Fields to put into output files.", GROUP_NAME,
++formatGroupCounter, ConfigDef.Width.NONE, FORMAT_OUTPUT_FIELDS_CONFIG,
FixedSetRecommender.ofSupportedValues(OutputFieldType.names()));

configDef.define(FORMAT_OUTPUT_FIELDS_VALUE_ENCODING_CONFIG, ConfigDef.Type.STRING,
OutputFieldEncodingType.BASE64.name, OUTPUT_FIELDS_ENCODING_VALIDATOR, ConfigDef.Importance.MEDIUM,
"The type of encoding for the value field. " + "The supported values are: "
+ OutputFieldEncodingType.SUPPORTED_FIELD_ENCODING_TYPES + ".",
GROUP_FORMAT, ++formatGroupCounter, ConfigDef.Width.NONE, FORMAT_OUTPUT_FIELDS_VALUE_ENCODING_CONFIG,
GROUP_NAME, ++formatGroupCounter, ConfigDef.Width.NONE, FORMAT_OUTPUT_FIELDS_VALUE_ENCODING_CONFIG,
FixedSetRecommender.ofSupportedValues(OutputFieldEncodingType.names()));

configDef.define(FORMAT_OUTPUT_ENVELOPE_CONFIG, ConfigDef.Type.BOOLEAN, true, ConfigDef.Importance.MEDIUM,
"Whether to enable envelope for entries with single field.", GROUP_FORMAT, ++formatGroupCounter,
"Whether to enable envelope for entries with single field.", GROUP_NAME, ++formatGroupCounter,
ConfigDef.Width.SHORT, FORMAT_OUTPUT_ENVELOPE_CONFIG);
return formatGroupCounter;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,9 @@ public void ensureValid(final String name, final Object value) {
}
}

@Override
public String toString() {
return OutputField.SUPPORTED_OUTPUT_FIELDS;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
public class OutputFormatFragmentFixture {// NOPMD

public enum OutputFormatArgs {
GROUP_FORMAT(OutputFormatFragment.GROUP_FORMAT), FORMAT_OUTPUT_FIELDS_CONFIG(
GROUP_FORMAT(OutputFormatFragment.GROUP_NAME), FORMAT_OUTPUT_FIELDS_CONFIG(
OutputFormatFragment.FORMAT_OUTPUT_FIELDS_CONFIG), FORMAT_OUTPUT_FIELDS_VALUE_ENCODING_CONFIG(
OutputFormatFragment.FORMAT_OUTPUT_FIELDS_VALUE_ENCODING_CONFIG), FORMAT_OUTPUT_ENVELOPE_CONFIG(
OutputFormatFragment.FORMAT_OUTPUT_ENVELOPE_CONFIG), FORMAT_OUTPUT_TYPE_CONFIG(
Expand Down

This file was deleted.

Loading
Loading