-
Notifications
You must be signed in to change notification settings - Fork 476
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Support for stored procedures in JDBC_PING2
- Sample configs for Postgres and MySql
- Loading branch information
Showing
3 changed files
with
192 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
<!-- | ||
JDBC_PING2 for MySql | ||
--> | ||
<config xmlns="urn:org:jgroups" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="urn:org:jgroups http://www.jgroups.org/schema/jgroups.xsd"> | ||
<TCP | ||
bind_addr="${jgroups.bind_addr:match-address:192.168.1.110}" | ||
bind_port="${jgroups.bind_port:7800}" | ||
port_range="50" | ||
recv_buf_size="150000" | ||
send_buf_size="640000" | ||
sock_conn_timeout="300" | ||
thread_pool.enabled="true" | ||
thread_pool.min_threads="1" | ||
thread_pool.max_threads="50" | ||
thread_pool.keep_alive_time="60000" | ||
/> | ||
|
||
<!-- Comment/remove attributes 'stored_procedures' and 'insert_sp' if you don't want to use stored procedures --> | ||
<JDBC_PING2 | ||
connection_driver="com.mysql.cj.jdbc.Driver" | ||
connection_url="jdbc:mysql://localhost/test" | ||
connection_username="bela" | ||
connection_password="password" | ||
remove_all_data_on_view_change="true" | ||
register_shutdown_hook="true" | ||
return_entire_cache="false" | ||
|
||
stored_procedures="CREATE PROCEDURE deleteAndInsert | ||
(IN addr varchar(200), IN name varchar(200), IN cluster varchar(200), | ||
IN ip varchar(200), IN coord boolean) | ||
BEGIN | ||
DELETE FROM jgroups WHERE address = addr; | ||
INSERT INTO jgroups VALUES (addr, name, cluster, ip, coord); | ||
END" | ||
insert_sp="call deleteAndInsert(?,?,?,?,?);" | ||
|
||
/> | ||
<MERGE3 min_interval="10000" | ||
max_interval="30000"/> | ||
<FD_SOCK2/> | ||
<FD_ALL3 timeout="40000" interval="5000" /> | ||
<VERIFY_SUSPECT2 timeout="5000" /> | ||
<pbcast.NAKACK2 | ||
use_mcast_xmit="false" | ||
xmit_interval="100"/> | ||
<UNICAST3 | ||
xmit_interval="100"/> | ||
<pbcast.STABLE | ||
desired_avg_gossip="5000" | ||
max_bytes="1000000"/> | ||
<pbcast.GMS | ||
print_local_addr="false" | ||
join_timeout="1000" | ||
max_join_attempts="1"/> | ||
<UFC max_credits="2000000" | ||
min_threshold="0.40"/> | ||
<MFC max_credits="2000000" | ||
min_threshold="0.4"/> | ||
<FRAG3 frag_size="60000" /> | ||
<pbcast.STATE_TRANSFER/> | ||
</config> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
<!-- | ||
JDBC_PING2 for Postgresql | ||
--> | ||
<config xmlns="urn:org:jgroups" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="urn:org:jgroups http://www.jgroups.org/schema/jgroups.xsd"> | ||
<TCP | ||
bind_addr="${jgroups.bind_addr:site_local}" | ||
bind_port="${jgroups.bind_port:7800}" | ||
port_range="50" | ||
recv_buf_size="150000" | ||
send_buf_size="640000" | ||
sock_conn_timeout="300" | ||
/> | ||
|
||
<!-- Comment/remove attributes 'stored_procedures' and 'insert_sp' if you don't want to use stored procedures --> | ||
<JDBC_PING2 | ||
connection_driver="org.postgresql.Driver" | ||
connection_url="jdbc:postgresql://localhost:5432/bela" | ||
connection_username="bela" | ||
connection_password="secret" | ||
remove_all_data_on_view_change="true" | ||
register_shutdown_hook="true" | ||
return_entire_cache="false" | ||
|
||
stored_procedures="CREATE PROCEDURE deleteAndInsert | ||
(addr varchar(200), name varchar(200), cluster varchar(200), ip varchar(200), coord boolean) | ||
LANGUAGE SQL | ||
BEGIN ATOMIC | ||
DELETE from jgroups where address = addr; | ||
INSERT INTO jgroups VALUES(addr, name, cluster, ip, coord); | ||
END" | ||
insert_sp="call deleteAndInsert(?,?,?,?,?);" | ||
|
||
/> | ||
<MERGE3 min_interval="10000" | ||
max_interval="30000"/> | ||
<FD_SOCK2/> | ||
<FD_ALL3 timeout="40000" interval="5000" /> | ||
<VERIFY_SUSPECT2 /> | ||
<pbcast.NAKACK2 | ||
use_mcast_xmit="false" | ||
xmit_interval="500"/> | ||
<UNICAST3 | ||
xmit_interval="500"/> | ||
<pbcast.STABLE | ||
desired_avg_gossip="5000" | ||
max_bytes="1000000"/> | ||
<pbcast.GMS | ||
print_local_addr="false" | ||
join_timeout="1000" | ||
max_join_attempts="1"/> | ||
<UFC max_credits="2M" | ||
min_threshold="0.40"/> | ||
<MFC max_credits="2M" | ||
min_threshold="0.4"/> | ||
<FRAG3 frag_size="60000" /> | ||
<pbcast.STATE_TRANSFER/> | ||
</config> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters