mirror of https://github.com/apache/druid.git
Add checkstyle rules about imports and empty lines between members (#6543)
* Add checkstyle rules about imports and empty lines between members * Add suppressions * Update Eclipse import order * Add empty line * Fix StatsDEmitter
This commit is contained in:
parent
a438a9b99c
commit
87b96fb1fd
|
@ -16,6 +16,7 @@
|
|||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.druid.common.aws;
|
||||
|
||||
import com.amazonaws.services.s3.S3ClientOptions;
|
||||
|
|
|
@ -539,14 +539,11 @@ public class FilterPartitionBenchmark
|
|||
|
||||
private static class NoBitmapSelectorDimFilter extends SelectorDimFilter
|
||||
{
|
||||
public NoBitmapSelectorDimFilter(
|
||||
String dimension,
|
||||
String value,
|
||||
ExtractionFn extractionFn
|
||||
)
|
||||
NoBitmapSelectorDimFilter(String dimension, String value, ExtractionFn extractionFn)
|
||||
{
|
||||
super(dimension, value, extractionFn);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Filter toFilter()
|
||||
{
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.druid.benchmark;
|
||||
|
||||
import com.google.common.base.Function;
|
||||
|
|
|
@ -116,6 +116,7 @@ public class TimeCompareBenchmark
|
|||
private int threshold;
|
||||
|
||||
protected static final Map<String, String> scriptDoubleSum = new HashMap<>();
|
||||
|
||||
static {
|
||||
scriptDoubleSum.put("fnAggregate", "function aggregate(current, a) { return current + a }");
|
||||
scriptDoubleSum.put("fnReset", "function reset() { return 0 }");
|
||||
|
|
|
@ -20,8 +20,8 @@
|
|||
-->
|
||||
|
||||
<!DOCTYPE suppressions PUBLIC
|
||||
"-//Puppy Crawl//DTD Suppressions 1.0//EN"
|
||||
"http://www.puppycrawl.com/dtds/suppressions_1_0.dtd">
|
||||
"-//Checkstyle//DTD SuppressionFilter Configuration 1.2//EN"
|
||||
"https://checkstyle.org/dtds/suppressions_1_2.dtd">
|
||||
|
||||
<suppressions>
|
||||
<!-- See http://checkstyle.sourceforge.net/config_filters.html#SuppressionFilter for examples -->
|
||||
|
@ -56,4 +56,10 @@
|
|||
|
||||
<!-- extendedset is a fork of Alessandro Colantonio's CONCISE (COmpressed 'N' Composable Integer SEt) repository and licensed to ASF under a CLA is not true. -->
|
||||
<suppress checks="Header" files="[\\/]extendedset[\\/]" />
|
||||
|
||||
<!-- See https://github.com/checkstyle/checkstyle/issues/5510 and the ImportOrder definition in checkstyle.xml -->
|
||||
<suppress checks="ImportOrder" message="^'java\..*'.*" />
|
||||
|
||||
<suppress checks="ImportOrder" files="[\\/]target[\\/]generated-test-sources[\\/]" />
|
||||
<suppress checks="EmptyLineSeparator" files="[\\/]target[\\/]generated-test-sources[\\/]" />
|
||||
</suppressions>
|
||||
|
|
|
@ -29,17 +29,15 @@
|
|||
<property name="fileExtensions" value="java"/>
|
||||
</module>
|
||||
|
||||
<module name="SuppressionCommentFilter">
|
||||
<property name="offCommentFormat" value="CHECKSTYLE.OFF\: ([\w\|]+)"/>
|
||||
<property name="onCommentFormat" value="CHECKSTYLE.ON\: ([\w\|]+)"/>
|
||||
<property name="checkFormat" value="$1"/>
|
||||
</module>
|
||||
|
||||
<module name="NewlineAtEndOfFile"/>
|
||||
<module name="FileTabCharacter"/>
|
||||
|
||||
<module name="TreeWalker">
|
||||
<module name="FileContentsHolder"/>
|
||||
<module name="SuppressionCommentFilter">
|
||||
<property name="offCommentFormat" value="CHECKSTYLE.OFF\: ([\w\|]+)"/>
|
||||
<property name="onCommentFormat" value="CHECKSTYLE.ON\: ([\w\|]+)"/>
|
||||
<property name="checkFormat" value="$1"/>
|
||||
</module>
|
||||
|
||||
<module name="RedundantModifier">
|
||||
<property name="tokens" value="INTERFACE_DEF,ENUM_DEF,METHOD_DEF"/>
|
||||
|
@ -96,6 +94,12 @@
|
|||
</module>
|
||||
<module name="GenericWhitespace"/>
|
||||
|
||||
<module name="EmptyLineSeparator">
|
||||
<property name="tokens" value="PACKAGE_DEF,IMPORT,STATIC_IMPORT,INTERFACE_DEF,STATIC_INIT,INSTANCE_INIT,CTOR_DEF,VARIABLE_DEF"/>
|
||||
<property name="allowNoEmptyLineBetweenFields" value="true"/>
|
||||
<property name="allowMultipleEmptyLinesInsideClassMembers" value="false"/>
|
||||
</module>
|
||||
|
||||
<module name="Indentation">
|
||||
<property name="basicOffset" value="2"/>
|
||||
<property name="caseIndent" value="2"/>
|
||||
|
@ -199,6 +203,16 @@
|
|||
</module>
|
||||
<module name="PackageDeclaration"/>
|
||||
|
||||
<!-- See https://github.com/checkstyle/checkstyle/issues/5510 and the ImportOrder suppression in
|
||||
checkstyle-suppressions.xml -->
|
||||
<module name="ImportOrder">
|
||||
<property name="groups" value="*,javax,java"/>
|
||||
<property name="ordered" value="true"/>
|
||||
<property name="separated" value="true"/>
|
||||
<property name="option" value="bottom"/>
|
||||
<property name="sortStaticImportsAlphabetically" value="true"/>
|
||||
</module>
|
||||
|
||||
<module name="Regexp">
|
||||
<property name="format" value="instanceof\s+(ObjectColumnSelector|LongColumnSelector|FloatColumnSelector|DoubleColumnSelector)"/>
|
||||
<property name="illegalPattern" value="true"/>
|
||||
|
|
|
@ -35,6 +35,7 @@ public final class DummyNonBlockingPool<T> implements NonBlockingPool<T>
|
|||
private DummyNonBlockingPool()
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResourceHolder<T> take()
|
||||
{
|
||||
|
|
|
@ -27,8 +27,8 @@ import java.util.regex.Pattern;
|
|||
* date version of data given a base descriptor and a matching pattern. "Version" is completely dependent on the
|
||||
* implementation but is commonly equal to the "last modified" timestamp.
|
||||
*
|
||||
* This is implemented explicitly for URIExtractionNamespaceFunctionFactory
|
||||
* If you have a use case for this interface beyond URIExtractionNamespaceFunctionFactory please bring it up in the dev list.
|
||||
* This is implemented explicitly for org.apache.druid.query.lookup.namespace.CacheGenerator
|
||||
* If you have a use case for this interface beyond CacheGenerator please bring it up in the dev list.
|
||||
*
|
||||
* @param <DataDescriptor> The containing type for the data. A simple example would be URI
|
||||
*/
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.druid.data.input.impl;
|
||||
|
||||
import com.google.common.collect.Iterators;
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.druid.data.input.impl.prefetch;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonParser;
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.druid.data.input.impl.prefetch;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
|
|
@ -16,9 +16,12 @@
|
|||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.druid.indexer;
|
||||
|
||||
/**
|
||||
* This includes the state of a task in the task runner not covered by {@link TaskState}, this state is not stored in database
|
||||
* This includes the state of a task in the task runner not covered by {@link TaskState}, this state is not stored
|
||||
* in database
|
||||
*/
|
||||
public enum RunnerTaskState
|
||||
{
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.druid.indexer;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.druid.java.util.common;
|
||||
|
||||
import com.google.common.base.Predicate;
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
package org.apache.druid.java.util.common.guava;
|
||||
|
||||
import com.google.common.base.Predicate;
|
||||
|
||||
/**
|
||||
*/
|
||||
public class FilteringYieldingAccumulator<OutType, T> extends YieldingAccumulator<OutType, T>
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.druid.java.util.common.guava;
|
||||
|
||||
import com.google.common.collect.Iterators;
|
||||
|
|
|
@ -82,6 +82,7 @@ public class NativeIO
|
|||
}
|
||||
|
||||
private static native int posix_fadvise(int fd, long offset, long len, int flag) throws LastErrorException;
|
||||
|
||||
private static native int sync_file_range(int fd, long offset, long len, int flags);
|
||||
|
||||
private NativeIO() {}
|
||||
|
@ -100,6 +101,7 @@ public class NativeIO
|
|||
|
||||
return field;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get system file descriptor (int) from FileDescriptor object.
|
||||
* @param descriptor - FileDescriptor object to get fd from
|
||||
|
@ -207,9 +209,7 @@ public class NativeIO
|
|||
long offset = 0;
|
||||
long lastOffset = 0;
|
||||
|
||||
try (
|
||||
final RandomAccessFile raf = new RandomAccessFile(dest, "rw")
|
||||
) {
|
||||
try (final RandomAccessFile raf = new RandomAccessFile(dest, "rw")) {
|
||||
final int fd = getfd(raf.getFD());
|
||||
|
||||
for (int numBytes = 0, bytesRead = 0, lastBytes = 0; bytesRead > -1;) {
|
||||
|
|
|
@ -32,6 +32,7 @@ public class BaseHttpEmittingConfig
|
|||
/** ensure the event buffers don't use more than 10% of memory by default */
|
||||
public static final int DEFAULT_MAX_BATCH_SIZE;
|
||||
public static final int DEFAULT_BATCH_QUEUE_SIZE_LIMIT;
|
||||
|
||||
static {
|
||||
Pair<Integer, Integer> batchConfigPair = getDefaultBatchSizeAndLimit(Runtime.getRuntime().maxMemory());
|
||||
DEFAULT_MAX_BATCH_SIZE = batchConfigPair.lhs;
|
||||
|
|
|
@ -739,7 +739,6 @@ public class HttpPostEmitter implements Flushable, Closeable, Emitter
|
|||
payloadLength = length;
|
||||
}
|
||||
|
||||
|
||||
request.setHeader(HttpHeaders.Names.CONTENT_TYPE, "application/json");
|
||||
request.setHeader(HttpHeaders.Names.CONTENT_LENGTH, String.valueOf(payloadLength));
|
||||
request.setBody(ByteBuffer.wrap(payload, 0, payloadLength));
|
||||
|
|
|
@ -148,7 +148,8 @@ public class SysMonitor extends FeedDefiningMonitor
|
|||
*/
|
||||
private class SwapStats implements Stats
|
||||
{
|
||||
private long prevPageIn = 0, prevPageOut = 0;
|
||||
private long prevPageIn = 0;
|
||||
private long prevPageOut = 0;
|
||||
|
||||
private SwapStats()
|
||||
{
|
||||
|
|
|
@ -39,6 +39,7 @@ public interface DataSegmentPusher
|
|||
|
||||
@Deprecated
|
||||
String getPathForHadoop(String dataSource);
|
||||
|
||||
String getPathForHadoop();
|
||||
|
||||
/**
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.druid.collections;
|
||||
|
||||
import com.google.common.base.Supplier;
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.druid.collections;
|
||||
|
||||
import com.google.common.base.Supplier;
|
||||
|
|
|
@ -27,6 +27,7 @@ import org.junit.Test;
|
|||
public class SocketUtilTest
|
||||
{
|
||||
private final int MAX_PORT = 0xffff;
|
||||
|
||||
@Test
|
||||
public void testSocketUtil()
|
||||
{
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.druid.data.input.impl.prefetch;
|
||||
|
||||
|
||||
|
|
|
@ -39,6 +39,7 @@ public class StreamUtilsTest
|
|||
{
|
||||
@Rule
|
||||
public final TemporaryFolder temporaryFolder = new TemporaryFolder();
|
||||
|
||||
@Test
|
||||
public void testRetryExceptionOnFlush()
|
||||
{
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.druid.timeline.partition;
|
||||
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
|
|
|
@ -12,11 +12,7 @@
|
|||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# Organize Import Order
|
||||
# Sun Apr 24 10:15:51 PDT 2016
|
||||
4=javax
|
||||
3=java
|
||||
2=org
|
||||
1=io
|
||||
0=com
|
||||
3=\#
|
||||
2=java
|
||||
1=javax
|
||||
0=
|
||||
|
|
|
@ -39,10 +39,11 @@ import java.util.List;
|
|||
public class AmbariMetricsEmitterModule implements DruidModule
|
||||
{
|
||||
private static final String EMITTER_TYPE = "ambari-metrics";
|
||||
|
||||
@Override
|
||||
public List<? extends Module> getJacksonModules()
|
||||
{
|
||||
return Collections.EMPTY_LIST;
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.druid.firehose.rocketmq;
|
||||
|
||||
import com.fasterxml.jackson.databind.Module;
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.druid.firehose.rocketmq;
|
||||
|
||||
import com.alibaba.rocketmq.client.Validators;
|
||||
|
|
|
@ -40,6 +40,7 @@ import java.util.List;
|
|||
public class GraphiteEmitterModule implements DruidModule
|
||||
{
|
||||
private static final String EMITTER_TYPE = "graphite";
|
||||
|
||||
@Override
|
||||
public List<? extends Module> getJacksonModules()
|
||||
{
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.druid.data.input.influx;
|
||||
|
||||
import com.fasterxml.jackson.databind.Module;
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.druid.data.input.influx;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.druid.data.input.influx;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
|
|
|
@ -97,7 +97,6 @@ public class KafkaEightSimpleConsumerFirehoseFactory implements
|
|||
"partitionIdList is null/empty"
|
||||
);
|
||||
|
||||
|
||||
this.clientId = clientId;
|
||||
Preconditions.checkArgument(
|
||||
clientId != null && !clientId.isEmpty(),
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.druid.query.materializedview;
|
||||
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.druid.data.input.orc;
|
||||
|
||||
import com.fasterxml.jackson.databind.Module;
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.druid.data.input.orc;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.druid.data.input.orc;
|
||||
|
||||
import org.apache.druid.data.input.MapBasedInputRow;
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.druid.data.input.orc;
|
||||
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.druid.firehose.rabbitmq;
|
||||
|
||||
import com.fasterxml.jackson.databind.Module;
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.druid.metadata.storage.sqlserver;
|
||||
|
||||
import com.google.common.base.Supplier;
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.druid.metadata.storage.sqlserver;
|
||||
|
||||
import com.fasterxml.jackson.databind.Module;
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.druid.metadata.storage.sqlserver;
|
||||
|
||||
import junit.framework.Assert;
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.druid.metadata.storage.sqlserver;
|
||||
|
||||
import com.google.common.base.Suppliers;
|
||||
|
|
|
@ -26,6 +26,7 @@ import com.google.common.collect.ImmutableMap;
|
|||
import org.apache.druid.java.util.common.ISE;
|
||||
import org.apache.druid.java.util.common.logger.Logger;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
|
@ -45,6 +46,7 @@ public class DimensionConverter
|
|||
metricMap = readMap(mapper, dimensionMapPath);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public StatsDMetric addFilteredUserDims(
|
||||
String service,
|
||||
String metric,
|
||||
|
|
|
@ -32,9 +32,9 @@ import org.apache.druid.java.util.emitter.core.Emitter;
|
|||
import org.apache.druid.java.util.emitter.core.Event;
|
||||
import org.apache.druid.java.util.emitter.service.ServiceMetricEvent;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*/
|
||||
|
@ -47,7 +47,7 @@ public class StatsDEmitter implements Emitter
|
|||
private static final Pattern BLANK = Pattern.compile("\\s+");
|
||||
private static final String[] EMPTY_ARRAY = new String[0];
|
||||
|
||||
static final StatsDEmitter of(StatsDEmitterConfig config, ObjectMapper mapper)
|
||||
static StatsDEmitter of(StatsDEmitterConfig config, ObjectMapper mapper)
|
||||
{
|
||||
NonBlockingStatsDClient client = new NonBlockingStatsDClient(
|
||||
config.getPrefix(),
|
||||
|
@ -163,7 +163,7 @@ public class StatsDEmitter implements Emitter
|
|||
}
|
||||
}
|
||||
} else {
|
||||
log.debug("Metric=[%s] has no StatsD type mapping", statsDMetric);
|
||||
log.debug("Service=[%s], Metric=[%s] has no StatsD type mapping", service, metric);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.druid.data.input.thrift;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.druid.query.aggregation;
|
||||
|
||||
import com.fasterxml.jackson.databind.Module;
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.druid.segment;
|
||||
|
||||
import com.google.common.base.Predicate;
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.druid.segment;
|
||||
|
||||
import org.apache.druid.common.config.NullHandling;
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.druid.segment;
|
||||
|
||||
import org.apache.druid.common.config.NullHandling;
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.druid.segment;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.druid.segment;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.druid.segment;
|
||||
|
||||
import com.google.common.io.CharSource;
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.druid.segment;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.druid.data.input;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.druid.data.input;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.druid.data.input.avro;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonSubTypes;
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.druid.data.input.avro;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.druid.data.input.avro;
|
||||
|
||||
import org.apache.avro.Schema;
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.druid.data.input.avro;
|
||||
|
||||
import org.apache.avro.Schema;
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.druid.data.input.avro;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.druid.data.input.avro;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.druid.data.input.schemarepo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.druid.data.input.schemarepo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.druid.data.input.schemarepo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonSubTypes;
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.druid.data.input;
|
||||
|
||||
import com.fasterxml.jackson.databind.Module;
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.druid.data.input;
|
||||
|
||||
import com.fasterxml.jackson.databind.DeserializationFeature;
|
||||
|
|
|
@ -21,7 +21,6 @@ package org.apache.druid.query.aggregation.datasketches.hll;
|
|||
|
||||
import com.yahoo.sketches.hll.HllSketch;
|
||||
import com.yahoo.sketches.hll.TgtHllType;
|
||||
|
||||
import org.apache.druid.java.util.common.IAE;
|
||||
import org.apache.druid.query.aggregation.Aggregator;
|
||||
import org.apache.druid.segment.ColumnValueSelector;
|
||||
|
|
|
@ -19,19 +19,18 @@
|
|||
|
||||
package org.apache.druid.query.aggregation.datasketches.hll;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.yahoo.sketches.hll.HllSketch;
|
||||
import com.yahoo.sketches.hll.TgtHllType;
|
||||
|
||||
import org.apache.druid.query.aggregation.Aggregator;
|
||||
import org.apache.druid.query.aggregation.AggregatorUtil;
|
||||
import org.apache.druid.query.aggregation.BufferAggregator;
|
||||
import org.apache.druid.segment.ColumnSelectorFactory;
|
||||
import org.apache.druid.segment.ColumnValueSelector;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
/**
|
||||
* This aggregator factory is for building sketches from raw data.
|
||||
* The input column can contain identifiers of type string, char[], byte[] or any numeric type.
|
||||
|
|
|
@ -19,22 +19,21 @@
|
|||
|
||||
package org.apache.druid.query.aggregation.datasketches.hll;
|
||||
|
||||
import com.google.common.util.concurrent.Striped;
|
||||
import com.yahoo.memory.WritableMemory;
|
||||
import com.yahoo.sketches.hll.HllSketch;
|
||||
import com.yahoo.sketches.hll.TgtHllType;
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
|
||||
import org.apache.druid.query.aggregation.BufferAggregator;
|
||||
import org.apache.druid.segment.ColumnValueSelector;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.ByteOrder;
|
||||
import java.util.IdentityHashMap;
|
||||
import java.util.concurrent.locks.Lock;
|
||||
import java.util.concurrent.locks.ReadWriteLock;
|
||||
|
||||
import com.google.common.util.concurrent.Striped;
|
||||
import com.yahoo.memory.WritableMemory;
|
||||
import com.yahoo.sketches.hll.HllSketch;
|
||||
import com.yahoo.sketches.hll.TgtHllType;
|
||||
|
||||
import org.apache.druid.query.aggregation.BufferAggregator;
|
||||
import org.apache.druid.segment.ColumnValueSelector;
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
|
||||
|
||||
/**
|
||||
* This aggregator builds sketches from raw data.
|
||||
* The input column can contain identifiers of type string, char[], byte[] or any numeric type.
|
||||
|
|
|
@ -19,13 +19,13 @@
|
|||
|
||||
package org.apache.druid.query.aggregation.datasketches.hll;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonGenerator;
|
||||
import com.fasterxml.jackson.databind.JsonSerializer;
|
||||
import com.fasterxml.jackson.databind.SerializerProvider;
|
||||
import com.yahoo.sketches.hll.HllSketch;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class HllSketchJsonSerializer extends JsonSerializer<HllSketch>
|
||||
{
|
||||
|
||||
|
|
|
@ -19,10 +19,9 @@
|
|||
|
||||
package org.apache.druid.query.aggregation.datasketches.hll;
|
||||
|
||||
import com.yahoo.sketches.hll.Union;
|
||||
import com.yahoo.sketches.hll.HllSketch;
|
||||
import com.yahoo.sketches.hll.TgtHllType;
|
||||
|
||||
import com.yahoo.sketches.hll.Union;
|
||||
import org.apache.druid.query.aggregation.Aggregator;
|
||||
import org.apache.druid.segment.ColumnValueSelector;
|
||||
|
||||
|
|
|
@ -19,20 +19,19 @@
|
|||
|
||||
package org.apache.druid.query.aggregation.datasketches.hll;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.yahoo.sketches.hll.HllSketch;
|
||||
import com.yahoo.sketches.hll.TgtHllType;
|
||||
import com.yahoo.sketches.hll.Union;
|
||||
|
||||
import org.apache.druid.query.aggregation.Aggregator;
|
||||
import org.apache.druid.query.aggregation.AggregatorUtil;
|
||||
import org.apache.druid.query.aggregation.BufferAggregator;
|
||||
import org.apache.druid.segment.ColumnSelectorFactory;
|
||||
import org.apache.druid.segment.ColumnValueSelector;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
/**
|
||||
* This aggregator factory is for merging existing sketches.
|
||||
* The input column must contain {@link HllSketch}
|
||||
|
|
|
@ -19,20 +19,19 @@
|
|||
|
||||
package org.apache.druid.query.aggregation.datasketches.hll;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.ByteOrder;
|
||||
import java.util.concurrent.locks.Lock;
|
||||
import java.util.concurrent.locks.ReadWriteLock;
|
||||
|
||||
import com.google.common.util.concurrent.Striped;
|
||||
import com.yahoo.memory.WritableMemory;
|
||||
import com.yahoo.sketches.hll.HllSketch;
|
||||
import com.yahoo.sketches.hll.TgtHllType;
|
||||
import com.yahoo.sketches.hll.Union;
|
||||
|
||||
import org.apache.druid.query.aggregation.BufferAggregator;
|
||||
import org.apache.druid.segment.ColumnValueSelector;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.ByteOrder;
|
||||
import java.util.concurrent.locks.Lock;
|
||||
import java.util.concurrent.locks.ReadWriteLock;
|
||||
|
||||
/**
|
||||
* This aggregator merges existing sketches.
|
||||
* The input column must contain {@link HllSketch}
|
||||
|
|
|
@ -19,18 +19,17 @@
|
|||
|
||||
package org.apache.druid.query.aggregation.datasketches.hll;
|
||||
|
||||
import java.util.Collections;
|
||||
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.hll.HllSketch;
|
||||
|
||||
import org.apache.druid.initialization.DruidModule;
|
||||
import org.apache.druid.segment.serde.ComplexMetrics;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* This module is to support count-distinct operations using {@link HllSketch}.
|
||||
* See <a href="https://datasketches.github.io/docs/HLL/HLL.html">HyperLogLog Sketch documentation</a>
|
||||
|
|
|
@ -19,14 +19,13 @@
|
|||
|
||||
package org.apache.druid.query.aggregation.datasketches.hll;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.ByteOrder;
|
||||
|
||||
import com.yahoo.memory.Memory;
|
||||
import com.yahoo.sketches.hll.HllSketch;
|
||||
|
||||
import org.apache.druid.segment.data.ObjectStrategy;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.ByteOrder;
|
||||
|
||||
public class HllSketchObjectStrategy implements ObjectStrategy<HllSketch>
|
||||
{
|
||||
|
||||
|
|
|
@ -22,20 +22,18 @@ package org.apache.druid.query.aggregation.datasketches.hll;
|
|||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.yahoo.sketches.hll.HllSketch;
|
||||
|
||||
import org.apache.druid.java.util.common.IAE;
|
||||
import org.apache.druid.query.aggregation.AggregatorFactory;
|
||||
import org.apache.druid.query.aggregation.AggregatorUtil;
|
||||
import org.apache.druid.query.aggregation.PostAggregator;
|
||||
import org.apache.druid.query.cache.CacheKeyBuilder;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.Comparator;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
/**
|
||||
* Returns a distinct count estimate and error bounds from a given {@link HllSketch}.
|
||||
* The result will be three double values: estimate, lower bound and upper bound.
|
||||
|
|
|
@ -22,7 +22,6 @@ package org.apache.druid.query.aggregation.datasketches.hll;
|
|||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.yahoo.sketches.hll.HllSketch;
|
||||
|
||||
import org.apache.druid.query.aggregation.AggregatorFactory;
|
||||
import org.apache.druid.query.aggregation.AggregatorUtil;
|
||||
import org.apache.druid.query.aggregation.PostAggregator;
|
||||
|
|
|
@ -22,7 +22,6 @@ package org.apache.druid.query.aggregation.datasketches.quantiles;
|
|||
import com.yahoo.memory.Memory;
|
||||
import com.yahoo.sketches.quantiles.DoublesSketch;
|
||||
import it.unimi.dsi.fastutil.bytes.ByteArrays;
|
||||
|
||||
import org.apache.druid.segment.data.ObjectStrategy;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
|
|
|
@ -33,6 +33,7 @@ import java.util.Comparator;
|
|||
import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
public class SketchEstimatePostAggregator implements PostAggregator
|
||||
{
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.druid.query.aggregation.datasketches.theta;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
|
|
|
@ -19,6 +19,9 @@
|
|||
|
||||
package org.apache.druid.query.aggregation.datasketches.hll;
|
||||
|
||||
import com.yahoo.sketches.hll.HllSketch;
|
||||
import org.apache.commons.codec.binary.Base64;
|
||||
|
||||
import java.io.BufferedWriter;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.nio.file.FileSystems;
|
||||
|
@ -27,11 +30,9 @@ import java.nio.file.Path;
|
|||
import java.util.Random;
|
||||
import java.util.concurrent.ThreadLocalRandom;
|
||||
|
||||
import org.apache.commons.codec.binary.Base64;
|
||||
|
||||
import com.yahoo.sketches.hll.HllSketch;
|
||||
|
||||
// This is used for generating test data for HllSketchAggregatorTest
|
||||
/**
|
||||
* This is used for generating test data for {@link HllSketchAggregatorTest}
|
||||
*/
|
||||
class GenerateTestData
|
||||
{
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.druid.query.aggregation.datasketches.theta;
|
||||
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.druid.guice;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonGenerator;
|
||||
|
|
|
@ -46,8 +46,8 @@ public class KerberosEscalator implements Escalator
|
|||
this.authorizerName = authorizerName;
|
||||
this.internalClientPrincipal = internalClientPrincipal;
|
||||
this.internalClientKeytab = internalClientKeytab;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpClient createEscalatedClient(HttpClient baseClient)
|
||||
{
|
||||
|
|
|
@ -34,10 +34,6 @@ import java.io.IOException;
|
|||
import java.net.URI;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/**
|
||||
* This is implemented explicitly for URIExtractionNamespaceFunctionFactory
|
||||
* If you have a use case for this interface beyond URIExtractionNamespaceFunctionFactory please bring it up in the dev list.
|
||||
*/
|
||||
public class HdfsFileTimestampVersionFinder extends HdfsDataSegmentPuller implements SearchableVersionedDataFinder<URI>
|
||||
{
|
||||
@Inject
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.druid.storage.hdfs.tasklog;
|
||||
|
||||
import com.google.common.base.Optional;
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.druid.storage.hdfs.tasklog;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
|
|
|
@ -17,9 +17,7 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
//CHECKSTYLE.OFF: PackageName
|
||||
package org.apache.hadoop.fs;
|
||||
//CHECKSTYLE.ON: PackageName
|
||||
package /*CHECKSTYLE.OFF: PackageName*/org.apache.hadoop.fs/*CHECKSTYLE.ON: PackageName*/;
|
||||
|
||||
import com.google.common.base.Throwables;
|
||||
import org.apache.druid.java.util.common.logger.Logger;
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.druid.indexing.kafka;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.druid.indexing.kafka;
|
||||
|
||||
import com.google.common.annotations.VisibleForTesting;
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.druid.indexing.kafka;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
|
|
|
@ -113,8 +113,6 @@ public final class UriCacheGenerator implements CacheGenerator<UriExtractionName
|
|||
uri = extractionNamespace.getUri();
|
||||
}
|
||||
|
||||
final String uriPath = uri.getPath();
|
||||
|
||||
return RetryUtils.retry(
|
||||
() -> {
|
||||
final String version = puller.getVersion(uri);
|
||||
|
|
|
@ -65,6 +65,7 @@ public class PollingLookupTest
|
|||
private static class MockDataFetcher implements DataFetcher
|
||||
{
|
||||
private int callNumber = 0;
|
||||
|
||||
@Override
|
||||
public Iterable fetchAll()
|
||||
{
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.druid.firehose.sql;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.druid.data.input.parquet.avro;
|
||||
|
||||
import org.apache.avro.generic.GenericRecord;
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.druid.data.input.parquet.avro;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue