You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 6ea2b06
Browse filesBrowse the repository at this point in the historyBrowse files
Prasanna Santhanam
committed
Fixing multiple minor annoyances:
1. Keeping the description consistent - Memory not RAM when referring to
overcommit
2. getters And setters grouped, provided right casing.
3. Removed wildcard imports
Signed-off-by: Prasanna Santhanam <tsp@apache.org>
@APICommand(name = "addCluster", description="Adds a new cluster", responseObject=ClusterResponse.class)
45
41
publicclassAddClusterCmdextendsBaseCmd {
@@ -86,10 +82,10 @@ public class AddClusterCmd extends BaseCmd {
86
82
privateStringvsmipaddress;
87
83
88
84
@Parameter (name=ApiConstants.CPU_OVERCOMMIT_RATIO, type = CommandType.STRING, required = false , description = "value of the cpu overcommit ratio, defaults to 1")
89
-
privateStringcpuovercommitRatio;
85
+
privateStringcpuOvercommitRatio;
90
86
91
-
@Parameter(name = ApiConstants.MEMORY_OVERCOMMIT_RATIO, type = CommandType.STRING, required = false ,description = "value of the default ram overcommit ratio, defaults to 1")
92
-
privateStringmemoryovercommitratio;
87
+
@Parameter(name = ApiConstants.MEMORY_OVERCOMMIT_RATIO, type = CommandType.STRING, required = false, description = "value of the default memory overcommit ratio, defaults to 1")
88
+
privateStringmemoryOvercommitRatio;
93
89
94
90
@Parameter(name = ApiConstants.VSWITCH_TYPE_GUEST_TRAFFIC, type = CommandType.STRING, required = false, description = "Type of virtual switch used for guest traffic in the cluster. Allowed values are, vmwaresvs (for VMware standard vSwitch) and vmwaredvs (for VMware distributed vSwitch)")
95
91
privateStringvSwitchTypeGuestTraffic;
@@ -186,24 +182,24 @@ public void setAllocationState(String allocationState) {
186
182
}
187
183
188
184
publicFloatgetCpuOvercommitRatio (){
189
-
if(cpuovercommitRatio != null){
190
-
returnFloat.parseFloat(cpuovercommitRatio);
185
+
if(cpuOvercommitRatio != null){
186
+
returnFloat.parseFloat(cpuOvercommitRatio);
191
187
}
192
188
return1.0f;
193
189
}
194
190
195
-
publicFloatgetMemoryOvercommitRaito(){
196
-
if (memoryovercommitratio != null){
197
-
returnFloat.parseFloat(memoryovercommitratio);
191
+
publicFloatgetMemoryOvercommitRatio(){
192
+
if (memoryOvercommitRatio != null){
193
+
returnFloat.parseFloat(memoryOvercommitRatio);
198
194
}
199
195
return1.0f;
200
196
}
201
197
202
198
@Override
203
199
publicvoidexecute(){
204
200
try {
205
-
if ((getMemoryOvercommitRaito().compareTo(1f) < 0) | (getCpuOvercommitRatio().compareTo(1f) < 0)) {
206
-
thrownewInvalidParameterValueException("Cpu and ram overcommit ratios should not be less than 1");
201
+
if (getMemoryOvercommitRatio().compareTo(1f) < 0 || getCpuOvercommitRatio().compareTo(1f) < 0) {
202
+
thrownewInvalidParameterValueException("cpu and memory overcommit ratios should be greater than or equal to one");
207
203
}
208
204
List<? extendsCluster> result = _resourceService.discoverCluster(this);
0 commit comments