Skip to content

Commit

Permalink
Add GenericWhitespace checkstyle check (apache#5668)
Browse files Browse the repository at this point in the history
  • Loading branch information
leventov authored and nishantmonu51 committed Apr 23, 2018
1 parent ca3f833 commit a3a9ada
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 34 deletions.
1 change: 1 addition & 0 deletions codestyle/checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@
<property name="tokens" value="DOT"/>
<property name="allowLineBreaks" value="false"/>
</module>
<module name="GenericWhitespace"/>

<module name="Indentation">
<property name="basicOffset" value="2"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ public int getMaxIntermediateSize()
@Override
public List<AggregatorFactory> getRequiredColumns()
{
return Collections.<AggregatorFactory> singletonList(
return Collections.singletonList(
new DoublesSketchAggregatorFactory(
fieldName,
fieldName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,17 @@

package io.druid.query.aggregation.datasketches.quantiles;

import java.util.Arrays;
import java.util.List;

import com.fasterxml.jackson.databind.Module;
import com.fasterxml.jackson.databind.jsontype.NamedType;
import com.fasterxml.jackson.databind.module.SimpleModule;
import com.google.inject.Binder;
import com.yahoo.sketches.quantiles.DoublesSketch;

import io.druid.initialization.DruidModule;
import io.druid.segment.serde.ComplexMetrics;

import java.util.Collections;
import java.util.List;

public class DoublesSketchModule implements DruidModule
{

Expand All @@ -53,15 +52,17 @@ public void configure(final Binder binder)
@Override
public List<? extends Module> getJacksonModules()
{
return Arrays.<Module> asList(
new SimpleModule("DoublesQuantilesSketchModule").registerSubtypes(
new NamedType(DoublesSketchAggregatorFactory.class, DOUBLES_SKETCH),
new NamedType(DoublesSketchMergeAggregatorFactory.class, DOUBLES_SKETCH_MERGE),
new NamedType(DoublesSketchToHistogramPostAggregator.class, DOUBLES_SKETCH_HISTOGRAM_POST_AGG),
new NamedType(DoublesSketchToQuantilePostAggregator.class, DOUBLES_SKETCH_QUANTILE_POST_AGG),
new NamedType(DoublesSketchToQuantilesPostAggregator.class, DOUBLES_SKETCH_QUANTILES_POST_AGG),
new NamedType(DoublesSketchToStringPostAggregator.class, DOUBLES_SKETCH_TO_STRING_POST_AGG))
.addSerializer(DoublesSketch.class, new DoublesSketchJsonSerializer()));
return Collections.<Module>singletonList(
new SimpleModule("DoublesQuantilesSketchModule")
.registerSubtypes(
new NamedType(DoublesSketchAggregatorFactory.class, DOUBLES_SKETCH),
new NamedType(DoublesSketchMergeAggregatorFactory.class, DOUBLES_SKETCH_MERGE),
new NamedType(DoublesSketchToHistogramPostAggregator.class, DOUBLES_SKETCH_HISTOGRAM_POST_AGG),
new NamedType(DoublesSketchToQuantilePostAggregator.class, DOUBLES_SKETCH_QUANTILE_POST_AGG),
new NamedType(DoublesSketchToQuantilesPostAggregator.class, DOUBLES_SKETCH_QUANTILES_POST_AGG),
new NamedType(DoublesSketchToStringPostAggregator.class, DOUBLES_SKETCH_TO_STRING_POST_AGG)
).addSerializer(DoublesSketch.class, new DoublesSketchJsonSerializer())
);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,7 @@ public void unlock(final Task task, final Interval interval)
return;
}

final List<TaskLockPosse > possesHolder = dsRunning.get(interval);
final List<TaskLockPosse> possesHolder = dsRunning.get(interval);
if (possesHolder == null || possesHolder.isEmpty()) {
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ public void testSecuredGetCompleteTasks()
expectAuthorizationTokenCheck();

List<String> tasksIds = ImmutableList.of("id_1", "id_2", "id_3");
EasyMock.<Collection<? extends TaskRunnerWorkItem>> expect(taskRunner.getRunningTasks()).andReturn(
EasyMock.<Collection<? extends TaskRunnerWorkItem>>expect(taskRunner.getRunningTasks()).andReturn(
ImmutableList.of(
new MockTaskRunnerWorkItem(tasksIds.get(0), null),
new MockTaskRunnerWorkItem(tasksIds.get(1), null),
Expand Down Expand Up @@ -373,7 +373,7 @@ public void testGetRunningTasksByDataSource()
{

List<String> tasksIds = ImmutableList.of("id_1", "id_2");
EasyMock.<Collection<? extends TaskRunnerWorkItem>> expect(taskRunner.getRunningTasks()).andReturn(
EasyMock.<Collection<? extends TaskRunnerWorkItem>>expect(taskRunner.getRunningTasks()).andReturn(
ImmutableList.of(
new MockTaskRunnerWorkItem(tasksIds.get(0), null),
new MockTaskRunnerWorkItem(tasksIds.get(1), null)));
Expand All @@ -398,7 +398,7 @@ public void testGetRunningTasksByDataSourceNeg()
expectAuthorizationTokenCheck();

List<String> tasksIds = ImmutableList.of("id_1", "id_2");
EasyMock.<Collection<? extends TaskRunnerWorkItem>> expect(taskRunner.getRunningTasks()).andReturn(
EasyMock.<Collection<? extends TaskRunnerWorkItem>>expect(taskRunner.getRunningTasks()).andReturn(
ImmutableList.of(
new MockTaskRunnerWorkItem(tasksIds.get(0), null),
new MockTaskRunnerWorkItem(tasksIds.get(1), null)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public static <T> Sequence<T> wrap(Sequence<T> seq, SequenceWrapper wrapper)
return new WrappingSequence<>(seq, wrapper);
}

public static <T> Sequence<T> withEffect(final Sequence <T> seq, final Runnable effect, final Executor exec)
public static <T> Sequence<T> withEffect(final Sequence<T> seq, final Runnable effect, final Executor exec)
{
// Uses YieldingSequenceBase to be able to execute the effect if all elements of the wrapped seq are processed
// (i. e. it "is done"), but the yielder of the underlying seq throws some exception from close(). This logic could
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ public Integer accumulate(Integer accumulated, Integer in)
}

@SuppressWarnings("unchecked")
public void testAll(Iterable <List<Integer>> vals) throws IOException
public void testAll(Iterable<List<Integer>> vals) throws IOException
{
final Iterable<TestSequence<Integer>> theSequences = Iterables.transform(
vals,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

import com.google.common.collect.ImmutableList;
import io.druid.query.dimension.DefaultDimensionSpec;
import io.druid.query.dimension.DimensionSpec;
import org.junit.Assert;
import org.junit.Test;

Expand All @@ -32,16 +31,16 @@ public class ColumnComparisonDimFilterTest
@Test
public void testGetCacheKey()
{
ColumnComparisonDimFilter columnComparisonDimFilter = new ColumnComparisonDimFilter(ImmutableList.<DimensionSpec> of(
ColumnComparisonDimFilter columnComparisonDimFilter = new ColumnComparisonDimFilter(ImmutableList.of(
DefaultDimensionSpec.of("abc"),
DefaultDimensionSpec.of("d")
));
ColumnComparisonDimFilter columnComparisonDimFilter2 = new ColumnComparisonDimFilter(ImmutableList.<DimensionSpec> of(
ColumnComparisonDimFilter columnComparisonDimFilter2 = new ColumnComparisonDimFilter(ImmutableList.of(
DefaultDimensionSpec.of("d"),
DefaultDimensionSpec.of("abc")
));
ColumnComparisonDimFilter columnComparisonDimFilter3 = new ColumnComparisonDimFilter(
ImmutableList.<DimensionSpec> of(
ImmutableList.of(
DefaultDimensionSpec.of("d"),
DefaultDimensionSpec.of("e")
)
Expand All @@ -61,19 +60,19 @@ ImmutableList.<DimensionSpec> of(
public void testHashCode()
{
ColumnComparisonDimFilter columnComparisonDimFilter = new ColumnComparisonDimFilter(
ImmutableList.<DimensionSpec> of(
ImmutableList.of(
DefaultDimensionSpec.of("abc"),
DefaultDimensionSpec.of("d")
)
);
ColumnComparisonDimFilter columnComparisonDimFilter2 = new ColumnComparisonDimFilter(
ImmutableList.<DimensionSpec> of(
ImmutableList.of(
DefaultDimensionSpec.of("d"),
DefaultDimensionSpec.of("abc")
)
);
ColumnComparisonDimFilter columnComparisonDimFilter3 = new ColumnComparisonDimFilter(
ImmutableList.<DimensionSpec> of(
ImmutableList.of(
DefaultDimensionSpec.of("d"),
DefaultDimensionSpec.of("e")
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,19 @@
package io.druid.segment.realtime.appenderator;

import io.druid.data.input.InputRow;
import io.druid.query.SegmentDescriptor;
import io.druid.segment.indexing.RealtimeTuningConfig;
import io.druid.segment.realtime.SegmentPublisher;
import io.druid.segment.realtime.plumber.IntervalStartVersioningPolicy;
import io.druid.segment.realtime.plumber.NoopRejectionPolicyFactory;
import io.druid.segment.realtime.plumber.SegmentHandoffNotifier;
import io.druid.segment.realtime.plumber.SegmentHandoffNotifierFactory;
import io.druid.server.coordination.DataSegmentAnnouncer;
import io.druid.timeline.DataSegment;
import org.easymock.EasyMock;
import org.junit.Assert;
import org.junit.Test;

import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.Executor;

public class AppenderatorPlumberTest
{
Expand All @@ -46,7 +43,7 @@ public AppenderatorPlumberTest() throws Exception
this.appenderatorTester = new AppenderatorTester(10);
DataSegmentAnnouncer segmentAnnouncer = EasyMock
.createMock(DataSegmentAnnouncer.class);
segmentAnnouncer.announceSegment(EasyMock.<DataSegment> anyObject());
segmentAnnouncer.announceSegment(EasyMock.anyObject());
EasyMock.expectLastCall().anyTimes();

SegmentPublisher segmentPublisher = EasyMock
Expand All @@ -62,9 +59,9 @@ public AppenderatorPlumberTest() throws Exception
EasyMock
.expect(
handoffNotifier.registerSegmentHandoffCallback(
EasyMock.<SegmentDescriptor> anyObject(),
EasyMock.<Executor> anyObject(),
EasyMock.<Runnable> anyObject())).andReturn(true).anyTimes();
EasyMock.anyObject(),
EasyMock.anyObject(),
EasyMock.anyObject())).andReturn(true).anyTimes();

RealtimeTuningConfig tuningConfig = new RealtimeTuningConfig(
1,
Expand Down

0 comments on commit a3a9ada

Please sign in to comment.