Merge branch 'master' into local-index

This commit is contained in:
fjy 2013-10-01 13:21:43 -07:00
commit 59f2d0711d
5 changed files with 3 additions and 29 deletions

View File

@ -210,19 +210,11 @@ public class IndexGeneratorTask extends AbstractTask
*/ */
private boolean shouldIndex(InputRow inputRow) 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; 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") @JsonProperty("firehose")

View File

@ -49,11 +49,6 @@ public class LinearShardSpec implements ShardSpec
return new LinearPartitionChunk<T>(partitionNum, obj); return new LinearPartitionChunk<T>(partitionNum, obj);
} }
@Override
public boolean isInChunk(Map<String, String> dimensions) {
return true;
}
@Override @Override
public boolean isInChunk(InputRow inputRow) { public boolean isInChunk(InputRow inputRow) {
return true; return true;

View File

@ -66,12 +66,6 @@ public class NumberedShardSpec implements ShardSpec
return NumberedPartitionChunk.make(partitionNum, partitions, obj); return NumberedPartitionChunk.make(partitionNum, partitions, obj);
} }
@Override
public boolean isInChunk(Map<String, String> dimensions)
{
return true;
}
@Override @Override
public boolean isInChunk(InputRow inputRow) public boolean isInChunk(InputRow inputRow)
{ {

View File

@ -105,12 +105,6 @@ public class SingleDimensionShardSpec implements ShardSpec
return new StringPartitionChunk<T>(start, end, partitionNum, obj); return new StringPartitionChunk<T>(start, end, partitionNum, obj);
} }
@Override
public boolean isInChunk(Map<String, String> dimensions)
{
return checkValue(dimensions.get(dimension));
}
@Override @Override
public boolean isInChunk(InputRow inputRow) public boolean isInChunk(InputRow inputRow)
{ {

View File

@ -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)); Assert.assertEquals(String.format("spec[%s], row[%s]", spec, inputRow), pair.lhs, spec.isInChunk(inputRow));
} }
} }