Yair Zaslavsky has posted comments on this change. Change subject: engine: Introduction of command entity dao ......................................................................
Patch Set 5: (4 comments) http://gerrit.ovirt.org/#/c/26337/5/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/tasks/CommandsCache.java File backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/tasks/CommandsCache.java: Line 10: public CommandEntity get(Guid commandId); Line 11: Line 12: public void remove(Guid commandId); Line 13: Line 14: public void put(Guid commandId, Guid parentCommandId, VdcActionType actionType, VdcActionParametersBase params); parent or root command id? Line 15: http://gerrit.ovirt.org/#/c/26337/5/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/tasks/CommandsCacheImpl.java File backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/tasks/CommandsCacheImpl.java: Line 37: return commandMap.get(commandId); Line 38: } Line 39: Line 40: @Override Line 41: public synchronized void remove(Guid commandId) { why do we have to synchronize the entire cache for that? Doesnt the cache work like ConcurrentHashMap? Line 42: commandMap.remove(commandId); Line 43: cmdEntityDao.remove(commandId); Line 44: } Line 45: http://gerrit.ovirt.org/#/c/26337/5/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/CommandEntityDaoDbFacadeImpl.java File backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/CommandEntityDaoDbFacadeImpl.java: Line 23: CommandEntity result = new CommandEntity(); Line 24: result.setId(Guid.createGuidFromString(resultSet.getString("command_id"))); Line 25: result.setCreatedAt(DbFacadeUtils.fromDate(resultSet.getTimestamp("created_at"))); Line 26: result.setCommandType(VdcActionType.forValue(resultSet.getInt("command_type"))); Line 27: result.setParentCommandId(Guid.createGuidFromString(resultSet.getString("parent_command_id"))); are we interested also in keeping root command id? Line 28: result.setData(deserializeData(resultSet.getString("data"))); Line 29: return result; Line 30: } Line 31: }; http://gerrit.ovirt.org/#/c/26337/5/packaging/dbscripts/upgrade/03_05_0160_add_command_entity_table.sql File packaging/dbscripts/upgrade/03_05_0160_add_command_entity_table.sql: Line 2: CREATE TABLE command_entities Line 3: ( Line 4: command_id UUID NOT NULL, Line 5: command_type integer NOT NULL, Line 6: parent_command_id UUID, I would consider indexing parent command_id. Also, shouldn't parent command id have an FK to command_+id? Line 7: data TEXT, Line 8: created_at TIMESTAMP WITH TIME ZONE, Line 9: CONSTRAINT pk_command_entities PRIMARY KEY(command_id) -- To view, visit http://gerrit.ovirt.org/26337 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I463102d85de7558fbcab23585ad6b48cdc35c0a0 Gerrit-PatchSet: 5 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Ravi Nori <[email protected]> Gerrit-Reviewer: Yair Zaslavsky <[email protected]> Gerrit-Reviewer: [email protected] Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: Yes _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
