SlideShare une entreprise Scribd logo
1  sur  35
Plugins in Drizzle
Plugins in Drizzle ,[object Object]
~80 plugins already bundled
Drizzle plugins load on startup only
Drizzle plugins more object-orientated
Plugin Types Authentication Authorization Catalogs Error Message Event Observer Function Listen Logging Query Cache Scheduler Schema Engine Storage Engine Table Function Transaction Applier Transaction Replicator
Plugin Loading drizzled --plugin-add=my_plugin,your_plugin drizzled --plugin-remove=unwanted_plugin
Plugin Loading Example: drizzle --plugin-remove=auth_all --plugin-add=auth_file
Plugin.ini [plugin] title= Drizzle Protocol Module description= Drizzle protocol module. Version= 0.3 author= Brian Aker license= PLUGIN_LICENSE_GPL libs= drizzled/algorithm/libhash.la load_by_default= yes ldlfags= $(LIBZ) headers= drizzle_protocol.h sources= drizzle_protocol.cc static= yes
Variables? ,[object Object]
Options processing uses Boost::Program_Options
drizzled --plugin.option=setting
SET plugin_option=setting
Intialization #include <drizzled/plugin.h> #include <drizzled/plugin/*plugin_type.h*> DRIZZLE_DECLARE_PLUGIN { DRIZZLE_VERSION_ID, name, plugin version, author, description, init, dependencies, init_options } DRIZZLE_DECLARE_PLUGIN_END;
Intialization #include <drizzled/plugin.h> #include <drizzled/plugin/*plugin_type.h*> DRIZZLE_PLUGIN ( init, system (unused), init_options )
Initialization static int init(drizzled::module::Context &context) { const module::option_map &vm= context.getOptions(); ListenDrizzleProtocol *protocol=new ListenDrizzleProtocol(&quot;drizzle_protocol&quot;, vm[&quot;bind-address&quot;].as<std::string>(), true); protocol->addCountersToTable(); context.add(protocol); context.registerVariable(new sys_var_constrained_value_readonly<in_port_t>(&quot;port&quot;, port)); ... return 0; }
Initialization static void init_options(drizzled::module::option_context &context) { context(&quot;port&quot;, po::value<port_constraint>(&port)->default_value(DRIZZLE_TCP_PORT), N_(&quot;Port number to use for connection or 0 for default to with Drizzle/MySQL protocol.&quot;)); ... }
Compiling $ cp $DRIZZLE_SRC_ROOT/config/config.rpath config/ $ cp $DRIZZLE_SRC_ROOT/config/pandora-plugin config/ $ cp $DRIZZLE_SRC_ROOT/config/pandora-plugin.ini config/ $ cp -R $DRIZZLE_SRC_PORT/m4 .
Compiling $ ./config/pandora-plugin $ autoreconf -i
Compiling $ ./configure $ make $ make install
Daemon Plugins ,[object Object]
Very similar to MySQL
Daemon Example Plugin.ini: [plugin] name= daemon_example module_name= daemon_example title= Daemon Example Module description= Daemon Example Module version= 0.1 author= Andrew Hutchings url= http://www.linuxjedi.co.uk/ license= PLUGIN_LICENSE_GPL load_by_default= no headers= daemon_example.h sources= daemon_example.cc
Daemon Example daemon_example.cc: #include &quot;config.h&quot; #include <iostream> #include &quot;daemon_example.h&quot; static int init(drizzled::module::Context&) { std::cout << &quot;Hello World!&quot; << std::endl; return 0; } static void init_options(drizzled::module::option_context&) { }
Daemon Example daemon_example.cc: DRIZZLE_DECLARE_PLUGIN { DRIZZLE_VERSION_ID, &quot;daemon-example&quot;, &quot;0.1&quot;, &quot;Andrew Hutchings&quot;, &quot;An example Daemon Plugin&quot;, drizzled::PLUGIN_LICENSE_GPL, init,  /* Plugin Init */ NULL, /* depends */ init_options  /* config options */ } DRIZZLE_DECLARE_PLUGIN_END;
Daemon Example daemon_example.h: #include <drizzled/plugin.h> #include <drizzled/plugin/daemon.h>
TableFunction Plugins ,[object Object]
Incorporates INFORMATION_SCHEMA and DATA_DICTIONARY
In memory only, no disk used
INFORMATION_SCHEMA is SQL standards compliant tables
DATA_DICTIONARY is everything else
Data Dictionary Example plugin.ini: [plugin] name= getrusage module_name= getrusage title= getrusage Data Dictionary Module description= getrusage Data Dictionary Module version= 0.1 author= Andrew Hutchings url= http://www.linuxjedi.co.uk/ license= PLUGIN_LICENSE_GPL load_by_default= no headers= getrusage_plugin.h sources= getrusage_plugin.cc
Data Dictionary Example getrusage_plugin.cc: #include <config.h> #include &quot;getrusage_plugin.h&quot; Getrusage::Getrusage() : drizzled::plugin::TableFunction(&quot;DATA_DICTIONARY&quot;, &quot;GETRUSAGE&quot;) { add_field(&quot;TYPE&quot;, drizzled::plugin::TableFunction::STRING, 7, false); add_field(&quot;TIME&quot;, drizzled::plugin::TableFunction::NUMBER, 0, false); }
Data Dictionary Example getrusage_plugin.cc: Getrusage::Generator::Generator(drizzled::Field **arg) : drizzled::plugin::TableFunction::Generator(arg), counter(0) { counter= 0; getrusage(RUSAGE_SELF, &usage_data); return; }
Data Dictionary Example getrusage_plugin.cc bool Getrusage::Generator::populate() { counter++; if (counter == 1) { push(&quot;USER&quot;); push(usage_data.ru_utime.tv_sec); return true; } if (counter == 2) { push(&quot;SYSTEM&quot;); push(usage_data.ru_stime.tv_sec); return true; } return false; }

Contenu connexe

Tendances

Python RESTful webservices with Python: Flask and Django solutions
Python RESTful webservices with Python: Flask and Django solutionsPython RESTful webservices with Python: Flask and Django solutions
Python RESTful webservices with Python: Flask and Django solutionsSolution4Future
 
Building robust and friendly command line applications in go
Building robust and friendly command line applications in goBuilding robust and friendly command line applications in go
Building robust and friendly command line applications in goAndrii Soldatenko
 
A new way to develop with WordPress!
A new way to develop with WordPress!A new way to develop with WordPress!
A new way to develop with WordPress!David Sanchez
 
GDG DevFest 2013 - PHP Web Apps on Google Cloud
GDG DevFest 2013 - PHP Web Apps on Google CloudGDG DevFest 2013 - PHP Web Apps on Google Cloud
GDG DevFest 2013 - PHP Web Apps on Google CloudBhavik Shah
 
Advanced debugging  techniques in different environments
Advanced debugging  techniques in different environmentsAdvanced debugging  techniques in different environments
Advanced debugging  techniques in different environmentsAndrii Soldatenko
 
Portland Puppet User Group June 2014: Writing and publishing puppet modules
Portland Puppet User Group June 2014: Writing and publishing puppet modulesPortland Puppet User Group June 2014: Writing and publishing puppet modules
Portland Puppet User Group June 2014: Writing and publishing puppet modulesPuppet
 
Debugging PHP with Xdebug - PHPUK 2018
Debugging PHP with Xdebug - PHPUK 2018Debugging PHP with Xdebug - PHPUK 2018
Debugging PHP with Xdebug - PHPUK 2018Mark Niebergall
 
Oliver hookins puppetcamp2011
Oliver hookins puppetcamp2011Oliver hookins puppetcamp2011
Oliver hookins puppetcamp2011Puppet
 
Hack in the Box Keynote 2006
Hack in the Box Keynote 2006Hack in the Box Keynote 2006
Hack in the Box Keynote 2006Mark Curphey
 
Debugging: Rules & Tools
Debugging: Rules & ToolsDebugging: Rules & Tools
Debugging: Rules & ToolsIan Barber
 
Groovy on the Shell
Groovy on the ShellGroovy on the Shell
Groovy on the Shellsascha_klein
 
Zend Framework Study@Tokyo #2
Zend Framework Study@Tokyo #2Zend Framework Study@Tokyo #2
Zend Framework Study@Tokyo #2Shinya Ohyanagi
 
Debugging concurrency programs in go
Debugging concurrency programs in goDebugging concurrency programs in go
Debugging concurrency programs in goAndrii Soldatenko
 
PHP Backdoor: The rise of the vuln
PHP Backdoor: The rise of the vulnPHP Backdoor: The rise of the vuln
PHP Backdoor: The rise of the vulnSandro Zaccarini
 
Automatic PHP 7 Compatibility Checking Using php7cc (and PHPCompatibility)
Automatic PHP 7 Compatibility Checking Using php7cc (and PHPCompatibility)Automatic PHP 7 Compatibility Checking Using php7cc (and PHPCompatibility)
Automatic PHP 7 Compatibility Checking Using php7cc (and PHPCompatibility)Mark Niebergall
 
Diving into HHVM Extensions (PHPNW Conference 2015)
Diving into HHVM Extensions (PHPNW Conference 2015)Diving into HHVM Extensions (PHPNW Conference 2015)
Diving into HHVM Extensions (PHPNW Conference 2015)James Titcumb
 

Tendances (20)

Python RESTful webservices with Python: Flask and Django solutions
Python RESTful webservices with Python: Flask and Django solutionsPython RESTful webservices with Python: Flask and Django solutions
Python RESTful webservices with Python: Flask and Django solutions
 
Building robust and friendly command line applications in go
Building robust and friendly command line applications in goBuilding robust and friendly command line applications in go
Building robust and friendly command line applications in go
 
A new way to develop with WordPress!
A new way to develop with WordPress!A new way to develop with WordPress!
A new way to develop with WordPress!
 
Puppet modules for Fun and Profit
Puppet modules for Fun and ProfitPuppet modules for Fun and Profit
Puppet modules for Fun and Profit
 
GDG DevFest 2013 - PHP Web Apps on Google Cloud
GDG DevFest 2013 - PHP Web Apps on Google CloudGDG DevFest 2013 - PHP Web Apps on Google Cloud
GDG DevFest 2013 - PHP Web Apps on Google Cloud
 
Ant
Ant Ant
Ant
 
PHP7 Presentation
PHP7 PresentationPHP7 Presentation
PHP7 Presentation
 
Advanced debugging  techniques in different environments
Advanced debugging  techniques in different environmentsAdvanced debugging  techniques in different environments
Advanced debugging  techniques in different environments
 
Portland Puppet User Group June 2014: Writing and publishing puppet modules
Portland Puppet User Group June 2014: Writing and publishing puppet modulesPortland Puppet User Group June 2014: Writing and publishing puppet modules
Portland Puppet User Group June 2014: Writing and publishing puppet modules
 
The new features of PHP 7
The new features of PHP 7The new features of PHP 7
The new features of PHP 7
 
Debugging PHP with Xdebug - PHPUK 2018
Debugging PHP with Xdebug - PHPUK 2018Debugging PHP with Xdebug - PHPUK 2018
Debugging PHP with Xdebug - PHPUK 2018
 
Oliver hookins puppetcamp2011
Oliver hookins puppetcamp2011Oliver hookins puppetcamp2011
Oliver hookins puppetcamp2011
 
Hack in the Box Keynote 2006
Hack in the Box Keynote 2006Hack in the Box Keynote 2006
Hack in the Box Keynote 2006
 
Debugging: Rules & Tools
Debugging: Rules & ToolsDebugging: Rules & Tools
Debugging: Rules & Tools
 
Groovy on the Shell
Groovy on the ShellGroovy on the Shell
Groovy on the Shell
 
Zend Framework Study@Tokyo #2
Zend Framework Study@Tokyo #2Zend Framework Study@Tokyo #2
Zend Framework Study@Tokyo #2
 
Debugging concurrency programs in go
Debugging concurrency programs in goDebugging concurrency programs in go
Debugging concurrency programs in go
 
PHP Backdoor: The rise of the vuln
PHP Backdoor: The rise of the vulnPHP Backdoor: The rise of the vuln
PHP Backdoor: The rise of the vuln
 
Automatic PHP 7 Compatibility Checking Using php7cc (and PHPCompatibility)
Automatic PHP 7 Compatibility Checking Using php7cc (and PHPCompatibility)Automatic PHP 7 Compatibility Checking Using php7cc (and PHPCompatibility)
Automatic PHP 7 Compatibility Checking Using php7cc (and PHPCompatibility)
 
Diving into HHVM Extensions (PHPNW Conference 2015)
Diving into HHVM Extensions (PHPNW Conference 2015)Diving into HHVM Extensions (PHPNW Conference 2015)
Diving into HHVM Extensions (PHPNW Conference 2015)
 

En vedette

Arquitectura orientada-a-servicios
Arquitectura orientada-a-serviciosArquitectura orientada-a-servicios
Arquitectura orientada-a-serviciosCiencias
 
Transparencia, rendición de cuentas y participación: una agenda comun para la...
Transparencia, rendición de cuentas y participación: una agenda comun para la...Transparencia, rendición de cuentas y participación: una agenda comun para la...
Transparencia, rendición de cuentas y participación: una agenda comun para la...EUROsociAL II
 
G6 m5-a-lesson 4-t
G6 m5-a-lesson 4-tG6 m5-a-lesson 4-t
G6 m5-a-lesson 4-tmlabuski
 
Creadores de la Calidad
Creadores de la CalidadCreadores de la Calidad
Creadores de la Calidadhguzman65
 
Metodika hj skripta
  Metodika hj skripta  Metodika hj skripta
Metodika hj skriptawedrana
 

En vedette (6)

Arquitectura orientada-a-servicios
Arquitectura orientada-a-serviciosArquitectura orientada-a-servicios
Arquitectura orientada-a-servicios
 
Transparencia, rendición de cuentas y participación: una agenda comun para la...
Transparencia, rendición de cuentas y participación: una agenda comun para la...Transparencia, rendición de cuentas y participación: una agenda comun para la...
Transparencia, rendición de cuentas y participación: una agenda comun para la...
 
Csharp4 basics
Csharp4 basicsCsharp4 basics
Csharp4 basics
 
G6 m5-a-lesson 4-t
G6 m5-a-lesson 4-tG6 m5-a-lesson 4-t
G6 m5-a-lesson 4-t
 
Creadores de la Calidad
Creadores de la CalidadCreadores de la Calidad
Creadores de la Calidad
 
Metodika hj skripta
  Metodika hj skripta  Metodika hj skripta
Metodika hj skripta
 

Similaire à Drizzle plugins

Developing Drizzle Replication Plugins
Developing Drizzle Replication PluginsDeveloping Drizzle Replication Plugins
Developing Drizzle Replication PluginsPadraig O'Sullivan
 
Create a web-app with Cgi Appplication
Create a web-app with Cgi AppplicationCreate a web-app with Cgi Appplication
Create a web-app with Cgi Appplicationolegmmiller
 
Auto-loading of Drupal CCK Nodes
Auto-loading of Drupal CCK NodesAuto-loading of Drupal CCK Nodes
Auto-loading of Drupal CCK Nodesnihiliad
 
Xdebug - Derick Rethans - Barcelona PHP Conference 2008
Xdebug - Derick Rethans - Barcelona PHP Conference 2008Xdebug - Derick Rethans - Barcelona PHP Conference 2008
Xdebug - Derick Rethans - Barcelona PHP Conference 2008phpbarcelona
 
JUDCon London 2011 - Bin packing with drools planner by example
JUDCon London 2011 - Bin packing with drools planner by exampleJUDCon London 2011 - Bin packing with drools planner by example
JUDCon London 2011 - Bin packing with drools planner by exampleGeoffrey De Smet
 
Write your first WordPress plugin
Write your first WordPress pluginWrite your first WordPress plugin
Write your first WordPress pluginAnthony Montalbano
 
June 2014 PDX PUG: Writing and Publishing Puppet Modules
June 2014 PDX PUG: Writing and Publishing Puppet Modules June 2014 PDX PUG: Writing and Publishing Puppet Modules
June 2014 PDX PUG: Writing and Publishing Puppet Modules Puppet
 
Intro To Mvc Development In Php
Intro To Mvc Development In PhpIntro To Mvc Development In Php
Intro To Mvc Development In Phpfunkatron
 
Tame Your Build And Deployment Process With Hudson, PHPUnit, and SSH
Tame Your Build And Deployment Process With Hudson, PHPUnit, and SSHTame Your Build And Deployment Process With Hudson, PHPUnit, and SSH
Tame Your Build And Deployment Process With Hudson, PHPUnit, and SSHDavid Stockton
 
Mini Curso Django Ii Congresso Academico Ces
Mini Curso Django Ii Congresso Academico CesMini Curso Django Ii Congresso Academico Ces
Mini Curso Django Ii Congresso Academico CesLeonardo Fernandes
 
Optimize Site Deployments with Drush (DrupalCamp WNY 2011)
Optimize Site Deployments with Drush (DrupalCamp WNY 2011)Optimize Site Deployments with Drush (DrupalCamp WNY 2011)
Optimize Site Deployments with Drush (DrupalCamp WNY 2011)Jon Peck
 
Zend Framework 1.9 Setup & Using Zend_Tool
Zend Framework 1.9 Setup & Using Zend_ToolZend Framework 1.9 Setup & Using Zend_Tool
Zend Framework 1.9 Setup & Using Zend_ToolGordon Forsythe
 
Debian graylog logging server.docx
Debian graylog logging server.docxDebian graylog logging server.docx
Debian graylog logging server.docxAhmed Swarup
 
course slides -- powerpoint
course slides -- powerpointcourse slides -- powerpoint
course slides -- powerpointwebhostingguy
 
Zend - Installation And Sample Project Creation
Zend - Installation And Sample Project Creation Zend - Installation And Sample Project Creation
Zend - Installation And Sample Project Creation Compare Infobase Limited
 
Writing and Publishing Puppet Modules
Writing and Publishing Puppet ModulesWriting and Publishing Puppet Modules
Writing and Publishing Puppet ModulesPuppet
 
2012 02-04 fosdem 2012 - drools planner
2012 02-04 fosdem 2012 - drools planner2012 02-04 fosdem 2012 - drools planner
2012 02-04 fosdem 2012 - drools plannerGeoffrey De Smet
 

Similaire à Drizzle plugins (20)

Developing Drizzle Replication Plugins
Developing Drizzle Replication PluginsDeveloping Drizzle Replication Plugins
Developing Drizzle Replication Plugins
 
Create a web-app with Cgi Appplication
Create a web-app with Cgi AppplicationCreate a web-app with Cgi Appplication
Create a web-app with Cgi Appplication
 
Auto-loading of Drupal CCK Nodes
Auto-loading of Drupal CCK NodesAuto-loading of Drupal CCK Nodes
Auto-loading of Drupal CCK Nodes
 
Catalyst MVC
Catalyst MVCCatalyst MVC
Catalyst MVC
 
Php Debugger
Php DebuggerPhp Debugger
Php Debugger
 
Xdebug - Derick Rethans - Barcelona PHP Conference 2008
Xdebug - Derick Rethans - Barcelona PHP Conference 2008Xdebug - Derick Rethans - Barcelona PHP Conference 2008
Xdebug - Derick Rethans - Barcelona PHP Conference 2008
 
Writing Pluggable Software
Writing Pluggable SoftwareWriting Pluggable Software
Writing Pluggable Software
 
JUDCon London 2011 - Bin packing with drools planner by example
JUDCon London 2011 - Bin packing with drools planner by exampleJUDCon London 2011 - Bin packing with drools planner by example
JUDCon London 2011 - Bin packing with drools planner by example
 
Write your first WordPress plugin
Write your first WordPress pluginWrite your first WordPress plugin
Write your first WordPress plugin
 
June 2014 PDX PUG: Writing and Publishing Puppet Modules
June 2014 PDX PUG: Writing and Publishing Puppet Modules June 2014 PDX PUG: Writing and Publishing Puppet Modules
June 2014 PDX PUG: Writing and Publishing Puppet Modules
 
Intro To Mvc Development In Php
Intro To Mvc Development In PhpIntro To Mvc Development In Php
Intro To Mvc Development In Php
 
Tame Your Build And Deployment Process With Hudson, PHPUnit, and SSH
Tame Your Build And Deployment Process With Hudson, PHPUnit, and SSHTame Your Build And Deployment Process With Hudson, PHPUnit, and SSH
Tame Your Build And Deployment Process With Hudson, PHPUnit, and SSH
 
Mini Curso Django Ii Congresso Academico Ces
Mini Curso Django Ii Congresso Academico CesMini Curso Django Ii Congresso Academico Ces
Mini Curso Django Ii Congresso Academico Ces
 
Optimize Site Deployments with Drush (DrupalCamp WNY 2011)
Optimize Site Deployments with Drush (DrupalCamp WNY 2011)Optimize Site Deployments with Drush (DrupalCamp WNY 2011)
Optimize Site Deployments with Drush (DrupalCamp WNY 2011)
 
Zend Framework 1.9 Setup & Using Zend_Tool
Zend Framework 1.9 Setup & Using Zend_ToolZend Framework 1.9 Setup & Using Zend_Tool
Zend Framework 1.9 Setup & Using Zend_Tool
 
Debian graylog logging server.docx
Debian graylog logging server.docxDebian graylog logging server.docx
Debian graylog logging server.docx
 
course slides -- powerpoint
course slides -- powerpointcourse slides -- powerpoint
course slides -- powerpoint
 
Zend - Installation And Sample Project Creation
Zend - Installation And Sample Project Creation Zend - Installation And Sample Project Creation
Zend - Installation And Sample Project Creation
 
Writing and Publishing Puppet Modules
Writing and Publishing Puppet ModulesWriting and Publishing Puppet Modules
Writing and Publishing Puppet Modules
 
2012 02-04 fosdem 2012 - drools planner
2012 02-04 fosdem 2012 - drools planner2012 02-04 fosdem 2012 - drools planner
2012 02-04 fosdem 2012 - drools planner
 

Dernier

presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfOrbitshub
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Bhuvaneswari Subramani
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...apidays
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 

Dernier (20)

presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 

Drizzle plugins

  • 2.
  • 4. Drizzle plugins load on startup only
  • 5. Drizzle plugins more object-orientated
  • 6. Plugin Types Authentication Authorization Catalogs Error Message Event Observer Function Listen Logging Query Cache Scheduler Schema Engine Storage Engine Table Function Transaction Applier Transaction Replicator
  • 7. Plugin Loading drizzled --plugin-add=my_plugin,your_plugin drizzled --plugin-remove=unwanted_plugin
  • 8. Plugin Loading Example: drizzle --plugin-remove=auth_all --plugin-add=auth_file
  • 9. Plugin.ini [plugin] title= Drizzle Protocol Module description= Drizzle protocol module. Version= 0.3 author= Brian Aker license= PLUGIN_LICENSE_GPL libs= drizzled/algorithm/libhash.la load_by_default= yes ldlfags= $(LIBZ) headers= drizzle_protocol.h sources= drizzle_protocol.cc static= yes
  • 10.
  • 11. Options processing uses Boost::Program_Options
  • 14. Intialization #include <drizzled/plugin.h> #include <drizzled/plugin/*plugin_type.h*> DRIZZLE_DECLARE_PLUGIN { DRIZZLE_VERSION_ID, name, plugin version, author, description, init, dependencies, init_options } DRIZZLE_DECLARE_PLUGIN_END;
  • 15. Intialization #include <drizzled/plugin.h> #include <drizzled/plugin/*plugin_type.h*> DRIZZLE_PLUGIN ( init, system (unused), init_options )
  • 16. Initialization static int init(drizzled::module::Context &context) { const module::option_map &vm= context.getOptions(); ListenDrizzleProtocol *protocol=new ListenDrizzleProtocol(&quot;drizzle_protocol&quot;, vm[&quot;bind-address&quot;].as<std::string>(), true); protocol->addCountersToTable(); context.add(protocol); context.registerVariable(new sys_var_constrained_value_readonly<in_port_t>(&quot;port&quot;, port)); ... return 0; }
  • 17. Initialization static void init_options(drizzled::module::option_context &context) { context(&quot;port&quot;, po::value<port_constraint>(&port)->default_value(DRIZZLE_TCP_PORT), N_(&quot;Port number to use for connection or 0 for default to with Drizzle/MySQL protocol.&quot;)); ... }
  • 18. Compiling $ cp $DRIZZLE_SRC_ROOT/config/config.rpath config/ $ cp $DRIZZLE_SRC_ROOT/config/pandora-plugin config/ $ cp $DRIZZLE_SRC_ROOT/config/pandora-plugin.ini config/ $ cp -R $DRIZZLE_SRC_PORT/m4 .
  • 20. Compiling $ ./configure $ make $ make install
  • 21.
  • 23. Daemon Example Plugin.ini: [plugin] name= daemon_example module_name= daemon_example title= Daemon Example Module description= Daemon Example Module version= 0.1 author= Andrew Hutchings url= http://www.linuxjedi.co.uk/ license= PLUGIN_LICENSE_GPL load_by_default= no headers= daemon_example.h sources= daemon_example.cc
  • 24. Daemon Example daemon_example.cc: #include &quot;config.h&quot; #include <iostream> #include &quot;daemon_example.h&quot; static int init(drizzled::module::Context&) { std::cout << &quot;Hello World!&quot; << std::endl; return 0; } static void init_options(drizzled::module::option_context&) { }
  • 25. Daemon Example daemon_example.cc: DRIZZLE_DECLARE_PLUGIN { DRIZZLE_VERSION_ID, &quot;daemon-example&quot;, &quot;0.1&quot;, &quot;Andrew Hutchings&quot;, &quot;An example Daemon Plugin&quot;, drizzled::PLUGIN_LICENSE_GPL, init, /* Plugin Init */ NULL, /* depends */ init_options /* config options */ } DRIZZLE_DECLARE_PLUGIN_END;
  • 26. Daemon Example daemon_example.h: #include <drizzled/plugin.h> #include <drizzled/plugin/daemon.h>
  • 27.
  • 29. In memory only, no disk used
  • 30. INFORMATION_SCHEMA is SQL standards compliant tables
  • 32. Data Dictionary Example plugin.ini: [plugin] name= getrusage module_name= getrusage title= getrusage Data Dictionary Module description= getrusage Data Dictionary Module version= 0.1 author= Andrew Hutchings url= http://www.linuxjedi.co.uk/ license= PLUGIN_LICENSE_GPL load_by_default= no headers= getrusage_plugin.h sources= getrusage_plugin.cc
  • 33. Data Dictionary Example getrusage_plugin.cc: #include <config.h> #include &quot;getrusage_plugin.h&quot; Getrusage::Getrusage() : drizzled::plugin::TableFunction(&quot;DATA_DICTIONARY&quot;, &quot;GETRUSAGE&quot;) { add_field(&quot;TYPE&quot;, drizzled::plugin::TableFunction::STRING, 7, false); add_field(&quot;TIME&quot;, drizzled::plugin::TableFunction::NUMBER, 0, false); }
  • 34. Data Dictionary Example getrusage_plugin.cc: Getrusage::Generator::Generator(drizzled::Field **arg) : drizzled::plugin::TableFunction::Generator(arg), counter(0) { counter= 0; getrusage(RUSAGE_SELF, &usage_data); return; }
  • 35. Data Dictionary Example getrusage_plugin.cc bool Getrusage::Generator::populate() { counter++; if (counter == 1) { push(&quot;USER&quot;); push(usage_data.ru_utime.tv_sec); return true; } if (counter == 2) { push(&quot;SYSTEM&quot;); push(usage_data.ru_stime.tv_sec); return true; } return false; }
  • 36. Data Dictionary Example getrusage_plugin.cc static int init(drizzled::module::Context &context) { context.add(new Getrusage); return 0; } DRIZZLE_DECLARE_PLUGIN { DRIZZLE_VERSION_ID, &quot;Getrusage Dictionary&quot;, &quot;0.1&quot;, &quot;Andrew Hutchings&quot;, &quot;Data Dictionary for Getrusage&quot;, drizzled::PLUGIN_LICENSE_GPL, init, NULL, NULL } DRIZZLE_DECLARE_PLUGIN_END;
  • 37. Data Dictionary Example getrusage_plugin.h: #include <drizzled/plugin.h> #include <drizzled/plugin/table_function.h> #include <sys/resource.h> class Getrusage : public drizzled::plugin::TableFunction { public: Getrusage();
  • 38. Data Dictionary Example getrusage_plugin.h: class Generator : public drizzled::plugin::TableFunction::Generator { public: Generator(drizzled::Field **arg); bool populate(); int counter; rusage usage_data; }; Generator *generator(drizzled::Field **arg) { return new Generator(arg); } };
  • 39.
  • 40. Same API as MySQL/Drizzle internal functions
  • 41. UDF Example plugin.ini: [plugin] name= udf_example module_name= udf_example title= An example UDF description= An example UDF version= 0.1 author= Andrew Hutchings url= http://www.linuxjedi.co.uk/ license= PLUGIN_LICENSE_GPL load_by_default= no headers= udf_example.h sources= udf_example.cc
  • 42. UDF Example udf_example.cc: #include <config.h> #include <drizzled/lex_string.h> #include &quot;udf_example.h&quot; namespace drizzled { String *Item_func_example::val_str(String *str) { assert(fixed == 1); String *result= args[0]->val_str(str); null_value= args[0]->null_value; return result; } } /* namespace drizzled */
  • 43. UDF Example udf_example.cc: static int init(drizzled::module::Context &context) { context.add(new drizzled::plugin::Create_function<drizzled::Item_func_example>(&quot;example&quot;)); return 0; }
  • 44. UDF Example udf_example.cc: DRIZZLE_DECLARE_PLUGIN { DRIZZLE_VERSION_ID, &quot;Example Function&quot;, &quot;0.1&quot;, &quot;Andrew Hutchings&quot;, &quot;Example Function&quot;, drizzled::PLUGIN_LICENSE_GPL, init, NULL, NULL } DRIZZLE_DECLARE_PLUGIN_END;
  • 45. UDF Example udf_example.h: #include <drizzled/plugin.h> #include <drizzled/plugin/function.h> #include <drizzled/function/str/strfunc.h> namespace drizzled {
  • 46. UDF Example udf_example.h: class Item_func_example: public Item_str_func { public: Item_func_example() : Item_str_func() {} const char *func_name() const { return &quot;example&quot;; } String *val_str(String *); void fix_length_and_dec() { collation.set(args[0]->collation); max_length= args[0]->max_length; } bool check_argument_count(int n) { return n == 1; } }; } /* namespace drizzled */
  • 47. Drizzle Developer Day Friday at the Hilton