Skip to content

[WIP] Implement refactoring changes #1286

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

Closed
wants to merge 77 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
6ec4c3d
First implementation of CacheService and MonitorService complete
aaron-congo Feb 5, 2025
184b68a
wip
aaron-congo Feb 5, 2025
2ddebce
Merge branch 'refactoring-wip' into refactoring
aaron-congo Feb 5, 2025
053dd75
Merge branch 'refactoring-wip' into refactoring
aaron-congo Feb 7, 2025
4437581
Merge branch 'refactoring' into refactoring-wip
aaron-congo Feb 7, 2025
a12410f
wip
aaron-congo Feb 7, 2025
3e17520
PR comments
aaron-congo Feb 7, 2025
e35d740
Merge branch 'refactoring-wip' into refactoring
aaron-congo Feb 7, 2025
07b36fc
Implemented ExpirationCache and StorageServiceImpl
aaron-congo Feb 11, 2025
8bfbd4f
Replaced topologyCache with StorageService
aaron-congo Feb 12, 2025
f7ef88f
Error when passing Topology.class as the itemClass
aaron-congo Feb 12, 2025
53a1429
Added itemClass parameter to get() method
aaron-congo Feb 13, 2025
5d3f698
Failover integration test passing
aaron-congo Feb 13, 2025
8b3e30e
Remove MonitorGroup and MonitorServiceImpl
aaron-congo Feb 13, 2025
a9041ae
Instantiate StorageService in Driver class
aaron-congo Feb 14, 2025
afd7a56
cleanup
aaron-congo Feb 14, 2025
98d6dff
ExpiringCache fixes
aaron-congo Feb 14, 2025
bc83286
Merge branch 'refactoring-wip' into storage-service
aaron-congo Feb 14, 2025
e0af969
Fix build errors
aaron-congo Feb 15, 2025
472c793
cleanup
aaron-congo Feb 18, 2025
a516492
cleanup
aaron-congo Feb 18, 2025
2107add
PR comments
aaron-congo Feb 18, 2025
55e3eec
Cleanup, gradle check passing
aaron-congo Feb 19, 2025
b12c200
Lazily auto-register default caches
aaron-congo Feb 19, 2025
34aaadb
Move cleanup thread to StorageServiceImpl
aaron-congo Feb 21, 2025
5e03973
Minor fixes, cleanup
aaron-congo Feb 21, 2025
4cd7117
Add log to cleanup thread
aaron-congo Feb 21, 2025
da8e939
Adjust default cleanup time
aaron-congo Feb 21, 2025
a1794ec
Replace custom endpoint storage
aaron-congo Feb 24, 2025
dcad5c3
Implement ServiceContainer
aaron-congo Feb 26, 2025
bd92538
Cleanup
aaron-congo Feb 26, 2025
0c2b548
MonitorServiceImpl wip
aaron-congo Feb 27, 2025
e7f0ae2
Make CacheItem protected
aaron-congo Feb 28, 2025
1ece19d
Remove cleanupInterval from ExpirationCache
aaron-congo Feb 28, 2025
f4390ca
MonitorServiceImpl with MonitorItem
aaron-congo Feb 28, 2025
e06375a
MonitorServiceImpl wip
aaron-congo Mar 3, 2025
e8a8820
Implemented inactive timeout, AbstractMonitor
aaron-congo Mar 4, 2025
bef3657
Implement default registration
aaron-congo Mar 4, 2025
b05c6f4
replace commented out default suppliers with TODO
aaron-congo Mar 5, 2025
f647219
Auto-register default monitor types if missing
aaron-congo Mar 5, 2025
01014b4
PR comments, fix missing monitor error processing
aaron-congo Mar 5, 2025
2cd5869
Added CacheContainer
aaron-congo Mar 6, 2025
497b648
Implement ExternallyManagedCache
aaron-congo Mar 6, 2025
c99243d
Add removeIf() method
aaron-congo Mar 7, 2025
7d6b0f0
Cleanup MonitorServiceImpl and fix minor issues
aaron-congo Mar 7, 2025
eb8f45d
Remove monitor if expired
aaron-congo Mar 7, 2025
7261a6b
Add MonitorService to ServiceContainer, adapt CustomEndpointMonitor t…
aaron-congo Mar 10, 2025
bd04054
Use defaultSuppliers
aaron-congo Mar 11, 2025
381d9c6
MonitorService starts the monitor
aaron-congo Mar 11, 2025
a56acce
Implement data access messages
aaron-congo Mar 11, 2025
0d7e117
Remove ItemCategory argument in StorageService
aaron-congo Mar 12, 2025
1f36aec
Small fixes, cleanup, update docs
aaron-congo Mar 12, 2025
eb48888
Remove isRenewableExpiration option for ExternallyManagedCache, cleanup
aaron-congo Mar 14, 2025
77139f5
Adapt topology monitors to monitor service
aaron-congo Apr 15, 2025
d943913
Undo changes to integration test files
aaron-congo Apr 16, 2025
7edb822
Fix checkstyle error
aaron-congo Apr 16, 2025
a984864
Merge branch 'refactoring-wip' into storage-service
aaron-congo Apr 16, 2025
cbe984d
ConnectionService wip
aaron-congo Apr 18, 2025
3b3d413
wip
aaron-congo Apr 21, 2025
c0e0438
chore(deps): bump org.jetbrains.kotlin:kotlin-stdlib from 2.1.0 to 2.…
dependabot[bot] Apr 21, 2025
f02112e
ConnectionService wip - tests passing
aaron-congo Apr 21, 2025
6d74c9e
chore(deps): bump com.fasterxml.jackson.core:jackson-databind from 2.…
dependabot[bot] Apr 21, 2025
f5f8061
chore(deps): bump io.opentelemetry:opentelemetry-api from 1.48.0 to 1…
dependabot[bot] Apr 21, 2025
1d4d995
chore(deps): bump org.mariadb.jdbc:mariadb-java-client from 3.5.1 to …
dependabot[bot] Apr 22, 2025
41e081f
chore(deps): bump software.amazon.awssdk:ec2 from 2.30.21 to 2.31.26 …
dependabot[bot] Apr 22, 2025
278b139
Remove non-auxiliary plugins for auxiliary connections
aaron-congo Apr 22, 2025
6056443
case sensitive parameter (#1361)
sergiyvamz Apr 22, 2025
f4fb2b5
javadoc improvement (#1368)
sergiyvamz Apr 22, 2025
c576cb3
Fix bug where auxiliary connection was sharing a ServiceContainer wit…
aaron-congo Apr 22, 2025
d72cf7a
Merge branch 'main' into storage-service
aaron-congo Apr 22, 2025
8536154
Fix checkstyle
aaron-congo Apr 23, 2025
e4df970
Fix CustomEndpointTest
aaron-congo Apr 23, 2025
932adee
Fix bug where duplicate topology monitor was being submitted
aaron-congo Apr 24, 2025
4a50f17
fix: LimitlessRouterMonitor to close connection properly (#1369)
aaronchung-bitquill Apr 24, 2025
d39aecf
fix: use default connection provider if the connection is auxiliary
aaron-congo Apr 24, 2025
a1851ec
Address some TODOs
aaron-congo Apr 24, 2025
838b574
Merge branch 'main' into storage-service
aaron-congo Apr 24, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion benchmarks/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ dependencies {
jmhImplementation(project(":aws-advanced-jdbc-wrapper"))
implementation("org.postgresql:postgresql:42.7.5")
implementation("com.mysql:mysql-connector-j:9.2.0")
implementation("org.mariadb.jdbc:mariadb-java-client:3.5.1")
implementation("org.mariadb.jdbc:mariadb-java-client:3.5.3")
implementation("com.zaxxer:HikariCP:4.0.3")
implementation("org.checkerframework:checker-qual:3.49.2")

testImplementation("org.junit.jupiter:junit-jupiter-api:5.12.1")
testImplementation("org.mockito:mockito-inline:4.11.0") // 4.11.0 is the last version compatible with Java 8
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@
import software.amazon.jdbc.dialect.Dialect;
import software.amazon.jdbc.hostavailability.SimpleHostAvailabilityStrategy;
import software.amazon.jdbc.targetdriverdialect.TargetDriverDialect;
import software.amazon.jdbc.util.connection.ConnectionService;
import software.amazon.jdbc.util.monitoring.MonitorService;
import software.amazon.jdbc.util.storage.StorageService;
import software.amazon.jdbc.util.telemetry.GaugeCallable;
import software.amazon.jdbc.util.telemetry.TelemetryContext;
import software.amazon.jdbc.util.telemetry.TelemetryCounter;
Expand All @@ -88,6 +91,9 @@ public class PluginBenchmarks {
private final HostSpec writerHostSpec = new HostSpecBuilder(new SimpleHostAvailabilityStrategy())
.host(TEST_HOST).port(TEST_PORT).build();

@Mock private StorageService mockStorageService;
@Mock private MonitorService mockMonitorService;
@Mock private ConnectionService mockConnectionService;
@Mock private PluginService mockPluginService;
@Mock private Dialect mockDialect;
@Mock private ConnectionPluginManager mockConnectionPluginManager;
Expand Down Expand Up @@ -164,7 +170,10 @@ public ConnectionWrapper initAndReleaseWithExecutionTimePlugin() throws SQLExcep
mockTelemetryFactory,
mockPluginService,
mockHostListProviderService,
mockPluginManagerService)) {
mockPluginManagerService,
mockStorageService,
mockMonitorService,
mockConnectionService)) {
wrapper.releaseResources();
return wrapper;
}
Expand All @@ -179,7 +188,10 @@ public ConnectionWrapper initAndReleaseWithAuroraHostListPlugin() throws SQLExce
mockTelemetryFactory,
mockPluginService,
mockHostListProviderService,
mockPluginManagerService)) {
mockPluginManagerService,
mockStorageService,
mockMonitorService,
mockConnectionService)) {
wrapper.releaseResources();
return wrapper;
}
Expand All @@ -194,7 +206,10 @@ public ConnectionWrapper initAndReleaseWithExecutionTimeAndAuroraHostListPlugins
mockTelemetryFactory,
mockPluginService,
mockHostListProviderService,
mockPluginManagerService)) {
mockPluginManagerService,
mockStorageService,
mockMonitorService,
mockConnectionService)) {
wrapper.releaseResources();
return wrapper;
}
Expand All @@ -209,7 +224,10 @@ public ConnectionWrapper initAndReleaseWithReadWriteSplittingPlugin() throws SQL
mockTelemetryFactory,
mockPluginService,
mockHostListProviderService,
mockPluginManagerService)) {
mockPluginManagerService,
mockStorageService,
mockMonitorService,
mockConnectionService)) {
wrapper.releaseResources();
return wrapper;
}
Expand All @@ -225,7 +243,10 @@ public ConnectionWrapper initAndReleaseWithAuroraHostListAndReadWriteSplittingPl
mockTelemetryFactory,
mockPluginService,
mockHostListProviderService,
mockPluginManagerService)) {
mockPluginManagerService,
mockStorageService,
mockMonitorService,
mockConnectionService)) {
wrapper.releaseResources();
return wrapper;
}
Expand All @@ -243,7 +264,10 @@ public ConnectionWrapper initAndReleaseWithReadWriteSplittingPlugin_internalConn
mockTelemetryFactory,
mockPluginService,
mockHostListProviderService,
mockPluginManagerService)) {
mockPluginManagerService,
mockStorageService,
mockMonitorService,
mockConnectionService)) {
wrapper.releaseResources();
ConnectionProviderManager.releaseResources();
Driver.resetCustomConnectionProvider();
Expand All @@ -264,7 +288,10 @@ public ConnectionWrapper initAndReleaseWithAuroraHostListAndReadWriteSplittingPl
mockTelemetryFactory,
mockPluginService,
mockHostListProviderService,
mockPluginManagerService)) {
mockPluginManagerService,
mockStorageService,
mockMonitorService,
mockConnectionService)) {
wrapper.releaseResources();
ConnectionProviderManager.releaseResources();
Driver.resetCustomConnectionProvider();
Expand All @@ -281,7 +308,10 @@ public Statement executeStatementBaseline() throws SQLException {
mockTelemetryFactory,
mockPluginService,
mockHostListProviderService,
mockPluginManagerService);
mockPluginManagerService,
mockStorageService,
mockMonitorService,
mockConnectionService);
Statement statement = wrapper.createStatement()) {
return statement;
}
Expand All @@ -297,7 +327,10 @@ public ResultSet executeStatementWithExecutionTimePlugin() throws SQLException {
mockTelemetryFactory,
mockPluginService,
mockHostListProviderService,
mockPluginManagerService);
mockPluginManagerService,
mockStorageService,
mockMonitorService,
mockConnectionService);
Statement statement = wrapper.createStatement();
ResultSet resultSet = statement.executeQuery("some sql")) {
return resultSet;
Expand All @@ -314,7 +347,10 @@ public ResultSet executeStatementWithTelemetryDisabled() throws SQLException {
mockTelemetryFactory,
mockPluginService,
mockHostListProviderService,
mockPluginManagerService);
mockPluginManagerService,
mockStorageService,
mockMonitorService,
mockConnectionService);
Statement statement = wrapper.createStatement();
ResultSet resultSet = statement.executeQuery("some sql")) {
return resultSet;
Expand All @@ -331,7 +367,10 @@ public ResultSet executeStatementWithTelemetry() throws SQLException {
mockTelemetryFactory,
mockPluginService,
mockHostListProviderService,
mockPluginManagerService);
mockPluginManagerService,
mockStorageService,
mockMonitorService,
mockConnectionService);
Statement statement = wrapper.createStatement();
ResultSet resultSet = statement.executeQuery("some sql")) {
return resultSet;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,28 @@
import software.amazon.jdbc.HostListProviderService;
import software.amazon.jdbc.PluginManagerService;
import software.amazon.jdbc.PluginService;
import software.amazon.jdbc.util.connection.ConnectionService;
import software.amazon.jdbc.util.monitoring.MonitorService;
import software.amazon.jdbc.util.storage.StorageService;
import software.amazon.jdbc.util.telemetry.TelemetryFactory;
import software.amazon.jdbc.wrapper.ConnectionWrapper;

// Test class allowing for mocks to be used with ConnectionWrapper logic
public class TestConnectionWrapper extends ConnectionWrapper {

public TestConnectionWrapper(@NonNull Properties props,
public TestConnectionWrapper(
@NonNull Properties props,
@NonNull String url,
@NonNull ConnectionPluginManager connectionPluginManager,
@NonNull final TelemetryFactory telemetryFactory,
@NonNull PluginService pluginService,
@NonNull HostListProviderService hostListProviderService,
@NonNull PluginManagerService pluginManagerService)
@NonNull PluginManagerService pluginManagerService,
@NonNull StorageService storageService,
@NonNull MonitorService monitorService,
@NonNull ConnectionService connectionService)
throws SQLException {
super(props, url, connectionPluginManager, telemetryFactory, pluginService, hostListProviderService,
pluginManagerService);
pluginManagerService, storageService, monitorService, connectionService);
}
}
Loading
Loading