How to place data in In Memory Data Grid to access in the project?

admin

Administrator
#1
The primary way of populating the in-memory data grid with your data is to use ScaleOut API (we provide API support for C#, Java and C/C++). The NamedCache.Add method efficiently adds a large collection of objects to the cache. To read more about it and see a C# code sample:
http://www.scaleoutsoftware.com/support/stateServer/soss_CacheAPIdoc/html/M_Soss_Client_NamedCache_Add_2.htm.
You can also use .NET’s Task Parallel Library to insert objects in parallel - this will take advantage of all of the CPU cores on the client system. The following code adds nCount of SampleObj objects to the grid:
Code:
            Parallel.For(0, nCount, i =>
            {
                try
                {
                    CreatePolicy pol = new CreatePolicy(TimeSpan.FromMinutes(30), true);
                    SampleObj obj = new SampleObj(i);

                    nc.Insert(i.ToString(), obj, pol, true, false);
                }
                catch (Exception ex)
                {
                    Console.WriteLine("Exception: {0}", ex.Message));
                }
            });
 
Top