Skip to content

Commit

Permalink
STORM-3440: client: fix all checkstyle warnings (apache#3055)
Browse files Browse the repository at this point in the history
* STORM-3440: client: fix all checkstyle warnings
  • Loading branch information
krichter722 authored and srdo committed Jul 7, 2019
1 parent 98ac65f commit 925422a
Show file tree
Hide file tree
Showing 459 changed files with 6,037 additions and 6,078 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,21 +57,21 @@ public Pair<Integer, Integer> init() {

@Override
public Pair<Integer, Integer> apply(Pair<Integer, Integer> sumAndCount, Integer value) {
return Pair.of(sumAndCount._1 + value, sumAndCount._2 + 1);
return Pair.of(sumAndCount.value1 + value, sumAndCount.value2 + 1);
}

@Override
public Pair<Integer, Integer> merge(Pair<Integer, Integer> sumAndCount1, Pair<Integer, Integer> sumAndCount2) {
System.out.println("Merge " + sumAndCount1 + " and " + sumAndCount2);
return Pair.of(
sumAndCount1._1 + sumAndCount2._1,
sumAndCount1._2 + sumAndCount2._2
sumAndCount1.value1 + sumAndCount2.value1,
sumAndCount1.value2 + sumAndCount2.value2
);
}

@Override
public Double result(Pair<Integer, Integer> sumAndCount) {
return (double) sumAndCount._1 / sumAndCount._2;
return (double) sumAndCount.value1 / sumAndCount.value2;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public static void main(String[] args) throws Exception {
StreamBuilder builder = new StreamBuilder();
Stream<Tuple3<Integer, Long, Long>> stream = builder.newStream(new RandomIntegerSpout(), TupleValueMappers.of(0, 1, 2));

PairStream<Long, Integer> pairs = stream.mapToPair(t -> Pair.of(t._2 / 10000, t._1));
PairStream<Long, Integer> pairs = stream.mapToPair(t -> Pair.of(t.value2 / 10000, t.value1));

pairs.window(TumblingWindows.of(Count.of(10))).groupByKey().print();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@

import org.apache.storm.validation.ConfigValidation.Validator;
import org.apache.storm.validation.ConfigValidationAnnotations.CustomValidator;
import org.apache.storm.validation.ConfigValidationAnnotations.isBoolean;
import org.apache.storm.validation.ConfigValidationAnnotations.isInteger;
import org.apache.storm.validation.ConfigValidationAnnotations.isMapEntryType;
import org.apache.storm.validation.ConfigValidationAnnotations.isPositiveNumber;
import org.apache.storm.validation.ConfigValidationAnnotations.isString;
import org.apache.storm.validation.ConfigValidationAnnotations.IsBoolean;
import org.apache.storm.validation.ConfigValidationAnnotations.IsInteger;
import org.apache.storm.validation.ConfigValidationAnnotations.IsMapEntryType;
import org.apache.storm.validation.ConfigValidationAnnotations.IsPositiveNumber;
import org.apache.storm.validation.ConfigValidationAnnotations.IsString;
import org.apache.storm.validation.NotConf;
import org.apache.storm.validation.Validated;

Expand All @@ -28,7 +28,7 @@ public class Configs implements Validated {
* @deprecated please use {@link HdfsSpout#setReaderType(String)}
*/
@Deprecated
@isString
@IsString
@CustomValidator(validatorClass = ReaderTypeValidator.class)
public static final String READER_TYPE = "hdfsspout.reader.type";
public static final String TEXT = "text";
Expand All @@ -38,67 +38,67 @@ public class Configs implements Validated {
* @deprecated please use {@link HdfsSpout#setHdfsUri(String)}
*/
@Deprecated
@isString
@IsString
public static final String HDFS_URI = "hdfsspout.hdfs";
/**
* Required - dir from which to read files.
* @deprecated please use {@link HdfsSpout#setSourceDir(String)}
*/
@Deprecated
@isString
@IsString
public static final String SOURCE_DIR = "hdfsspout.source.dir";
/**
* Required - completed files will be moved here.
* @deprecated please use {@link HdfsSpout#setArchiveDir(String)}
*/
@Deprecated
@isString
@IsString
public static final String ARCHIVE_DIR = "hdfsspout.archive.dir";
/**
* Required - unparsable files will be moved here.
* @deprecated please use {@link HdfsSpout#setBadFilesDir(String)}
*/
@Deprecated
@isString
@IsString
public static final String BAD_DIR = "hdfsspout.badfiles.dir";
/**
* Directory in which lock files will be created.
* @deprecated please use {@link HdfsSpout#setLockDir(String)}
*/
@Deprecated
@isString
@IsString
public static final String LOCK_DIR = "hdfsspout.lock.dir";
/**
* Commit after N records. 0 disables this.
* @deprecated please use {@link HdfsSpout#setCommitFrequencyCount(int)}
*/
@Deprecated
@isInteger
@isPositiveNumber(includeZero = true)
@IsInteger
@IsPositiveNumber(includeZero = true)
public static final String COMMIT_FREQ_COUNT = "hdfsspout.commit.count";
/**
* Commit after N secs. cannot be disabled.
* @deprecated please use {@link HdfsSpout#setCommitFrequencySec(int)}
*/
@Deprecated
@isInteger
@isPositiveNumber
@IsInteger
@IsPositiveNumber
public static final String COMMIT_FREQ_SEC = "hdfsspout.commit.sec";
/**
* Max outstanding.
* @deprecated please use {@link HdfsSpout#setMaxOutstanding(int)}
*/
@Deprecated
@isInteger
@isPositiveNumber(includeZero = true)
@IsInteger
@IsPositiveNumber(includeZero = true)
public static final String MAX_OUTSTANDING = "hdfsspout.max.outstanding";
/**
* Lock timeout.
* @deprecated please use {@link HdfsSpout#setLockTimeoutSec(int)}
*/
@Deprecated
@isInteger
@isPositiveNumber
@IsInteger
@IsPositiveNumber
public static final String LOCK_TIMEOUT = "hdfsspout.lock.timeout.sec";
/**
* If clocks on machines in the Storm cluster are in sync inactivity duration after which locks are considered
Expand All @@ -107,14 +107,14 @@ public class Configs implements Validated {
* @deprecated please use {@link HdfsSpout#setClocksInSync(boolean)}
*/
@Deprecated
@isBoolean
@IsBoolean
public static final String CLOCKS_INSYNC = "hdfsspout.clocks.insync";
/**
* Ignore suffix.
* @deprecated please use {@link HdfsSpout#setIgnoreSuffix(String)}
*/
@Deprecated
@isString
@IsString
public static final String IGNORE_SUFFIX = "hdfsspout.ignore.suffix";
/**
* Filenames with this suffix in archive dir will be ignored by the Spout.
Expand All @@ -125,7 +125,7 @@ public class Configs implements Validated {
public static final int DEFAULT_COMMIT_FREQ_SEC = 10;
public static final int DEFAULT_MAX_OUTSTANDING = 10000;
public static final int DEFAULT_LOCK_TIMEOUT = 5 * 60; // 5 min
@isMapEntryType(keyType = String.class, valueType = String.class)
@IsMapEntryType(keyType = String.class, valueType = String.class)
public static final String DEFAULT_HDFS_CONFIG_KEY = "hdfs.config";

public static class ReaderTypeValidator extends Validator {
Expand Down
2 changes: 1 addition & 1 deletion storm-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@
<!--Note - the version would be inherited-->
<configuration>
<excludes>**/generated/**</excludes>
<maxAllowedViolations>3067</maxAllowedViolations>
<maxAllowedViolations>0</maxAllowedViolations>
</configuration>
</plugin>
<plugin>
Expand Down
Loading

0 comments on commit 925422a

Please sign in to comment.