-
Notifications
You must be signed in to change notification settings - Fork 13
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
Add invalidation for the schema-list cache 2.2.0 branch (close #215) #218
Conversation
@@ -111,7 +111,8 @@ final case class Resolver[F[_]](repos: List[Registry], cache: Option[ResolverCac | |||
def listSchemasResult( | |||
vendor: Vendor, | |||
name: Name, | |||
model: Model | |||
model: Model, | |||
mustIncludeKey: Option[SchemaKey] = None |
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.
As this is public method, such change would mean breaking compatibility? So to avoid that, we could either:
- don't touch this method, then basically copy all that content but with
mustIncludeKey
to the newlistSchemasLike
method. - extract this new method body to private method,
listSchemasResult
would call it withNone
,listSchemasLike
withSome
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 have a suspicion that this method should not be public. Cached/NotCached should be transparent for the consumers. Could we just make it private?
However, since it is already public, I've added a 3 argument version of it. I'm pretty sure that the default value argument would compile to the same code. But just for the good measure.
F: Monad[F], | ||
L: RegistryLookup[F], | ||
C: Clock[F] | ||
): F[Either[ResolutionError, SchemaList]] = |
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.
Is it possible to return here full SchemaListLookupResult
? I suspect it would be useful for caching in transformer?
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 functions in the same the the listSchemas
does. The same argument as before as consumers shouldn't need to know if it came from the cache or not.
The transformer's result would be cached by the iglu-client, so I won't be building another caching wrapper.
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.
In general yes, caching details should be hidden. But we needed that to build related cache in the transfromer -> see : #207 and usage in transformer snowplow/snowplow-rdb-loader@756b4a7
That's what I meant by 'caching in transformer' - on top of the cache in iglu-client build another cache for ddl Properties
(in case of shredded type) and cache for ddl Field
(in case of parquet type)
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.
What about:
Is it possible to return here full SchemaListLookupResult
? When we add mentioned Field
cache to transfromer, we'd need that. So maybe it's better to add full SchemaListLookupResult
now and map on a consumer side. Otherwise, we would have to add this method in the next release or use full listSchemasResult(schemaKey.vendor, schemaKey.name, schemaKey.version.model, Some(schemaKey))
which is a bit verbose?
val resultTwo = resolver.listSchemasLike(schema101) | ||
|
||
resultOne must beRight(SchemaList(List(schema100))) | ||
resultTwo must beRight(SchemaList(List(schema100, schema101))) |
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.
If there is 1-0-2
added to the iglucentral this test would fail?
CHANGELOG
Outdated
@@ -1,3 +1,7 @@ | |||
Version 2.2.0 (2022-11-18) |
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.
Aaand I think this commit shouldn't be here? ;)
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.
Why not? It was created during the release in master, it should be picked to develop.
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.
But...2.2.0 hasn't been released yet? I think it will be when all those pending PRs are merged :)
162c1ee
to
e5a9666
Compare
e5a9666
to
6c30d7f
Compare
No description provided.