Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix findbugs errors #587

Merged
merged 1 commit into from
Jan 4, 2018
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
5 changes: 5 additions & 0 deletions ksql-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@
<artifactId>avro</artifactId>
</dependency>

<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>annotations</artifactId>
</dependency>

<!-- Required for running tests -->

<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
**/
package io.confluent.ksql.metrics;

import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import io.confluent.common.utils.Time;
import org.apache.kafka.common.metrics.KafkaMetric;
import org.apache.kafka.common.metrics.Metrics;
Expand Down Expand Up @@ -76,6 +77,8 @@ public Stat(String name, double value, long timestamp) {
this.value = value;
this.timestamp = timestamp;
}

@SuppressFBWarnings("FE_FLOATING_POINT_EQUALITY")
public String formatted() {
if (value == Math.round(value)) {
return String.format("%16s:%10.0f", name, value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ public class KsqlConstants {
public static final String SCHEMA_REGISTRY_VALUE_SUFFIX = "-value";
public static final String AVRO_SCHEMA_ID = "AVRO_SCHEMA_ID";

public static int defaultSinkNumberOfPartitions = 4;
public static short defaultSinkNumberOfReplications = 1;
public static final int defaultSinkNumberOfPartitions = 4;
public static final short defaultSinkNumberOfReplications = 1;
// TODO: Find out the best default value.
public static long defaultSinkWindowChangeLogAdditionalRetention = 1000000;
public static final long defaultSinkWindowChangeLogAdditionalRetention = 1000000;

public static String defaultAutoOffsetRestConfig = "latest";
public static long defaultCommitIntervalMsConfig = 2000;
public static long defaultCacheMaxBytesBufferingConfig = 10000000;
public static int defaultNumberOfStreamsThreads = 4;
public static final String defaultAutoOffsetRestConfig = "latest";
public static final long defaultCommitIntervalMsConfig = 2000;
public static final long defaultCacheMaxBytesBufferingConfig = 10000000;
public static final int defaultNumberOfStreamsThreads = 4;

}
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@ public SourceDescription(StructuredDataSource dataSource, boolean extended, Stri
dataSource.getKsqlTopic().getKafkaTopicName(),
topology,
executionPlan,
(extended & topicClient != null ? getPartitions(topicClient, dataSource.getKsqlTopic().getKafkaTopicName()) : 0),
(extended & topicClient != null ? getReplication(topicClient, dataSource.getKsqlTopic().getKafkaTopicName()) : 0)
(extended && topicClient != null ? getPartitions(topicClient, dataSource.getKsqlTopic().getKafkaTopicName()) : 0),
(extended && topicClient != null ? getReplication(topicClient, dataSource.getKsqlTopic().getKafkaTopicName()) : 0)
);
}
public SourceDescription(KsqlStructuredDataOutputNode outputNode, String statementString, String name, String topoplogy, String executionPlan, KafkaTopicClient topicClient) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.nio.charset.StandardCharsets;

import io.confluent.support.metrics.submitters.ResponseHandler;

Expand All @@ -38,8 +39,9 @@ public void handle(HttpResponse response) {
try {
if (statusCode == HttpStatus.SC_OK && response.getEntity().getContent() != null) {

BufferedReader br =
new BufferedReader(new InputStreamReader((response.getEntity().getContent())));
BufferedReader br = new BufferedReader(
new InputStreamReader((response.getEntity().getContent()), StandardCharsets.UTF_8)
);

StringBuilder content = new StringBuilder();
String line;
Expand Down