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 @@ -25,6 +25,7 @@
/**
* Annotation for suppressing spotbugs checks when necessary.
*/
@SuppressWarnings("unused")
@Retention(RetentionPolicy.CLASS)
public @interface SuppressFBWarnings
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ default Firehose connectForSampler(T parser, @Nullable File temporaryDirectory)
return connect(parser, temporaryDirectory);
}

@SuppressWarnings("unused")
@JsonIgnore
default boolean isSplittable()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,6 @@ public FiniteFirehoseFactory getFirehoseFactory()
return firehoseFactory;
}

public InputRowParser getInputRowParser()
{
return inputRowParser;
}

@Override
public boolean isSplittable()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ public interface InputFormat
* This method is not being used anywhere for now, but should be considered
* in {@link SplittableInputSource#createSplits} in the future.
*/
@SuppressWarnings("unused")
@JsonIgnore
boolean isSplittable();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.common.net.HostAndPort;
import org.apache.druid.java.util.common.IAE;

import javax.annotation.Nullable;
Expand Down Expand Up @@ -133,12 +132,4 @@ public int hashCode()
{
return Objects.hash(host, port, tlsPort);
}

public HostAndPort toHostAndPort()
{
if (tlsPort >= 0) {
return HostAndPort.fromParts(host, tlsPort);
}
return HostAndPort.fromParts(host, port);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@

public interface TaskMetricsGetter
{
@SuppressWarnings("unused")
List<String> getKeys();

@SuppressWarnings("unused")
@Nullable
Map<String, Number> getTotalMetrics();
}
Original file line number Diff line number Diff line change
Expand Up @@ -171,11 +171,6 @@ private static MethodHandle defineClassJava8(MethodHandles.Lookup lookup) throws
return defineClass;
}

static int getArrayLength(byte[] bytes)
{
return bytes.length;
}

public static Class defineClass(
Class<?> targetClass,
byte[] byteCode,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
@Target({ElementType.METHOD, ElementType.FIELD, ElementType.ANNOTATION_TYPE, ElementType.CONSTRUCTOR, ElementType.PARAMETER})
@Retention(RetentionPolicy.RUNTIME)
@Documented
@SuppressWarnings("unused")
@Constraint(validatedBy = HumanReadableBytesRange.HumanReadableBytesRangeValidator.class)
public @interface HumanReadableBytesRange
{
Expand All @@ -66,9 +67,11 @@
//ConstraintValidator requires
String message() default "value must be in the range of [{min}, {max}]";


//ConstraintValidator requires
Class<? extends Payload>[] payload() default {};

@SuppressWarnings("unused")
class HumanReadableBytesRangeValidator implements ConstraintValidator<HumanReadableBytesRange, Object>
{
private HumanReadableBytesRange range;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,21 +200,13 @@ public static Long parseLongObject(@Nullable String val)
return lobj;
}
// try as a double, for "ddd.dd" , Longs.tryParse(..) returns null
Double dobj = Doubles.tryParse((String) val);
Double dobj = Doubles.tryParse(val);
if (dobj != null) {
return dobj.longValue();
}
throw new NumberFormatException("Cannot parse string to long");
}

public static int toIntExact(long value, String error)
{
if ((int) value != value) {
throw new ArithmeticException(error);
}
return (int) value;
}

private Numbers()
{
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,10 @@

import com.google.common.base.Strings;
import it.unimi.dsi.fastutil.bytes.ByteArrayList;
import it.unimi.dsi.fastutil.bytes.ByteList;
import org.apache.commons.io.IOUtils;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;

import java.io.IOException;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;
Expand Down Expand Up @@ -268,11 +266,6 @@ public static String fromUtf8(final ByteArrayList buffer)
return StringUtils.fromUtf8(buffer.elements(), 0, buffer.size());
}

public static String fromUtf8(final ByteList buffer)
{
return StringUtils.fromUtf8(buffer.toByteArray());
}

/**
* If buffer is Decodes a UTF-8 string from the remaining bytes of a buffer.
* Advances the position of the buffer by {@link ByteBuffer#remaining()}.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public ParallelMergeCombiningSequence(
BinaryOperator<T> combineFn,
boolean hasTimeout,
long timeoutMillis,
int queryPriority,
@SuppressWarnings("unused") int queryPriority,

Check notice

Code scanning / CodeQL

Useless parameter

The parameter 'queryPriority' is never used.
int parallelism,
int yieldAfter,
int batchSize,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,18 +130,6 @@ public <C extends Closeable> C register(@Nullable C closeable)
return closeable;
}

/**
* Registers a list of {@code Closeable} to be closed when this {@code Closer} is
* {@linkplain #close closed}.
*
* @return the supplied list of {@code Closeable}
*/
public <C extends Closeable> Iterable<C> registerAll(Iterable<C> closeables)
{
closeables.forEach(this::register);
return closeables;
}

/**
* Stores the given throwable and rethrows it. It will be rethrown as is if it is an
* {@code IOException}, {@code RuntimeException} or {@code Error}. Otherwise, it will be rethrown
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ protected org.slf4j.Logger getSlf4jLogger()
return log;
}

@SuppressWarnings("unused")
@Override
public String toString()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,6 @@ public Builder putNonNull(String key, Object value)
return this;
}

/**
* Adds map entry to the map
*/
public Builder put(Map.Entry<String, Object> entry)
{
map.put(entry.getKey(), entry.getValue());
return this;
}

/**
* Adds all key -> value pairs from other map
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
import org.apache.druid.java.util.emitter.core.HttpPostEmitter;
import org.asynchttpclient.AsyncHttpClient;

@SuppressWarnings("unused")
public class HttpEmitterFactory extends HttpEmitterConfig implements EmitterFactory
{

@Override
public Emitter makeEmitter(ObjectMapper objectMapper, AsyncHttpClient httpClient, Lifecycle lifecycle)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,9 @@
import org.apache.druid.java.util.emitter.core.LoggingEmitterConfig;
import org.asynchttpclient.AsyncHttpClient;

@SuppressWarnings("unused")
public class LoggingEmitterFactory extends LoggingEmitterConfig implements EmitterFactory
{
public LoggingEmitterFactory()
{
}

@Override
public Emitter makeEmitter(ObjectMapper objectMapper, AsyncHttpClient httpClient, Lifecycle lifecycle)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import org.apache.druid.java.util.emitter.core.NoopEmitter;
import org.asynchttpclient.AsyncHttpClient;

@SuppressWarnings("unused")
public class NoopEmitterFactory implements EmitterFactory
{
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
import org.apache.druid.java.util.emitter.core.ParametrizedUriEmitterConfig;
import org.asynchttpclient.AsyncHttpClient;

@SuppressWarnings("unused")
public class ParametrizedUriEmitterFactory extends ParametrizedUriEmitterConfig implements EmitterFactory
{

@Override
public Emitter makeEmitter(ObjectMapper objectMapper, AsyncHttpClient httpClient, Lifecycle lifecycle)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public class HttpClientProxyConfig
@JsonProperty("password")
private String password;

@SuppressWarnings("unused")
public HttpClientProxyConfig()
{
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,6 @@ public HttpResponse getResponse()
/**
* Get the data.
*/
@SuppressWarnings("unused")
public abstract T getContent();
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public void stop()
started = false;
}

@SuppressWarnings("unused")
public boolean isStarted()
{
return started;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,6 @@

public interface PidDiscoverer
{
@SuppressWarnings("unused")
long getPid();
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ public class ProcFsReader
private final File procDir;

private static final Logger LOG = new Logger(ProcFsReader.class);
public static final Path DEFAULT_PROC_FS_ROOT = Paths.get("/proc/");
private static final String BOOT_ID_PATH = "sys/kernel/random/boot_id";
private static final String CPUINFO_PATH = "cpuinfo";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1249,12 +1249,6 @@ public Expr toExpr()
return new ArrayExpr(arrayType, value);
}

@Nullable
public Object getIndex(int index)
{
return value == null ? null : value[index];
}

protected boolean isScalar()
{
return value != null && value.length == 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ public abstract class BivariateDoubleFunctionVectorValueProcessor<TLeftInput, TR
{
final ExprVectorProcessor<TLeftInput> left;
final ExprVectorProcessor<TRightInput> right;
final int maxVectorSize;
final boolean[] outNulls;
final double[] outValues;

Expand All @@ -46,7 +45,6 @@ protected BivariateDoubleFunctionVectorValueProcessor(
{
this.left = left;
this.right = right;
this.maxVectorSize = maxVectorSize;
this.outValues = new double[maxVectorSize];
this.outNulls = new boolean[maxVectorSize];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,17 @@ public abstract class BivariateFunctionVectorObjectProcessor<TLeftInput, TRightI
{
final ExprVectorProcessor<TLeftInput> left;
final ExprVectorProcessor<TRightInput> right;
final int maxVectorSize;
final TOutput outValues;
final boolean sqlCompatible = NullHandling.sqlCompatible();

protected BivariateFunctionVectorObjectProcessor(
ExprVectorProcessor<TLeftInput> left,
ExprVectorProcessor<TRightInput> right,
int maxVectorSize,
TOutput outValues
)
{
this.left = left;
this.right = right;
this.maxVectorSize = maxVectorSize;
this.outValues = outValues;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ public abstract class BivariateLongFunctionVectorValueProcessor<TLeftInput, TRig
{
final ExprVectorProcessor<TLeftInput> left;
final ExprVectorProcessor<TRightInput> right;
final int maxVectorSize;
final boolean[] outNulls;
final long[] outValues;

Expand All @@ -46,7 +45,6 @@ protected BivariateLongFunctionVectorValueProcessor(
{
this.left = left;
this.right = right;
this.maxVectorSize = maxVectorSize;
this.outValues = new long[maxVectorSize];
this.outNulls = new boolean[maxVectorSize];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,13 @@
public abstract class LongOutObjectInFunctionVectorProcessor
extends UnivariateFunctionVectorObjectProcessor<Object[], long[]>
{
final ExpressionType inputType;

public LongOutObjectInFunctionVectorProcessor(
ExprVectorProcessor<Object[]> processor,
int maxVectorSize,
ExpressionType inputType
)
{
super(CastToTypeVectorProcessor.cast(processor, inputType), maxVectorSize, new long[maxVectorSize]);
this.inputType = inputType;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ protected LongOutObjectsInFunctionVectorProcessor(
super(
CastToTypeVectorProcessor.cast(left, inputType),
CastToTypeVectorProcessor.cast(right, inputType),
maxVectorSize,
new long[maxVectorSize]
);
this.outNulls = new boolean[maxVectorSize];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
public abstract class ObjectOutMultiObjectInVectorProcessor implements ExprVectorProcessor<Object[]>
{
final ExprVectorProcessor<Object[]>[] inputs;
final int maxVectorSize;
final Object[] outValues;

final ExpressionType expressionType;
Expand All @@ -40,7 +39,6 @@ protected ObjectOutMultiObjectInVectorProcessor(
)
{
this.inputs = inputs;
this.maxVectorSize = maxVectorSize;
this.outValues = new Object[maxVectorSize];
this.expressionType = objectType;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ protected ObjectOutObjectsInFunctionVectorProcessor(
super(
CastToTypeVectorProcessor.cast(left, expressionType),
CastToTypeVectorProcessor.cast(right, expressionType),
maxVectorSize,
new Object[maxVectorSize]
);
this.expressionType = expressionType;
Expand Down
Loading