Oved Ourfali has posted comments on this change.

Change subject: core: Improve Dynamic Query SQL generator
......................................................................


Patch Set 12:

(5 comments)

http://gerrit.ovirt.org/#/c/28135/12/backend/manager/modules/searchbackend/src/main/java/org/ovirt/engine/core/searchbackend/SearchObjectAutoCompleter.java
File 
backend/manager/modules/searchbackend/src/main/java/org/ovirt/engine/core/searchbackend/SearchObjectAutoCompleter.java:

Line 80:         // vds - storage domain
Line 81:         addJoin(SearchObjects.VDS_OBJ_NAME,
Line 82:                 "storage_pool_id",
Line 83:                 SearchObjects.VDC_STORAGE_DOMAIN_OBJ_NAME,
Line 84:                 "storage_pool_id");
Just curios, is that a bug-fix, or an optimization?
Also, it can be nice to have all the lines above in this style.
Line 85: 
Line 86:         // cluster - storage domain
Line 87:         addJoin(SearchObjects.VDC_CLUSTER_OBJ_NAME, "storage_id", 
SearchObjects.VDC_STORAGE_DOMAIN_OBJ_NAME, "id");
Line 88: 


Line 387:     }
Line 388: 
Line 389:     public String getInnerJoin(String searchObj, String crossRefObj, 
boolean useTags) {
Line 390:         final String[] joinKey = 
mJoinDictionary.get(StringFormat.format("%1$s.%2$s", searchObj, crossRefObj));
Line 391:         final String crossRefTable = getRelatedTableName(crossRefObj, 
true);
useTags isn't relevant here? it should always be true?
If so, a comment might be helpful here.
Line 392:         final String searchObjTable = getRelatedTableName(searchObj, 
useTags);
Line 393: 
Line 394:         return StringFormat.format(" LEFT OUTER JOIN %3$s ON 
%1$s.%2$s=%3$s.%4$s ", searchObjTable, joinKey[0],
Line 395:                 crossRefTable, joinKey[1]);


Line 414:         if (useTags) {
Line 415:             return getRelatedTableName(obj);
Line 416:         }
Line 417: 
Line 418:         return getRelatedTableNameWithOutTags(obj);
s/WithOut/Without
(know it is not you who did this typo, but worth fixing.).
Line 419:     }
Line 420: 
Line 421:     private String getRelatedTableNameWithOutTags(String obj) {
Line 422:         if (obj == null) {


http://gerrit.ovirt.org/#/c/28135/12/backend/manager/modules/searchbackend/src/main/java/org/ovirt/engine/core/searchbackend/SyntaxChecker.java
File 
backend/manager/modules/searchbackend/src/main/java/org/ovirt/engine/core/searchbackend/SyntaxChecker.java:

Line 860: 
Line 861:             // Add special handling (not deleted) to event searches
Line 862:             if (searchObjStr.equalsIgnoreCase("EVENT")) {
Line 863:                 whereBuilder.add("not deleted");
Line 864:             }
not sure I understand this special treatment.
can you elaborate more in this comment?
Line 865: 
Line 866:             // adding WHERE if required and All implicit AND
Line 867:             StringBuilder wherePhrase = new StringBuilder();
Line 868:             if (whereBuilder.size() > 0) {


Line 1113: 
Line 1114:         // We will take the table with tags for all subtables
Line 1115:         // TODO: Optimize this
Line 1116:         if (conditionType == ConditionType.ConditionwithSpesificObj) 
{
Line 1117:             tableName = mSearchObjectAC.getRelatedTableName(objName, 
true);
same here. is it always true?
Line 1118:         } else {
Line 1119:             tableName = mSearchObjectAC.getRelatedTableName(objName, 
fieldName);
Line 1120:         }
Line 1121:         if (customizedRelation.equalsIgnoreCase("LIKE") || 
customizedRelation.equalsIgnoreCase("ILIKE")) {


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I862873171c6753f8c8863c10c336e981e39dc8cb
Gerrit-PatchSet: 12
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Liran Zelkha <lzel...@redhat.com>
Gerrit-Reviewer: Barak Azulay <bazu...@redhat.com>
Gerrit-Reviewer: Eli Mesika <emes...@redhat.com>
Gerrit-Reviewer: Liran Zelkha <lzel...@redhat.com>
Gerrit-Reviewer: Oved Ourfali <oourf...@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