Skip to content

removed code in comments #11145

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 14 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion agent/src/main/java/com/cloud/agent/Agent.java
Original file line number Diff line number Diff line change
Expand Up @@ -1321,7 +1321,6 @@ public void doTask(final Task task) throws TaskExecutionException {
processResponse((Response)request, task.getLink());
} else {
//put the requests from mgt server into another thread pool, as the request may take a longer time to finish. Don't block the NIO main thread pool
//processRequest(request, task.getLink());
requestHandler.submit(new AgentRequestHandler(getType(), getLink(), request));
}
} catch (final ClassNotFoundException e) {
Expand Down
1 change: 0 additions & 1 deletion api/src/main/java/com/cloud/host/HostStats.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,4 @@ public interface HostStats {
public HostStats getHostStats();

public double getLoadAverage();
// public double getXapiMemoryUsageKBs();
}
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,7 @@ public LbStickinessMethod(StickinessMethodType methodType, String description) {
}

public void addParam(String name, Boolean required, String description, Boolean isFlag) {
/* FIXME : UI is breaking if the capability string length is larger , temporarily description is commented out */
// LbStickinessMethodParam param = new LbStickinessMethodParam(name, required, description);
/* is this still a valid comment: FIXME : UI is breaking if the capability string length is larger , temporarily description is commented out */
LbStickinessMethodParam param = new LbStickinessMethodParam(name, required, " ", isFlag);
_paramList.add(param);
return;
Expand All @@ -133,7 +132,6 @@ public String getDescription() {

public void setDescription(String description) {
/* FIXME : UI is breaking if the capability string length is larger , temporarily description is commented out */
//this.description = description;
this._description = " ";
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Licensedname = "listIsoPermissions", to the Apache Software Foundation (ASF) under one
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Licensedname = "listTemplatePermissions", to the Apache Software Foundation (ASF) under one
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Licensedname = "listIsoPermissions", to the Apache Software Foundation (ASF) under one
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Licensedname = "listTemplatePermissions", to the Apache Software Foundation (ASF) under one
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@
import org.apache.cloudstack.network.tls.SslCert;
import com.cloud.serializer.Param;

//import org.apache.cloudstack.api.EntityReference;

@EntityReference(value = SslCert.class)
public class SslCertResponse extends BaseResponse {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,6 @@ public void testCreateSuccess() {
scaleVMCmd._responseGenerator = responseGenerator;

UserVmResponse userVmResponse = Mockito.mock(UserVmResponse.class);
//List<UserVmResponse> list = Mockito.mock(UserVmResponse.class);
//list.add(userVmResponse);
//LinkedList<UserVmResponse> mockedList = Mockito.mock(LinkedList.class);
//Mockito.when(mockedList.get(0)).thenReturn(userVmResponse);

List<UserVmResponse> list = new LinkedList<UserVmResponse>();
list.add(userVmResponse);
Expand Down
3 changes: 0 additions & 3 deletions core/src/main/java/com/cloud/network/HAProxyConfigurator.java
Original file line number Diff line number Diff line change
Expand Up @@ -597,9 +597,6 @@ public String[] generateConfiguration(final LoadBalancerConfigCommand lbCmd) {
}
}
result.addAll(gSection);
// TODO decide under what circumstances these options are needed
// result.add("\tnokqueue");
// result.add("\tnopoll");

result.add(blankLine);
final List<String> dSection = Arrays.asList(defaultsSection);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -417,8 +417,6 @@ private void verifyArgs(final SetNetworkACLCommand cmd, final String script, fin
// FIXME Check the json content
assertEquals(VRScripts.UPDATE_CONFIG, script);
assertEquals(VRScripts.NETWORK_ACL_CONFIG, args);
// assertEquals(args, " -d eth3 -M 01:23:45:67:89:AB -i 192.168.1.1 -m 24 -a Egress:ALL:0:0:192.168.0.1/24-192.168.0.2/24:ACCEPT:," +
// "Ingress:ICMP:0:0:192.168.0.1/24-192.168.0.2/24:DROP:,Ingress:TCP:20:80:192.168.0.1/24-192.168.0.2/24:ACCEPT:,");
break;
case 2:
assertEquals(VRScripts.UPDATE_CONFIG, script);
Expand Down Expand Up @@ -464,8 +462,6 @@ protected SetupGuestNetworkCommand generateSetupGuestNetworkCommand() {

private void verifyArgs(final SetupGuestNetworkCommand cmd, final String script, final String args) {
// TODO Check the contents of the json file
//assertEquals(script, VRScripts.VPC_GUEST_NETWORK);
//assertEquals(args, " -C -M 01:23:45:67:89:AB -d eth4 -i 10.1.1.2 -g 10.1.1.1 -m 24 -n 10.1.1.0 -s 8.8.8.8,8.8.4.4 -e cloud.test");
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,12 @@ public static String serialize(VmWork work) {
// use java binary serialization instead
//
return JobSerializerHelper.toObjectSerializedString(work);
// return s_gson.toJson(work);
}

public static <T extends VmWork> T deserialize(Class<?> clazz, String workInJsonText) {
// TODO: there are way many generics, too tedious to get serialization work under GSON
// use java binary serialization instead
//
return (T)JobSerializerHelper.fromObjectSerializedString(workInJsonText);
// return (T)s_gson.fromJson(workInJsonText, clazz);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1627,7 +1627,6 @@ protected void processRequest(final Link link, final Request request) {
final String reason = shutdown.getReason();
logger.info("Host {} has informed us that it is shutting down with reason {} and detail {}", attache, reason, shutdown.getDetail());
if (reason.equals(ShutdownCommand.Update)) {
// disconnectWithoutInvestigation(attache, Event.UpdateNeeded);
throw new CloudRuntimeException("Agent update not implemented");
} else if (reason.equals(ShutdownCommand.Requested)) {
disconnectWithoutInvestigation(attache, Event.ShutdownRequested);
Expand Down Expand Up @@ -1728,7 +1727,6 @@ protected void doTask(final Task task) throws TaskExecutionException {
}
} catch (final UnsupportedVersionException e) {
logger.warn(e.getMessage());
// upgradeAgent(task.getLink(), data, e.getReason());
} catch (final ClassNotFoundException e) {
final String message = String.format("Exception occurred when executing tasks! Error '%s'", e.getMessage());
logger.error(message);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -962,7 +962,6 @@ protected void runInContext() {
synchronized (_agentToTransferIds) {
if (!_agentToTransferIds.isEmpty()) {
logger.debug("Found {} agents to transfer", _agentToTransferIds.size());
// for (Long hostId : _agentToTransferIds) {
for (final Iterator<Long> iterator = _agentToTransferIds.iterator(); iterator.hasNext(); ) {
final Long hostId = iterator.next();
final AgentAttache attache = findAttache(hostId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,6 @@ public EngineHostDaoImpl() {

SequenceSearch = createSearchBuilder();
SequenceSearch.and("id", SequenceSearch.entity().getId(), SearchCriteria.Op.EQ);
// SequenceSearch.addRetrieve("sequence", SequenceSearch.entity().getSequence());
SequenceSearch.done();

DirectlyConnectedSearch = createSearchBuilder();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1523,12 +1523,8 @@ public void prepareForMigration(VirtualMachineProfile vm, DeployDestination dest
vm.addDisk(disk);
}

//if (vm.getType() == VirtualMachine.Type.User && vm.getTemplate().getFormat() == ImageFormat.ISO) {
if (vm.getType() == VirtualMachine.Type.User) {
_tmpltMgr.prepareIsoForVmProfile(vm, dest);
//DataTO dataTO = tmplFactory.getTemplate(vm.getTemplate().getId(), DataStoreRole.Image, vm.getVirtualMachine().getDataCenterId()).getTO();
//DiskTO iso = new DiskTO(dataTO, 3L, null, Volume.Type.ISO);
//vm.addDisk(iso);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,20 +140,12 @@ public List<Host> listHosts() {

@Override
public List<PodEntity> listPods() {
/*
* Not in use now, just commented out.
*/
//List<PodEntity> pods = new ArrayList<PodEntity>();
//pods.add(new PodEntityImpl("pod-uuid-1", "pod1"));
//pods.add(new PodEntityImpl("pod-uuid-2", "pod2"));
return null;
}

@Override
public List<ZoneEntity> listZones() {
List<ZoneEntity> zones = new ArrayList<ZoneEntity>();
//zones.add(new ZoneEntityImpl("zone-uuid-1"));
//zones.add(new ZoneEntityImpl("zone-uuid-2"));
return zones;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ public class ClusterVSMMapDaoImpl extends GenericDaoBase<ClusterVSMMapVO, Long>
final SearchBuilder<ClusterVSMMapVO> VsmSearch;

public ClusterVSMMapDaoImpl() {
//super();

ClusterSearch = createSearchBuilder();
ClusterSearch.and("clusterId", ClusterSearch.entity().getClusterId(), SearchCriteria.Op.EQ);
Expand Down Expand Up @@ -82,8 +81,6 @@ public boolean remove(Long id) {
TransactionLegacy txn = TransactionLegacy.currentTxn();
txn.start();
ClusterVSMMapVO cluster = createForUpdate();
//cluster.setClusterId(null);
//cluster.setVsmId(null);

update(id, cluster);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ public VmRulesetLogVO findByVmId(long vmId) {

@Override
public int createOrUpdate(Set<Long> workItems) {
//return createOrUpdateUsingBatch(workItems);
return createOrUpdateUsingMultiInsert(workItems);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ public class VMTemplateDaoImpl extends GenericDaoBase<VMTemplateVO, Long> implem
private SearchBuilder<VMTemplateVO> PublicIsoSearch;
private SearchBuilder<VMTemplateVO> UserIsoSearch;
private GenericSearchBuilder<VMTemplateVO, Long> CountTemplatesByAccount;
// private SearchBuilder<VMTemplateVO> updateStateSearch;
private SearchBuilder<VMTemplateVO> AllFieldsSearch;
protected SearchBuilder<VMTemplateVO> ParentTemplateIdSearch;
private SearchBuilder<VMTemplateVO> InactiveUnremovedTmpltSearch;
Expand Down Expand Up @@ -403,12 +402,6 @@ public boolean configure(String name, Map<String, Object> params) throws Configu
CountTemplatesByAccount.and("state", CountTemplatesByAccount.entity().getState(), SearchCriteria.Op.EQ);
CountTemplatesByAccount.done();

// updateStateSearch = this.createSearchBuilder();
// updateStateSearch.and("id", updateStateSearch.entity().getId(), Op.EQ);
// updateStateSearch.and("state", updateStateSearch.entity().getState(), Op.EQ);
// updateStateSearch.and("updatedCount", updateStateSearch.entity().getUpdatedCount(), Op.EQ);
// updateStateSearch.done();

AllFieldsSearch = createSearchBuilder();
AllFieldsSearch.and("state", AllFieldsSearch.entity().getState(), SearchCriteria.Op.EQ);
AllFieldsSearch.and("accountId", AllFieldsSearch.entity().getAccountId(), SearchCriteria.Op.EQ);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,6 @@ public void performDataMigration(Connection conn) {
encryptData(conn);
// drop keys
dropKeysIfExist(conn);
//update template ID for system Vms
//updateSystemVms(conn); This is not required as system template update is handled during 4.2 upgrade
// update domain network ref
updateDomainNetworkRef(conn);
// update networks that use redundant routers to the new network offering
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ public InputStream[] getPrepareScripts() {

@Override
public void performDataMigration(Connection conn) {
//updateVmWareSystemVms(conn); This is not required as system template update is handled during 4.2 upgrade
correctVRProviders(conn);
correctMultiplePhysicaNetworkSetups(conn);
addHostDetailsUniqueKey(conn);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ public void performDataMigration(Connection conn) {
addVpcProvider(conn);
updateRouterNetworkRef(conn);
fixZoneUsingExternalDevices(conn);
// updateSystemVms(conn);
fixForeignKeys(conn);
encryptClusterDetails(conn);
}
Expand All @@ -81,54 +80,6 @@ public InputStream[] getCleanupScripts() {
return new InputStream[] {script};
}

private void updateSystemVms(Connection conn) {
PreparedStatement pstmt = null;
ResultSet rs = null;
boolean VMware = false;
try {
pstmt = conn.prepareStatement("select distinct(hypervisor_type) from `cloud`.`cluster` where removed is null");
rs = pstmt.executeQuery();
while (rs.next()) {
if ("VMware".equals(rs.getString(1))) {
VMware = true;
}
}
} catch (SQLException e) {
throw new CloudRuntimeException("Error while iterating through list of hypervisors in use", e);
}
// Just update the VMware system template. Other hypervisor templates are unchanged from previous 3.0.x versions.
logger.debug("Updating VMware System Vms");
try {
//Get 3.0.5 VMware system Vm template Id
pstmt = conn.prepareStatement("select id from `cloud`.`vm_template` where name = 'systemvm-vmware-3.0.5' and removed is null");
rs = pstmt.executeQuery();
if (rs.next()) {
long templateId = rs.getLong(1);
rs.close();
pstmt.close();
// change template type to SYSTEM
pstmt = conn.prepareStatement("update `cloud`.`vm_template` set type='SYSTEM' where id = ?");
pstmt.setLong(1, templateId);
pstmt.executeUpdate();
pstmt.close();
// update template ID of system Vms
pstmt = conn.prepareStatement("update `cloud`.`vm_instance` set vm_template_id = ? where type <> 'User' and hypervisor_type = 'VMware'");
pstmt.setLong(1, templateId);
pstmt.executeUpdate();
pstmt.close();
} else {
if (VMware) {
throw new CloudRuntimeException("3.0.5 VMware SystemVm template not found. Cannot upgrade system Vms");
} else {
logger.warn("3.0.5 VMware SystemVm template not found. VMware hypervisor is not used, so not failing upgrade");
}
}
} catch (SQLException e) {
throw new CloudRuntimeException("Error while updating VMware systemVm template", e);
}
logger.debug("Updating System Vm Template IDs Complete");
}

private void addVpcProvider(Connection conn) {
//Encrypt config params and change category to Hidden
logger.debug("Adding vpc provider to all physical networks in the system");
Expand Down
4 changes: 0 additions & 4 deletions engine/schema/src/main/java/com/cloud/user/UserAccountVO.java
Original file line number Diff line number Diff line change
Expand Up @@ -226,10 +226,6 @@ public Date getCreated() {
return created;
}

// public void setCreated(Date created) {
// this.created = created;
// }

@Override
public Date getRemoved() {
return removed;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,10 +209,8 @@ public VolumeDataStoreVO(long hostId, long volumeId) {

public VolumeDataStoreVO(long hostId, long volumeId, Date lastUpdated, int downloadPercent, Status downloadState, String localDownloadPath, String errorString,
String jobId, String installPath, String downloadUrl, String checksum) {
// super();
dataStoreId = hostId;
this.volumeId = volumeId;
// this.zoneId = zoneId;
this.lastUpdated = lastUpdated;
this.downloadPercent = downloadPercent;
this.downloadState = downloadState;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ public void initialize() {
/* Avoid using configDao at this time, we can't be sure that the database is already upgraded
* and there might be fatal errors when using a dao.
*/
//unusedTimeInterval = NumbersUtil.parseInt(configDao.getValue(Config.StorageCacheReplacementLRUTimeInterval.key()), 30);
}

public void setUnusedTimeInterval(Integer interval) {
Expand Down
Loading
Loading