Martin Peřina has posted comments on this change.

Change subject: core: Replace oVirt logger with slf4j in bll
......................................................................


Patch Set 5:

(24 comments)

http://gerrit.ovirt.org/#/c/34359/5/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVdsCommand.java
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVdsCommand.java:

Line 230:             return false;
Line 231:         }
Line 232: 
Line 233:         String vdsName = getParameters().getVdsStaticData().getName();
Line 234:         log.info("Host '{}', id '{}' of type '{}' is being 
re-registered as Host '{}'",
> not sure I follow.
I don't understand, Yair?
Line 235:                 vds.getName(),
Line 236:                 vds.getId(),
Line 237:                 vds.getVdsType().name(),
Line 238:                 vdsName);


http://gerrit.ovirt.org/#/c/34359/5/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AttachUserToVmFromPoolAndRunCommand.java
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AttachUserToVmFromPoolAndRunCommand.java:

Line 201:                 } else {
Line 202:                     log.info("Succeeded giving user '{}' permission 
to Vm '{}'", getAdUserId(), vmToAttach);
Line 203:                 }
Line 204:             } else {
Line 205:                 log.info("No free Vms in pool '{}'. Cannot allocate 
for user '{}'", getVmPoolId(), getAdUserId());                throw new 
VdcBLLException(VdcBllErrors.NO_FREE_VM_IN_POOL);
> please format the line above: should be broken into 2 lines as before.
Sorry, not sure how did it happen. Done
Line 206:             }
Line 207:         }
Line 208: 
Line 209:         // Only when using a Vm that is not prestarted do we need to 
run the vm


http://gerrit.ovirt.org/#/c/34359/5/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/Backend.java
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/Backend.java:

Line 347:                             "Failed to run compensation on startup 
for Command '{}', Command Id '{}': {}",
Line 348:                             commandSnapshot.getValue(),
Line 349:                             commandSnapshot.getKey(),
Line 350:                             ExceptionUtils.getMessage(e));
Line 351:                     log.debug("Exception", e);
> not sure its a good idea to log this in debug... i would leave in error, th
OK, changed to error.
Line 352:                 }
Line 353:                 log.info("Running compensation on startup for Command 
'{}', Command Id '{}'",
Line 354:                         commandSnapshot.getValue(), 
commandSnapshot.getKey());
Line 355:             } else {


http://gerrit.ovirt.org/#/c/34359/5/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ChangeVMClusterCommand.java
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ChangeVMClusterCommand.java:

Line 235:             StringBuilder sb = new StringBuilder();
Line 236:             for (AffinityGroup affinityGroup : 
allAffinityGroupsByVmId) {
Line 237:                 sb.append(affinityGroup.getName() + " ");
Line 238:             }
Line 239:             log.info("Due to cluster change, removing VM from 
associated affinity group(s): {}", sb.toString());
> toString
Well, I'm used to use toString() on StringBuilder instances, but OK, I will 
remove
Line 240:             
DbFacade.getInstance().getAffinityGroupDao().removeVmFromAffinityGroups(vm.getId());
Line 241:         }
Line 242:         setSucceeded(true);
Line 243:     }


http://gerrit.ovirt.org/#/c/34359/5/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CommandBase.java
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CommandBase.java:

Line 1166:             }
Line 1167:             functionReturnValue = getSucceeded();
Line 1168:             exceptionOccurred = false;
Line 1169:         } catch (VdcBLLException e) {
Line 1170:             log.error("Command '{}' throw Vdc Bll exception. With 
error message: {}",
> Command '{}' failed: {}
Done
Line 1171:                     getClass().getName(),
Line 1172:                     e.getMessage());
Line 1173:             log.debug("Exception", e);
Line 1174:             processExceptionToClient(new VdcFault(e, 
e.getVdsError().getCode()));


Line 1173:             log.debug("Exception", e);
Line 1174:             processExceptionToClient(new VdcFault(e, 
e.getVdsError().getCode()));
Line 1175:         } catch (RuntimeException e) {
Line 1176:             processExceptionToClient(new VdcFault(e, 
VdcBllErrors.ENGINE));
Line 1177:             log.error("Command '{}' throw exception: {}", 
getClass().getName(), e.getMessage());
> Command '{}' failed: {}
Done
Line 1178:             log.error("Exception", e);
Line 1179:         } finally {
Line 1180:             if (!exceptionOccurred) {
Line 1181:                 setCommandExecuted();


http://gerrit.ovirt.org/#/c/34359/5/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CommandsFactory.java
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CommandsFactory.java:

Line 113:             log.error("CommandsFactory : Failed to get type 
information using reflection for Class  '{}', Command Id '{}': {}",
Line 114:                     className,
Line 115:                     commandId,
Line 116:                     e.getMessage());
Line 117:             log.debug("Exception", e);
> stackstace might be useful to figure out what went wrong: either an expecte
OK, changed to error
Line 118:             return null;
Line 119:         } finally {
Line 120:             if (isAcessible != null) {
Line 121:                 constructor.setAccessible(isAcessible);


Line 139:             }
Line 140:             return result;
Line 141:         } catch (Exception e) {
Line 142:             log.error("Command Factory: Failed to create command '{}' 
using reflection: {}", type, e.getMessage());
Line 143:             log.debug("Exception", e);
> same here.
OK, changed to error
Line 144:             throw new RuntimeException(e);
Line 145:         }
Line 146:     }
Line 147: 


http://gerrit.ovirt.org/#/c/34359/5/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CreateAllSnapshotsFromVmCommand.java
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CreateAllSnapshotsFromVmCommand.java:

Line 428:                 && 
FeatureSupported.isMemorySnapshotSupportedByArchitecture(getVm().getClusterArch(),
 getVm().getVdsGroupCompatibilityVersion());
Line 429:     }
Line 430: 
Line 431:     private void handleVdsLiveSnapshotFailure(VdcBLLException e) {
Line 432:         log.warn("Could not perform live snapshot due to error: {}. 
VM will still be configured to the new created snapshot",
> Could not perform live snapshot due to error, VM will still be configured t
Done
Line 433:                 ExceptionUtils.getMessage(e));
Line 434:         addCustomValue("SnapshotName", getSnapshotName());
Line 435:         addCustomValue("VmName", getVmName());
Line 436:         updateCallStackFromThrowable(e);


http://gerrit.ovirt.org/#/c/34359/5/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CreateCloneOfTemplateCommand.java
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CreateCloneOfTemplateCommand.java:

Line 64:                                     newDiskImage.getVolumeFormat(), 
newDiskImage.getVolumeType(),
Line 65:                                     
getDiskImage().isWipeAfterDelete(), false)));
Line 66: 
Line 67:         } catch (VdcBLLException e) {
Line 68:             log.error("Failed creating snapshot from image id -'{}'", 
getImage().getImageId());
> s/-//'
Done
Line 69:             throw e;
Line 70:         }
Line 71: 
Line 72:         if (vdsReturnValue.getSucceeded()) {


http://gerrit.ovirt.org/#/c/34359/5/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CreateSnapshotCommand.java
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CreateSnapshotCommand.java:

Line 120:                     throw new RuntimeException();
Line 121:                 }
Line 122:             }
Line 123:         } catch (Exception e) {
Line 124:             log.error("Failed creating snapshot from image id -'{}'", 
getImage().getImageId());
> s/-//
Done
Line 125:             
CommandCoordinatorUtil.logAndFailTaskOfCommandWithEmptyVdsmId(getAsyncTaskId(),
Line 126:                     "Create snapshot failed at VDSM. DB task ID is " 
+ getAsyncTaskId());
Line 127:             throw new 
VdcBLLException(VdcBllErrors.VolumeCreationError);
Line 128:         }


http://gerrit.ovirt.org/#/c/34359/5/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ExtendImageSizeCommand.java
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ExtendImageSizeCommand.java:

Line 92
Line 93
Line 94
Line 95
Line 96
> Failed to update VM '{}' with the new volume size, VM should be restarted t
Done


Line 93
Line 94
Line 95
Line 96
Line 97
> stack?
Done


Line 130
Line 131
Line 132
Line 133
Line 134
> s/!//
Done


http://gerrit.ovirt.org/#/c/34359/5/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/FenceVdsBaseCommand.java
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/FenceVdsBaseCommand.java:

Line 470:     private void handleError(VDSStatus lastStatus, final 
VDSReturnValue vdsReturnValue, FenceAgentOrder order) {
Line 471:         if (!((FenceStatusReturnValue) 
(vdsReturnValue.getReturnValue())).getIsSkipped()) {
Line 472:             // Since this is a non-transactive command , restore last 
status
Line 473:             setSucceeded(false);
Line 474:             log.error("Failed to {} VDS using {} Power Management 
agent",
> '{}'?
Not here, because 1st param is one of start|stop|restart and 2nd one of 
primary|secondary strings.
Line 475:                     getParameters().getAction().name().toLowerCase(),
Line 476:                     order.name());
Line 477:             
AlertIfPowerManagementOperationSkipped(getParameters().getAction().name(), 
vdsReturnValue.getExceptionObject());
Line 478:             throw new 
VdcBLLException(VdcBllErrors.VDS_FENCE_OPERATION_FAILED);


Line 514:         final int UNKNOWN_RESULT_ALLOWED = 3;
Line 515:         int i = 1;
Line 516:         int j = 1;
Line 517:         boolean statusReached = false;
Line 518:         log.info("Waiting for vds {} to {}", vdsName, ACTION_NAME);
> '{}'?
Added to vds param, I would leave action without, it's one of 
start|stop|restart strings
Line 519: 
Line 520:         // Waiting before first attempt to check the host status.
Line 521:         // This is done because if we will attempt to get host status 
immediately
Line 522:         // in most cases it will not turn from on/off to off/on and 
we will need


Line 526:         // get a proxy host to be used along the whole 
wait-for-status loop in order to prevent unnecessary delays when
Line 527:         // a potential preferred proxy host has connectivity problems 
and can not access the fenced host PM card
Line 528:         if (executor.findProxyHost()) {
Line 529:             while (!statusReached && i <= getRerties()) {
Line 530:                 log.info("Attempt {} to get vds {} status", i, 
vdsName);
> '{}'?
Added to vds, I usually don't surround numbers with '
Line 531: 
Line 532:                     VDSReturnValue returnValue = 
executor.fence(order);
Line 533:                     if (returnValue != null && 
returnValue.getReturnValue() != null) {
Line 534:                         FenceStatusReturnValue value = 
(FenceStatusReturnValue) returnValue.getReturnValue();


http://gerrit.ovirt.org/#/c/34359/5/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/HandleVdsCpuFlagsOrClusterChangedCommand.java
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/HandleVdsCpuFlagsOrClusterChangedCommand.java:

Line 58:                 foundCPU = false;
Line 59:             } else {
Line 60:                 _hasFlags = false;
Line 61:             }
Line 62:             log.error("Could not find server cpu for server {}:{}, 
flags: {}", getVdsId(), getVds()
> '{}'({}) (name, id)
Done
Line 63:                     .getName(), getVds().getCpuFlags());
Line 64:         }
Line 65: 
Line 66:         // Checks whether the host and the cluster have the same 
architecture


http://gerrit.ovirt.org/#/c/34359/5/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ImportVmFromConfigurationCommand.java
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ImportVmFromConfigurationCommand.java:

Line 101:                     
vmFromConfiguration.setDiskMap(getParameters().getDiskMap());
Line 102:                     
vmFromConfiguration.setImages(getDiskImageListFromDiskMap(getParameters().getDiskMap()));
Line 103:                 }
Line 104:             } catch (OvfReaderException e) {
Line 105:                 log.error("Failed to parse a given ovf 
configuration:\n{}", ovfEntityData.getOvfData());
> please add getMessage
Done
Line 106:                 log.error("Exception", e);
Line 107:             }
Line 108:         }
Line 109:     }


http://gerrit.ovirt.org/#/c/34359/5/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ImportVmTemplateFromConfigurationCommand.java
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ImportVmTemplateFromConfigurationCommand.java:

Line 74:                     vmTemplateFromConfiguration.setDiskList(imageList);
Line 75:                     ensureDomainMap(imageList, 
getParameters().getDestDomainId());
Line 76:                 }
Line 77:             } catch (OvfReaderException e) {
Line 78:                 log.error("Failed to parse a given ovf 
configuration:\n{}", ovfEntityData.getOvfData());
> please add getMessage.
Done
Line 79:                 log.error("Exception", e);
Line 80:             }
Line 81:         }
Line 82:         setVdsGroupId(getParameters().getVdsGroupId());


http://gerrit.ovirt.org/#/c/34359/5/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/MultipleActionsRunner.java
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/MultipleActionsRunner.java:

Line 98:                 }
Line 99:             }
Line 100:         } catch (RuntimeException e) {
Line 101:             log.error("Failed to execute multiple actions of type 
'{}': {} ", actionType, e.getMessage());
Line 102:             log.debug("Exception", e);
> please log.error("Exception", e);
Done
Line 103:         }
Line 104:         return returnValues;
Line 105:     }
Line 106: 


http://gerrit.ovirt.org/#/c/34359/5/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/UpdateMomPolicyCommand.java
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/UpdateMomPolicyCommand.java:

Line 29:                     new MomPolicyVDSParameters(getVds(), 
getVdsGroup().isEnableBallooning(),
Line 30:                                                 
getVdsGroup().isEnableKsm())
Line 31:                                               ).getSucceeded();
Line 32:         } catch (VdcBLLException e) {
Line 33:             log.error("Could not update MoM policy on host '{}'", 
getVdsName());
> getMessage()?
Done
Line 34:         }
Line 35:         getReturnValue().setSucceeded(succeeded);
Line 36:     }
Line 37: 


http://gerrit.ovirt.org/#/c/34359/5/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VdsEventListener.java
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VdsEventListener.java:

Line 303:                                     ctx);
Line 304:                         }
Line 305:                     } catch (RuntimeException e) {
Line 306:                         log.error("Failed to initialize Vds on up: 
{}", e.getMessage());
Line 307:                         log.debug("Exception", e);
> please log in error
Done
Line 308:                     }
Line 309:                 }
Line 310:             });
Line 311:         }


http://gerrit.ovirt.org/#/c/34359/5/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VmHandler.java
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VmHandler.java:

Line 407:     private static Version getApplicationVersion(final String part, 
final String appName) {
Line 408:         try {
Line 409:             return new RpmVersion(part, getAppName(part, appName), 
true);
Line 410:         } catch (Exception e) {
Line 411:             log.debug("Failed to create rpm version object, part '{}' 
appName '{}', error: {}",
> s/, error//
Done
Line 412:                     part,
Line 413:                     appName,
Line 414:                     e.getMessage());
Line 415:             log.debug("Exception", e);


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I82070b252197458422792c49b2135fcb9b9b1430
Gerrit-PatchSet: 5
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Martin Peřina <mper...@redhat.com>
Gerrit-Reviewer: Allon Mureinik <amure...@redhat.com>
Gerrit-Reviewer: Alon Bar-Lev <alo...@redhat.com>
Gerrit-Reviewer: Gilad Chaplik <gchap...@redhat.com>
Gerrit-Reviewer: Martin Peřina <mper...@redhat.com>
Gerrit-Reviewer: Martin Sivák <msi...@redhat.com>
Gerrit-Reviewer: Moti Asayag <masa...@redhat.com>
Gerrit-Reviewer: Omer Frenkel <ofren...@redhat.com>
Gerrit-Reviewer: Oved Ourfali <oourf...@redhat.com>
Gerrit-Reviewer: Roy Golan <rgo...@redhat.com>
Gerrit-Reviewer: Tal Nisan <tni...@redhat.com>
Gerrit-Reviewer: Yair Zaslavsky <yzasl...@redhat.com>
Gerrit-Reviewer: automat...@ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to