Skip to content

Commit 6dd1a44

Browse files
committed
fixed backport
1 parent 6e31b25 commit 6dd1a44

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/java/org/apache/cassandra/db/filter/RowFilter.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ protected BaseRowIterator<?> applyToPartition(BaseRowIterator<?> partition)
224224

225225
// Short-circuit all partitions that won't match based on static and partition keys
226226
for (Expression e : partitionLevelExpressions)
227-
if (!e.isSatisfiedBy(metadata, partition.partitionKey(), partition.staticRow()))
227+
if (!e.isSatisfiedBy(metadata, partition.partitionKey(), partition.staticRow(), nowInSec))
228228
{
229229
partition.close();
230230
return null;
@@ -251,7 +251,7 @@ public Row applyToRow(Row row)
251251
return null;
252252

253253
for (Expression e : rowLevelExpressions)
254-
if (!e.isSatisfiedBy(metadata, pk, purged))
254+
if (!e.isSatisfiedBy(metadata, pk, purged, nowInSec))
255255
return null;
256256

257257
return row;
@@ -303,7 +303,7 @@ public boolean isSatisfiedBy(TableMetadata metadata, DecoratedKey partitionKey,
303303

304304
for (Expression e : expressions)
305305
{
306-
if (!e.isSatisfiedBy(metadata, partitionKey, purged))
306+
if (!e.isSatisfiedBy(metadata, partitionKey, purged, nowInSec))
307307
return false;
308308
}
309309
return true;
@@ -522,9 +522,9 @@ public void validateForIndexing()
522522
* (i.e. it should come from a RowIterator).
523523
* @return whether the row is satisfied by this expression.
524524
*/
525-
public abstract boolean isSatisfiedBy(TableMetadata metadata, DecoratedKey partitionKey, Row row);
525+
public abstract boolean isSatisfiedBy(TableMetadata metadata, DecoratedKey partitionKey, Row row, long nowInSec);
526526

527-
protected ByteBuffer getValue(TableMetadata metadata, DecoratedKey partitionKey, Row row)
527+
protected ByteBuffer getValue(TableMetadata metadata, DecoratedKey partitionKey, Row row, long nowInSec)
528528
{
529529
switch (column.kind)
530530
{
@@ -697,7 +697,7 @@ public static class SimpleExpression extends Expression
697697
super(column, operator, value);
698698
}
699699

700-
public boolean isSatisfiedBy(TableMetadata metadata, DecoratedKey partitionKey, Row row)
700+
public boolean isSatisfiedBy(TableMetadata metadata, DecoratedKey partitionKey, Row row, long nowInSec)
701701
{
702702
// We support null conditions for LWT (in ColumnCondition) but not for RowFilter.
703703
// TODO: we should try to merge both code someday.
@@ -711,7 +711,7 @@ public boolean isSatisfiedBy(TableMetadata metadata, DecoratedKey partitionKey,
711711
// representation. See CASSANDRA-11629
712712
if (column.type.isCounter())
713713
{
714-
ByteBuffer foundValue = getValue(metadata, partitionKey, row);
714+
ByteBuffer foundValue = getValue(metadata, partitionKey, row, nowInSec);
715715
if (foundValue == null)
716716
return false;
717717

@@ -721,7 +721,7 @@ public boolean isSatisfiedBy(TableMetadata metadata, DecoratedKey partitionKey,
721721
else
722722
{
723723
// Note that CQL expression are always of the form 'x < 4', i.e. the tested value is on the left.
724-
ByteBuffer foundValue = getValue(metadata, partitionKey, row);
724+
ByteBuffer foundValue = getValue(metadata, partitionKey, row, nowInSec);
725725
return foundValue != null && operator.isSatisfiedBy(column.type, foundValue, value);
726726
}
727727
}
@@ -736,7 +736,7 @@ else if (operator.appliesToCollectionElements() || operator.appliesToMapKeys())
736736
}
737737
else
738738
{
739-
ByteBuffer foundValue = getValue(metadata, partitionKey, row);
739+
ByteBuffer foundValue = getValue(metadata, partitionKey, row, nowInSec);
740740
return foundValue != null && operator.isSatisfiedBy(column.type, foundValue, value);
741741
}
742742
}
@@ -840,7 +840,7 @@ public boolean isSatisfiedBy(TableMetadata metadata, DecoratedKey partitionKey,
840840
}
841841
else
842842
{
843-
ByteBuffer serializedMap = getValue(metadata, partitionKey, row);
843+
ByteBuffer serializedMap = getValue(metadata, partitionKey, row, nowInSec);
844844
if (serializedMap == null)
845845
return false;
846846

0 commit comments

Comments
 (0)