public class EndpointWriterResolver extends java.lang.Object implements WriterResolver
WriterResolver that connects to the configured write endpoint, optionally verifying the
connection role. Ports the legacy SimpleReadWriteSplittingPlugin.initializeWriterConnection.
Fails fast at construction if the endpoint is missing/blank.| Constructor and Description |
|---|
EndpointWriterResolver(java.lang.String writeEndpoint,
boolean verifyNewConnections,
EndpointConnectionVerifier verifier) |
| Modifier and Type | Method and Description |
|---|---|
WriterResolution |
resolveWriter(RwSplitContext ctx)
Resolves the writer target.
|
public EndpointWriterResolver(java.lang.String writeEndpoint,
boolean verifyNewConnections,
EndpointConnectionVerifier verifier)
public WriterResolution resolveWriter(RwSplitContext ctx) throws java.sql.SQLException
WriterResolverWriterResolution is either
WriterResolution.Kind.CONNECTED (a writer connection was established) or
WriterResolution.Kind.STAY (remain on the current reader connection, e.g. Global Write
Forwarding).resolveWriter in interface WriterResolverctx - the read/write splitting contextjava.sql.SQLException