Skip to content

Commit ee4d067

Browse files
author
ahuang
committed
Fixed a bunch of asserts
1 parent 541f9d7 commit ee4d067

7 files changed

Lines changed: 31 additions & 30 deletions

File tree

engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/EngineClusterVO.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,15 +100,15 @@ public class EngineClusterVO implements EngineCluster, Identity {
100100
@Enumerated(value=EnumType.STRING)
101101
@StateMachine(state=State.class, event=Event.class)
102102
@Column(name="engine_state", updatable=true, nullable=false, length=32)
103-
protected State engineState = null;
103+
protected State state = null;
104104

105105

106106
public EngineClusterVO() {
107107
clusterType = Cluster.ClusterType.CloudManaged;
108108
allocationState = Grouping.AllocationState.Enabled;
109109

110110
this.uuid = UUID.randomUUID().toString();
111-
this.engineState = State.Disabled;
111+
this.state = State.Disabled;
112112
}
113113

114114
public EngineClusterVO(long dataCenterId, long podId, String name) {
@@ -119,7 +119,7 @@ public EngineClusterVO(long dataCenterId, long podId, String name) {
119119
this.allocationState = Grouping.AllocationState.Enabled;
120120
this.managedState = ManagedState.Managed;
121121
this.uuid = UUID.randomUUID().toString();
122-
this.engineState = State.Disabled;
122+
this.state = State.Disabled;
123123
}
124124

125125
@Override
@@ -238,6 +238,6 @@ public Date getLastUpdated() {
238238
}
239239

240240
public State getState() {
241-
return engineState;
241+
return state;
242242
}
243243
}

engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/EngineDataCenterVO.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ public class EngineDataCenterVO implements EngineDataCenter, Identity {
158158
@Enumerated(value=EnumType.STRING)
159159
@StateMachine(state=State.class, event=Event.class)
160160
@Column(name="engine_state", updatable=true, nullable=false, length=32)
161-
protected State engineState = null;
161+
protected State state = null;
162162

163163

164164
@Override
@@ -246,7 +246,7 @@ public EngineDataCenterVO(String name, String description, String dns1, String d
246246
this.zoneToken = zoneToken;
247247
this.domain = domainSuffix;
248248
this.uuid = UUID.randomUUID().toString();
249-
this.engineState = State.Disabled;
249+
this.state = State.Disabled;
250250
}
251251

252252
@Override
@@ -481,7 +481,7 @@ public Date getLastUpdated() {
481481
}
482482

483483
public State getState() {
484-
return engineState;
484+
return state;
485485
}
486486

487487
@Override

engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/EngineHostPodVO.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public class EngineHostPodVO implements EnginePod, Identity {
9292
@Enumerated(value=EnumType.STRING)
9393
@StateMachine(state=State.class, event=Event.class)
9494
@Column(name="engine_state", updatable=true, nullable=false, length=32)
95-
protected State engineState = null;
95+
protected State state = null;
9696

9797
public EngineHostPodVO(String name, long dcId, String gateway, String cidrAddress, int cidrSize, String description) {
9898
this.name = name;
@@ -104,7 +104,7 @@ public EngineHostPodVO(String name, long dcId, String gateway, String cidrAddres
104104
this.allocationState = Grouping.AllocationState.Enabled;
105105
this.externalDhcp = false;
106106
this.uuid = UUID.randomUUID().toString();
107-
this.engineState = State.Disabled;
107+
this.state = State.Disabled;
108108
}
109109

110110
/*
@@ -240,6 +240,6 @@ public Date getLastUpdated() {
240240
}
241241

242242
public State getState() {
243-
return engineState;
243+
return state;
244244
}
245245
}

engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/EngineHostVO.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ public void setHostTags(List<String> hostTags) {
383383
@Enumerated(value=EnumType.STRING)
384384
@StateMachine(state=State.class, event=Event.class)
385385
@Column(name="engine_state", updatable=true, nullable=false, length=32)
386-
protected State engineState = null;
386+
protected State orchestrationState = null;
387387

388388

389389
public EngineHostVO(String guid) {
@@ -393,12 +393,12 @@ public EngineHostVO(String guid) {
393393
this.dom0MinMemory = 0;
394394
this.resourceState = ResourceState.Creating;
395395
this.uuid = UUID.randomUUID().toString();
396-
this.engineState = State.Disabled;
396+
this.orchestrationState = State.Disabled;
397397
}
398398

399399
protected EngineHostVO() {
400400
this.uuid = UUID.randomUUID().toString();
401-
this.engineState = State.Disabled;
401+
this.orchestrationState = State.Disabled;
402402
}
403403

404404
public EngineHostVO(long id,
@@ -433,7 +433,7 @@ public EngineHostVO(long id,
433433
this.totalSize = totalSize;
434434
this.fsType = fsType;
435435
this.uuid = UUID.randomUUID().toString();
436-
this.engineState = State.Disabled;
436+
this.orchestrationState = State.Disabled;
437437
}
438438

439439
public EngineHostVO(long id,
@@ -492,7 +492,7 @@ public EngineHostVO(long id,
492492
this.dom0MinMemory = dom0MinMemory;
493493
this.storageUrl = url;
494494
this.uuid = UUID.randomUUID().toString();
495-
this.engineState = State.Disabled;
495+
this.orchestrationState = State.Disabled;
496496
}
497497

498498
public void setPodId(Long podId) {
@@ -773,6 +773,6 @@ public Date getLastUpdated() {
773773
}
774774

775775
public State getOrchestrationState() {
776-
return engineState;
776+
return orchestrationState;
777777
}
778778
}

engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/dao/EngineHostDaoImpl.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,12 @@
2929
import javax.inject.Inject;
3030
import javax.persistence.TableGenerator;
3131

32+
import org.apache.log4j.Logger;
33+
import org.springframework.stereotype.Component;
34+
3235
import org.apache.cloudstack.engine.datacenter.entity.api.DataCenterResourceEntity;
3336
import org.apache.cloudstack.engine.datacenter.entity.api.DataCenterResourceEntity.State;
3437
import org.apache.cloudstack.engine.datacenter.entity.api.db.EngineHostVO;
35-
import org.apache.log4j.Logger;
36-
import org.springframework.stereotype.Component;
3738

3839
import com.cloud.host.Host;
3940
import com.cloud.host.Host.Type;
@@ -311,7 +312,7 @@ public EngineHostDaoImpl() {
311312

312313
StateChangeSearch = createSearchBuilder();
313314
StateChangeSearch.and("id", StateChangeSearch.entity().getId(), SearchCriteria.Op.EQ);
314-
StateChangeSearch.and("state", StateChangeSearch.entity().getState(), SearchCriteria.Op.EQ);
315+
StateChangeSearch.and("state", StateChangeSearch.entity().getStatus(), SearchCriteria.Op.EQ);
315316
StateChangeSearch.done();
316317
}
317318

@@ -336,7 +337,7 @@ public EngineHostVO findByGuid(String guid) {
336337
@Override @DB
337338
public List<EngineHostVO> findAndUpdateDirectAgentToLoad(long lastPingSecondsAfter, Long limit, long managementServerId) {
338339
Transaction txn = Transaction.currentTxn();
339-
txn.start();
340+
txn.start();
340341
SearchCriteria<EngineHostVO> sc = UnmanagedDirectConnectSearch.create();
341342
sc.setParameters("lastPinged", lastPingSecondsAfter);
342343
//sc.setParameters("resourceStates", ResourceState.ErrorInMaintenance, ResourceState.Maintenance, ResourceState.PrepareForMaintenance, ResourceState.Disabled);

engine/schema/src/com/cloud/storage/UploadVO.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public class UploadVO implements Upload {
4444
private String uuid;
4545

4646
@Column(name = "host_id")
47-
private long storeId;
47+
private long dataStoreId;
4848

4949
@Column(name = "type_id")
5050
private long typeId;
@@ -85,11 +85,11 @@ public class UploadVO implements Upload {
8585

8686
@Override
8787
public long getDataStoreId() {
88-
return storeId;
88+
return dataStoreId;
8989
}
9090

9191
public void setDataStoreId(long hostId) {
92-
this.storeId = hostId;
92+
this.dataStoreId = hostId;
9393
}
9494

9595
@Override
@@ -118,15 +118,15 @@ public void setLastUpdated(Date date) {
118118

119119
public UploadVO(long hostId, long templateId) {
120120
super();
121-
this.storeId = hostId;
121+
this.dataStoreId = hostId;
122122
this.typeId = templateId;
123123
this.uuid = UUID.randomUUID().toString();
124124
}
125125

126126
public UploadVO(long hostId, long typeId, Date lastUpdated, Status uploadState, Type type, String uploadUrl,
127127
Mode mode) {
128128
super();
129-
this.storeId = hostId;
129+
this.dataStoreId = hostId;
130130
this.typeId = typeId;
131131
this.lastUpdated = lastUpdated;
132132
this.uploadState = uploadState;
@@ -139,7 +139,7 @@ public UploadVO(long hostId, long typeId, Date lastUpdated, Status uploadState,
139139
public UploadVO(long hostId, long typeId, Date lastUpdated, Status uploadState, int uploadPercent, Type type,
140140
Mode mode) {
141141
super();
142-
this.storeId = hostId;
142+
this.dataStoreId = hostId;
143143
this.typeId = typeId;
144144
this.lastUpdated = lastUpdated;
145145
this.uploadState = uploadState;
@@ -179,7 +179,7 @@ public String getJobId() {
179179
public boolean equals(Object obj) {
180180
if (obj instanceof UploadVO) {
181181
UploadVO other = (UploadVO) obj;
182-
return (this.typeId == other.getTypeId() && this.storeId == other.getDataStoreId() && this.type == other
182+
return (this.typeId == other.getTypeId() && this.dataStoreId == other.getDataStoreId() && this.type == other
183183
.getType());
184184
}
185185
return false;

plugins/network-elements/stratosphere-ssp/src/org/apache/cloudstack/network/dao/SspCredentialVO.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public class SspCredentialVO {
3232
private long id;
3333

3434
@Column(name="data_center_id")
35-
private long dataCenterId; // Actually, this is zoneId
35+
private long zoneId; // Actually, this is zoneId
3636

3737
// XXX: We might want to restrict access to this by cloudstack privileges.
3838
@Column(name="username")
@@ -42,11 +42,11 @@ public class SspCredentialVO {
4242
private String password;
4343

4444
public long getZoneId() {
45-
return dataCenterId;
45+
return zoneId;
4646
}
4747

4848
public void setZoneId(long zoneId) {
49-
this.dataCenterId = zoneId;
49+
this.zoneId = zoneId;
5050
}
5151

5252
public String getUsername() {

0 commit comments

Comments
 (0)