Skip to content

Commit 91eef99

Browse files
committed
Remove unused code
1 parent e4a68a0 commit 91eef99

2 files changed

Lines changed: 0 additions & 83 deletions

File tree

server/src/main/java/com/cloud/api/query/dao/StoragePoolJoinDao.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@
1919
import java.util.List;
2020

2121
import com.cloud.storage.ScopeType;
22-
import com.cloud.storage.StoragePoolStatus;
23-
import com.cloud.utils.Pair;
24-
import com.cloud.utils.db.Filter;
2522
import org.apache.cloudstack.api.response.StoragePoolResponse;
2623

2724
import com.cloud.api.query.vo.StoragePoolJoinVO;
@@ -43,10 +40,6 @@ public interface StoragePoolJoinDao extends GenericDao<StoragePoolJoinVO, Long>
4340

4441
List<StoragePoolJoinVO> searchByIds(Long... spIds);
4542

46-
Pair<List<StoragePoolJoinVO>, Integer> searchAndCount(Long storagePoolId, String storagePoolName, Long zoneId,
47-
String path, Long podId, Long clusterId, String address, ScopeType scopeType, StoragePoolStatus status,
48-
String keyword, Filter searchFilter);
49-
5043
List<StoragePoolVO> findStoragePoolByScopeAndRuleTags(Long datacenterId, Long podId, Long clusterId, ScopeType scopeType, List<String> tags);
5144

5245
}

server/src/main/java/com/cloud/api/query/dao/StoragePoolJoinDaoImpl.java

Lines changed: 0 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,10 @@
2323
import com.cloud.storage.ScopeType;
2424
import com.cloud.storage.Storage;
2525
import com.cloud.storage.StoragePool;
26-
import com.cloud.storage.StoragePoolStatus;
2726
import com.cloud.storage.StorageStats;
2827
import com.cloud.storage.VolumeApiServiceImpl;
2928
import com.cloud.user.AccountManager;
30-
import com.cloud.utils.Pair;
3129
import com.cloud.utils.StringUtils;
32-
import com.cloud.utils.db.Filter;
3330
import com.cloud.utils.db.GenericDaoBase;
3431
import com.cloud.utils.db.SearchBuilder;
3532
import com.cloud.utils.db.SearchCriteria;
@@ -311,79 +308,6 @@ public List<StoragePoolJoinVO> searchByIds(Long... spIds) {
311308
return uvList;
312309
}
313310

314-
@Override
315-
public Pair<List<StoragePoolJoinVO>, Integer> searchAndCount(Long storagePoolId, String storagePoolName,
316-
Long zoneId, String path, Long podId, Long clusterId, String address, ScopeType scopeType,
317-
StoragePoolStatus status, String keyword, Filter searchFilter) {
318-
SearchCriteria<StoragePoolJoinVO> sc = createStoragePoolSearchCriteria(storagePoolId, storagePoolName, zoneId, path, podId, clusterId, address, scopeType, status, keyword);
319-
return searchAndCount(sc, searchFilter);
320-
}
321-
322-
private SearchCriteria<StoragePoolJoinVO> createStoragePoolSearchCriteria(Long storagePoolId, String storagePoolName, Long zoneId, String path, Long podId, Long clusterId, String address, ScopeType scopeType, StoragePoolStatus status, String keyword) {
323-
SearchBuilder<StoragePoolJoinVO> sb = createSearchBuilder();
324-
sb.select(null, SearchCriteria.Func.DISTINCT, sb.entity().getId()); // select distinct
325-
// ids
326-
sb.and("id", sb.entity().getId(), SearchCriteria.Op.EQ);
327-
sb.and("name", sb.entity().getName(), SearchCriteria.Op.EQ);
328-
sb.and("path", sb.entity().getPath(), SearchCriteria.Op.EQ);
329-
sb.and("dataCenterId", sb.entity().getZoneId(), SearchCriteria.Op.EQ);
330-
sb.and("podId", sb.entity().getPodId(), SearchCriteria.Op.EQ);
331-
sb.and("clusterId", sb.entity().getClusterId(), SearchCriteria.Op.EQ);
332-
sb.and("hostAddress", sb.entity().getHostAddress(), SearchCriteria.Op.EQ);
333-
sb.and("scope", sb.entity().getScope(), SearchCriteria.Op.EQ);
334-
sb.and("status", sb.entity().getStatus(), SearchCriteria.Op.EQ);
335-
sb.and("parent", sb.entity().getParent(), SearchCriteria.Op.EQ);
336-
337-
SearchCriteria<StoragePoolJoinVO> sc = sb.create();
338-
339-
if (keyword != null) {
340-
SearchCriteria<StoragePoolJoinVO> ssc = createSearchCriteria();
341-
ssc.addOr("name", SearchCriteria.Op.LIKE, "%" + keyword + "%");
342-
ssc.addOr("poolType", SearchCriteria.Op.LIKE, "%" + keyword + "%");
343-
344-
sc.addAnd("name", SearchCriteria.Op.SC, ssc);
345-
}
346-
347-
if (storagePoolId != null) {
348-
sc.setParameters("id", storagePoolId);
349-
}
350-
351-
if (storagePoolName != null) {
352-
sc.setParameters("name", storagePoolName);
353-
}
354-
355-
if (path != null) {
356-
sc.setParameters("path", path);
357-
}
358-
if (zoneId != null) {
359-
sc.setParameters("dataCenterId", zoneId);
360-
}
361-
if (podId != null) {
362-
SearchCriteria<StoragePoolJoinVO> ssc = createSearchCriteria();
363-
ssc.addOr("podId", SearchCriteria.Op.EQ, podId);
364-
ssc.addOr("podId", SearchCriteria.Op.NULL);
365-
366-
sc.addAnd("podId", SearchCriteria.Op.SC, ssc);
367-
}
368-
if (address != null) {
369-
sc.setParameters("hostAddress", address);
370-
}
371-
if (clusterId != null) {
372-
SearchCriteria<StoragePoolJoinVO> ssc = createSearchCriteria();
373-
ssc.addOr("clusterId", SearchCriteria.Op.EQ, clusterId);
374-
ssc.addOr("clusterId", SearchCriteria.Op.NULL);
375-
376-
sc.addAnd("clusterId", SearchCriteria.Op.SC, ssc);
377-
}
378-
if (scopeType != null) {
379-
sc.setParameters("scope", scopeType.toString());
380-
}
381-
if (status != null) {
382-
sc.setParameters("status", status.toString());
383-
}
384-
sc.setParameters("parent", 0);
385-
return sc;
386-
}
387311
@Override
388312
public List<StoragePoolVO> findStoragePoolByScopeAndRuleTags(Long datacenterId, Long podId, Long clusterId, ScopeType scopeType, List<String> tags) {
389313
SearchCriteria<StoragePoolJoinVO> sc = findByDatacenterAndScopeSb.create();

0 commit comments

Comments
 (0)