Eli Mesika has posted comments on this change.

Change subject: core: support materialized views in Java
......................................................................


Patch Set 3: (6 inline comments)

IMHO the annotation should contain a list of MV to refresh , then 
RefreshMaterializedView may be called on each or we can add a SP that get a 
comma separated list of views and refresh them all in one round-trip

....................................................
File backend/manager/modules/dal/pom.xml
Line 50:     <dependency>
Line 51:       <groupId>${engine.groupId}</groupId>
Line 52:       <artifactId>scheduler</artifactId>
Line 53:       <version>${engine.version}</version>
Line 54:     </dependency>    
Please remove TWS
Line 55:     <dependency>
Line 56:       <groupId>org.springframework</groupId>
Line 57:       <artifactId>spring-jdbc</artifactId>
Line 58:     </dependency>


....................................................
File 
backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dal/dbbroker/materializedviews/MaterializedView.java
Line 6: import java.lang.annotation.Target;
Line 7: 
Line 8: /**
Line 9:  * This annotation is used to mark Dao's that are based on Materialized 
Views
Line 10:  * @author lzelkha
please remove author
Line 11:  */
Line 12: @Retention(RetentionPolicy.RUNTIME)
Line 13: @Target(ElementType.TYPE)
Line 14: public @interface MaterializedView {


....................................................
File 
backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dal/dbbroker/materializedviews/MatrializedViewListener.java
Line 16:         if (data.getDao() == null || 
!data.getDao().getClass().isAnnotationPresent(MaterializedView.class)) {
Line 17:             return;
Line 18:         }
Line 19: 
Line 20:         String entityName = null;
I would encapsulate that as getEntityName with the for loop
Line 21: 
Line 22:         for (Class<?> clz : data.getDao().getClass().getInterfaces()) {
Line 23: 
Line 24:             if (DAO.class.isAssignableFrom(clz)) {


Line 41:             log.error("MaterializedViewListener could not discover 
activated entity for DAO " + data.getDao()
Line 42:                     + " . Data inconsistency might occur.");
Line 43:         } else {
Line 44:             log.info("Refreshing materialized view for entity " + 
entityName);
Line 45:             // 
DbFacade.getInstance().getCallsHandler().executeModification("test", null);
Should call the SP
Line 46:         }
Line 47:     }
Line 48: 
Line 49:     @Override


....................................................
File 
backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dal/dbbroker/updateListeners/QueuedUpdateListener.java
Line 13:     private long updateDelayInterval;
Line 14:     protected List<UpdateData> pendingUpdates = new ArrayList<>();
Line 15: 
Line 16:     public QueuedUpdateListener() {
Line 17:         updateDelayInterval = 5 * 1000;
Probably needs to be  soft value at the end, maybe internal config value
Line 18:     }
Line 19: 
Line 20:     public QueuedUpdateListener(long updateDelayInterval) {
Line 21:         this.updateDelayInterval = updateDelayInterval;


....................................................
File 
backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dal/dbbroker/updateListeners/UpdateMethod.java
Line 7: 
Line 8: /**
Line 9:  * This annotation is used to mark methods that update the database, 
and will require an update to depending
Line 10:  * materialized view objects
Line 11:  * @author lzelkha
please remove author
Line 12:  */
Line 13: @Retention(RetentionPolicy.RUNTIME)
Line 14: @Target(ElementType.METHOD)
Line 15: public @interface UpdateMethod {


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I745e934fde341bd1264e5e5fedaf59fc64ad4ad8
Gerrit-PatchSet: 3
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Liran Zelkha <[email protected]>
Gerrit-Reviewer: Eli Mesika <[email protected]>
Gerrit-Reviewer: Yair Zaslavsky <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to