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
1 change: 0 additions & 1 deletion codestyle/spotbugs-exclude.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@
<Bug pattern="NP_LOAD_OF_KNOWN_NULL_VALUE"/>
<Bug pattern="NP_METHOD_PARAMETER_TIGHTENS_ANNOTATION"/>
<Bug pattern="NP_NONNULL_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR"/>
<Bug pattern="NP_NONNULL_RETURN_VIOLATION"/>
<Bug pattern="NP_NULL_ON_SOME_PATH"/>
<Bug pattern="NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE"/>
<Bug pattern="NP_NULL_ON_SOME_PATH_MIGHT_BE_INFEASIBLE"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ public int hashCode()
return result;
}

@Nullable
static Long convertLong(TimestampSpec timestampSpec, Object input)
{
if (input instanceof Number) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@ public PositionMaintainer(
this.max = max - increment; // Make sure there is enough room for one more increment
}

@Nullable
public Integer getNext()
{
if (nextVal > max) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,12 @@

package org.apache.druid.segment;

import javax.annotation.Nullable;

public abstract class AbstractSegment implements Segment
{
@Override
@Nullable
public <T> T as(Class<T> clazz)
{
if (clazz.equals(QueryableIndex.class)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ public BitmapFactory getBitmapFactory()
}

@Override
@Nullable
public BitmapIndex getBitmapIndex(String dimension)
{
if (isVirtualColumn(dimension)) {
Expand All @@ -204,6 +205,7 @@ public int getCardinality()
}

@Override
@Nullable
public String getValue(int index)
{
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
import org.apache.druid.segment.selector.settable.SettableColumnValueSelector;
import org.apache.druid.segment.writeout.SegmentWriteOutMedium;

import javax.annotation.Nullable;

import java.util.Comparator;

/**
Expand Down Expand Up @@ -70,6 +72,7 @@ public interface DimensionHandler
* Get {@link MultiValueHandling} for the column associated with this handler.
* Only string columns can have {@link MultiValueHandling} currently.
*/
@Nullable
default MultiValueHandling getMultivalueHandling()
{
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ static List<String> getMergedDimensions(List<IndexableAdapter> indexes)
}
}

@Nullable
static List<String> getLongestSharedDimOrder(List<IndexableAdapter> indexes)
{
int maxSize = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
import org.apache.druid.segment.data.VSizeColumnarMultiInts;
import org.joda.time.Interval;

import javax.annotation.Nullable;

import java.util.Map;

/**
Expand Down Expand Up @@ -85,15 +87,10 @@ public Interval getDataInterval()
return dataInterval;
}

@Nullable
public MetricHolder getMetricHolder(String metric)
{
final MetricHolder retVal = metrics.get(metric);

if (retVal == null) {
return null;
}

return retVal;
return metrics.get(metric);
}

public GenericIndexed<String> getDimValueLookup(String dimension)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
import org.apache.druid.timeline.partition.ShardSpec;
import org.joda.time.Interval;

import javax.annotation.Nullable;

import java.io.Closeable;
import java.util.concurrent.Phaser;
import java.util.concurrent.atomic.AtomicBoolean;
Expand Down Expand Up @@ -111,6 +113,7 @@ private ReferenceCountingSegment(
this.atomicUpdateGroupSize = atomicUpdateGroupSize;
}

@Nullable
public Segment getBaseSegment()
{
return !isClosed() ? baseSegment : null;
Expand All @@ -127,24 +130,28 @@ public boolean isClosed()
}

@Override
@Nullable
public SegmentId getId()
{
return !isClosed() ? baseSegment.getId() : null;
}

@Override
@Nullable
public Interval getDataInterval()
{
return !isClosed() ? baseSegment.getDataInterval() : null;
}

@Override
@Nullable
public QueryableIndex asQueryableIndex()
{
return !isClosed() ? baseSegment.asQueryableIndex() : null;
}

@Override
@Nullable
public StorageAdapter asStorageAdapter()
{
return !isClosed() ? baseSegment.asStorageAdapter() : null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,6 @@ public interface Segment extends Closeable
* @param <T> desired interface
* @return instance of clazz, or null if the interface is not supported by this segment
*/
@Nullable
<T> T as(Class<T> clazz);
}
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ public int getId(@Nullable String value)
}
}

@Nullable
public String getValue(int id)
{
lock.readLock().lock();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ public DimensionSelector makeDimensionSelector(DimensionSpec dimensionSpec, Colu
}
}

@Nullable
public BitmapIndex getBitmapIndex(String columnName, ColumnSelector columnSelector)
{
final VirtualColumn virtualColumn = getVirtualColumn(columnName);
Expand Down Expand Up @@ -273,7 +274,7 @@ public byte[] getCacheKey()
return new CacheKeyBuilder((byte) 0).appendCacheablesIgnoringOrder(virtualColumns).build();
}

private void detectCycles(VirtualColumn virtualColumn, Set<String> columnNames)
private void detectCycles(VirtualColumn virtualColumn, @Nullable Set<String> columnNames)
{
// Copy columnNames to avoid modifying it
final Set<String> nextSet = columnNames == null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -726,6 +726,7 @@ IncrementalIndexRowResult toIncrementalIndexRow(InputRow row)
return new IncrementalIndexRowResult(incrementalIndexRow, parseExceptionMessages);
}

@Nullable
public static ParseException getCombinedParseException(
InputRow row,
@Nullable List<String> dimParseExceptionMessages,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
import org.apache.druid.java.util.common.ISE;
import org.joda.time.DateTime;

import javax.annotation.Nullable;

import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
Expand Down Expand Up @@ -208,6 +210,7 @@ private boolean isJoinedSpatialDimValValid(String dimVal)
return true;
}

@Nullable
private static Float tryParseFloat(String val)
{
try {
Expand All @@ -225,6 +228,7 @@ private static Float tryParseFloat(String val)
*
* @return decoded coordinate, or null if it could not be decoded
*/
@Nullable
public static float[] decode(final String encodedCoordinate)
{
if (encodedCoordinate == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ public abstract class ComplexMetricSerde
*
* @return A function that can compute the size of the complex object or null if you cannot/do not want to compute it
*/
@Nullable
public Function<Object, Long> inputSizeFn()
{
return null;
Expand Down