-
Notifications
You must be signed in to change notification settings - Fork 682
Feature: Adding sqlite persistence applying migrations to sqlite #389
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
Conversation
d8037ea
to
8e77db8
Compare
while (null != causeException && !(causeException instanceof SQLException)) { | ||
causeException = causeException.getCause(); | ||
} | ||
return (SQLException) causeException; |
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.
Have we verified, it will always be an SQLException
?
super(retryTemplate, objectMapper, dataSource); | ||
this.scheduledExecutorService = | ||
Executors.newSingleThreadScheduledExecutor( | ||
ExecutorsUtil.newNamedThreadFactory("postgres-execution-")); |
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.
postgres-execution-
?
super(retryTemplate, objectMapper, dataSource); | ||
this.properties = properties; | ||
this.executorService = null; | ||
// this.properties = properties; |
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.
Mercilessly remove unused code :) . You can get it from version history if it is ever relevant.
DataSource dataSource, | ||
SqliteProperties properties) { | ||
super(retryTemplate, objectMapper, dataSource); | ||
// //this.pollDataFlushInterval = properties.getPollDataFlushInterval().toMillis(); |
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.
Remove if not required
TimeUnit.MILLISECONDS); | ||
logger.debug("{} is ready to serve", SqliteBaseDAO.class.getName()); | ||
|
||
// if (properties.getExperimentalQueueNotify()) { |
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.
Remove if not required
@@ -0,0 +1,37 @@ | |||
/* |
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.
This may have nothing specific to sqlite. This is potentially more of a common util ?
import java.util.function.Supplier; | ||
|
||
/** Functional class to support the lazy execution of a String result. */ | ||
public class LazyToString { |
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.
Common util ?
* @author mustafa | ||
*/ | ||
@FunctionalInterface | ||
public interface QueryFunction<R> { |
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.
DB, but not sqlite specific ? package and module
883c38e
to
547e682
Compare
Pull Request type
NOTE: Please remember to run
./gradlew spotlessApply
to fix any format violations.Changes in this PR
Describe the new behavior from this PR, and why it's needed
Adding Sqlite based implementation in the conductor repo, in this PR i have added migration steps to migrate the tables to sqlite
Alternatives considered
Describe alternative implementation you have considered