Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 150956

Re: Get data from a one member of Partitioned Region from Client

$
0
0

Hi

I tried that, but i am a bit confused now, i have 3 members, and region is replicated on all 3 members but when i execute this function like below, it runs on only 2 members, what am i missing

 

ClientCache clientCache = new ClientCacheFactory()

   .set("name", "Client")

       .set("cache-xml-file", "xml/ClientCache.xml")

        .create();

ResultCollector rc = FunctionService.onRegion(clientCache.getRegion("MyRegion"))

  .withCollector(new GetDataFromRegionResultCollector() )

  .execute("MyFunction");

 

 

My Function

public void execute(FunctionContext context) {

 

  RegionFunctionContext fc = (RegionFunctionContext) context;

  

  Region region = fc.getDataSet();

  

  Map formatRecordMap = new HashMap();

  

  List keys = new ArrayList();

 

  String id = CacheFactory.getAnyInstance().getDistributedSystem().getDistributedMember().getId();

  logger.debug("number of keys in region {} {} on member {} " , keys.size(), region.getName(), id);

}


Viewing all articles
Browse latest Browse all 150956

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>