Allon Mureinik has posted comments on this change.

Change subject: core: introducing OvfAutoUpdate
......................................................................


Patch Set 18: (47 inline comments)

1. See inline implementation issues
2. Please add a test to the new behavior in OvfWriter
3. Shouldn't OvfReader have a symetric behavior to OvfWriter?

....................................................
File backend/manager/dbscripts/storages_sp.sql
Line 97:     WHERE  vm_id IN (
Line 98:         SELECT vm_guid
Line 99:         FROM   vms
Line 100:         WHERE  storage_pool_id = v_id);
Line 101:     delete FROM vm_static where vm_guid in (select vm_guid from vms 
where storage_pool_id = v_id);    
And use UPPER case for SQL keywords: DELETE, WHERE, FROM
Line 102:       -- Get (and keep) a shared lock with "right to upgrade to 
exclusive"
Line 103:       -- in order to force locking parent before children
Line 104:    select   id INTO v_val FROM storage_pool  WHERE id = v_id     FOR 
UPDATE;
Line 105: 


....................................................
File backend/manager/dbscripts/upgrade/03_02_1550_add_vm_generation_columns.sql
Line 10: 
Line 11: INSERT into vm_ovf_generations
Line 12: (SELECT vm.vm_guid, sp.id
Line 13: FROM vm_static vm ,storage_pool sp, vds_groups vg WHERE
Line 14: vg.storage_pool_id = sp.id AND vm.vds_group_id = vg.vds_group_id);
please format this query
Line 15: 
Line 16: -- Only pre-existing vms should have ovf_generation set to 1, so after 
we added
Line 17: -- the pre existing vms, the default should be 0.
Line 18: SELECT fn_db_change_column_type ('vm_ovf_generations', 
'ovf_generation', 'BIGINT DEFAULT 1','BIGINT DEFAULT 0');


....................................................
File backend/manager/dbscripts/vms_sp.sql
Line 4: Create or replace FUNCTION UpdateOvfGenerations(v_vms_ids 
VARCHAR(5000), v_vms_db_generations VARCHAR(5000))
Line 5:     RETURNS VOID
Line 6:     AS $procedure$
Line 7: DECLARE
Line 8: curs_vmids CURSOR FOR SELECT ID from fnSplitterUuid(v_vms_ids);
This could just be written as SELECT fnSplitterUuid(v_vms_ids);
Line 9: curs_newovfgen CURSOR FOR SELECT id from 
fnSplitter(v_vms_db_generations);
Line 10: id UUID;
Line 11: new_ovf_gen BIGINT;
Line 12: BEGIN


Line 5:     RETURNS VOID
Line 6:     AS $procedure$
Line 7: DECLARE
Line 8: curs_vmids CURSOR FOR SELECT ID from fnSplitterUuid(v_vms_ids);
Line 9: curs_newovfgen CURSOR FOR SELECT id from 
fnSplitter(v_vms_db_generations);
This could just be written as SELECT fnSplitterUuid(v_vms_db_generations);
Line 10: id UUID;
Line 11: new_ovf_gen BIGINT;
Line 12: BEGIN
Line 13:  OPEN curs_vmids;


Line 35:    AS $procedure$
Line 36: BEGIN
Line 37: RETURN QUERY SELECT ovf.vm_guid as vm_guid
Line 38:    FROM vm_ovf_generations ovf
Line 39:    WHERE ovf.vm_guid NOT IN (SELECT vm_guid FROM vm_static) AND 
ovf.storage_pool_id = v_storage_pool_id;
Don't think short-circuiting is mandated by ANSI SQL, but let's give the DB a 
chance at it and put the simple = condition first.
Line 40: END; $procedure$
Line 41: LANGUAGE plpgsql;
Line 42: 
Line 43: 


Line 83: Create or replace FUNCTION GetVmsIdsForOvfUpdate(v_storage_pool_id 
UUID) RETURNS SETOF UUID
Line 84:    AS $procedure$
Line 85: BEGIN
Line 86: RETURN QUERY SELECT vm.vm_guid as vm_guid
Line 87:    FROM vms vm,  vm_ovf_generations ovf_gen
duplicate spaces here.
Line 88:    WHERE vm.vm_guid = ovf_gen.vm_guid AND
Line 89:          vm.db_generation >  ovf_gen.ovf_generation AND
Line 90:          vm.storage_pool_id = v_storage_pool_id;
Line 91: END; $procedure$


Line 84:    AS $procedure$
Line 85: BEGIN
Line 86: RETURN QUERY SELECT vm.vm_guid as vm_guid
Line 87:    FROM vms vm,  vm_ovf_generations ovf_gen
Line 88:    WHERE vm.vm_guid = ovf_gen.vm_guid AND
I'd push the ANDs to the beginning og the next line
Line 89:          vm.db_generation >  ovf_gen.ovf_generation AND
Line 90:          vm.storage_pool_id = v_storage_pool_id;
Line 91: END; $procedure$
Line 92: LANGUAGE plpgsql;


Line 102: Create or replace FUNCTION DeleteOvfGenerations(v_vms_ids 
VARCHAR(5000))
Line 103:     RETURNS VOID
Line 104:     AS $procedure$
Line 105: BEGIN
Line 106:     DELETE FROM vm_ovf_generations where vm_guid in (SELECT ID from 
fnSplitterUuid(v_vms_ids));
s/where/WHERE/

s/SELECT ID from fnSplitterUuid(v_vms_ids/SELECT fnSplitterUuid(v_vms_ids)/
Line 107: END; $procedure$
Line 108: LANGUAGE plpgsql;
Line 109: 
Line 110: 


Line 480:          FETCH curs INTO id;
Line 481:          IF NOT FOUND THEN
Line 482:             EXIT;
Line 483:          END IF;
Line 484:          UPDATE vm_static SET db_generation  = db_generation + 1 
WHERE vm_guid = id;
Why do we need a cursor here, and not just an update statement?
Line 485:       END LOOP;
Line 486: END; $procedure$
Line 487: LANGUAGE plpgsql;
Line 488: 


Line 720:    AS $procedure$
Line 721: BEGIN
Line 722: RETURN QUERY SELECT vm.*
Line 723:              FROM vms vm
Line 724:              WHERE vm.vm_guid in (SELECT ID from 
fnSplitterUuid(v_vms_ids));
s/SELECT ID from fnSplitterUuid(v_vms_ids)/SELECT fnSplitterUuid(v_vms_ids)/
Line 725: END; $procedure$
Line 726: LANGUAGE plpgsql;
Line 727: 
Line 728: 


....................................................
File backend/manager/dbscripts/vm_templates_sp.sql
Line 128: INSERT INTO vm_ovf_generations(vm_guid, storage_pool_id) VALUES 
(v_vmt_guid, (select storage_pool_id from vds_groups vg where vg.vds_group_id = 
v_vds_group_id));
Line 129: END; $procedure$
Line 130: LANGUAGE plpgsql;
Line 131: 
Line 132: 
And format the SQL code
Line 133: 
Line 134: 
Line 135: 
Line 136: 


....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/OvfDataUpdater.java
Line 45: 
Line 46: public class OvfDataUpdater {
Line 47:     private static final Log log = 
LogFactory.getLog(OvfDataUpdater.class);
Line 48:     private static final OvfDataUpdater INSTANCE = new 
OvfDataUpdater();
Line 49:     private int ITEMS_COUNT_PER_UPDATE;
use lowercase - this is no longer a constant
Line 50:     protected static final int MAX_ITEMS_PER_SQL_STATEMENT = 100;
Line 51: 
Line 52:     private List<Guid> proccessedIdsInfo;
Line 53:     private List<Long> proccessedOvfGenerationsInfo;


Line 46: public class OvfDataUpdater {
Line 47:     private static final Log log = 
LogFactory.getLog(OvfDataUpdater.class);
Line 48:     private static final OvfDataUpdater INSTANCE = new 
OvfDataUpdater();
Line 49:     private int ITEMS_COUNT_PER_UPDATE;
Line 50:     protected static final int MAX_ITEMS_PER_SQL_STATEMENT = 100;
Why isn't this a config value?
Line 51: 
Line 52:     private List<Guid> proccessedIdsInfo;
Line 53:     private List<Long> proccessedOvfGenerationsInfo;
Line 54: 


Line 85:         for (storage_pool pool : storagePools) {
Line 86:             try {
Line 87:                 initProccessedInfoLists();
Line 88:                 log.infoFormat("OvfDataUpdater: Attempting to update 
VM OVFs in Data Center {0}",
Line 89:                         pool.getname());
I'd move the log up a line
Line 90:                 updateOvfForVmsOfStoragePool(pool.getId());
Line 91: 
Line 92:                 log.infoFormat("OvfDataUpdater: Attempting to update 
template OVFs in Data Center {0}",
Line 93:                         pool.getname());


Line 180:                 if (verifyDisksNotLocked) {
Line 181:                     loadTemplateData(template);
Line 182:                     Long currentDbGeneration = 
getVmStaticDao().getDbGeneration(template.getId());
Line 183:                     // equals() is used because currentDbGeneration 
can be null in case that the template
Line 184:                     // was deleted during the run of OvfDataUpdater.
I don't understand this comment.
please elaborate?
Line 185:                     if 
(template.getDb_generation().equals(currentDbGeneration)) {
Line 186:                         buildMetadataDictionaryForTemplate(template, 
vmsAndTemplateMetadata);
Line 187:                         proccessedIdsInfo.add(template.getId());
Line 188:                         
proccessedOvfGenerationsInfo.add(template.getDb_generation());


Line 207:      * update ovfs for updated/added templates since last for the 
given storage pool
Line 208:      * @param poolId
Line 209:      */
Line 210:     protected void updateOvfForTemplatesOfStoragePool(Guid poolId) {
Line 211:         List<Guid> templateIdsForUpdate = 
getVmAndTemplatesGenerationsDao().
perhaps move getVmAndTemplatesGenerationsDao down to the next line?
Line 212:                 getVmTemplatesIdsForOvfUpdate(poolId);
Line 213:         int i = 0;
Line 214:         while (i < templateIdsForUpdate.size()) {
Line 215:             int size = Math.min(templateIdsForUpdate.size() - i, 
ITEMS_COUNT_PER_UPDATE);


Line 277:     protected void buildMetadataDictionaryForTemplate(VmTemplate 
template , Map<Guid, KeyValuePairCompat<String, List<Guid>>> metaDictionary){
Line 278:         List<DiskImage> allTemplateImages = template.getDiskList();
Line 279:         String templateMeta = generateVmTemplateMetadata(template, 
allTemplateImages);
Line 280:         metaDictionary.put(template.getId(), new 
KeyValuePairCompat<String, List<Guid>>(
Line 281:                 templateMeta, LinqUtils.foreach(allTemplateImages, 
new Function<DiskImage, Guid>() {
why not just a simple for loop instead if LinqUtils?
Line 282:                     @Override
Line 283:                     public Guid eval(DiskImage diskImage) {
Line 284:                         return diskImage.getId().getValue();
Line 285:                     }


Line 290:      * loads additional need template data for it's ovf
Line 291:      * @param template
Line 292:      */
Line 293:     protected void loadTemplateData(VmTemplate template) {
Line 294:         if (template.getInterfaces() == null || 
template.getInterfaces().isEmpty()) {
Use CollectionUtils.isEmpty
Line 295:             template.setInterfaces(getVmNetworkInterfaceDao()
Line 296:                     .getAllForTemplate(template.getId()));
Line 297:         }
Line 298:     }


Line 301:      * loads additional need vm data for it's ovf
Line 302:      * @param vm
Line 303:      */
Line 304:     protected void loadVmData(VM vm) {
Line 305:         if (vm.getInterfaces().isEmpty()) {
why aren't you checking == null here?
Line 306:             
vm.setInterfaces(getVmNetworkInterfaceDao().getAllForVm(vm.getId()));
Line 307:         }
Line 308:         if (StringUtils.isEmpty(vm.getVmtName())) {
Line 309:             if (!Guid.Empty.equals(vm.getVmtGuid())) {


Line 345:                             @Override
Line 346:                             public Guid eval(Disk a) {
Line 347:                                 return a.getId();
Line 348:                             }
Line 349:                         })));
why not a simple for?
Line 350:     }
Line 351: 
Line 352:     protected VmDAO getVmDao() {
Line 353:         return DbFacade.getInstance()


Line 350:     }
Line 351: 
Line 352:     protected VmDAO getVmDao() {
Line 353:         return DbFacade.getInstance()
Line 354:         .getVmDao();
push this up to the previous line
Line 355:     }
Line 356: 
Line 357:     protected VmTemplateDAO getVmTemplateDao() {
Line 358:         return DbFacade.getInstance()


Line 355:     }
Line 356: 
Line 357:     protected VmTemplateDAO getVmTemplateDao() {
Line 358:         return DbFacade.getInstance()
Line 359:         .getVmTemplateDao();
push this up to the previous line
Line 360:     }
Line 361: 
Line 362:     protected VmNetworkInterfaceDAO getVmNetworkInterfaceDao() {
Line 363:         return DbFacade.getInstance().getVmNetworkInterfaceDao();


Line 364:     }
Line 365: 
Line 366:     protected VmAndTemplatesGenerationsDAO 
getVmAndTemplatesGenerationsDao() {
Line 367:         return DbFacade.getInstance()
Line 368:         .getVmAndTemplatesGenerationsDAO();
push this up to the previous line
Line 369:     }
Line 370: 
Line 371:     protected VmStaticDAO getVmStaticDao() {
Line 372:         return DbFacade.getInstance()


Line 369:     }
Line 370: 
Line 371:     protected VmStaticDAO getVmStaticDao() {
Line 372:         return DbFacade.getInstance()
Line 373:                 .getVmStaticDao();
push this up to the previous line
Line 374:     }
Line 375: 
Line 376:     /**
Line 377:      * init the lists contain the processed info.


....................................................
File 
backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/OvfDataUpdaterTest.java
Line 2: 
Line 3: import static org.junit.Assert.assertEquals;
Line 4: import static org.junit.Assert.assertFalse;
Line 5: import static org.junit.Assert.assertTrue;
Line 6: import static org.mockito.Matchers.*;
Use FQCN imports, not *.
Line 7: import static org.mockito.Mockito.doAnswer;
Line 8: import static org.mockito.Mockito.doCallRealMethod;
Line 9: import static org.mockito.Mockito.doNothing;
Line 10: import static org.mockito.Mockito.doReturn;


Line 91:     Map<Guid, List<Guid>> executedRemovedIds;
Line 92: 
Line 93:     Guid executedRemoveStoragePoolId;
Line 94: 
Line 95:     Guid executedRemoveStorageDomainId;
All data members should be private
Line 96: 
Line 97:     private final int ITEMS_COUNT_PER_UPDATE = 100;
Line 98: 
Line 99:     @Before


Line 144:         executedRemovedIds.put(pool3.getId(), new LinkedList<Guid>());
Line 145: 
Line 146:         executedUpdatedOvfGenerationIdsInDb.put(pool1.getId(), new 
HashMap<Guid, Long>());
Line 147:         executedUpdatedOvfGenerationIdsInDb.put(pool2.getId(), new 
HashMap<Guid, Long>());
Line 148:         executedUpdatedOvfGenerationIdsInDb.put(pool3.getId(), new 
HashMap<Guid, Long>());
Instead of copy-pasting each line 3 times with 3 different pools, why not use a 
for loop?
Line 149:     }
Line 150: 
Line 151: 
Line 152:     private void mockAnswers() {


Line 156:                 VM vm = (VM) invocation.getArguments()[0];
Line 157:                 return vm.getId().toString();
Line 158:             }
Line 159: 
Line 160:         }).when(updater).generateVmMetadata(any(VM.class), 
any(ArrayList.class));
shouldn't this use any(List.class)? - and if so - just use anyList()
Line 161: 
Line 162:         doAnswer(new Answer<String>() {
Line 163:             @Override
Line 164:             public String answer(InvocationOnMock invocation) throws 
Throwable {


Line 178:                 }
Line 179:                 return toReturn;
Line 180:             }
Line 181: 
Line 182:         }).when(vmDAO).getVmsByIds(any(List.class));
s/(any(List.class)/anyList()
Line 183: 
Line 184:         doAnswer(new Answer<List<VmTemplate>>() {
Line 185:             @Override
Line 186:             public List<VmTemplate> answer(InvocationOnMock 
invocation) throws Throwable {


Line 205:                 assertTrue("too many ovfs were sent in one vdsm 
call", updateMap.size() <= ITEMS_COUNT_PER_UPDATE);
Line 206:                 return true;
Line 207:             }
Line 208: 
Line 209:         }).when(updater).executeUpdateVmInSpmCommand(any(Guid.class), 
any(Map.class), any(Guid.class));
s/any(Map.class)/anyMap()/
Line 210: 
Line 211:         doAnswer(new Answer<Boolean>() {
Line 212:             @Override
Line 213:             public Boolean answer(InvocationOnMock invocation) throws 
Throwable {


Line 232:                         "list with the new ovf values", 
values.size(), ids.size());
Line 233:                 Guid[] ids_array = ids.toArray(new Guid[ids.size()]);
Line 234:                 Long[] values_array = values.toArray(new 
Long[values.size()]);
Line 235:                 for (int i = 0; i < ids_array.length; i++)
Line 236:                 {
move { up a line
Line 237:                     
executedUpdatedOvfGenerationIdsInDb.get(executedUpdateStoragePoolId).put(ids_array[i],
 values_array[i]);
Line 238:                 }
Line 239:                 return null;
Line 240:             }


Line 238:                 }
Line 239:                 return null;
Line 240:             }
Line 241: 
Line 242:         
}).when(vmAndTemplatesGenerationsDAO).updateOvfGenerations(any(List.class), 
any(List.class));
s/any(List.class)/anyList()/
Line 243:     }
Line 244: 
Line 245:     public List<storage_pool> createStoragePools() {
Line 246:         List<storage_pool> pools = new LinkedList<storage_pool>();


Line 264:                         StoragePoolStatus.Maintanance.getValue());
Line 265:         pools.add(pool1);
Line 266:         pools.add(pool2);
Line 267:         pools.add(pool3);
Line 268:         return pools;
how about a for loop?
Line 269:     }
Line 270: 
Line 271:     private VM createVm(Guid id, VMStatus status) {
Line 272:         VM vm = new VM();


Line 586: 
Line 587:         initTestForPool(pool1.getId(), vmGuids, templatesGuids, 
removedGuids);
Line 588: 
Line 589:         updater.ovfUpdate_timer();
Line 590:         verify(updater, never()).performOvfUpdate(any(Guid.class), 
any(Map.class));
s/any(Map.class)/anyMap()/
Line 591:         verify(updater, 
times(size)).executeRemoveVmInSpm(any(Guid.class), any(Guid.class), 
any(Guid.class));
Line 592:         verifyCorrectOvfDataUpdaterRun(pool1.getId(), 
Collections.<Guid> emptyList(), removedGuids);
Line 593:     }
Line 594: 


Line 615:         updater.ovfUpdate_timer();
Line 616: 
Line 617:         List<Guid> neededToBeUpdated = new 
LinkedList<Guid>(vmGuidsUnlocked);
Line 618:         neededToBeUpdated.addAll(templatesGuidsUnlocked);
Line 619:         verify(updater, times(numberOfTimesToBeCalled(size, 
true))).performOvfUpdate(any(Guid.class), any(Map.class));
s/any(Map.class)/anyMap()/
Line 620:         verify(updater, 
times(size)).executeRemoveVmInSpm(any(Guid.class), any(Guid.class), 
any(Guid.class));
Line 621:         verifyCorrectOvfDataUpdaterRun(pool1.getId(), 
neededToBeUpdated, removedGuids);
Line 622:     }
Line 623: 


Line 635:         
doReturn(2L).when(vmStaticDAO).getDbGeneration(any(Guid.class));
Line 636: 
Line 637:         updater.ovfUpdate_timer();
Line 638: 
Line 639:         verify(updater, never()).performOvfUpdate(any(Guid.class), 
any(Map.class));
s/any(Map.class)/anyMap()/
Line 640:         verify(updater, 
never()).executeRemoveVmInSpm(any(Guid.class), any(Guid.class), 
any(Guid.class));
Line 641: 
Line 642:         List<Guid> idsThatNeededToBeUpdated = new 
LinkedList<Guid>(vmGuids);
Line 643:         idsThatNeededToBeUpdated.addAll(templatesGuids);


....................................................
File 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VmBase.java
Line 112:     @Column(name = "is_delete_protected")
Line 113:     private boolean deleteProtected;
Line 114: 
Line 115:     @Column(name = "db_generation")
Line 116:     private Long db_generation;
I think you also need to list this field somewhere in VmHandler.
Line 117: 
Line 118:     @Column(name = "is_smartcard_enabled")
Line 119:     private boolean smartcardEnabled;
Line 120: 


....................................................
File 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/config/ConfigValues.java
Line 825:     WaitForVdsInitInSec(230),
Line 826: 
Line 827:     @TypeConverterAttribute(Integer.class)
Line 828:     @DefaultValueAttribute("1")
Line 829:     OvfUpdateIntervalInMinutes(231),
should be reloadable.
Line 830: 
Line 831:     @TypeConverterAttribute(Integer.class)
Line 832:     @DefaultValueAttribute("100")
Line 833:     OvfItemsCountPerUpdate(232),


Line 829:     OvfUpdateIntervalInMinutes(231),
Line 830: 
Line 831:     @TypeConverterAttribute(Integer.class)
Line 832:     @DefaultValueAttribute("100")
Line 833:     OvfItemsCountPerUpdate(232),
this too
Line 834: 
Line 835:     // JTODO - temporarily using values from 256 for Java specific 
options
Line 836:     @TypeConverterAttribute(String.class)
Line 837:     @DefaultValueAttribute("keys/engine.p12")


....................................................
File 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/vdscommands/UpdateVMVDSCommandParameters.java
Line 4: 
Line 5: import java.util.List;
Line 6: import java.util.HashMap;
Line 7: import java.util.Map;
Line 8: 
How is this (blessed!) cleanup relevant to this patch?
Line 9: public class UpdateVMVDSCommandParameters extends 
StorageDomainIdParametersBase {
Line 10:     public UpdateVMVDSCommandParameters(Guid storagePoolId,
Line 11:             Map<Guid, KeyValuePairCompat<String, List<Guid>>> 
infoDictionary) {
Line 12:         super(storagePoolId);


....................................................
File 
backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/StoragePoolDAODbFacadeImpl.java
Line 192:                 return entity;
Line 193:             }
Line 194:         };
Line 195: 
Line 196:         return getCallsHandler().executeReadList("GetAllByStatus", 
mapper, parameterSource);
Please create a cleanup patch to extract the mapper to a static instance as per 
http://www.ovirt.org/Backend_Coding_Standards#RowMapper_singletons and stack it 
before this patch
Line 197:     }
Line 198: 
Line 199:     @Override
Line 200:     public List<storage_pool> getAll(Guid userID, boolean isFiltered) 
{


....................................................
File 
backend/manager/modules/dal/src/test/java/org/ovirt/engine/core/dao/VdsDynamicDAOTest.java
Line 11: import org.ovirt.engine.core.compat.Guid;
Line 12: import org.ovirt.engine.core.compat.NGuid;
Line 13: 
Line 14: public class VdsDynamicDAOTest extends BaseDAOTestCase {
Line 15:     private static final Guid EXISTING_VDS_ID = new 
Guid("2001751e-549b-4e7a-aff6-32d36856c125");
Please move this to FixturesTool.java
Line 16:     private VdsDynamicDAO dao;
Line 17:     private VdsStaticDAO staticDao;
Line 18:     private VdsStatisticsDAO statisticsDao;
Line 19:     private VdsStatic existingVds;


....................................................
File 
backend/manager/modules/dal/src/test/java/org/ovirt/engine/core/dao/VdsStaticDAOTest.java
Line 15: import org.ovirt.engine.core.compat.NGuid;
Line 16: 
Line 17: 
Line 18: public class VdsStaticDAOTest extends BaseDAOTestCase {
Line 19:     private static final Guid EXISTING_VDS_ID = new 
Guid("2001751e-549b-4e7a-aff6-32d36856c125");
Please move this to FixturesTool.java
Line 20:     private static final String IP_ADDRESS = "192.168.122.17";
Line 21:     private VdsStaticDAO dao;
Line 22:     private VdsDynamicDAO dynamicDao;
Line 23:     private VdsStatisticsDAO statisticsDao;


....................................................
File 
backend/manager/modules/dal/src/test/java/org/ovirt/engine/core/dao/VdsStatisticsDAOTest.java
Line 9: import org.ovirt.engine.core.compat.Guid;
Line 10: import org.ovirt.engine.core.compat.NGuid;
Line 11: 
Line 12: public class VdsStatisticsDAOTest extends BaseDAOTestCase {
Line 13:     private static final Guid EXISTING_VDS_ID = new 
Guid("2001751e-549b-4e7a-aff6-32d36856c125");
Please move this to FixturesTool.java
Line 14:     private VdsStatisticsDAO dao;
Line 15:     private VdsStaticDAO staticDao;
Line 16:     private VdsDynamicDAO dynamicDao;
Line 17:     private VdsStatic existingVds;


....................................................
File 
backend/manager/modules/dal/src/test/java/org/ovirt/engine/core/dao/VmAndTemplatesGenerationsDaoTest.java
Line 1: package org.ovirt.engine.core.dao;
Line 2: 
Line 3: import static org.junit.Assert.*;
Don't use * imports.
Line 4: 
Line 5: import java.util.Collections;
Line 6: import java.util.LinkedList;
Line 7: import java.util.List;


....................................................
File backend/manager/modules/dal/src/test/resources/fixtures.xml
Line 847:             <value>2010-12-01 09:52:57</value>
Line 848:             <value>4</value>
Line 849:         </row>
Line 850:     </table>
Line 851:     
Please remove TWS
Line 852:     <table name="vm_ovf_generations">
Line 853:         <column>vm_guid</column>
Line 854:         <column>storage_pool_id</column>
Line 855:         <column>ovf_generation</column>


....................................................
File 
backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/irsbroker/RemoveVMVDSCommand.java
Line 1: package org.ovirt.engine.core.vdsbroker.irsbroker;
Line 2: 
Line 3: import org.ovirt.engine.core.compat.*;
while you're at it, I would fix the * imports too
Line 4: import org.ovirt.engine.core.common.errors.VdcBllErrors;
Line 5: import org.ovirt.engine.core.common.vdscommands.*;
Line 6: import org.ovirt.engine.core.vdsbroker.vdsbroker.VDSExceptionBase;
Line 7: 


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I9b5132300fb1f1fd94f771cab15efe5246dbeca8
Gerrit-PatchSet: 18
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Liron Aravot <[email protected]>
Gerrit-Reviewer: Allon Mureinik <[email protected]>
Gerrit-Reviewer: Arik Hadas <[email protected]>
Gerrit-Reviewer: Ayal Baron <[email protected]>
Gerrit-Reviewer: Liron Aravot <[email protected]>
Gerrit-Reviewer: Maor Lipchuk <[email protected]>
Gerrit-Reviewer: Michael Kublin <[email protected]>
Gerrit-Reviewer: Tal Nisan <[email protected]>
Gerrit-Reviewer: Vered Volansky <[email protected]>
Gerrit-Reviewer: Yair Zaslavsky <[email protected]>
Gerrit-Reviewer: liron aravot <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to