-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
[ISSUE#11659] Develop config query chain of responsibility. #12892
Open
MatthewAden
wants to merge
2
commits into
alibaba:develop
Choose a base branch
from
MatthewAden:develop-config-query-responsibility-chain
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
288 changes: 139 additions & 149 deletions
288
config/src/main/java/com/alibaba/nacos/config/server/controller/ConfigServletInner.java
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
config/src/main/java/com/alibaba/nacos/config/server/enums/ApiVersionEnum.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/* | ||
* Copyright 1999-$toady.year Alibaba Group Holding Ltd. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.alibaba.nacos.config.server.enums; | ||
|
||
/** | ||
* Config Api Version enum. | ||
* @author Nacos | ||
*/ | ||
public enum ApiVersionEnum { | ||
|
||
V1("v1"), | ||
|
||
V2("v2"); | ||
|
||
private final String version; | ||
|
||
ApiVersionEnum(String version) { | ||
this.version = version; | ||
} | ||
|
||
public String getVersion() { | ||
return version; | ||
} | ||
} |
98 changes: 98 additions & 0 deletions
98
config/src/main/java/com/alibaba/nacos/config/server/model/ConfigQueryChainRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
/* | ||
* Copyright 1999-$toady.year Alibaba Group Holding Ltd. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.alibaba.nacos.config.server.model; | ||
|
||
import java.util.Map; | ||
import java.util.Objects; | ||
|
||
/** | ||
* ConfigQueryChainRequest. | ||
* @author Nacos | ||
*/ | ||
public class ConfigQueryChainRequest { | ||
|
||
private String dataId; | ||
|
||
private String group; | ||
|
||
private String tenant; | ||
|
||
private String tag; | ||
|
||
private Map<String, String> appLabels; | ||
|
||
public String getDataId() { | ||
return dataId; | ||
} | ||
|
||
public void setDataId(String dataId) { | ||
this.dataId = dataId; | ||
} | ||
|
||
public String getGroup() { | ||
return group; | ||
} | ||
|
||
public void setGroup(String group) { | ||
this.group = group; | ||
} | ||
|
||
public String getTenant() { | ||
return tenant; | ||
} | ||
|
||
public void setTenant(String tenant) { | ||
this.tenant = tenant; | ||
} | ||
|
||
public String getTag() { | ||
return tag; | ||
} | ||
|
||
public void setTag(String tag) { | ||
this.tag = tag; | ||
} | ||
|
||
public Map<String, String> getAppLabels() { | ||
return appLabels; | ||
} | ||
|
||
public void setAppLabels(Map<String, String> appLabels) { | ||
this.appLabels = appLabels; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) { | ||
return true; | ||
} | ||
if (o == null || getClass() != o.getClass()) { | ||
return false; | ||
} | ||
ConfigQueryChainRequest that = (ConfigQueryChainRequest) o; | ||
return Objects.equals(dataId, that.dataId) | ||
&& Objects.equals(group, that.group) | ||
&& Objects.equals(tenant, that.tenant) | ||
&& Objects.equals(tag, that.tag) | ||
&& Objects.equals(appLabels, that.appLabels); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(dataId, group, tenant, tag, appLabels); | ||
} | ||
} |
128 changes: 128 additions & 0 deletions
128
config/src/main/java/com/alibaba/nacos/config/server/model/ConfigQueryChainResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,128 @@ | ||
/* | ||
* Copyright 1999-$toady.year Alibaba Group Holding Ltd. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.alibaba.nacos.config.server.model; | ||
|
||
import java.util.Objects; | ||
|
||
/** | ||
* ConfigQueryChainResponse. | ||
* @author Nacos | ||
*/ | ||
public class ConfigQueryChainResponse { | ||
|
||
private String content; | ||
|
||
private String contentType; | ||
|
||
private String encryptedDataKey; | ||
|
||
private String md5; | ||
|
||
private long lastModified; | ||
|
||
private ConfigCacheGray matchedGray; | ||
|
||
private ConfigQueryStatus status; | ||
|
||
public enum ConfigQueryStatus { | ||
BETA, | ||
TAG, | ||
TAG_NOT_FOUND, | ||
FORMAL, | ||
CONFIG_QUERY_CONFLICT, | ||
CONFIG_NOT_FOUND, | ||
} | ||
|
||
public String getContent() { | ||
return content; | ||
} | ||
|
||
public void setContent(String content) { | ||
this.content = content; | ||
} | ||
|
||
public String getContentType() { | ||
return contentType; | ||
} | ||
|
||
public void setContentType(String contentType) { | ||
this.contentType = contentType; | ||
} | ||
|
||
public String getEncryptedDataKey() { | ||
return encryptedDataKey; | ||
} | ||
|
||
public void setEncryptedDataKey(String encryptedDataKey) { | ||
this.encryptedDataKey = encryptedDataKey; | ||
} | ||
|
||
public String getMd5() { | ||
return md5; | ||
} | ||
|
||
public void setMd5(String md5) { | ||
this.md5 = md5; | ||
} | ||
|
||
public long getLastModified() { | ||
return lastModified; | ||
} | ||
|
||
public void setLastModified(long lastModified) { | ||
this.lastModified = lastModified; | ||
} | ||
|
||
public ConfigCacheGray getMatchedGray() { | ||
return matchedGray; | ||
} | ||
|
||
public void setMatchedGray(ConfigCacheGray matchedGray) { | ||
this.matchedGray = matchedGray; | ||
} | ||
|
||
public ConfigQueryStatus getStatus() { | ||
return status; | ||
} | ||
|
||
public void setStatus(ConfigQueryStatus status) { | ||
this.status = status; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) { | ||
return true; | ||
} | ||
if (o == null || getClass() != o.getClass()) { | ||
return false; | ||
} | ||
ConfigQueryChainResponse that = (ConfigQueryChainResponse) o; | ||
return lastModified == that.lastModified | ||
&& Objects.equals(content, that.content) | ||
&& Objects.equals(contentType, that.contentType) | ||
&& Objects.equals(encryptedDataKey, that.encryptedDataKey) | ||
&& Objects.equals(md5, that.md5) | ||
&& Objects.equals(matchedGray, that.matchedGray) | ||
&& status == that.status; | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(content, contentType, encryptedDataKey, md5, lastModified, matchedGray, status); | ||
} | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
beta,tag-> gray