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 @@ -1578,7 +1578,6 @@ class BeamModulePlugin implements Plugin<Project> {
"UnnecessaryLongToIntConversion",
"UnusedVariable",
// intended suppressions emerged in newer protobuf versions
"AutoValueBoxedValues",
// For backward compatibility. Public method checked in before this check impl
// Possible use in interface subclasses
"ClassInitializationDeadlock",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ public static Builder newBuilder() {
@Nullable
public abstract String delimiter();

public abstract Boolean hasHeaders();
public abstract boolean hasHeaders();

public abstract String inputFileSpec();

Expand Down Expand Up @@ -468,7 +468,7 @@ public abstract static class Builder {

public abstract Builder setDelimiter(@Nullable String delimiter);

public abstract Builder setHasHeaders(Boolean hasHeaders);
public abstract Builder setHasHeaders(boolean hasHeaders);

public abstract Builder setInputFileSpec(String inputFileSpec);

Expand All @@ -486,8 +486,6 @@ public ReadCsv build() {

checkArgument(readCsv.csvFormat() != null, "Csv format must not be null.");

checkArgument(readCsv.hasHeaders() != null, "Header information must be provided.");

return readCsv;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public abstract class ClickHouseRowsCheck extends ConditionCheck {

abstract String table();

abstract Integer minRows();
abstract int minRows();

abstract @Nullable Integer maxRows();

Expand Down Expand Up @@ -85,7 +85,7 @@ public abstract static class Builder {

public abstract Builder setTable(String table);

public abstract Builder setMinRows(Integer minRows);
public abstract Builder setMinRows(int minRows);

public abstract Builder setMaxRows(Integer maxRows);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public abstract class DatadogLogEntriesCheck extends ConditionCheck {

abstract DatadogResourceManager resourceManager();

abstract Integer minEntries();
abstract int minEntries();

@Nullable
abstract Integer maxEntries();
Expand Down Expand Up @@ -78,7 +78,7 @@ public abstract static class Builder {

public abstract Builder setResourceManager(DatadogResourceManager resourceManager);

public abstract Builder setMinEntries(Integer minEvents);
public abstract Builder setMinEntries(int minEvents);

public abstract Builder setMaxEntries(Integer maxEvents);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public abstract class BigQueryRowsCheck extends ConditionCheck {

abstract TableId tableId();

abstract Integer minRows();
abstract int minRows();

abstract @Nullable Integer maxRows();

Expand Down Expand Up @@ -87,7 +87,7 @@ public abstract static class Builder {

public abstract Builder setTableId(TableId tableId);

public abstract Builder setMinRows(Integer minRows);
public abstract Builder setMinRows(int minRows);

public abstract Builder setMaxRows(Integer maxRows);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public abstract class PubsubMessagesCheck extends ConditionCheck {

abstract SubscriptionName subscription();

abstract Integer minMessages();
abstract int minMessages();

abstract @Nullable Integer maxMessages();

Expand Down Expand Up @@ -104,7 +104,7 @@ public abstract static class Builder {

public abstract Builder setSubscription(SubscriptionName subscription);

public abstract Builder setMinMessages(Integer minMessages);
public abstract Builder setMinMessages(int minMessages);

public abstract Builder setMaxMessages(Integer maxMessages);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,18 +160,18 @@ public static void cleanup() {
@AutoValue
abstract static class TestConfiguration {
/** Rows will be generated for this many minutes. */
abstract Integer getMinutes();
abstract int getMinutes();

/** Data shape: The byte-size for each field. */
abstract Integer getByteSizePerField();
abstract int getByteSizePerField();

/** Data shape: The number of fields per row. */
abstract Integer getNumFields();
abstract int getNumFields();

/**
* Rate of generated elements sent to the sink. Will run with a minimum of 1k rows per second.
*/
abstract Integer getRowsPerSecond();
abstract int getRowsPerSecond();

abstract String getRunner();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ public void testBigtableWriteAndRead() throws IOException {
region,
readInfo.jobId(),
getBeamMetricsName(PipelineMetricsType.COUNTER, READ_ELEMENT_METRIC_NAME));
assertEquals(configuration.getNumRows(), numRecords, 0.5);
assertEquals((double) configuration.getNumRows(), numRecords, 0.5);

// export metrics
MetricsConfiguration metricsConfig =
Expand Down Expand Up @@ -214,13 +214,13 @@ private PipelineLauncher.LaunchInfo testRead() throws IOException {
/** Options for BigtableIO load test. */
@AutoValue
abstract static class Configuration {
abstract Long getNumRows();
abstract long getNumRows();

abstract Integer getPipelineTimeout();
abstract int getPipelineTimeout();

abstract String getRunner();

abstract Integer getValueSizeBytes();
abstract int getValueSizeBytes();

static Configuration of(long numRows, int pipelineTimeout, String runner, int valueSizeBytes) {
return new AutoValue_BigTableIOLT_Configuration.Builder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ public void testWriteAndRead() throws IOException {
region,
readInfo.jobId(),
getBeamMetricsName(PipelineMetricsType.COUNTER, READ_ELEMENT_METRIC_NAME));
assertEquals(configuration.getNumRows(), numRecords, 10.0);
assertEquals((double) configuration.getNumRows(), numRecords, 10.0);
} finally {
// clean up pipelines
if (pipelineLauncher.getJobStatus(project, region, writeInfo.jobId())
Expand Down Expand Up @@ -207,13 +207,13 @@ private PipelineLauncher.LaunchInfo testRead() throws IOException {
/** Options for Kafka IO load test. */
@AutoValue
abstract static class Configuration {
abstract Long getNumRows();
abstract long getNumRows();

abstract Integer getPipelineTimeout();
abstract int getPipelineTimeout();

abstract String getRunner();

abstract Integer getRowSize();
abstract int getRowSize();

static Configuration of(long numRows, int pipelineTimeout, String runner) {
return new AutoValue_KafkaIOLT_Configuration.Builder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public abstract class MongoDBDocumentsCheck extends ConditionCheck {

abstract String collectionName();

abstract Integer minDocuments();
abstract int minDocuments();

abstract @Nullable Integer maxDocuments();

Expand Down Expand Up @@ -88,7 +88,7 @@ public abstract static class Builder {

public abstract Builder setCollectionName(String collectionName);

public abstract Builder setMinDocuments(Integer minDocuments);
public abstract Builder setMinDocuments(int minDocuments);

public abstract Builder setMaxDocuments(Integer maxDocuments);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public abstract class SplunkEventsCheck extends ConditionCheck {

abstract @Nullable String query();

abstract Integer minEvents();
abstract int minEvents();

abstract @Nullable Integer maxEvents();

Expand Down Expand Up @@ -85,7 +85,7 @@ public abstract static class Builder {

public abstract Builder setQuery(String query);

public abstract Builder setMinEvents(Integer minEvents);
public abstract Builder setMinEvents(int minEvents);

public abstract Builder setMaxEvents(Integer maxEvents);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ abstract static class CommonCoder {
@SuppressWarnings("mutable")
abstract byte[] getPayload();

abstract Boolean getNonDeterministic();
abstract boolean getNonDeterministic();

abstract Map<ByteString, ByteString> getState();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
package org.apache.beam.sdk.providers;

import static org.apache.beam.vendor.guava.v32_1_2_jre.com.google.common.base.Preconditions.checkArgument;
import static org.apache.beam.vendor.guava.v32_1_2_jre.com.google.common.base.Preconditions.checkNotNull;

import com.google.auto.service.AutoService;
import com.google.auto.value.AutoValue;
Expand Down Expand Up @@ -90,7 +89,7 @@ public abstract static class GenerateSequenceConfiguration {
@AutoValue
public abstract static class Rate {
@SchemaFieldDescription("Number of elements component of the rate.")
public abstract Long getElements();
public abstract long getElements();

@SchemaFieldDescription("Number of seconds component of the rate.")
@Nullable
Expand All @@ -103,7 +102,7 @@ public static Builder builder() {

@AutoValue.Builder
public abstract static class Builder {
public abstract Builder setElements(Long elements);
public abstract Builder setElements(long elements);

public abstract Builder setSeconds(Long seconds);

Expand All @@ -117,7 +116,7 @@ public static Builder builder() {
}

@SchemaFieldDescription("The minimum number to generate (inclusive).")
public abstract Long getStart();
public abstract long getStart();

@SchemaFieldDescription(
"The maximum number to generate (exclusive). Will be an unbounded sequence if left unspecified.")
Expand All @@ -133,7 +132,7 @@ public static Builder builder() {
@AutoValue.Builder
public abstract static class Builder {

public abstract Builder setStart(Long start);
public abstract Builder setStart(long start);

public abstract Builder setEnd(Long end);

Expand All @@ -143,8 +142,7 @@ public abstract static class Builder {
}

public void validate() {
checkNotNull(this.getStart(), "Must specify a starting point \"start\".");
Long start = this.getStart();
long start = this.getStart();
Long end = this.getEnd();
if (end != null) {
checkArgument(end == -1 || end >= start, "Invalid range [%s, %s)", start, end);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,7 @@ public abstract static class FieldType implements Serializable {
public abstract TypeName getTypeName();

// Whether this type is nullable.
public abstract Boolean getNullable();
public abstract boolean getNullable();

// For logical types, return the implementing class.

Expand Down Expand Up @@ -744,7 +744,7 @@ abstract static class Builder {

abstract Builder setCollectionElementType(@Nullable FieldType collectionElementType);

abstract Builder setNullable(Boolean nullable);
abstract Builder setNullable(boolean nullable);

abstract Builder setMapKeyType(@Nullable FieldType mapKeyType);

Expand Down Expand Up @@ -953,7 +953,7 @@ public final boolean equals(@Nullable Object o) {
}
}
return Objects.equals(getTypeName(), other.getTypeName())
&& Objects.equals(getNullable(), other.getNullable())
&& getNullable() == other.getNullable()
&& Objects.equals(getCollectionElementType(), other.getCollectionElementType())
&& Objects.equals(getMapKeyType(), other.getMapKeyType())
&& Objects.equals(getMapValueType(), other.getMapValueType())
Expand Down Expand Up @@ -984,7 +984,7 @@ public boolean typesEqual(FieldType other) {
return false;
}
}
if (!Objects.equals(getNullable(), other.getNullable())) {
if (getNullable() != other.getNullable()) {
return false;
}
if (!Objects.equals(getMetadata(), other.getMetadata())) {
Expand All @@ -1009,7 +1009,7 @@ public boolean typesEqual(FieldType other) {
/** Check whether two types are equivalent. */
public boolean equivalent(FieldType other, EquivalenceNullablePolicy nullablePolicy) {
if (nullablePolicy == EquivalenceNullablePolicy.SAME
&& !other.getNullable().equals(getNullable())) {
&& other.getNullable() != getNullable()) {
return false;
} else if (nullablePolicy == EquivalenceNullablePolicy.WEAKEN) {
if (getNullable() && !other.getNullable()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -998,7 +998,7 @@ public static Fanout of(SerializableFunction<Row, Integer> f) {

abstract @Nullable Fanout getFanout();

abstract Boolean getFewKeys();
abstract boolean getFewKeys();

abstract ByFields<InputT> getByFields();

Expand All @@ -1014,7 +1014,7 @@ public static Fanout of(SerializableFunction<Row, Integer> f) {
abstract static class Builder<InputT> {
public abstract Builder<InputT> setFanout(@Nullable Fanout value);

public abstract Builder<InputT> setFewKeys(Boolean fewKeys);
public abstract Builder<InputT> setFewKeys(boolean fewKeys);

abstract Builder<InputT> setByFields(ByFields<InputT> byFields);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -728,7 +728,7 @@ abstract static class SchemaFieldNumberSimpleClass {
abstract String getStr();

@SchemaFieldNumber("0")
abstract Long getLng();
abstract long getLng();
}

private static final Schema FIELD_NUMBER_SCHEMA =
Expand Down Expand Up @@ -866,7 +866,7 @@ abstract static class SchemaFieldDescriptionSimpleClass {
"This field is a long in the row. Interestingly enough, longs are e"
+ "ncoded as int64 by Beam, while ints are encoded as int32. "
+ "Sign semantics are another thing")
abstract Long getLng();
abstract long getLng();
}

private static final Schema FIELD_DESCRIPTION_SCHEMA =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,13 @@ public void equals_sameSchemaDifferentType_returnsFalse() throws NoSuchSchemaExc
public abstract static class SimpleAutoValue {
public abstract String getString();

public abstract Integer getInt32();
public abstract int getInt32();

public abstract Long getInt64();
public abstract long getInt64();

public abstract DateTime getDatetime();

public static SimpleAutoValue of(String string, Integer int32, Long int64, DateTime datetime) {
public static SimpleAutoValue of(String string, int int32, long int64, DateTime datetime) {
return new AutoValue_SchemaCoderTest_SimpleAutoValue(string, int32, int64, datetime);
}
}
Expand Down
Loading
Loading