← Back to team overview

maria-developers team mailing list archive

Re: MDEV-3792: review of the handler part of the cassandra engine

 

On Thu, Dec 20, 2012 at 05:15:02PM +0400, Sergei Petrunia wrote:
> > +static int show_cassandra_vars(THD *thd, SHOW_VAR *var, char *buff)
> > +{
> > +  cassandra_counters_copy= cassandra_counters;
> > +
> > +  var->type= SHOW_ARRAY;
> > +  var->value= (char *) &cassandra_status_variables;
> 
> what's the point? If you don't do anything in this function,
> you can just as easily list all status variables below
> in the func_status[] array.

InnoDB doesn't do this. I've followed your suggestion (doable), and figured out
why: If I list all variables in cassandra_status_variables,  FLUSH STATUS
flushes them. 

Is it a good thing? InnoDB counters are not reset by FLUSH STATUS, and neither 
are others.

> 
> > +  return 0;
> > +}
> > +
> > +
> > +struct st_mysql_storage_engine cassandra_storage_engine=
> > +{ MYSQL_HANDLERTON_INTERFACE_VERSION };
> > +
> > +static struct st_mysql_show_var func_status[]=
> > +{
> > +  {"Cassandra",  (char *)show_cassandra_vars, SHOW_FUNC},
> > +  {0,0,SHOW_UNDEF}
> > +};
> > +
> > +maria_declare_plugin(cassandra)
> > +{
> > +  MYSQL_STORAGE_ENGINE_PLUGIN,
> > +  &cassandra_storage_engine,
> > +  "CASSANDRA",
> > +  "Monty Program Ab",
> > +  "Cassandra storage engine",
> > +  PLUGIN_LICENSE_GPL,
> > +  cassandra_init_func,                            /* Plugin Init */
> > +  cassandra_done_func,                            /* Plugin Deinit */
> > +  0x0001,                                       /* version number (0.1) */
> > +  func_status,                                  /* status variables */
> > +  cassandra_system_variables,                     /* system variables */
> > +  "0.1",                                        /* string version */
> > +  MariaDB_PLUGIN_MATURITY_EXPERIMENTAL          /* maturity */
> > +}
> > +maria_declare_plugin_end;

BR
 Sergei
-- 
Sergei Petrunia, Software Developer
Monty Program AB, http://askmonty.org
Blog: http://s.petrunia.net/blog


References