var p = ignite.affinity(“CACHENAME”).partitions();

> On 25 Aug 2022, at 13:10, wkhapy...@gmail.com wrote:
> 
>> affinityCallAsync 
>> <https://ignite.apache.org/releases/latest/javadoc/org/apache/ignite/IgniteCompute.html#affinityCallAsync-java.util.Collection-int-org.apache.ignite.lang.IgniteCallable->
>>  need  PartitionId,how can i get all  PartitionIds?
>> 
> Or the number of partitions is 1024
> 
> wkhapy...@gmail.com <mailto:wkhapy...@gmail.com>
>  
> From: wkhapy...@gmail.com <mailto:wkhapy...@gmail.com>
> Date: 2022-08-25 19:11
> To: user <mailto:user@ignite.apache.org>
> Subject: Re: Re: count cache key number
>> affinityCallAsync 
>> <https://ignite.apache.org/releases/latest/javadoc/org/apache/ignite/IgniteCompute.html#affinityCallAsync-java.util.Collection-int-org.apache.ignite.lang.IgniteCallable->
>>  need  PartitionId,how can i get all  PartitionIds
> 
> 
> wkhapy...@gmail.com
>  
> From: Stephen Darlington <mailto:stephen.darling...@gridgain.com>
> Date: 2022-08-25 18:55
> To: user <mailto:user@ignite.apache.org>
> Subject: Re: count cache key number
> You’d need to use a thick client to call that API.
> 
>> On 25 Aug 2022, at 10:39, wkhapy...@gmail.com <mailto:wkhapy...@gmail.com> 
>> wrote:
>> 
>> sorry,i find igniteClient.compute() has no affinityCallAsync 
>> <https://ignite.apache.org/releases/latest/javadoc/org/apache/ignite/IgniteCompute.html#affinityCallAsync-java.util.Collection-int-org.apache.ignite.lang.IgniteCallable->
>>  method ,does igniteClient can call affinityCallAsync 
>> <https://ignite.apache.org/releases/latest/javadoc/org/apache/ignite/IgniteCompute.html#affinityCallAsync-java.util.Collection-int-org.apache.ignite.lang.IgniteCallable->
>> 
>> wkhapy...@gmail.com <mailto:wkhapy...@gmail.com>
>>  
>> From: Stephen Darlington <mailto:stephen.darling...@gridgain.com>
>> Date: 2022-08-24 20:27
>> To: user <mailto:user@ignite.apache.org>
>> Subject: Re: count cache key number
>> There are a number of ways to tackle this. 
>> 
>> If your cache split the key into distinct fields rather that a concatenated 
>> string, you could SQL-enable your cache and get your count as a simple 
>> SELECT statement.
>> 
>> Alternatively, there’s an affinity compute task that takes a partition 
>> (affinityCallAsync 
>> <https://ignite.apache.org/releases/latest/javadoc/org/apache/ignite/IgniteCompute.html#affinityCallAsync-java.util.Collection-int-org.apache.ignite.lang.IgniteCallable->).
>>  If you use that and a ScanQuery that fetches records from a specific 
>> partition (ScanQuery 
>> <https://ignite.apache.org/releases/latest/javadoc/org/apache/ignite/cache/query/ScanQuery.html#ScanQuery-int->),
>>  you’ll get something like a map-reduce. (You could also use the map-reduce 
>> API, but an affinity call is probably easier.)
>> 
>>> On 24 Aug 2022, at 11:59, wkhapy...@gmail.com <mailto:wkhapy...@gmail.com> 
>>> wrote:
>>> 
>>> hi
>>> do I pass cache in distribute compute than use cache scan ,that faster than 
>>> I use a cache scan in client api.
>>> 
>>> ---Original---
>>> From: "wkhapy...@gmail.com 
>>> <mailto:wkhapy...@gmail.com>"<wkhapy...@gmail.com 
>>> <mailto:wkhapy...@gmail.com>>
>>> Date: Wed, Aug 24, 2022 17:06 PM
>>> To: "user"<user@ignite.apache.org <mailto:user@ignite.apache.org>>;
>>> Subject: count cache key number
>>> 
>>> Hi,
>>>     I have a cache ,it's key like 
>>>    "mobile:140000"
>>>    "mobile:140001",
>>>     "address:test1",
>>>     "address:test2",
>>>     "address:test3"。
>>>    I want to count mobile number and address number。
>>>    address number is 3 and mobile number is 2。I see Ignite doc has 
>>> mapreduce job,but it seem not example iterator cache key。 is there any 
>>> method to iterator key in mapreduce job。Thank you very much
>>> 
>>> wkhapy...@gmail.com <mailto:wkhapy...@gmail.com>

Reply via email to