-
-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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
apollo assembly optimization #5035
Merged
Merged
Changes from 49 commits
Commits
Show all changes
70 commits
Select commit
Hold shift + click to select a range
72f014f
table prefix
vdiskg b0223c2
assembly config v0.1
vdiskg b518cc6
assembly config v0.2
vdiskg aae21a1
assembly db init
vdiskg 4b5ebee
assembly db init fix
vdiskg d0fbd74
assembly sql
vdiskg cb48902
Merge branch 'master' into assembly
vdiskg 7bcc979
WebSecurity
vdiskg baf16c2
Merge branch 'master' into assembly
vdiskg af7f56e
H2Function
vdiskg c22644a
assembly profile
vdiskg 73d45a7
assembly session
vdiskg ab86efe
ddl-auto=none
vdiskg d248136
DataSource
vdiskg 8caeaa2
doc
vdiskg b9b055a
Merge branch 'master' into assembly
vdiskg d1590b5
admin assembly profile
vdiskg 3000fa8
copy assembly sql on build
vdiskg 889943f
merge sql conflict
vdiskg 1782d58
sql comment
vdiskg 497fb9f
sql converter
vdiskg 2888dbf
sql converter delta
vdiskg ea07f15
sql converter clean
vdiskg 84a54cc
fix assembly sql
vdiskg 41b010f
fix assembly sql temp
vdiskg 074376b
Merge branch 'master' into assembly
nobodyiam 4a6837f
fix assembly sql temp v0.2
vdiskg d773cd7
fix assembly sql temp v0.3
vdiskg 7663dd3
fix assembly sql temp v0.4
vdiskg 7930dc3
fix assembly sql temp v0.5
vdiskg 6763f62
assembly doc
vdiskg 1fe8c27
autoGeneratedDeclaration
vdiskg cc438b8
rename sql-converter module
vdiskg b485a29
sql-converter h2
vdiskg e2de672
fix database-discovery
vdiskg 08da155
Merge branch 'assembly-temp' into assembly
vdiskg 7fc7246
Merge branch 'master' into assembly-temp
vdiskg 001119f
mv sql
vdiskg 5fba666
mv sql v0.2
vdiskg 852feff
mv sql v0.3
vdiskg 3ce7c39
multi datasource
vdiskg f305489
remove table prefix
vdiskg 34c2596
update doc
vdiskg 224bd7a
fix init
vdiskg 435348a
log apollo datasource initialize
vdiskg 0397d90
fix apollo datasource initialize
vdiskg ee487c8
mv h2 sql
vdiskg e24336a
fix apollo datasource initialize v0.2
vdiskg 31657f3
Merge branch 'assembly-temp' into assembly
vdiskg bbe2163
clean import
vdiskg d0aa029
fix sql check
vdiskg 5d212c3
fix sql check v0.2
vdiskg 6e4ad6d
Merge branch 'assembly-temp' into assembly
vdiskg 497e36e
Merge branch 'master' into assembly
vdiskg 1080e41
merge sql
vdiskg bce70ef
merge sql generated
vdiskg d0e409e
add sql test temp
vdiskg 1313fc3
add sql test temp 2
vdiskg db9a48a
add sql test
vdiskg c8b3765
sql convert
vdiskg 08ffbb7
fix sql-convert
vdiskg 10f65ae
Merge branch 'master' into assembly
vdiskg b1e370a
CHANGES.md
vdiskg 768c250
fix copyright
vdiskg 4d72047
clean logger
vdiskg a8398e5
Merge branch 'master' into assembly
vdiskg 4941f4f
fix order
vdiskg 06afabb
fix h2 converter
vdiskg d68ed97
fix h2 converter v0.2
vdiskg e8b44ee
fix order v0.2
vdiskg 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
39 changes: 39 additions & 0 deletions
39
.../main/java/com/ctrip/framework/apollo/adminservice/AdminServiceAssemblyConfiguration.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,39 @@ | ||
/* | ||
* Copyright 2024 Apollo Authors | ||
* | ||
* 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.ctrip.framework.apollo.adminservice; | ||
|
||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.context.annotation.Profile; | ||
import org.springframework.core.annotation.Order; | ||
import org.springframework.security.config.annotation.web.builders.HttpSecurity; | ||
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; | ||
|
||
@Profile("assembly") | ||
@Configuration | ||
public class AdminServiceAssemblyConfiguration { | ||
|
||
@Order(99) | ||
@Configuration | ||
static class AdminServiceSecurityConfigurer extends WebSecurityConfigurerAdapter { | ||
|
||
@Override | ||
protected void configure(HttpSecurity http) throws Exception { | ||
http.csrf().disable(); | ||
http.httpBasic(); | ||
} | ||
} | ||
} |
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
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
26 changes: 26 additions & 0 deletions
26
apollo-assembly/src/main/resources/application-database-discovery.properties
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,26 @@ | ||
# | ||
# Copyright 2024 Apollo Authors | ||
# | ||
# 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. | ||
# | ||
apollo.eureka.server.enabled=false | ||
eureka.client.enabled=false | ||
spring.cloud.discovery.enabled=false | ||
|
||
apollo.service.registry.enabled=true | ||
apollo.service.registry.cluster=default | ||
apollo.service.registry.heartbeatIntervalInSecond=10 | ||
|
||
apollo.service.discovery.enabled=true | ||
# health check by heartbeat, heartbeat time before 61s ago will be seemed as unhealthy | ||
apollo.service.discovery.healthCheckIntervalInSecond = 61 |
47 changes: 47 additions & 0 deletions
47
apollo-assembly/src/main/resources/application-github.properties
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,47 @@ | ||
# | ||
# Copyright 2024 Apollo Authors | ||
# | ||
# 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. | ||
# | ||
# Config DataSource | ||
spring.config-datasource.url=jdbc:h2:mem:~/apollo-config-db;mode=mysql;DB_CLOSE_ON_EXIT=FALSE;DB_CLOSE_DELAY=-1;BUILTIN_ALIAS_OVERRIDE=TRUE;DATABASE_TO_UPPER=FALSE | ||
#spring.config-datasource.username= | ||
#spring.config-datasource.password= | ||
spring.sql.config-init.schema-locations=@@repository@@/profiles/@@platform@@@@suffix@@/apolloconfigdb.sql | ||
spring.sql.config-init.mode=embedded | ||
# Portal DataSource | ||
spring.portal-datasource.url=jdbc:h2:mem:~/apollo-portal-db;mode=mysql;DB_CLOSE_ON_EXIT=FALSE;DB_CLOSE_DELAY=-1;BUILTIN_ALIAS_OVERRIDE=TRUE;DATABASE_TO_UPPER=FALSE | ||
#spring.portal-datasource.username= | ||
#spring.portal-datasource.password= | ||
spring.sql.portal-init.schema-locations=@@repository@@/profiles/@@platform@@@@suffix@@/apolloportaldb.sql | ||
spring.sql.portal-init.mode=embedded | ||
|
||
# Resolve Multi DataSource JMX name conflict | ||
spring.jmx.unique-names=true | ||
|
||
# H2 datasource | ||
spring.jpa.hibernate.ddl-auto=none | ||
spring.jpa.hibernate.naming.physical-strategy=org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl | ||
spring.jpa.properties.hibernate.show_sql=false | ||
spring.jpa.properties.hibernate.metadata_builder_contributor=com.ctrip.framework.apollo.common.jpa.SqlFunctionsMetadataBuilderContributor | ||
spring.h2.console.enabled=true | ||
spring.h2.console.settings.web-allow-others=true | ||
|
||
# Sql logging | ||
#logging.level.org.hibernate.SQL=DEBUG | ||
|
||
# Default env | ||
apollo.portal.envs=local | ||
|
||
# Spring session | ||
spring.session.store-type=none |
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
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
36 changes: 36 additions & 0 deletions
36
apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/ApolloBizAssemblyConfiguration.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,36 @@ | ||
/* | ||
* Copyright 2024 Apollo Authors | ||
* | ||
* 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.ctrip.framework.apollo.biz; | ||
|
||
import org.springframework.boot.autoconfigure.jdbc.DataSourceProperties; | ||
import org.springframework.boot.context.properties.ConfigurationProperties; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.context.annotation.Primary; | ||
import org.springframework.context.annotation.Profile; | ||
|
||
@Profile("assembly") | ||
@Configuration | ||
public class ApolloBizAssemblyConfiguration { | ||
|
||
@Primary | ||
@ConfigurationProperties(prefix = "spring.config-datasource") | ||
@Bean | ||
public static DataSourceProperties dataSourceProperties() { | ||
return new DataSourceProperties(); | ||
} | ||
} |
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
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.
Check failure
Code scanning / CodeQL
Disabled Spring CSRF protection High