Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
jenkins
提交
171c4d7f
J
jenkins
项目概览
xxadev
/
jenkins
与 Fork 源项目一致
从无法访问的项目Fork
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
J
jenkins
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
171c4d7f
编写于
12月 10, 2019
作者:
O
Oleg Nenashev
提交者:
GitHub
12月 10, 2019
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #4388 from jglick/nullability-Label
Adding some nullability annotations related to Label
上级
d36acc1c
1125b1b4
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
12 addition
and
3 deletion
+12
-3
core/src/main/java/hudson/model/Label.java
core/src/main/java/hudson/model/Label.java
+6
-1
core/src/main/java/hudson/slaves/NodeProvisioner.java
core/src/main/java/hudson/slaves/NodeProvisioner.java
+6
-2
未找到文件。
core/src/main/java/hudson/model/Label.java
浏览文件 @
171c4d7f
...
@@ -71,6 +71,7 @@ import com.thoughtworks.xstream.converters.MarshallingContext;
...
@@ -71,6 +71,7 @@ import com.thoughtworks.xstream.converters.MarshallingContext;
import
com.thoughtworks.xstream.converters.UnmarshallingContext
;
import
com.thoughtworks.xstream.converters.UnmarshallingContext
;
import
com.thoughtworks.xstream.io.HierarchicalStreamWriter
;
import
com.thoughtworks.xstream.io.HierarchicalStreamWriter
;
import
com.thoughtworks.xstream.io.HierarchicalStreamReader
;
import
com.thoughtworks.xstream.io.HierarchicalStreamReader
;
import
javax.annotation.Nonnull
;
/**
/**
* Group of {@link Node}s.
* Group of {@link Node}s.
...
@@ -84,16 +85,19 @@ public abstract class Label extends Actionable implements Comparable<Label>, Mod
...
@@ -84,16 +85,19 @@ public abstract class Label extends Actionable implements Comparable<Label>, Mod
/**
/**
* Display name of this label.
* Display name of this label.
*/
*/
@Nonnull
protected
transient
final
String
name
;
protected
transient
final
String
name
;
private
transient
volatile
Set
<
Node
>
nodes
;
private
transient
volatile
Set
<
Node
>
nodes
;
private
transient
volatile
Set
<
Cloud
>
clouds
;
private
transient
volatile
Set
<
Cloud
>
clouds
;
private
transient
volatile
int
tiedJobsCount
;
private
transient
volatile
int
tiedJobsCount
;
@Exported
@Exported
@Nonnull
public
transient
final
LoadStatistics
loadStatistics
;
public
transient
final
LoadStatistics
loadStatistics
;
@Nonnull
public
transient
final
NodeProvisioner
nodeProvisioner
;
public
transient
final
NodeProvisioner
nodeProvisioner
;
public
Label
(
String
name
)
{
public
Label
(
@Nonnull
String
name
)
{
this
.
name
=
name
;
this
.
name
=
name
;
// passing these causes an infinite loop - getTotalExecutors(),getBusyExecutors());
// passing these causes an infinite loop - getTotalExecutors(),getBusyExecutors());
this
.
loadStatistics
=
new
LoadStatistics
(
0
,
0
)
{
this
.
loadStatistics
=
new
LoadStatistics
(
0
,
0
)
{
...
@@ -137,6 +141,7 @@ public abstract class Label extends Actionable implements Comparable<Label>, Mod
...
@@ -137,6 +141,7 @@ public abstract class Label extends Actionable implements Comparable<Label>, Mod
/**
/**
* Returns a human-readable text that represents this label.
* Returns a human-readable text that represents this label.
*/
*/
@Nonnull
public
String
getDisplayName
()
{
public
String
getDisplayName
()
{
return
name
;
return
name
;
}
}
...
...
core/src/main/java/hudson/slaves/NodeProvisioner.java
浏览文件 @
171c4d7f
...
@@ -35,6 +35,7 @@ import jenkins.util.SystemProperties;
...
@@ -35,6 +35,7 @@ import jenkins.util.SystemProperties;
import
jenkins.util.Timer
;
import
jenkins.util.Timer
;
import
org.jenkinsci.Symbol
;
import
org.jenkinsci.Symbol
;
import
javax.annotation.CheckForNull
;
import
javax.annotation.Nonnull
;
import
javax.annotation.Nonnull
;
import
javax.annotation.concurrent.GuardedBy
;
import
javax.annotation.concurrent.GuardedBy
;
import
java.awt.Color
;
import
java.awt.Color
;
...
@@ -126,6 +127,7 @@ public class NodeProvisioner {
...
@@ -126,6 +127,7 @@ public class NodeProvisioner {
* Null if this {@link NodeProvisioner} is working for the entire Hudson,
* Null if this {@link NodeProvisioner} is working for the entire Hudson,
* for jobs that are unassigned to any particular node.
* for jobs that are unassigned to any particular node.
*/
*/
@CheckForNull
private
final
Label
label
;
private
final
Label
label
;
private
final
AtomicReference
<
List
<
PlannedNode
>>
pendingLaunches
private
final
AtomicReference
<
List
<
PlannedNode
>>
pendingLaunches
...
@@ -149,7 +151,7 @@ public class NodeProvisioner {
...
@@ -149,7 +151,7 @@ public class NodeProvisioner {
private
final
MultiStageTimeSeries
plannedCapacitiesEMA
=
private
final
MultiStageTimeSeries
plannedCapacitiesEMA
=
new
MultiStageTimeSeries
(
Messages
.
_NodeProvisioner_EmptyString
(),
Color
.
WHITE
,
0
,
DECAY
);
new
MultiStageTimeSeries
(
Messages
.
_NodeProvisioner_EmptyString
(),
Color
.
WHITE
,
0
,
DECAY
);
public
NodeProvisioner
(
Label
label
,
LoadStatistics
loadStatistics
)
{
public
NodeProvisioner
(
@CheckForNull
Label
label
,
LoadStatistics
loadStatistics
)
{
this
.
label
=
label
;
this
.
label
=
label
;
this
.
stat
=
loadStatistics
;
this
.
stat
=
loadStatistics
;
}
}
...
@@ -395,6 +397,7 @@ public class NodeProvisioner {
...
@@ -395,6 +397,7 @@ public class NodeProvisioner {
/**
/**
* The label under consideration.
* The label under consideration.
*/
*/
@CheckForNull
private
final
Label
label
;
private
final
Label
label
;
/**
/**
* The planned capacity for this {@link #label}.
* The planned capacity for this {@link #label}.
...
@@ -416,7 +419,7 @@ public class NodeProvisioner {
...
@@ -416,7 +419,7 @@ public class NodeProvisioner {
* @param label the label.
* @param label the label.
* @param plannedCapacitySnapshot the planned executor count.
* @param plannedCapacitySnapshot the planned executor count.
*/
*/
private
StrategyState
(
LoadStatistics
.
LoadStatisticsSnapshot
snapshot
,
Label
label
,
int
plannedCapacitySnapshot
)
{
private
StrategyState
(
LoadStatistics
.
LoadStatisticsSnapshot
snapshot
,
@CheckForNull
Label
label
,
int
plannedCapacitySnapshot
)
{
this
.
snapshot
=
snapshot
;
this
.
snapshot
=
snapshot
;
this
.
label
=
label
;
this
.
label
=
label
;
this
.
plannedCapacitySnapshot
=
plannedCapacitySnapshot
;
this
.
plannedCapacitySnapshot
=
plannedCapacitySnapshot
;
...
@@ -425,6 +428,7 @@ public class NodeProvisioner {
...
@@ -425,6 +428,7 @@ public class NodeProvisioner {
/**
/**
* The label under consideration.
* The label under consideration.
*/
*/
@CheckForNull
public
Label
getLabel
()
{
public
Label
getLabel
()
{
return
label
;
return
label
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录