Results 1 to 4 of 4
  1. #1
    Senior Member
    Join Date
    Jul 2013
    Posts
    39

    Remove field in MERG mode

    Hi,

    My scenario is: item A in MERGE mode. At the begining, my .NET adapter updates item A with 3 fields: f1, f2, f3. Now, I just want to update 2 fields only: f1 & f2. Is there any way to remove field f3 at LS server? My concern is to save server memory and reduce size of snapshot data for new client.

    Thanks,
    Last edited by tvhnet2013; October 23rd, 2013 at 04:15 AM.

  2. #2
    Administrator
    Join Date
    Feb 2012
    Location
    Milano
    Posts
    538
    Hi tvhnet2013,

    I confirm that you can not remove a field from the hash map of an item inside the Lightstreamer server.

    However, in order to achieve the following goals: saving internal memory for the server, and saving bandwidth used on the network to send the snapshot values, you could clear the value of the 'f3' field (you could pass null or empty string or some other appropriate applicative value).

    So, your second update should be something like this:
    Code:
    update.Add("f1", value1);
    update.Add("f1", value2);
    update.Add("f3", ""); 
    // alternatively
    // update.Add("f3", null); 
    
    listener.Update("A", update, false);

  3. #3
    Senior Member
    Join Date
    Jul 2013
    Posts
    39
    I want to understand more deeply about LS optimization mechanism in sending MERGE snapshot to client.

    If I update null value to 'f3' field, when sending snapshot, does LS send full pairs of <fieldname, value> to client (as your example: f1:value1, f2:value2, f3:null) or just has-value pairs (f1:value1, f2:value2) and ignore null-value field?

  4. #4
    Administrator
    Join Date
    Feb 2012
    Location
    Milano
    Posts
    538
    For a subscription in MERGE mode the snapshot is intended as the list of fields that define the complete state of the item.
    In your example if the schema requested by the client is [f1, f2, f3] the values expected for the snapshot are [v1, v2, null] (I confirm you that for internal protocol optimization a null field involves a minimum consumption in size).

    The MERGE mode ensures that for each subsequent update that does not involve f3 field the compression algorithm causes that nothing is sent for f3 field (as well as for every other unchanged field).

 

 

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT +1. The time now is 03:06 PM.