<commit_before>mysql-r2d2
==========

A simple message queue storage engine for MySQL.  Inspired by r2d2 from star wars :)


mysql> show engines;

+--------+---------+---------------------------------------------------------+--------------+----+------------+

| Engine | Support | Comment                                                 | Transactions | XA | Savepoints |

+--------+---------+---------------------------------------------------------+--------------+----+------------+

| r2d2   | YES     | Interface with message queues.(may the force be with u) | NO           | NO | NO         |

+------- +---------+---------------------------------------------------------+--------------+----+------------+


How to work with this engine ?
-----------------------------

(Step-0) compile the java producer library. refer to https://github.com/jaihind213/r2d2-java

(Step-1) compile the storage engine(refer build instructions). copy 'ha_r2d2.so' to directory shown by command `show variables like '%plugin%';`


(Step-2) add following variable to my.cnf `r2d2_jvm_arguments_var="-Djava.class.path=<path_to_r2d2-java.jar>"`


(Step-3) start mysqld server


(Step-4) open mysql prompt & run the following: `INSTALL PLUGIN r2d2 SONAME 'ha_r2d2.so';`


(Step-5) create table. please note the mandatory column 'payload' should be present. 

	create table foo(payload varchar(213))engine=r2d2  CONNECTION='producer_type:BLACKHOLE;dest_type:TOPIC;dest_name:bar;key1:value1';

	Note: The connection string specifies the following:
	
		(a) producer_type:BLACKHOLE
                    The type of producer, i.e. here we have blackhole producer, producing to blackhole(stdout), valid values are `BLACKHOLE` for now (TODO: Add KAFKA)
 		(b) dest_type:TOPIC <commit_msg>modified readme<commit_after>mysql-r2d2
==========

A simple message queue storage engine for MySQL.  Inspired by r2d2 from star wars :)


mysql> show engines;

+--------+---------+---------------------------------------------------------+--------------+----+------------+

| Engine | Support | Comment                                                 | Transactions | XA | Savepoints |

+--------+---------+---------------------------------------------------------+--------------+----+------------+

| r2d2   | YES     | Interface with message queues.(may the force be with u) | NO           | NO | NO         |

+------- +---------+---------------------------------------------------------+--------------+----+------------+


How to work with this engine ?
-----------------------------

(Step-0) compile the java producer library. refer to https://github.com/jaihind213/r2d2-java

(Step-1) compile the storage engine(refer build instructions). copy 'ha_r2d2.so' to directory shown by command `show variables like '%plugin%';`

(Step-2) start mysqld server

(Step-3) open mysql prompt & run the following: `INSTALL PLUGIN r2d2 SONAME 'ha_r2d2.so';`

         check the logs. the engine should have been registered successfully. you will also find a class not found exception! 

(Step-4) To Fix the exception: add following variable to my.cnf `r2d2_jvm_arguments_var="-Djava.class.path=<path_to_r2d2-java.jar>"`

(Step-5) create table. please note the mandatory column 'payload' should be present. 

	create table foo(payload varchar(213))engine=r2d2  CONNECTION='producer_type:BLACKHOLE;dest_type:TOPIC;dest_name:bar;key1:value1';

	Note: The connection string specifies the following:
	
		(a) producer_type:BLACKHOLE
                    The type of producer, i.e. here we have blackhole producer, producing to blackhole(stdout), valid values are `BLACKHOLE` for now (TODO: Add KAFKA)
 		(b) dest_type:TOPIC 
{'fraction_non_alphanumeric': 0.2730245231607629, 'fraction_numerical': 0.018528610354223433, 'mean_word_length': 1.703240058910162, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3449725', 'n_tokens_mistral': 1027, 'n_tokens_neox': 972, 'n_words': 312}