Mike Adamson created CASSANDRA-18590:
----------------------------------------

             Summary: Introduce IndexTermType to replace TypeUtils in SAI
                 Key: CASSANDRA-18590
                 URL: https://issues.apache.org/jira/browse/CASSANDRA-18590
             Project: Cassandra
          Issue Type: Improvement
          Components: Feature/SAI
            Reporter: Mike Adamson


>From a review comment by [~adelapena] on the 
>[CASSANDRA-18067|https://issues.apache.org/jira/browse/CASSANDRA-18067] PR
{quote}Not directly related to this ticket, but it seems to me that the methods 
on TypeUtil do a lot of repeated work in the hot path just to determine the 
data type of the caller. These operations include finding the base type of 
reversed multiple times, multiple instanceof calls, etc. All these operations 
on each index are called with the same IndexContext#getValidator argument, 
needlessly repeating work for every column value.

I understand that most of the methods on TypeUtil are things that would 
normally be part of AbstractType, so each particular data type can provide its 
own implementation. But we don't want to couple the generic data types with 
SAI, so we have this class instead.

I think that we could add a kind of TermType class decorating AbstractType, and 
subclass it for every data type that gets special treatment (LONG, VARINT, 
DECIMAL and INET). Then, IndexContext would hold the adequate instance of 
TermType. This instance would be able to provide the same operations as the 
current TypeUtil, but without the type checks.{quote}




--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to