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
ISPN-14568 Cache Alias #11726
ISPN-14568 Cache Alias #11726
Conversation
1afdd4d
to
097c283
Compare
097c283
to
f9c68df
Compare
f9c68df
to
a723edb
Compare
core/src/main/java/org/infinispan/configuration/cache/Configuration.java
Show resolved
Hide resolved
core/src/main/java/org/infinispan/configuration/ConfigurationManager.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/infinispan/configuration/ConfigurationManager.java
Outdated
Show resolved
Hide resolved
core/src/test/java/org/infinispan/commands/module/TestGlobalConfigurationBuilder.java
Show resolved
Hide resolved
server/runtime/src/main/server/server/conf/infinispan-dev-mode.xml
Outdated
Show resolved
Hide resolved
import java.util.Map; | ||
import java.util.LinkedHashMap; | ||
import java.util.Set; |
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.
Unrelated change, can be reverted.
Consumers.OK_BICONSUMER.accept(null, handler.allocator()); | ||
} else { | ||
ByteBufferUtils.stringToByteBuf("-ERR DB index is out of range\r\n", handler.allocator()); | ||
} |
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.
My Redis/RESP knowledge is lacking here. I understand that we're adding an alias of 0
by default, but what must be configured in order for an Infinispan user to do SELECT 1
? This should be documented.
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've added a chapter to the redis connector docs
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.
Looking good, just some minor concerns
client/rest-client/src/main/java/org/infinispan/client/rest/impl/jdk/RestCacheClientJDK.java
Outdated
Show resolved
Hide resolved
@@ -229,6 +234,11 @@ public Builder<T> initializer(AttributeInitializer<? extends T> initializer) { | |||
return this; | |||
} | |||
|
|||
public Builder<T> matcher(AttributeMatcher<T> matcher) { |
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 see the only use is to always return true for the matcher. Do you expect to see other implementations?
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.
At the moment the need is only theoretical.
@@ -119,4 +130,55 @@ public ConfigurationBuilderHolder toBuilderHolder() { | |||
} | |||
return holder; | |||
} | |||
|
|||
private void addAliases(String cacheName, Collection<String> aliases) { | |||
synchronized (this.aliases) { |
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 feel like there is an issue here that if you have an alias setup and then you define a new configuration that "overwrites" the alias.
I think we need to double check that the cacheName is not present in the aliases map as a value.
server/resp/src/main/java/org/infinispan/server/resp/CacheRespRequestHandler.java
Outdated
Show resolved
Hide resolved
server/resp/src/main/java/org/infinispan/server/resp/RespServer.java
Outdated
Show resolved
Hide resolved
@@ -942,7 +942,7 @@ private CompletionStage<RestResponse> getCacheConfigMutableAttribute(RestRequest | |||
private CompletionStage<RestResponse> setCacheConfigMutableAttribute(RestRequest request) { | |||
NettyRestResponse.Builder responseBuilder = invocationHelper.newResponse(request); | |||
String attributeName = request.getParameter("attribute-name"); | |||
String attributeValue = request.getParameter("attribute-value"); | |||
String attributeValue = String.join(" ", request.parameters().get("attribute-value")); |
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 seems like a pretty big change for other things that take parameters as well outside of this...
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.
attribute.fromString()
already supports splitting space-separated multi-value attributes (this is how XML attributes work), so not really a big change.
a723edb
to
289084e
Compare
core/src/main/java/org/infinispan/configuration/cache/Configuration.java
Outdated
Show resolved
Hide resolved
289084e
to
5269fb7
Compare
5269fb7
to
f2cb3f0
Compare
181c67b
to
d4b353c
Compare
d4b353c
to
86bdc81
Compare
Failures are unrelated |
86bdc81
to
1750193
Compare
It's green! |
Thanks @tristantarrant |
https://issues.redhat.com/browse/ISPN-14568