@@ -252,16 +252,16 @@ public long removeEntriesByOwner(long ownerId, ResourceOwnerType ownerType) {
252252 return 0 ;
253253 }
254254
255- private String baseSqlCountComputingResourceAllocatedToAccount = "Select "
256- + " SUM((CASE "
255+ private String baseSqlCountComputingResourceAllocatedToAccount = "Select "
256+ + " SUM((CASE "
257257 + " WHEN so.%s is not null THEN so.%s "
258- + " ELSE CONVERT(vmd.value, UNSIGNED INTEGER) "
258+ + " ELSE CONVERT(vmd.value, UNSIGNED INTEGER) "
259259 + " END)) as total "
260- + " from vm_instance vm "
260+ + " from vm_instance vm "
261261 + " join service_offering_view so on so.id = vm.service_offering_id "
262262 + " left join user_vm_details vmd on vmd.vm_id = vm.id and vmd.name = '%s' "
263263 + " where vm.type = 'User' and state not in ('Destroyed', 'Error', 'Expunging') and display_vm = true and account_id = ? " ;
264-
264+
265265 @ Override
266266 public long countCpuNumberAllocatedToAccount (long accountId ) {
267267 String sqlCountCpuNumberAllocatedToAccount = String .format (baseSqlCountComputingResourceAllocatedToAccount , ResourceType .cpu , ResourceType .cpu , "cpuNumber" );
@@ -279,7 +279,7 @@ private long executeSqlCountComputingResourcesForAccount(long accountId, String
279279 try (TransactionLegacy tx = TransactionLegacy .currentTxn ()) {
280280 PreparedStatement pstmt = tx .prepareAutoCloseStatement (sqlCountComputingResourcesAllocatedToAccount );
281281 pstmt .setLong (1 , accountId );
282-
282+
283283 ResultSet rs = pstmt .executeQuery ();
284284 if (!rs .next ()) {
285285 throw new CloudRuntimeException (String .format ("An unexpected case happened while counting allocated computing resources for account: " + accountId ));
@@ -289,5 +289,4 @@ private long executeSqlCountComputingResourcesForAccount(long accountId, String
289289 throw new CloudRuntimeException (e );
290290 }
291291 }
292-
293292}
0 commit comments