Search code examples
c#.netgridgain

GridGain: Correct way to remove keys from a list


I am using the Append/Prepend functionality of the GridGain .Net client, is this the correct approach? And what's the recommended way of removing items from this list?

IGridClientData cache = client.Data("partitioned_tx");

cache.Put<string, long[]>("testlist", new long[] { 1L});
cache.Append<string, long[]>("testlist", new long[] { 2L});
cache.Prepend<string, long[]>("testlist", new long[] { 0L});

var testlist = cache.GetItem<string, System.Collections.ArrayList>("testlist");
long[] array = (long[])test.ToArray(typeof(long));

Solution

  • Starting with GridGain 6.2.0-rc2 you can store Lists of Portable Objects in cache directly without having to convert them to arrays.

    Some more information on Portable Objects is provided here: GridGain + .NET Client Connection Warnings / Dropouts