Gilad Chaplik has posted comments on this change.

Change subject: engine: watchdog - DB and logic changes
......................................................................


Patch Set 8: (5 inline comments)

....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/UpdateWatchdogCommand.java
Line 20:     @Override
Line 21:     protected void executeVmCommand() {
Line 22:         List<VmDevice> watchdogs =
Line 23:                 
getVmDeviceDao().getVmDeviceByVmIdAndType(getParameters().getVmId(), 
VmDeviceType.WATCHDOG.getName());
Line 24:         if(getParameters().getModel() == null) {
all CRUD in a single command?
Line 25:             for(VmDevice device : watchdogs) {
Line 26:                 getVmDeviceDao().remove(device.getId());
Line 27:             }
Line 28:         } else {


....................................................
File 
backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/GetWatchdogQueryTest.java
Line 36:         Assert.assertNull(query.getReturnValue());
Line 37:     }
Line 38: 
Line 39:     @Test
Line 40:     @Ignore
remove
Line 41:     public void executeQueryCommandWithWatchdog() {
Line 42:         final Guid vmId = new 
Guid("ee655a4d-effc-4aab-be2b-2f80ff40cd1c");
Line 43:         VmDeviceDAO vmDeviceDaoMock = Mockito.mock(VmDeviceDAO.class);
Line 44:         HashMap<String, Object> watchdogSpecParams = new 
HashMap<String, Object>();


....................................................
File 
backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/BaseDAODbFacade.java
Line 92:         this.dbFacade = dbFacade;
Line 93:     }
Line 94: 
Line 95:     /**
Line 96:      * Returns a Double or a null if the column was NULL.
/s/Double/Long
Line 97:      * @param resultSet the ResultSet to extract the result from
Line 98:      * @param columnName
Line 99:      * @return a Long or null
Line 100:      * @throws SQLException


....................................................
File 
backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/VdsUpdateRunTimeInfo.java
Line 1287:                 auditLogable.setVmId(vmDynamic.getId());
Line 1288:                 auditLogable.addCustomValue("wdaction", 
vmDynamic.getLastWatchdogAction());
Line 1289:                 //for the interpretation of vdsm's response see 
http://docs.python.org/2/library/time.html
Line 1290:                 auditLogable.addCustomValue("wdevent",
Line 1291:                         ObjectUtils.toString(new 
Date(vmDynamic.getLastWatchdogEvent().longValue() * 1000)));
The date should be calculated in the client side, taking into account user's 
time zone and locale. maybe we need to add a TODO here.
Line 1292:                 AuditLogDirector.log(auditLogable, 
AuditLogType.WATCHDOG_EVENT);
Line 1293:             }
Line 1294:         }
Line 1295:     }


Line 1293:             }
Line 1294:         }
Line 1295:     }
Line 1296: 
Line 1297:     protected static boolean isNewWatchdogEvent(VmDynamic vmDynamic, 
VM vmTo) {
remove static
Line 1298:         Long lastWatchdogEvent = vmDynamic.getLastWatchdogEvent();
Line 1299:         return vmTo != null && lastWatchdogEvent != null
Line 1300:                 && (vmTo.getLastWatchdogEvent() == null || 
vmTo.getLastWatchdogEvent() < lastWatchdogEvent);
Line 1301:     }


--
To view, visit http://gerrit.ovirt.org/13057
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I813a6f97e23008d15446285998a4e9b50b456040
Gerrit-PatchSet: 8
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Laszlo Hornyak <[email protected]>
Gerrit-Reviewer: Doron Fediuck <[email protected]>
Gerrit-Reviewer: Eli Mesika <[email protected]>
Gerrit-Reviewer: Gilad Chaplik <[email protected]>
Gerrit-Reviewer: Laszlo Hornyak <[email protected]>
Gerrit-Reviewer: Omer Frenkel <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to