Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can't read data back from MMF #78

Closed
unruledboy opened this issue Jul 25, 2017 · 1 comment
Closed

can't read data back from MMF #78

unruledboy opened this issue Jul 25, 2017 · 1 comment
Labels

Comments

@unruledboy
Copy link

Hi,

I used the sample code from your files : https://github.com/aumcode/nfx/blob/master/Source/Testing/Manual/WinFormsTest/PileForm.cs#L77-L84 and https://github.com/aumcode/nfx/tree/master/Source/NFX/ApplicationModel/Pile

I can add records to the MMF cache, but I couldn't find a way to get the data back, either with tA.Get(key) or tA.AsEnumerable(withValues: true).

      var cache = new LocalCache();
      var pile = new MMFPile(cache);//Pile owned by cache
      pile.DataDirectoryRoot = @"c:\temp\test";
      cache.Pile = pile;
      cache.Configure(null);
      cache.DefaultTableOptions = new TableOptions("*")
      {
        CollisionMode = CollisionMode.Durable
      };
      cache.Start();
      
      var tA = cache.GetOrCreateTable<int>("A");

      for (int i = 0; i < 10000; i++)
      {
        tA.Put(i, Person.MakeFake());
      }

      DisposableObject.DisposeAndNull(ref cache);

@unruledboy unruledboy changed the title reading data back from MMF can't read data back from MMF Jul 25, 2017
@itadapter
Copy link
Member

The LocalCache class does not use pile to store it's key buckets. You get your mmf pile back with data
but not the keys.
The MMF-backed cache is not a part of oss yet, what you can do for now - reload the keys back to local cache by enumerating through them using pile, but it will be slow depending on the number of object that you store. OR you can save all of the cache keys separately and load them up on startup which is also not automatic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants