Appfabric 1.1后写方法 - 按顺序将数据传递给提供者 [英] Appfabric 1.1 Write behind approach - Passing data to the provider sequentially

查看:75
本文介绍了Appfabric 1.1后写方法 - 按顺序将数据传递给提供者的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我打算使用appfabric 1.1写入功能。我有一个类似下面的场景。

I am planning to use the appfabric 1.1 write behind functionalty . I have a scenario like below .

我们有一个sharepoint列表作为数据存储区。我们对sharepoint列表行进行了顺序更新,即:对于每个更新,将创建行版本。我们计划首先更新缓存,然后通过
后写提供商异步更新共享点列表。如果我们以毫秒延迟进行单行更新,即:两个用户同时更新列表,以便列表将更新为毫秒延迟 。对于这种情况,我们要做的是将
项作为数据对象添加到缓存中,然后DataCacheStoreProvider将获取这些对象并更新sharepoint。为实现此目的,我们将两次插入缓存。对于单行的每次更新都有一次(这发生在
毫秒延迟) 。    现在,Appfabric主机中的DataStoreProvider覆盖方法将被触发。这里我们得到一个Dictionary对象,它包含在缓存中更新的缓存键集合。我所面临的问题是,字典中的项目顺序不是顺序的。在我的情况下,字典中的第一个项目(第0个索引元素)可能是第二个更新到缓存的行。在这种情况下,数据存储区将使用第二个更新的元素
更新到不正确的缓存。我们是否在powershell中设置了任何设置以使此集合顺序排列  ..对此的任何帮助将非常感激..

We have a sharepoint list as a datastore . We have sequential updates to the sharepoint lists rows ie: for each updates a row version will be created . This we are planning to update the cache first and then asynchrously update the sharepoint list through write-behind provider. If we have a single row update in millisecond delay ie: Two users are updating the list at the same time so that list will be updated with millisecond delay . For this scenario what we do is we will be adding the items to the cache as datarow objects then the DataCacheStoreProvider will take those Objects and update the sharepoint . For achieving this  we will be inserting cache twice . one for each update to the single row (This happends in millisecond delay) .    Now the DataStoreProvider overrridden method in the Appfabric hosts fires . Here we are getting a Dictionary Object which contains a collection of cache Keys which are updated in the cache . The problem which i am facing is that the order of items in the Dictionary is not sequential . In my case the first item(the 0 th index element) in the Dictionary may be second updated row to the cache . In this case datastore will be updated with second updated element to the cache which is not correct . Do we have any setting in the powershell to make this collection sequential  .. Any help on this will be really appreciated ..

提前致谢

Shobin

推荐答案

默认的IDictionary实现不维护原始操作的顺序。我们也不会保留原始的缓存操作顺序,因为在
分布式环境中,多个缓存主机之间没有定义排序。订单仅定义为对同一(缓存名称,区域,密钥)条目的多次访问。如果
必须依赖于操作顺序,我建议在写一行时在有效负载中发送时间。 实际上,使用  cache.Put(Key,值:new Tuple< object,DateTime>(actualValue,DateTime.UtcNow))和((Tuple< object,
DateTime>)cache.Get(Key))。Item1。

The default IDictionary implementation does not maintain the sequence of original operations. Nor do we retain at any point the original sequence of cache operations, considering ordering is not defined across multiple cache hosts in a distributed environment. Order is defined only for multiple accesses to the same (cache name, region, key) entry. If you must take a dependency on the order of operations, I'd recommend sending the time in the payload when writing a row. Essentially, use cache.Put(Key, Value: new Tuple<object, DateTime>(actualValue, DateTime.UtcNow)) and ((Tuple<object, DateTime>)cache.Get(Key)).Item1.

DataCacheItemVersion(在DataCacheItem :: Version字段中找到)定义IComparable< DataCacheItemVersion>此订单是针对单个区域/密钥中的多次访问定义的。 在跨区域比较项目版本时,此订单无效。

DataCacheItemVersion (found in the field DataCacheItem::Version) defines IComparable<DataCacheItemVersion> and this order is defined for multiple accesses in a single region/key. This will not work when comparing item versions across regions.


这篇关于Appfabric 1.1后写方法 - 按顺序将数据传递给提供者的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆