Eli Mesika has posted comments on this change.

Change subject: core: [RFE]Backup Awareness - Handler
......................................................................


Patch Set 1:

(8 comments)

https://gerrit.ovirt.org/#/c/39527/1/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/EngineBackupAwarenessManager.java
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/EngineBackupAwarenessManager.java:

Line 11: import org.ovirt.engine.core.utils.timer.SchedulerUtilQuartzImpl;
Line 12: import org.slf4j.Logger;
Line 13: import org.slf4j.LoggerFactory;
Line 14: 
Line 15: import javax.inject.Inject;
> Correctly formatted imports should look like this:
Done
Line 16: import javax.inject.Singleton;
Line 17: import java.util.Calendar;
Line 18: import java.util.Date;
Line 19: import java.util.concurrent.TimeUnit;


Line 24:  */
Line 25: @Singleton
Line 26: public class EngineBackupAwarenessManager {
Line 27:     private static final Logger log = 
LoggerFactory.getLogger(EngineBackupAwarenessManager.class);
Line 28:     private boolean active = false;
> will fix
Done
Line 29:     private static final String DB = "engine";
Line 30: 
Line 31:     @Inject
Line 32:     private AuditLogDirector auditLogDirector;


Line 25: @Singleton
Line 26: public class EngineBackupAwarenessManager {
Line 27:     private static final Logger log = 
LoggerFactory.getLogger(EngineBackupAwarenessManager.class);
Line 28:     private boolean active = false;
Line 29:     private static final String DB = "engine";
> So you mean that the engine-backup will insert 'engine' as the constant whi
Done
Line 30: 
Line 31:     @Inject
Line 32:     private AuditLogDirector auditLogDirector;
Line 33: 


Line 34:     /**
Line 35:      * Initializes the backup h Check Manager
Line 36:      */
Line 37:     public void initialize() {
Line 38:         
if(Config.<Boolean>getValue(ConfigValues.BackupCheckPeriodInHours)) {
> will fix
Done
Line 39:             log.info("Start initializing {}", 
getClass().getSimpleName());
Line 40:             Integer backupCheckPeriodInHours = Config.<Integer> 
getValue(ConfigValues.BackupCheckPeriodInHours);
Line 41:             // disable feature if value is negative
Line 42:             if (backupCheckPeriodInHours > 0) {


Line 56:     public void backupCheck() {
Line 57:         // skip backup check if previous operation is not completed yet
Line 58:         if (!active) {
Line 59:             try {
Line 60:                 synchronized (this) {
> this is not harmful, but the overall duration of the this job is less than 
Done
Line 61:                     log.info("Backup check started.");
Line 62:                     active = true;
Line 63:                     doBackupCheck();
Line 64:                     log.info("Backup check completed.");


Line 70:         }
Line 71:     }
Line 72: 
Line 73:     private void doBackupCheck() {
Line 74:         final int DAY_IN_MILLISEC= 60 * 60 * 24 *1000;
> sure
Done
Line 75:         AuditLogableBase alert = new AuditLogableBase();
Line 76: 
Line 77:         //try to get last backup record
Line 78:         EngineBackupHistory lastBackup = 
DbFacade.getInstance().getEngineBackupHistoryDAO().getLastSuccessfulEngineBackup(DB);


Line 74:         final int DAY_IN_MILLISEC= 60 * 60 * 24 *1000;
Line 75:         AuditLogableBase alert = new AuditLogableBase();
Line 76: 
Line 77:         //try to get last backup record
Line 78:         EngineBackupHistory lastBackup = 
DbFacade.getInstance().getEngineBackupHistoryDAO().getLastSuccessfulEngineBackup(DB);
> yea , should start to get used to the @Inject
Done
Line 79:         if (lastBackup == null) {
Line 80:             auditLogDirector.log(alert, AuditLogType.ENGINE_NO_BACKUP);
Line 81:         }
Line 82:         else {


Line 77:         //try to get last backup record
Line 78:         EngineBackupHistory lastBackup = 
DbFacade.getInstance().getEngineBackupHistoryDAO().getLastSuccessfulEngineBackup(DB);
Line 79:         if (lastBackup == null) {
Line 80:             auditLogDirector.log(alert, AuditLogType.ENGINE_NO_BACKUP);
Line 81:         }
> will do
Done
Line 82:         else {
Line 83:             //check time elapsed from last backup
Line 84:             if 
(Config.<Boolean>getValue(ConfigValues.BackupAlertPeriodInDays)) {
Line 85:                 Integer backupAlertPeriodInDays = Config.<Integer> 
getValue(ConfigValues.BackupAlertPeriodInDays);


-- 
To view, visit https://gerrit.ovirt.org/39527
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I8567ae314a3d612d8e3d4dd948394b65789ac670
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Eli Mesika <[email protected]>
Gerrit-Reviewer: Eli Mesika <[email protected]>
Gerrit-Reviewer: Martin PeÅ™ina <[email protected]>
Gerrit-Reviewer: Moti Asayag <[email protected]>
Gerrit-Reviewer: Oved Ourfali <[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

Reply via email to