mirror of https://github.com/apache/cassandra
Merge branch 'cassandra-6.0' into trunk
* cassandra-6.0: Avoid allocation by getFunctions in SelectStatement.authorize
This commit is contained in:
commit
9394991853
|
|
@ -10,6 +10,7 @@ Merged from 5.0:
|
|||
|
||||
|
||||
6.0-alpha2
|
||||
* Avoid allocation by getFunctions in SelectStatement.authorize (CASSANDRA-21347)
|
||||
* Avoid unit conversion in DatabaseDescriptor.getMaxValueSize() for every deserializing Cell (CASSANDRA-21295)
|
||||
* Fix single token batch atomicity with Accord/non-Accord batches by using the batch log (CASSANDRA-20588)
|
||||
* Avoid CompactionOptions parsing for every read by WithoutPurgeableTombstones (CASSANDRA-21294)
|
||||
|
|
|
|||
|
|
@ -194,6 +194,8 @@ public class SelectStatement implements CQLStatement.SingleKeyspaceCqlStatement,
|
|||
*/
|
||||
private final ColumnComparator<List<ByteBuffer>> orderingComparator;
|
||||
|
||||
private final List<Function> functions;
|
||||
|
||||
public final StatementSource source;
|
||||
|
||||
// Used by forSelection below
|
||||
|
|
@ -228,6 +230,7 @@ public class SelectStatement implements CQLStatement.SingleKeyspaceCqlStatement,
|
|||
this.perPartitionLimit = perPartitionLimit;
|
||||
this.source = source;
|
||||
this.selectOptions = selectOptions;
|
||||
this.functions = findAllFunctions();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -244,9 +247,19 @@ public class SelectStatement implements CQLStatement.SingleKeyspaceCqlStatement,
|
|||
|
||||
@Override
|
||||
public Iterable<Function> getFunctions()
|
||||
{
|
||||
return functions;
|
||||
}
|
||||
|
||||
private List<Function> findAllFunctions()
|
||||
{
|
||||
List<Function> functions = new ArrayList<>();
|
||||
addFunctionsTo(functions);
|
||||
if (functions.isEmpty())
|
||||
{
|
||||
functions = Collections.emptyList(); // to avoid a new Iterator object creation during each authorization
|
||||
}
|
||||
|
||||
return functions;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue