Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
apollo
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
openSource
apollo
Commits
b8de6d75
Commit
b8de6d75
authored
May 25, 2016
by
lepdou
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #221 from nobodyiam/misc-change-merge
Misc changes.
parents
a0308f8d
90c85d3e
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
24 additions
and
9 deletions
+24
-9
EntityManagerUtil.java
...m/ctrip/framework/apollo/biz/utils/EntityManagerUtil.java
+3
-0
Config.java
...ient/src/main/java/com/ctrip/framework/apollo/Config.java
+1
-1
ConfigServiceLocator.java
...trip/framework/apollo/internals/ConfigServiceLocator.java
+12
-3
TitanSettings.java
...rip/framework/apollo/common/datasource/TitanSettings.java
+6
-0
ApolloConfigDemo.java
apollo-demo/src/main/java/ApolloConfigDemo.java
+1
-4
startup.sh
apollo-portal/src/main/scripts/startup.sh
+1
-1
No files found.
apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/utils/EntityManagerUtil.java
View file @
b8de6d75
...
...
@@ -22,6 +22,9 @@ public class EntityManagerUtil extends EntityManagerFactoryAccessor {
public
void
closeEntityManager
()
{
EntityManagerHolder
emHolder
=
(
EntityManagerHolder
)
TransactionSynchronizationManager
.
getResource
(
getEntityManagerFactory
());
if
(
emHolder
==
null
)
{
return
;
}
logger
.
debug
(
"Closing JPA EntityManager in EntityManagerUtil"
);
EntityManagerFactoryUtils
.
closeEntityManager
(
emHolder
.
getEntityManager
());
}
...
...
apollo-client/src/main/java/com/ctrip/framework/apollo/Config.java
View file @
b8de6d75
...
...
@@ -100,7 +100,7 @@ public interface Config {
* exist.
*
* @param key the property name
* @param delimiter
* @param delimiter
the delimiter regex
* @param defaultValue the default value when key is not found
* @return
*/
...
...
apollo-client/src/main/java/com/ctrip/framework/apollo/internals/ConfigServiceLocator.java
View file @
b8de6d75
...
...
@@ -114,9 +114,14 @@ public class ConfigServiceLocator implements Initializable {
transaction
.
addData
(
"Url"
,
url
);
try
{
HttpResponse
<
List
<
ServiceDTO
>>
response
=
m_httpUtil
.
doGet
(
request
,
m_responseType
);
m_configServices
.
set
(
response
.
getBody
());
logConfigServicesToCat
(
response
.
getBody
());
transaction
.
setStatus
(
Message
.
SUCCESS
);
List
<
ServiceDTO
>
services
=
response
.
getBody
();
if
(
services
==
null
||
services
.
isEmpty
())
{
logConfigServiceToCat
(
"Empty response!"
);
continue
;
}
m_configServices
.
set
(
services
);
logConfigServicesToCat
(
services
);
return
;
}
catch
(
Throwable
ex
)
{
Cat
.
logError
(
ex
);
...
...
@@ -151,7 +156,11 @@ public class ConfigServiceLocator implements Initializable {
private
void
logConfigServicesToCat
(
List
<
ServiceDTO
>
serviceDtos
)
{
for
(
ServiceDTO
serviceDto
:
serviceDtos
)
{
Cat
.
logEvent
(
"Apollo.Config.Services"
,
serviceDto
.
getHomepageUrl
());
logConfigServiceToCat
(
serviceDto
.
getHomepageUrl
());
}
}
private
void
logConfigServiceToCat
(
String
serviceUrl
)
{
Cat
.
logEvent
(
"Apollo.Config.Services"
,
serviceUrl
);
}
}
apollo-common/src/main/java/com/ctrip/framework/apollo/common/datasource/TitanSettings.java
View file @
b8de6d75
...
...
@@ -30,6 +30,9 @@ public class TitanSettings {
public
String
getTitanUrl
()
{
Env
env
=
EnvUtils
.
transformEnv
(
Foundation
.
server
().
getEnvType
());
if
(
env
==
null
)
{
return
""
;
}
switch
(
env
)
{
case
FAT:
case
FWS:
...
...
@@ -46,6 +49,9 @@ public class TitanSettings {
public
String
getTitanDbname
()
{
Env
env
=
EnvUtils
.
transformEnv
(
Foundation
.
server
().
getEnvType
());
if
(
env
==
null
)
{
return
""
;
}
switch
(
env
)
{
case
FAT:
case
FWS:
...
...
apollo-demo/src/main/java/ApolloConfigDemo.java
View file @
b8de6d75
import
com.google.common.base.Strings
;
import
com.ctrip.framework.apollo.Config
;
import
com.ctrip.framework.apollo.ConfigChangeListener
;
import
com.ctrip.framework.apollo.ConfigService
;
...
...
@@ -39,7 +36,7 @@ public class ApolloConfigDemo implements ConfigChangeListener {
while
(
true
)
{
System
.
out
.
print
(
"> "
);
String
input
=
new
BufferedReader
(
new
InputStreamReader
(
System
.
in
)).
readLine
();
if
(
Strings
.
isNullOrEmpty
(
input
)
)
{
if
(
input
==
null
||
input
.
length
()
==
0
)
{
continue
;
}
input
=
input
.
trim
();
...
...
apollo-portal/src/main/scripts/startup.sh
View file @
b8de6d75
...
...
@@ -2,7 +2,7 @@
SERVICE_NAME
=
apollo-portal
PATH_TO_JAR
=
$SERVICE_NAME
".jar"
export
JAVA_OPTS
=
"-server -Xms
4096m -Xmx4096m -Xss256k -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=384m -XX:NewSize=1536m -XX:MaxNewSize=1536
m -XX:SurvivorRatio=22 -XX:+UseParNewGC -XX:ParallelGCThreads=4 -XX:MaxTenuringThreshold=9 -XX:+UseConcMarkSweepGC -XX:+DisableExplicitGC -XX:+UseCMSInitiatingOccupancyOnly -XX:+ScavengeBeforeFullGC -XX:+UseCMSCompactAtFullCollection -XX:+CMSParallelRemarkEnabled -XX:CMSFullGCsBeforeCompaction=9 -XX:CMSInitiatingOccupancyFraction=60 -XX:+CMSClassUnloadingEnabled -XX:SoftRefLRUPolicyMSPerMB=0 -XX:-ReduceInitialCardMarks -XX:+CMSPermGenSweepingEnabled -XX:CMSInitiatingPermOccupancyFraction=70 -XX:+ExplicitGCInvokesConcurrent -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCApplicationConcurrentTime -XX:+PrintHeapAtGC -XX:+HeapDumpOnOutOfMemoryError -XX:-OmitStackTraceInFastThrow -Duser.timezone=Asia/Shanghai -Dclient.encoding.override=UTF-8 -Dfile.encoding=UTF-8"
export
JAVA_OPTS
=
"-server -Xms
8192m -Xmx8192m -Xss256k -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=384m -XX:NewSize=3072m -XX:MaxNewSize=3072
m -XX:SurvivorRatio=22 -XX:+UseParNewGC -XX:ParallelGCThreads=4 -XX:MaxTenuringThreshold=9 -XX:+UseConcMarkSweepGC -XX:+DisableExplicitGC -XX:+UseCMSInitiatingOccupancyOnly -XX:+ScavengeBeforeFullGC -XX:+UseCMSCompactAtFullCollection -XX:+CMSParallelRemarkEnabled -XX:CMSFullGCsBeforeCompaction=9 -XX:CMSInitiatingOccupancyFraction=60 -XX:+CMSClassUnloadingEnabled -XX:SoftRefLRUPolicyMSPerMB=0 -XX:-ReduceInitialCardMarks -XX:+CMSPermGenSweepingEnabled -XX:CMSInitiatingPermOccupancyFraction=70 -XX:+ExplicitGCInvokesConcurrent -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCApplicationConcurrentTime -XX:+PrintHeapAtGC -XX:+HeapDumpOnOutOfMemoryError -XX:-OmitStackTraceInFastThrow -Duser.timezone=Asia/Shanghai -Dclient.encoding.override=UTF-8 -Dfile.encoding=UTF-8"
export
JAVA_OPTS
=
"
$JAVA_OPTS
-Xloggc:/opt/logs/100003173/heap_trace.txt -XX:HeapDumpPath=/opt/logs/100003173/HeapDumpOnOutOfMemoryError/"
if
[[
-z
"
$JAVA_HOME
"
&&
-d
/usr/java/latest/
]]
;
then
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment