Skip to content

Commit

Permalink
Add checkstyle and intellij rule to prohibit unnecessary qualifiers i…
Browse files Browse the repository at this point in the history
…n interfaces (apache#4958)

* add checkstyle and intellij rule

* fix tc fail
  • Loading branch information
jihoonson authored and gianm committed Oct 13, 2017
1 parent c07678b commit 675c6c0
Show file tree
Hide file tree
Showing 191 changed files with 622 additions and 620 deletions.
2 changes: 2 additions & 0 deletions .idea/inspectionProfiles/Druid.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion api/src/main/java/io/druid/cli/CliCommandCreator.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@
*/
public interface CliCommandCreator
{
public void addCommands(Cli.CliBuilder builder);
void addCommands(Cli.CliBuilder builder);
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@
public interface ByteBufferInputRowParser extends InputRowParser<ByteBuffer>
{
@Override
public ByteBufferInputRowParser withParseSpec(ParseSpec parseSpec);
ByteBufferInputRowParser withParseSpec(ParseSpec parseSpec);
}
2 changes: 1 addition & 1 deletion api/src/main/java/io/druid/data/input/Committer.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@ public interface Committer extends Runnable
* which needs to be serialized and deserialized by Jackson.
* Commit metadata can be a complex type, but we recommend keeping it to List/Map/"Primitive JSON" types
*/
public Object getMetadata();
Object getMetadata();
}
3 changes: 1 addition & 2 deletions api/src/main/java/io/druid/data/input/FirehoseFactoryV2.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,5 @@
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type")
public interface FirehoseFactoryV2<T extends InputRowParser>
{
public FirehoseV2 connect(T parser, Object lastCommit) throws IOException, ParseException;

FirehoseV2 connect(T parser, Object lastCommit) throws IOException, ParseException;
}
6 changes: 3 additions & 3 deletions api/src/main/java/io/druid/data/input/FirehoseV2.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,12 @@ public interface FirehoseV2 extends Closeable
*
* @return true if and when there is another row available, false if the stream has dried up
*/
public boolean advance();
boolean advance();

/**
* @return The current row
*/
public InputRow currRow();
InputRow currRow();

/**
* Returns a Committer that will "commit" everything read up to the point at which makeCommitter() is called.
Expand All @@ -86,5 +86,5 @@ public interface FirehoseV2 extends Closeable
* A simple implementation of this interface might do nothing when run() is called,
* and save proper commit information in metadata
*/
public Committer makeCommitter();
Committer makeCommitter();
}
2 changes: 1 addition & 1 deletion api/src/main/java/io/druid/data/input/InputRow.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,5 @@ public interface InputRow extends Row
*
* @return the dimensions that exist in this row.
*/
public List<String> getDimensions();
List<String> getDimensions();
}
14 changes: 7 additions & 7 deletions api/src/main/java/io/druid/data/input/Row.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,15 @@ public interface Row extends Comparable<Row>
*
* @return the timestamp from the epoch in milliseconds.
*/
public long getTimestampFromEpoch();
long getTimestampFromEpoch();

/**
* Returns the timestamp from the epoch as an org.joda.time.DateTime. If the event happened _right now_, this would return the
* same thing as new DateTime();
*
* @return the timestamp from the epoch as an org.joda.time.DateTime object.
*/
public DateTime getTimestamp();
DateTime getTimestamp();

/**
* Returns the list of dimension values for the given column name.
Expand All @@ -61,7 +61,7 @@ public interface Row extends Comparable<Row>
*
* @return the list of values for the provided column name
*/
public List<String> getDimension(String dimension);
List<String> getDimension(String dimension);

/**
* Returns the raw dimension value for the given column name. This is different from #getDimension which
Expand All @@ -71,7 +71,7 @@ public interface Row extends Comparable<Row>
*
* @return the value of the provided column name
*/
public Object getRaw(String dimension);
Object getRaw(String dimension);

/**
* Returns the float value of the given metric column.
Expand All @@ -81,7 +81,7 @@ public interface Row extends Comparable<Row>
*
* @return the float value for the provided column name.
*/
public float getFloatMetric(String metric);
float getFloatMetric(String metric);

/**
* Returns the long value of the given metric column.
Expand All @@ -91,7 +91,7 @@ public interface Row extends Comparable<Row>
*
* @return the long value for the provided column name.
*/
public long getLongMetric(String metric);
long getLongMetric(String metric);

/**
* Returns the double value of the given metric column.
Expand All @@ -101,5 +101,5 @@ public interface Row extends Comparable<Row>
*
* @return the double value for the provided column name.
*/
public double getDoubleMetric(String metric);
double getDoubleMetric(String metric);
}
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public static ValueType fromString(String name)
}
}

public static enum MultiValueHandling
public enum MultiValueHandling
{
SORTED_ARRAY,
SORTED_SET,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@
})
public interface InputRowParser<T>
{
public InputRow parse(T input);
InputRow parse(T input);

public ParseSpec getParseSpec();
ParseSpec getParseSpec();

public InputRowParser withParseSpec(ParseSpec parseSpec);
InputRowParser withParseSpec(ParseSpec parseSpec);
}
2 changes: 1 addition & 1 deletion api/src/main/java/io/druid/initialization/DruidModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@
@ExtensionPoint
public interface DruidModule extends com.google.inject.Module
{
public List<? extends Module> getJacksonModules();
List<? extends Module> getJacksonModules();
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@
@ExtensionPoint
public interface DataSegmentMover
{
public DataSegment move(DataSegment segment, Map<String, Object> targetLoadSpec) throws SegmentLoadingException;
DataSegment move(DataSegment segment, Map<String, Object> targetLoadSpec) throws SegmentLoadingException;
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,5 @@ public interface DataSegmentPuller
*
* @throws SegmentLoadingException if there are any errors
*/
public void getSegmentFiles(DataSegment segment, File dir) throws SegmentLoadingException;
void getSegmentFiles(DataSegment segment, File dir) throws SegmentLoadingException;
}
4 changes: 2 additions & 2 deletions api/src/main/java/io/druid/segment/loading/LoadSpec.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ public interface LoadSpec
* @param destDir The destination directory
* @return The byte count of data put in the destination directory
*/
public LoadSpecResult loadSegment(File destDir) throws SegmentLoadingException;
LoadSpecResult loadSegment(File destDir) throws SegmentLoadingException;

// Hold interesting data about the results of the segment load
public static class LoadSpecResult
class LoadSpecResult
{
private final long size;

Expand Down
6 changes: 3 additions & 3 deletions api/src/main/java/io/druid/segment/loading/URIDataPuller.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public interface URIDataPuller
*
* @throws IOException
*/
public InputStream getInputStream(URI uri) throws IOException;
InputStream getInputStream(URI uri) throws IOException;

/**
* Returns an abstract "version" for the URI. The exact meaning of the version is left up to the implementation.
Expand All @@ -52,13 +52,13 @@ public interface URIDataPuller
*
* @throws IOException on error
*/
public String getVersion(URI uri) throws IOException;
String getVersion(URI uri) throws IOException;

/**
* Evaluates a Throwable to see if it is recoverable. This is expected to be used in conjunction with the other methods
* to determine if anything thrown from the method should be retried.
*
* @return Predicate function indicating if the Throwable is recoverable
*/
public Predicate<Throwable> shouldRetryPredicate();
Predicate<Throwable> shouldRetryPredicate();
}
2 changes: 1 addition & 1 deletion api/src/main/java/io/druid/tasklogs/TaskLogPusher.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@
@ExtensionPoint
public interface TaskLogPusher
{
public void pushTaskLog(String taskid, File logFile) throws IOException;
void pushTaskLog(String taskid, File logFile) throws IOException;
}
2 changes: 1 addition & 1 deletion api/src/main/java/io/druid/tasklogs/TaskLogStreamer.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,5 @@ public interface TaskLogStreamer
*
* @return input supplier for this log, if available from this provider
*/
public Optional<ByteSource> streamTaskLog(String taskid, long offset) throws IOException;
Optional<ByteSource> streamTaskLog(String taskid, long offset) throws IOException;
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public interface PartitionChunk<T> extends Comparable<PartitionChunk<T>>
*
* @return the payload
*/
public T getObject();
T getObject();

/**
* Determines if this PartitionChunk abuts another PartitionChunk. A sequence of abutting PartitionChunks should
Expand All @@ -44,29 +44,29 @@ public interface PartitionChunk<T> extends Comparable<PartitionChunk<T>>
* @param chunk input chunk
* @return true if this chunk abuts the input chunk
*/
public boolean abuts(PartitionChunk<T> chunk);
boolean abuts(PartitionChunk<T> chunk);

/**
* Returns true if this chunk is the beginning of the partition. Most commonly, that means it represents the range
* [-infinity, X) for some concrete X.
*
* @return true if the chunk is the beginning of the partition
*/
public boolean isStart();
boolean isStart();

/**
* Returns true if this chunk is the end of the partition. Most commonly, that means it represents the range
* [X, infinity] for some concrete X.
*
* @return true if the chunk is the beginning of the partition
*/
public boolean isEnd();
boolean isEnd();

/**
* Returns the partition chunk number of this PartitionChunk. I.e. if there are 4 partitions in total and this
* is the 3rd partition, it will return 2
*
* @return the sequential numerical id of this partition chunk
*/
public int getChunkNumber();
int getChunkNumber();
}
10 changes: 5 additions & 5 deletions api/src/main/java/io/druid/timeline/partition/ShardSpec.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,18 @@
})
public interface ShardSpec
{
public <T> PartitionChunk<T> createChunk(T obj);
<T> PartitionChunk<T> createChunk(T obj);

public boolean isInChunk(long timestamp, InputRow inputRow);
boolean isInChunk(long timestamp, InputRow inputRow);

public int getPartitionNum();
int getPartitionNum();

public ShardSpecLookup getLookup(List<ShardSpec> shardSpecs);
ShardSpecLookup getLookup(List<ShardSpec> shardSpecs);

/**
* Get the possible range of each dimension for the rows this shard contains.
*
* @return map of dimensions to its possible range. Dimensions with unknown possible range are not mapped
*/
public Map<String, Range<String>> getDomain();
Map<String, Range<String>> getDomain();
}
8 changes: 4 additions & 4 deletions api/src/test/java/io/druid/guice/PolyBindTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -140,14 +140,14 @@ public void configure(Binder binder)
}
}

public static interface Gogo
public interface Gogo
{
public String go();
String go();
}

public static interface GogoSally
public interface GogoSally
{
public String go();
String go();
}

public static class GoA implements Gogo, GogoSally
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ public interface BitmapFactory
*
* @return the new bitmap
*/
public MutableBitmap makeEmptyMutableBitmap();
MutableBitmap makeEmptyMutableBitmap();

public ImmutableBitmap makeEmptyImmutableBitmap();
ImmutableBitmap makeEmptyImmutableBitmap();

public ImmutableBitmap makeImmutableBitmap(MutableBitmap mutableBitmap);
ImmutableBitmap makeImmutableBitmap(MutableBitmap mutableBitmap);

/**
* Given a ByteBuffer pointing at a serialized version of a bitmap,
Expand All @@ -47,7 +47,7 @@ public interface BitmapFactory
*
* @return the new bitmap
*/
public ImmutableBitmap mapImmutableBitmap(ByteBuffer b);
ImmutableBitmap mapImmutableBitmap(ByteBuffer b);

/**
* Compute the union (bitwise-OR) of a set of bitmaps. They are assumed to be
Expand All @@ -61,7 +61,7 @@ public interface BitmapFactory
* @throws ClassCastException if one of the ImmutableGenericBitmap objects if not an instance
* of WrappedImmutableConciseBitmap
*/
public ImmutableBitmap union(Iterable<ImmutableBitmap> b);
ImmutableBitmap union(Iterable<ImmutableBitmap> b);

/**
* Compute the intersection (bitwise-AND) of a set of bitmaps. They are assumed to be
Expand All @@ -75,9 +75,9 @@ public interface BitmapFactory
* @throws ClassCastException if one of the ImmutableGenericBitmap objects if not an instance
* of WrappedImmutableConciseBitmap
*/
public ImmutableBitmap intersection(Iterable<ImmutableBitmap> b);
ImmutableBitmap intersection(Iterable<ImmutableBitmap> b);

public ImmutableBitmap complement(ImmutableBitmap b);
ImmutableBitmap complement(ImmutableBitmap b);

public ImmutableBitmap complement(ImmutableBitmap b, int length);
ImmutableBitmap complement(ImmutableBitmap b, int length);
}
Loading

0 comments on commit 675c6c0

Please sign in to comment.