Skip to content
Open
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 @@ -1555,7 +1555,6 @@ class BeamModulePlugin implements Plugin<Project> {
"MixedMutabilityReturnType",
"PreferJavaTimeOverload",
"NonCanonicalType",
"Slf4jFormatShouldBeConst",
"Slf4jSignOnlyFormat",
"StaticAssignmentInConstructor",
"ThreadPriorityCheck",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public LogOutput(String prefix) {

@ProcessElement
public void processElement(ProcessContext c) throws Exception {
LOG.info(prefix + c.element());
LOG.info("{}{}", prefix, c.element());
c.output(c.element());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public LogOutput(String prefix) {

@ProcessElement
public void processElement(ProcessContext c) throws Exception {
LOG.info(prefix + c.element());
LOG.info("{}{}", prefix, c.element());
c.output(c.element());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public LogOutput(String prefix) {

@ProcessElement
public void processElement(ProcessContext c) throws Exception {
LOG.info(prefix + c.element());
LOG.info("{}{}", prefix, c.element());
c.output(c.element());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ public LogOutput(String prefix) {

@ProcessElement
public void processElement(ProcessContext c) throws Exception {
LOG.info(prefix + c.element());
LOG.info("{}{}", prefix, c.element());
c.output(c.element());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public LogOutput(String prefix) {

@ProcessElement
public void processElement(ProcessContext c) throws Exception {
LOG.info(prefix + c.element());
LOG.info("{}{}", prefix, c.element());
c.output(c.element());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public LogOutput(String prefix) {

@ProcessElement
public void processElement(ProcessContext c) throws Exception {
LOG.info(prefix + c.element());
LOG.info("{}{}", prefix, c.element());
c.output(c.element());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public LogOutput(String prefix) {

@ProcessElement
public void processElement(ProcessContext c) throws Exception {
LOG.info(prefix + c.element());
LOG.info("{}{}", prefix, c.element());
c.output(c.element());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public LogOutput(String prefix) {

@ProcessElement
public void processElement(ProcessContext c) throws Exception {
LOG.info(prefix + c.element());
LOG.info("{}{}", prefix, c.element());
c.output(c.element());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public LogOutput(String prefix) {

@ProcessElement
public void processElement(ProcessContext c) throws Exception {
LOG.info(prefix + c.element());
LOG.info("{}{}", prefix, c.element());
c.output(c.element());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,14 +119,14 @@ public void processElement(ProcessContext c) {
if (filter.matcher(c.element().getKey()).matches()) {
// Log at the "DEBUG" level each element that we match. When executing this pipeline
// these log lines will appear only if the log level is set to "DEBUG" or lower.
LOG.debug("Matched: " + c.element().getKey());
LOG.debug("Matched: {}", c.element().getKey());
matchedWords.inc();
c.output(c.element());
} else {
// Log at the "TRACE" level each element that is not matched. Different log levels
// can be used to control the verbosity of logging providing an effective mechanism
// to filter less important information.
LOG.trace("Did not match: " + c.element().getKey());
LOG.trace("Did not match: {}", c.element().getKey());
unmatchedWords.inc();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public LogOutput(String prefix) {

@ProcessElement
public void processElement(ProcessContext c) throws Exception {
LOG.info(prefix + c.element());
LOG.info("{}{}", prefix, c.element());
c.output(c.element());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public LogOutput(String prefix) {

@ProcessElement
public void processElement(ProcessContext c) throws Exception {
LOG.info(prefix + c.element());
LOG.info("{}{}", prefix, c.element());
c.output(c.element());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public LogOutput(String prefix) {

@ProcessElement
public void processElement(ProcessContext c) throws Exception {
LOG.info(prefix + c.element());
LOG.info("{}{}", prefix, c.element());
c.output(c.element());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public LogOutput(String prefix) {

@ProcessElement
public void processElement(ProcessContext c) throws Exception {
LOG.info(prefix + c.element());
LOG.info("{}{}", prefix, c.element());
c.output(c.element());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public LogOutput(String prefix) {

@ProcessElement
public void processElement(ProcessContext c) throws Exception {
LOG.info(prefix + c.element());
LOG.info("{}{}", prefix, c.element());
c.output(c.element());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public LogOutput(String prefix) {

@ProcessElement
public void processElement(ProcessContext c) throws Exception {
LOG.info(prefix + c.element());
LOG.info("{}{}", prefix, c.element());
c.output(c.element());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public LogOutput(String prefix) {

@ProcessElement
public void processElement(ProcessContext c) throws Exception {
LOG.info(prefix + c.element());
LOG.info("{}{}", prefix, c.element());
c.output(c.element());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public LogOutput(String prefix) {

@ProcessElement
public void processElement(ProcessContext c) throws Exception {
LOG.info(prefix + c.element());
LOG.info("{}{}", prefix, c.element());
c.output(c.element());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public LogOutput(String prefix) {

@ProcessElement
public void processElement(ProcessContext c) throws Exception {
LOG.info(prefix + c.element());
LOG.info("{}{}", prefix, c.element());
c.output(c.element());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public LogOutput(String prefix) {

@ProcessElement
public void processElement(ProcessContext c) throws Exception {
LOG.info(prefix + c.element());
LOG.info("{}{}", prefix, c.element());
c.output(c.element());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public LogOutput(String prefix) {

@ProcessElement
public void processElement(ProcessContext c) throws Exception {
LOG.info(prefix + c.element());
LOG.info("{}{}", prefix, c.element());
c.output(c.element());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public LogOutput(String prefix) {

@ProcessElement
public void processElement(ProcessContext c) throws Exception {
LOG.info(prefix + c.element());
LOG.info("{}{}", prefix, c.element());
c.output(c.element());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public LogOutput(String prefix) {

@ProcessElement
public void processElement(ProcessContext c) throws Exception {
LOG.info(prefix + c.element());
LOG.info("LogOutput: {} {}", prefix, c.element());
c.output(c.element());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ public LogOutput(String prefix) {

@ProcessElement
public void processElement(ProcessContext c) throws Exception {
LOG.info(prefix + c.element());
LOG.info("{}{}", prefix, c.element());
c.output(c.element());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public void processElement(ProcessContext c) throws Exception {
}

// Simulate external API call
LOG.info("Processing: " + element);
LOG.info("Processing: {}", element);
Thread.sleep(100);
c.output("Processed: " + element);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public LogOutput(String prefix) {

@ProcessElement
public void processElement(ProcessContext c) throws Exception {
LOG.info(prefix + c.element());
LOG.info("{}{}", prefix, c.element());
c.output(c.element());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public LogOutput(String prefix) {

@ProcessElement
public void processElement(ProcessContext c) throws Exception {
LOG.info(prefix + c.element());
LOG.info("{}{}", prefix, c.element());
c.output(c.element());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public LogOutput(String prefix) {

@ProcessElement
public void processElement(ProcessContext c) throws Exception {
LOG.info(prefix + c.element());
LOG.info("{}{}", prefix, c.element());
c.output(c.element());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public LogOutput(String prefix) {

@ProcessElement
public void processElement(ProcessContext c) throws Exception {
LOG.info(prefix + c.element());
LOG.info("{}{}", prefix, c.element());
c.output(c.element());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public LogOutput(String prefix) {

@ProcessElement
public void processElement(ProcessContext c) throws Exception {
LOG.info(prefix + c.element());
LOG.info("{}{}", prefix, c.element());
c.output(c.element());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public LogOutput(String prefix) {

@ProcessElement
public void processElement(ProcessContext c) throws Exception {
LOG.info(prefix + c.element());
LOG.info("{}{}", prefix, c.element());
c.output(c.element());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public LogOutput(String prefix) {

@ProcessElement
public void processElement(ProcessContext c) throws Exception {
LOG.info(prefix + c.element());
LOG.info("{}{}", prefix, c.element());
c.output(c.element());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public LogOutput(String prefix) {

@ProcessElement
public void processElement(ProcessContext c) throws Exception {
LOG.info(prefix + c.element());
LOG.info("{}{}", prefix, c.element());
c.output(c.element());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public LogOutput(String prefix) {

@ProcessElement
public void processElement(ProcessContext c) throws Exception {
LOG.info(prefix + c.element());
LOG.info("{}{}", prefix, c.element());
c.output(c.element());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ static String buildJsonString(
break;

default:
LOG.error("Invalid data type, got: " + type);
LOG.error("Invalid data type, got: {}", type);
throw new RuntimeException("Invalid data type, got: " + type);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public SchemasUtils(String path, Charset encoding) throws IOException {
byte[] encoded = Files.readAllBytes(Paths.get(path));
parseJson(new String(encoded, encoding));
}
LOG.info("Extracted schema: " + bigQuerySchema.toPrettyString());
LOG.info("Extracted schema: {}", bigQuerySchema.toPrettyString());
}

public TableSchema getBigQuerySchema() {
Expand Down Expand Up @@ -156,7 +156,7 @@ public static String getGcsFileAsString(String filePath) {
return CharStreams.toString(reader);

} catch (IOException ioe) {
LOG.error("File system i/o error: " + ioe.getMessage());
LOG.error("File system i/o error", ioe);
throw new RuntimeException(ioe);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,10 @@ public void processElement(ProcessContext c) {
Double gmc = c.sideInput(globalMeanScore);
if (score > (gmc * SCORE_WEIGHT)) {
LOG.info(
"user "
+ c.element().getKey()
+ " spammer score "
+ score
+ " with mean "
+ gmc);
"user {} spammer score {} with mean {}",
c.element().getKey(),
score,
gmc);
numSpammerUsers.inc();
c.output(c.element());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ public void processElement(ProcessContext c) {
c.output(gInfo);
} catch (ArrayIndexOutOfBoundsException | NumberFormatException e) {
numParseErrors.inc();
LOG.info("Parse error on " + c.element() + ", " + e.getMessage());
LOG.info("Parse error on {}", c.element(), e);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,12 +199,10 @@ public static PipelineResult run(Pipeline pipeline, KafkaToPubsubOptions options
"bootstrapServers cannot be an empty string.");

LOG.info(
"Starting Kafka-To-PubSub pipeline with parameters bootstrap servers:"
+ options.getBootstrapServers()
+ " input topics: "
+ options.getInputTopics()
+ " output pubsub topic: "
+ options.getOutputTopic());
"Starting Kafka-To-PubSub pipeline with parameters bootstrap servers:{} input topics: {} output pubsub topic: {}",
options.getBootstrapServers(),
options.getInputTopics(),
options.getOutputTopic());

/*
* Steps:
Expand Down
Loading
Loading