Package org.keycloak.jgroups.protocol
Class KEYCLOAK_JDBC_PING2
java.lang.Object
org.jgroups.stack.Protocol
org.jgroups.protocols.Discovery
org.jgroups.protocols.FILE_PING
org.jgroups.protocols.JDBC_PING2
org.keycloak.jgroups.protocol.KEYCLOAK_JDBC_PING2
- All Implemented Interfaces:
org.jgroups.Lifecycle
public class KEYCLOAK_JDBC_PING2
extends org.jgroups.protocols.JDBC_PING2
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class org.jgroups.protocols.FILE_PING
org.jgroups.protocols.FILE_PING.InfoWriterNested classes/interfaces inherited from class org.jgroups.protocols.Discovery
org.jgroups.protocols.Discovery.DiscoveryCacheDisseminationTask -
Field Summary
Fields inherited from class org.jgroups.protocols.JDBC_PING2
call_insert_sp, clear_sql, connection_driver, connection_password, connection_url, connection_username, dataSource, datasource_injecter_class, datasource_jndi_name, delete_single_sql, initialize_sql, insert_single_sql, insert_sp, lock, select_all_pingdata_sqlFields inherited from class org.jgroups.protocols.FILE_PING
filter, info_writer, info_writer_max_writes_after_view, info_writer_sleep_time, location, num_read_loops, read_sleep, reads, regexp, register_shutdown_hook, remove_all_data_on_view_change, remove_old_coords_on_view_change, root_dir, SUFFIX, update_store_on_view_change, write_data_on_find, writesFields inherited from class org.jgroups.protocols.Discovery
async_discovery, async_discovery_use_separate_thread_per_request, break_on_coord_rsp, cluster_name, current_coord, discovery_req_futures, discovery_rsp_callback, discovery_rsp_expiry_time, is_coord, is_leaving, is_server, max_members_in_discovery_request, max_rank_to_reply, num_discovery_requests, num_discovery_runs, ping_responses, return_entire_cache, send_cache_on_join, sends_can_block, stagger_timeout, timer, transport, transport_supports_multicasting, use_disk_cache, view, WHITESPACEFields inherited from class org.jgroups.stack.Protocol
after_creation_hook, down_prot, ergonomics, id, local_addr, log, policies, stack, stats, up_prot -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected ConnectionDetects a network partition and decides if the node belongs to the winning partition.protected voidvoidMethods inherited from class org.jgroups.protocols.JDBC_PING2
assertNonNull, callInsertStoredProcedure, clearTable, createInsertStoredProcedure, createRootDir, createSchema, delete, delete, dump, findMembers, findMembersInitialDiscovery, getCallInsertSp, getClearSql, getConnectionDriver, getConnectionPassword, getConnectionUrl, getConnectionUsername, getDataSource, getDataSourceFromJNDI, getDatasourceInjecterClass, getDatasourceJndiName, getDeleteSingleSql, getInitializeSql, getInsertSingleSql, getInsertSp, getSelectAllPingdataSql, handleView, init, injectDataSource, insert, isInfoWriterRunning, learnExistingAddresses, main, prepare, readAll, readFromDB, remove, removeAll, removeAllNotInCurrentView, setCallInsertSp, setClearSql, setConnectionDriver, setConnectionPassword, setConnectionUrl, setConnectionUsername, setDataSource, setDatasourceInjecterClass, setDatasourceJndiName, setDeleteSingleSql, setInitializeSql, setInsertSingleSql, setInsertSp, setSelectAllPingdataSql, write, writeLocalAddress, writeToDBMethods inherited from class org.jgroups.protocols.FILE_PING
addressToFilename, deleteFile, down, getInfoWriterMaxWritesAfterView, getInfoWriterSleepTime, getLocation, isDynamic, read, read, registerShutdownHook, registerShutdownHook, removeAllDataOnViewChange, removeAllDataOnViewChange, removeOldCoordsOnViewChange, removeOldCoordsOnViewChange, resetStats, setInfoWriterMaxWritesAfterView, setInfoWriterSleepTime, setLocation, startInfoWriter, stop, stopInfoWriter, updateStoreOnViewChange, updateStoreOnViewChange, write, writeAll, writeAll, writeDataOnFind, writeDataOnFind, writeInfoMethods inherited from class org.jgroups.protocols.Discovery
addDiscoveryResponseToCaches, addResponse, addResponse, addressAsString, addToCache, asyncDiscovery, asyncDiscovery, asyncDiscoveryUseSeparateThread, asyncDiscoveryUseSeparateThread, breakOnCoordResponse, breakOnCoordResponse, callFindMembersInAllDiscoveryProtocols, clearRequestFutures, deserialize, discoveryRequestReceived, discoveryRspExpiryTime, disseminateDiscoveryInformation, dumpCache, findInitialMembersAsString, findMembers, findTopmostDiscoveryProtocol, getClusterName, getCurrentCoord, getNumberOfDiscoveryRequestsSent, getView, getViewId, handle, handleConnect, handleDisconnect, handleDiscoveryResponse, handleDiscoveryResponse, isCoord, isMergeRunning, marshal, marshal, marshal, maxRankToReply, maxRankToReply, print, providedUpServices, readPingData, returnEntireCache, returnEntireCache, sendCacheInformation, sendCacheOnJoin, sendCacheOnJoin, sendDiscoveryResponse, sendDiscoveryResponse, serializeWithoutView, setClusterName, staggerTimeout, staggerTimeout, start, startCacheDissemination, transportSupportsMulticasting, up, up, up, useDiskCache, useDiskCache, weedOutCompletedDiscoveryResponsesMethods inherited from class org.jgroups.stack.Protocol
accept, addPolicy, addr, addr, afterCreationHook, destroy, down, down, enableStats, getAddress, getComponents, getDownProtocol, getDownServices, getId, getIdsAbove, getLevel, getLog, getName, getPolicies, getProtocolStack, getSocketFactory, getThreadFactory, getTransport, getUpProtocol, getUpServices, getValue, isErgonomics, level, parse, policies, providedDownServices, removePolicy, requiredDownServices, requiredUpServices, resetStatistics, setAddress, setDownProtocol, setErgonomics, setId, setLevel, setPolicies, setProtocolStack, setSocketFactory, setUpProtocol, setValue, statsEnabled, toString
-
Constructor Details
-
KEYCLOAK_JDBC_PING2
public KEYCLOAK_JDBC_PING2()
-
-
Method Details
-
loadDriver
protected void loadDriver()- Overrides:
loadDriverin classorg.jgroups.protocols.JDBC_PING2
-
getConnection
- Overrides:
getConnectionin classorg.jgroups.protocols.JDBC_PING2
-
setJpaConnectionProviderFactory
-
healthStatus
Detects a network partition and decides if the node belongs to the winning partition.The algorithm performs the following steps
- Reads the data from the database
- If an error occurs fetching the data, it returns
KEYCLOAK_JDBC_PING2.HealthStatus.ERROR - Filters out non coordinator members
- If no coordinator is found, it return
KEYCLOAK_JDBC_PING2.HealthStatus.NO_COORDINATOR - If multiple coordinators are found, it compares them and uses the coordinator with the lowest
UUID - Finally, it compares if the coordinator is the same as the current view coordinator. If so, it returns
KEYCLOAK_JDBC_PING2.HealthStatus.HEALTHY, otherwiseKEYCLOAK_JDBC_PING2.HealthStatus.UNHEALTHY
- Returns:
- The
KEYCLOAK_JDBC_PING2.HealthStatus. - See Also:
-