Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -126,14 +126,7 @@

logger.debug(String.format("Starting to remove all volume_stats rows older than [%s].", limitDate));

long totalRemoved = 0;
long removed;

do {
removed = expunge(sc, limitPerQuery);
totalRemoved += removed;
logger.trace(String.format("Removed [%s] volume_stats rows on the last update and a sum of [%s] volume_stats rows older than [%s] until now.", removed, totalRemoved, limitDate));
} while (limitPerQuery > 0 && removed >= limitPerQuery);
long totalRemoved = batchExpunge(sc, limitPerQuery);

Check warning on line 129 in engine/schema/src/main/java/com/cloud/storage/dao/VolumeStatsDaoImpl.java

View check run for this annotation

Codecov / codecov/patch

engine/schema/src/main/java/com/cloud/storage/dao/VolumeStatsDaoImpl.java#L129

Added line #L129 was not covered by tests

logger.info(String.format("Removed a total of [%s] volume_stats rows older than [%s].", totalRemoved, limitDate));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,14 +123,7 @@

logger.debug(String.format("Starting to remove all vm_stats rows older than [%s].", limitDate));

long totalRemoved = 0;
long removed;

do {
removed = expunge(sc, limitPerQuery);
totalRemoved += removed;
logger.trace(String.format("Removed [%s] vm_stats rows on the last update and a sum of [%s] vm_stats rows older than [%s] until now.", removed, totalRemoved, limitDate));
} while (limitPerQuery > 0 && removed >= limitPerQuery);
long totalRemoved = batchExpunge(sc, limitPerQuery);

Check warning on line 126 in engine/schema/src/main/java/com/cloud/vm/dao/VmStatsDaoImpl.java

View check run for this annotation

Codecov / codecov/patch

engine/schema/src/main/java/com/cloud/vm/dao/VmStatsDaoImpl.java#L126

Added line #L126 was not covered by tests

logger.info(String.format("Removed a total of [%s] vm_stats rows older than [%s].", totalRemoved, limitDate));
}
Expand Down
8 changes: 0 additions & 8 deletions framework/db/src/main/java/com/cloud/utils/db/GenericDao.java
Original file line number Diff line number Diff line change
Expand Up @@ -247,14 +247,6 @@ public interface GenericDao<T, ID extends Serializable> {

int expungeList(List<ID> ids);

/**
* Delete the entity beans specified by the search criteria with a given limit
* @param sc Search criteria
* @param limit Maximum number of rows that will be affected
* @return Number of rows deleted
*/
int expunge(SearchCriteria<T> sc, long limit);

/**
* expunge the removed rows.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1244,13 +1244,6 @@ public boolean expunge(final ID id) {
}
}

// FIXME: Does not work for joins.
@Override
public int expunge(final SearchCriteria<T> sc, long limit) {
Filter filter = new Filter(limit);
return expunge(sc, filter);
}

@Override
public int expunge(final SearchCriteria<T> sc, final Filter filter) {
if (sc == null) {
Expand Down
5 changes: 0 additions & 5 deletions server/src/test/java/com/cloud/user/MockUsageEventDao.java
Original file line number Diff line number Diff line change
Expand Up @@ -210,11 +210,6 @@ public int expunge(SearchCriteria<UsageEventVO> sc) {
return 0;
}

@Override
public int expunge(SearchCriteria<UsageEventVO> sc, long limit) {
return 0;
}

@Override
public void expunge() {

Expand Down
Loading