Sfoglia il codice sorgente

HPCC-17640 Avoid collecting change info. for new SDS client trees

Signed-off-by: Jake Smith <jake.smith@lexisnexisrisk.com>
Jake Smith 8 anni fa
parent
commit
57c28719bf
2 ha cambiato i file con 6 aggiunte e 13 eliminazioni
  1. 5 12
      dali/base/dacsds.cpp
  2. 1 1
      dali/base/dacsds.ipp

+ 5 - 12
dali/base/dacsds.cpp

@@ -71,7 +71,7 @@ public:
 
     virtual void onRemove(void *e)
     {
-        if (owner.queryConnection().queryStateChanges())
+        if (owner.queryStateChanges())
         {
             CClientRemoteTree *child = (CClientRemoteTree *)((IPropertyTree *)e);
             assertex(child);
@@ -752,7 +752,9 @@ IPropertyTree *CClientRemoteTree::ownPTree(IPropertyTree *tree)
     // if taking ownership of an orphaned clientremote tree need to reset it's attributes.
     if ((connection.queryStateChanges()) && isEquivalent(tree) && (!QUERYINTERFACE(tree, CClientRemoteTree)->IsShared()))
     {
-        ((CClientRemoteTree *)tree)->resetState(CPS_Changed, true);
+        CClientRemoteTree *_tree = QUERYINTERFACE(tree, CClientRemoteTree);
+        if (_tree->queryServerId())
+            ((CClientRemoteTree *)tree)->resetState(CPS_Changed, true);
         return tree;
     }
     else
@@ -767,8 +769,6 @@ IPropertyTree *CClientRemoteTree::create(const char *name, IPTArrayValue *value,
         newTree->setServerId(queryServerId());
         setServerId(0);
     }
-    else
-        newTree->mergeState(CPS_Changed); // flag new element as changed.
     return newTree;
 }
 
@@ -1122,14 +1122,7 @@ IPropertyTree *CClientRemoteTree::collateData()
 
     if (0 == serverId)
     {
-        if (ct.queryTree())
-        {
-            ct.queryTree()->removeProp(ATTRDELETE_TAG);
-            ct.queryTree()->removeProp(ATTRCHANGE_TAG);
-            ct.queryTree()->removeProp(DELETE_TAG);
-        }
-        else
-            ct.createTree();
+        ct.createTree();
         Owned<IAttributeIterator> iter = getAttributes();
         if (iter->count())
         {

+ 1 - 1
dali/base/dacsds.ipp

@@ -298,7 +298,7 @@ public:
     CClientRemoteTree(const char *name, IPTArrayValue *value, ChildMap *children, CRemoteConnection &conn, CPState _state=CPS_Unchanged);
     void beforeDispose();
     void resetState(unsigned state, bool sub=false);
-    inline bool queryStateChanges() const { return connection.queryStateChanges(); }
+    inline bool queryStateChanges() const { return serverId && connection.queryStateChanges(); }
     inline unsigned queryState() { return state; }
     void mergeState(unsigned _state) { setState(state | _state); }
     void clearState(unsigned _state) { setState(state & ~_state); }