Skip to content

sqlite object cache#11

Draft
milt wants to merge 21 commits into
mainfrom
sql_cache
Draft

sqlite object cache#11
milt wants to merge 21 commits into
mainfrom
sql_cache

Conversation

@milt

@milt milt commented Jun 18, 2026

Copy link
Copy Markdown
Member

Cache simulation object state in a SQLite db. This approach attempts to "flatten" object attributes into an EAV index with some success.

milt and others added 11 commits June 18, 2026 11:49
# Conflicts:
#	pom.xml
#	src/main/java/com/yetanalytics/hlaxapi/HlaInterfaceImpl.java
#	src/main/java/com/yetanalytics/hlaxapi/InjectionHandler.java
…e_sync

# Conflicts:
#	src/main/java/com/yetanalytics/hlaxapi/HlaInterfaceImpl.java
#	src/main/java/com/yetanalytics/hlaxapi/InjectionHandler.java
#	src/test/java/com/yetanalytics/ConfigParserTest.java

@cliffcaseyyet cliffcaseyyet left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall totally makes sense so far. Biggest note (you can probably predict) is we should have a session on DI, as there is a lot here that could just be wired easily to go along with everything else, as most of these new services are effectively singletons.

String formatString = (replacement instanceof String && embedded) ? "\"%s\"" : "%s";
return String.format(formatString, replacement.toString());
private JsonNode render(Object replacement, Boolean embedded, ObjectMapper mapper) {
if (Boolean.TRUE.equals(embedded)) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh, I was prepared to write how this removed something important, then i tested it, and apparently valueToTree is doing a lot that I wasn't considering. Quotes handling is perfect with no mess.

@Autowired
private HLADecoderRegistry hlaDecoderRegistry;

public void setQueryService(CacheQueryService cacheQueryService) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am going to guess there was a reason this wasn't done with DI? There's a lot of code that doesn't need to be here otherwise.

If the issue is just that it needs to be specially initialized first we can figure that out.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it may predate DI being in the project! I'll get it wired up


// Use injected HLADecoderRegistry when available; fall back to creating one
// decoderRegistry.registerAlias("ScaleFactorFloat32", "HLAfloat32BE");
fomCatalog = FomCatalog.fromFomXml(fomXml);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Strong indicator for a component.

Comment on lines +117 to +123
if (objectCacheSubscriptions.isEmpty()) {
injectionHandler.setQueryService(null);
logger.info("No query injections configured; object cache is disabled");
} else {
objectCache = new HlaObjectCache(HlaObjectCache.defaultJdbcUrl(), fomCatalog, fomXml, decoderRegistry);
injectionHandler.setQueryService(objectCache.queryService());
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this can all be bootstrapped and sorted out in config and used to make ObjectCache component, and that just wired into here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants