-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: support passive auto discovery #267
Conversation
databend-jdbc/src/main/java/com/databend/jdbc/AbstractDatabendResultSet.java
Outdated
Show resolved
Hide resolved
*/ | ||
void tryAutoDiscovery(OkHttpClient client, ClientSettings settings) { | ||
if (this.autoDiscovery) { | ||
if (this.driverUri.enableMock()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
neat mock 👍
logger.log(Level.WARNING, "Current Query Node do not support auto discovery, close the functionality: " + e.getMessage()); | ||
this.autoDiscovery = false; | ||
} catch (Exception e) { | ||
logger.log(Level.FINE, "Error auto discovery: " + " cause: " + e.getCause() + " message: " + e.getMessage()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
first time to find out FINE log level, what's it's normal use case?
(not an issue at all, just curious 👀)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
info level will print problem by default, I think it is similar to DEBUG level on golang
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
|
||
public class DatabendNodes implements DatabendNodeRouter { | ||
|
||
private AtomicReference<List<URI>> query_nodes_uris; | ||
protected final AtomicInteger index; | ||
// keep track of latest discovery scheduled time | ||
protected final AtomicReference<Long> lastDiscoveryTime = new AtomicReference<>(0L); | ||
private static final Logger logger = Logger.getLogger(DatabendNodes.class.getPackage().getName()); | ||
@Setter | ||
private boolean debug = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i guess if there is only one setter, define a setDebug
is preferrable than using lomok
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍, only one small style issue about lomok, it's not important
No description provided.