Thanks! Based on this and a suggestion by Jon, I'm working on a pluggable query-logging implementation. Can somebody have a quick look at the last patch submitted for CASSANDRA-13001 and tell me if I'm heading in the right direction?
Quoting my comment for that file to summarize: - a new interface o.a.c.db.monitoring.IQueryLogger, with one function void logQueries(MonitoringTask.AggregatedOperations operations, MonitoringTask.OperationType type, long elapsed), accordingly, various elements in MonitoringTask have been made public - Two classes implementing it, o.a.c.d.m.QueryDebugLogger and {{o.a.c.d.m.QueryTableLogger. The former implements the current debug.log behaviour and is default, and the latter saves stats and metadata to a table (hard-coded to perf.slow_log, looking for better ideas on this). - New configuration setting slow_query_logger, works like authenticator. - Rolled up both timed out and slow operation logging in MonitoringTask to use the interface. Accordingly cleaned up MonitoringTask. Perhaps the configuration setting should be renamed, again looking for ideas. On 2017-03-01 19:42 (+0900), Romain Hardouin <romainh...@yahoo.fr.INVALID> wrote: > Hi, > I think you have to look at how authenticator/authorizer/role_manager are > handled.e.g. > https://github.com/apache/cassandra/blob/trunk/conf/cassandra.yaml#L103https://github.com/apache/cassandra/blob/trunk/src/java/org/apache/cassandra/auth/AllowAllAuthenticator.java > Best,Romain > Le Mercredi 1 mars 2017 6h19, Murukesh Mohanan > <murukesh.moha...@gmail.com> a écrit : > > I'm looking at CASSANDRA-13001 (pluggable slow query logging / handling). I > wrote a hacky patch, where my main goal was to touch as few files as possible > - so I did what I could within MonitoringTask, mostly. However, it seems that > I completely misunderstood what the feature request was. Jon Haddad noted > that pluggable means: > > > 1. It's going to be java code > > 2. the pluggable thing implements an interface defined in cassandra. > > 3. the class would be compiled and dropped in lib (loaded into classpath > > automatically) > > 4. The class can be specified in the yaml and is loaded by Class.forName() > > to pull the interface in > > > > We would need to convert the current slow query logger into a class of the > > defined interface and have it be the default if no class is specified in > > the yaml. > > Can someone point me to an existing implementation of this, that I can learn > from? A previous patch that contributed something similar, perhaps? > > >