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 @@ -1545,7 +1545,6 @@ class BeamModulePlugin implements Plugin<Project> {
"EqualsUnsafeCast",
"EscapedEntity",
"ExtendsAutoValue",
"InlineFormatString",
"InlineMeSuggester",
"InvalidBlockTag",
"InvalidInlineTag",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,6 @@ private TestProperties() {}
public static final String DEFAULT_REGION = "us-central1";

// Error messages
private static final String CLI_ERR_MSG = "-D%s is required on the command line";
private static final String ENV_VAR_MSG = "%s is required as an environment variable";

private static final Logger LOG = LoggerFactory.getLogger(TestProperties.class);

Expand Down Expand Up @@ -170,8 +168,8 @@ private static String getProperty(String name, Type type, boolean required) {
if (required) {
String errMsg =
type == Type.PROPERTY
? String.format(CLI_ERR_MSG, name)
: String.format(ENV_VAR_MSG, name);
? String.format("-D%s is required on the command line", name)
: String.format("%s is required as an environment variable", name);
checkState(value != null, errMsg);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ public class SamzaTransformMetrics implements Serializable {

private static final int DEFAULT_LOOKBACK_TIMER_WINDOW_SIZE_MS = 180000;
private static final String GROUP = "SamzaBeamTransformMetrics";
private static final String METRIC_NAME_PATTERN = "%s-%s";
private static final String TRANSFORM_LATENCY_METRIC = "handle-message-ns";
private static final String TRANSFORM_WATERMARK_PROGRESS = "output-watermark-ms";
private static final String TRANSFORM_IP_THROUGHPUT = "num-input-messages";
Expand Down Expand Up @@ -138,6 +137,6 @@ private static Timer getTimerWithCustomizedLookBackWindow(String transformName)
private static String getMetricNameWithPrefix(String metricName, String transformName) {
// Replace all non-alphanumeric characters with underscore
final String samzaSafeMetricName = transformName.replaceAll("[^A-Za-z0-9_]", "_");
return String.format(METRIC_NAME_PATTERN, samzaSafeMetricName, metricName);
return String.format("%s-%s", samzaSafeMetricName, metricName);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1389,10 +1389,6 @@ private BigQueryStorageQuerySource<T> createStorageQuerySource(
getDirectReadPicosTimestampPrecision());
}

private static final String QUERY_VALIDATION_FAILURE_ERROR =
"Validation of query \"%1$s\" failed. If the query depends on an earlier stage of the"
+ " pipeline, This validation can be disabled using #withoutValidation.";

@Override
public void validate(PipelineOptions options) {
// Even if existence validation is disabled, we need to make sure that the BigQueryIO
Expand Down Expand Up @@ -1452,7 +1448,11 @@ public void validate(PipelineOptions options) {
getQueryLocation());
} catch (Exception e) {
throw new IllegalArgumentException(
String.format(QUERY_VALIDATION_FAILURE_ERROR, getQuery().get()), e);
String.format(
"Validation of query \"%1$s\" failed. If the query depends on an earlier stage of the"
+ " pipeline, This validation can be disabled using #withoutValidation.",
getQuery().get()),
e);
}

// If the user provided a temp dataset, check if the dataset exists before launching the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,6 @@ abstract class HttpEventPublisher {
private static final String CONTENT_TYPE =
Joiner.on('/').join(MEDIA_TYPE.getType(), MEDIA_TYPE.getSubType());

private static final String AUTHORIZATION_SCHEME = "Splunk %s";

private static final String HTTPS_PROTOCOL_PREFIX = "https";

/** Provides a builder for creating a {@link HttpEventPublisher}. */
Expand Down Expand Up @@ -184,7 +182,7 @@ void close() throws IOException {
* @param token Splunk's HEC authorization token
*/
private void setHeaders(HttpRequest request, String token) {
request.getHeaders().setAuthorization(String.format(AUTHORIZATION_SCHEME, token));
request.getHeaders().setAuthorization(String.format("Splunk %s", token));

if (enableGzipHttpCompression()) {
request.getHeaders().setContentEncoding("gzip");
Expand Down
Loading