Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
thythm
ribbon
提交
3a339b4e
R
ribbon
项目概览
thythm
/
ribbon
与 Fork 源项目一致
从无法访问的项目Fork
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
ribbon
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
3a339b4e
编写于
4月 26, 2019
作者:
E
elandau
提交者:
GitHub
4月 26, 2019
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #404 from elandau/bugfix/null_client_name
Fix client name being null
上级
e1111b49
bf65e373
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
15 addition
and
9 deletion
+15
-9
ribbon-archaius/src/main/java/com/netflix/client/config/DefaultClientConfigImpl.java
...va/com/netflix/client/config/DefaultClientConfigImpl.java
+7
-2
ribbon-eureka/src/test/java/com/netflix/niws/loadbalancer/LBBuilderTest.java
...est/java/com/netflix/niws/loadbalancer/LBBuilderTest.java
+0
-2
ribbon-loadbalancer/src/main/java/com/netflix/loadbalancer/BaseLoadBalancer.java
.../main/java/com/netflix/loadbalancer/BaseLoadBalancer.java
+3
-3
ribbon-loadbalancer/src/main/java/com/netflix/loadbalancer/LoadBalancerContext.java
...in/java/com/netflix/loadbalancer/LoadBalancerContext.java
+2
-1
ribbon-loadbalancer/src/test/java/com/netflix/loadbalancer/ZoneAwareLoadBalancerTest.java
...a/com/netflix/loadbalancer/ZoneAwareLoadBalancerTest.java
+1
-1
ribbon-transport/src/test/java/com/netflix/ribbon/transport/netty/http/DiscoveryLoadBalancerTest.java
...ibbon/transport/netty/http/DiscoveryLoadBalancerTest.java
+2
-0
未找到文件。
ribbon-archaius/src/main/java/com/netflix/client/config/DefaultClientConfigImpl.java
浏览文件 @
3a339b4e
...
...
@@ -27,6 +27,7 @@ import com.netflix.config.DynamicStringProperty;
import
com.netflix.config.PropertyWrapper
;
import
org.apache.commons.configuration.AbstractConfiguration
;
import
org.apache.commons.configuration.Configuration
;
import
org.apache.commons.lang.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
...
...
@@ -163,7 +164,7 @@ public class DefaultClientConfigImpl implements IClientConfig {
private
static
final
Logger
LOG
=
LoggerFactory
.
getLogger
(
DefaultClientConfigImpl
.
class
);
private
String
clientName
=
null
;
private
String
clientName
=
""
;
private
VipAddressResolver
resolver
=
null
;
...
...
@@ -452,7 +453,7 @@ public class DefaultClientConfigImpl implements IClientConfig {
}
private
String
getConfigKey
(
String
propName
)
{
return
(
clientName
==
null
)
?
getDefaultPropName
(
propName
)
:
getInstancePropName
(
clientName
,
propName
);
return
(
StringUtils
.
isEmpty
(
clientName
)
)
?
getDefaultPropName
(
propName
)
:
getInstancePropName
(
clientName
,
propName
);
}
protected
void
setPropertyInternal
(
final
String
propName
,
Object
value
)
{
...
...
@@ -909,6 +910,8 @@ public class DefaultClientConfigImpl implements IClientConfig {
@Override
public
<
T
>
Property
<
T
>
getGlobalProperty
(
IClientConfigKey
<
T
>
key
)
{
LOG
.
debug
(
"Get global property {}"
,
key
.
key
());
final
PropertyWrapper
<
T
>
propertyWrapper
=
getPropertyWrapper
(
key
.
key
(),
key
.
type
(),
...
...
@@ -994,6 +997,8 @@ public class DefaultClientConfigImpl implements IClientConfig {
@Override
public
<
T
>
Property
<
T
>
getDynamicProperty
(
IClientConfigKey
<
T
>
key
)
{
LOG
.
debug
(
"Get dynamic property {}"
,
key
.
key
());
final
PropertyWrapper
<
T
>
propertyWrapper
=
getPropertyWrapper
(
getInstancePropName
(
getClientName
(),
key
.
key
()),
key
.
type
(),
...
...
ribbon-eureka/src/test/java/com/netflix/niws/loadbalancer/LBBuilderTest.java
浏览文件 @
3a339b4e
...
...
@@ -80,7 +80,6 @@ public class LBBuilderTest {
}
@Test
@Ignore
public
void
testBuildWithDiscoveryEnabledNIWSServerList
()
{
IRule
rule
=
new
AvailabilityFilteringRule
();
ServerList
<
DiscoveryEnabledServer
>
list
=
new
DiscoveryEnabledNIWSServerList
(
"dummy:7001"
);
...
...
@@ -100,7 +99,6 @@ public class LBBuilderTest {
}
@Test
@Ignore
public
void
testBuildWithDiscoveryEnabledNIWSServerListAndUpdater
()
{
IRule
rule
=
new
AvailabilityFilteringRule
();
ServerList
<
DiscoveryEnabledServer
>
list
=
new
DiscoveryEnabledNIWSServerList
(
"dummy:7001"
);
...
...
ribbon-loadbalancer/src/main/java/com/netflix/loadbalancer/BaseLoadBalancer.java
浏览文件 @
3a339b4e
...
...
@@ -235,9 +235,9 @@ public class BaseLoadBalancer extends AbstractLoadBalancer implements
try
{
return
(
LoadBalancerStats
)
factory
.
create
(
loadBalancerStatsClassName
,
clientConfig
);
}
catch
(
Exception
e
)
{
logger
.
warn
(
"Error initializing configured LoadBalancerStats class - "
+
String
.
valueOf
(
loadBalancerStatsClassName
)
+
". Falling-back to a new LoadBalancerStats instance instead."
,
e
);
return
new
LoadBalancerStats
(
clientConfig
.
getClientName
()
);
throw
new
RuntimeException
(
"Error initializing configured LoadBalancerStats class - "
+
loadBalancerStatsClassName
,
e
);
}
}
...
...
ribbon-loadbalancer/src/main/java/com/netflix/loadbalancer/LoadBalancerContext.java
浏览文件 @
3a339b4e
...
...
@@ -28,6 +28,7 @@ import com.netflix.client.config.IClientConfig;
import
com.netflix.servo.monitor.Monitors
;
import
com.netflix.servo.monitor.Timer
;
import
com.netflix.util.Pair
;
import
org.apache.commons.lang.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
...
...
@@ -87,7 +88,7 @@ public class LoadBalancerContext implements IClientConfigAware {
return
;
}
clientName
=
clientConfig
.
getClientName
();
if
(
clientName
==
null
)
{
if
(
StringUtils
.
isEmpty
(
clientName
)
)
{
clientName
=
"default"
;
}
vipAddresses
=
clientConfig
.
resolveDeploymentContextbasedVipAddresses
();
...
...
ribbon-loadbalancer/src/test/java/com/netflix/loadbalancer/ZoneAwareLoadBalancerTest.java
浏览文件 @
3a339b4e
...
...
@@ -70,11 +70,11 @@ public class ZoneAwareLoadBalancerTest {
@Test
@Ignore
public
void
testChooseZone
()
throws
Exception
{
ConfigurationManager
.
getConfigInstance
().
setProperty
(
"niws.loadbalancer.serverStats.activeRequestsCount.effectiveWindowSeconds"
,
10
);
DefaultClientConfigImpl
config
=
new
DefaultClientConfigImpl
();
config
.
setClientName
(
"testChooseZone"
);
ZoneAwareLoadBalancer
<
Server
>
balancer
=
new
ZoneAwareLoadBalancer
<
Server
>();
balancer
.
init
();
IRule
globalRule
=
new
RoundRobinRule
();
...
...
ribbon-transport/src/test/java/com/netflix/ribbon/transport/netty/http/DiscoveryLoadBalancerTest.java
浏览文件 @
3a339b4e
...
...
@@ -25,11 +25,13 @@ import com.netflix.niws.loadbalancer.DiscoveryEnabledNIWSServerList;
import
com.netflix.ribbon.testutils.MockedDiscoveryServerListTest
;
import
io.netty.buffer.ByteBuf
;
import
org.junit.Test
;
import
org.powermock.core.classloader.annotations.PowerMockIgnore
;
import
java.util.List
;
import
static
org
.
junit
.
Assert
.
assertEquals
;
@PowerMockIgnore
(
"com.google.*"
)
public
class
DiscoveryLoadBalancerTest
extends
MockedDiscoveryServerListTest
{
@Override
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录