Skip to content

Commit ef187a9

Browse files
committed
remove memcached support and legacy config compatibility
1 parent 3b7e150 commit ef187a9

11 files changed

Lines changed: 28 additions & 349 deletions

File tree

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,10 @@ bus.ifPresent(redisBus -> {
4141
- [Usage guide](docs/USAGE_GUIDE.md)
4242
- [Best practices](docs/BEST_PRACTICES.md)
4343
- [Architecture and maintainability review](docs/ARCHITECTURE_REVIEW.md)
44-
- [ProxyFeatures integration notes](docs/PROXYFEATURES_INTEGRATION.md)
4544
- [Examples](docs/examples)
4645

4746
## Notes
4847

4948
- Caller identity is resolved at runtime from the platform plugin context.
5049
- `registerDatabase(...)` is reference-counted internally; repeated registrations reuse the same connection.
51-
-
50+
- Use explicit, current config section names only (for example: `default`, `example`).

docs/ARCHITECTURE_REVIEW.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ Reviewed on: 2026-03-24
1818
## Key Findings (Before Improvements)
1919

2020
- Test coverage was effectively absent (`src/test/java/Test.java` placeholder only).
21-
- Bundled database templates used `default_credentials`, while docs/examples/integration commonly used `default`.
2221
- API default helper methods had null/readiness edge-cases that could produce unclear failures.
2322
- Missing docs files referenced by README reduced maintainability and onboarding quality.
2423

@@ -33,15 +32,14 @@ Reviewed on: 2026-03-24
3332
- `requireDataAccess(...)` now reports null provider data access explicitly.
3433
- `getDataSourceOptional()` now tolerates unsupported and not-ready provider states.
3534
- Improved config usability:
36-
- Added compatibility alias resolution between `default` and `default_credentials`.
3735
- Added clearer missing-section warnings with available section names.
38-
- Updated bundled config templates to include `default` as the primary identifier.
39-
- Added `player_data_rw` MySQL template for common ORM write usage.
36+
- Removed legacy compatibility paths:
37+
- Removed old identifier alias behavior from config resolution.
38+
- Removed Memcached implementation and dependency.
4039
- Hardened registry lookups:
4140
- Stale/disconnected providers are now evicted during lookup, not just during registration.
4241

4342
## Residual Risks / Next Steps
4443

4544
- Most tests are unit-level; no automated integration tests currently validate real MySQL/Mongo/Redis instances.
46-
- Memcached implementations exist but are not reachable through `DatabaseType`; either expose or remove to reduce dead surface area.
4745
- Consider adding CI quality gates (`checkstyle`, test coverage thresholds, and smoke integration matrix).

docs/USAGE_GUIDE.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Caller identity is resolved automatically from the plugin runtime context.
2121
Basic:
2222

2323
```java
24-
DatabaseProvider provider = api.registerDatabase(DatabaseType.MYSQL, "player_data_rw");
24+
DatabaseProvider provider = api.registerDatabase(DatabaseType.MYSQL, "example");
2525
if (provider == null || !provider.isConnected()) {
2626
// handle unavailable database
2727
}
@@ -30,15 +30,15 @@ if (provider == null || !provider.isConnected()) {
3030
Optional style:
3131

3232
```java
33-
Optional<DatabaseProvider> provider = api.registerDatabaseOptional(DatabaseType.MYSQL, "player_data_rw");
33+
Optional<DatabaseProvider> provider = api.registerDatabaseOptional(DatabaseType.MYSQL, "example");
3434
```
3535

3636
Typed provider style:
3737

3838
```java
3939
Optional<RelationalDatabaseProvider> relational = api.registerDatabaseAs(
4040
DatabaseType.MYSQL,
41-
"player_data_rw",
41+
"example",
4242
RelationalDatabaseProvider.class
4343
);
4444
```
@@ -56,6 +56,7 @@ Optional<MessagingDataAccess> redisBus = api.registerDataAccess(
5656
Identifier guidance:
5757

5858
- Prefer `default` for single-connection setups.
59+
- Use explicit names like `example` for relational read/write paths.
5960

6061
## 3. Use the provider safely
6162

@@ -71,7 +72,7 @@ Optional<DataSource> dataSource = provider.getDataSourceOptional();
7172
Release a specific connection:
7273

7374
```java
74-
api.unregisterDatabase(DatabaseType.MYSQL, "player_data_rw");
75+
api.unregisterDatabase(DatabaseType.MYSQL, "example");
7576
```
7677

7778
Release all connections for your plugin context:

docs/examples/RelationalOrmExample.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ public final class RelationalOrmExample {
1616
public void onEnable(DataProviderAPI api, ILoggerAdapter logger) {
1717
Optional<RelationalDatabaseProvider> relational = api.registerDatabaseAs(
1818
DatabaseType.MYSQL,
19-
"player_data_rw",
19+
"example",
2020
RelationalDatabaseProvider.class
2121
);
2222

2323
if (relational.isEmpty()) {
24-
logger.error("Could not initialize MySQL connection 'player_data_rw'.");
24+
logger.error("Could not initialize MySQL connection 'example'.");
2525
return;
2626
}
2727

@@ -40,7 +40,7 @@ public void onDisable(DataProviderAPI api) {
4040
ormContext.shutdown();
4141
ormContext = null;
4242
}
43-
api.unregisterDatabase(DatabaseType.MYSQL, "player_data_rw");
43+
api.unregisterDatabase(DatabaseType.MYSQL, "example");
4444
}
4545

4646
private static final class PlayerEntity {

pom.xml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>nl.hauntedmc.dataprovider</groupId>
88
<artifactId>dataprovider</artifactId>
9-
<version>1.20.3</version>
9+
<version>1.20.4</version>
1010
<packaging>jar</packaging>
1111
<name>DataProvider</name>
1212
<url>http://maven.apache.org</url>
@@ -110,11 +110,6 @@
110110
<artifactId>jedis</artifactId>
111111
<version>5.1.3</version>
112112
</dependency>
113-
<dependency>
114-
<groupId>net.spy</groupId>
115-
<artifactId>spymemcached</artifactId>
116-
<version>2.12.3</version>
117-
</dependency>
118113
<dependency>
119114
<groupId>com.velocitypowered</groupId>
120115
<artifactId>velocity-api</artifactId>

src/main/java/nl/hauntedmc/dataprovider/database/keyvalue/KeyValueDatabaseProvider.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
/**
88
* KeyValueDatabaseProvider is the parent interface for key–value
9-
* databases like Redis, Memcached, etc.
9+
* databases like Redis.
1010
*/
1111
public interface KeyValueDatabaseProvider extends DatabaseProvider {
1212

src/main/java/nl/hauntedmc/dataprovider/database/keyvalue/impl/memcached/MemcachedDataAccess.java

Lines changed: 0 additions & 168 deletions
This file was deleted.

0 commit comments

Comments
 (0)