mirror of https://github.com/apache/druid.git
ShardSpec: Remove isInChunk(Map<String, String>)
This commit is contained in:
parent
16558404d6
commit
62eda5020c
|
@ -210,19 +210,11 @@ public class IndexGeneratorTask extends AbstractTask
|
|||
*/
|
||||
private boolean shouldIndex(InputRow inputRow)
|
||||
{
|
||||
if (!getImplicitLockInterval().get().contains(inputRow.getTimestampFromEpoch())) {
|
||||
if (getImplicitLockInterval().get().contains(inputRow.getTimestampFromEpoch())) {
|
||||
return schema.getShardSpec().isInChunk(inputRow);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
||||
final Map<String, String> eventDimensions = Maps.newHashMapWithExpectedSize(inputRow.getDimensions().size());
|
||||
for (final String dim : inputRow.getDimensions()) {
|
||||
final List<String> dimValues = inputRow.getDimension(dim);
|
||||
if (dimValues.size() == 1) {
|
||||
eventDimensions.put(dim, Iterables.getOnlyElement(dimValues));
|
||||
}
|
||||
}
|
||||
|
||||
return schema.getShardSpec().isInChunk(eventDimensions);
|
||||
}
|
||||
|
||||
@JsonProperty("firehose")
|
||||
|
|
|
@ -49,11 +49,6 @@ public class LinearShardSpec implements ShardSpec
|
|||
return new LinearPartitionChunk<T>(partitionNum, obj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isInChunk(Map<String, String> dimensions) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isInChunk(InputRow inputRow) {
|
||||
return true;
|
||||
|
|
|
@ -66,12 +66,6 @@ public class NumberedShardSpec implements ShardSpec
|
|||
return NumberedPartitionChunk.make(partitionNum, partitions, obj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isInChunk(Map<String, String> dimensions)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isInChunk(InputRow inputRow)
|
||||
{
|
||||
|
|
|
@ -105,12 +105,6 @@ public class SingleDimensionShardSpec implements ShardSpec
|
|||
return new StringPartitionChunk<T>(start, end, partitionNum, obj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isInChunk(Map<String, String> dimensions)
|
||||
{
|
||||
return checkValue(dimensions.get(dimension));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isInChunk(InputRow inputRow)
|
||||
{
|
||||
|
|
|
@ -111,7 +111,6 @@ public class SingleDimensionShardSpecTest
|
|||
}
|
||||
)
|
||||
);
|
||||
Assert.assertEquals(String.format("spec[%s], map[%s]", spec, pair.rhs), pair.lhs, spec.isInChunk(pair.rhs));
|
||||
Assert.assertEquals(String.format("spec[%s], row[%s]", spec, inputRow), pair.lhs, spec.isInChunk(inputRow));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue