flink-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Attila BernĂ¡th <bernath.at...@gmail.com>
Subject Re: partition identifier
Date Wed, 03 Dec 2014 15:12:31 GMT
Thank you, Stephan.
How to access the partition number from the RuntimeContext?

Attila

2014-12-03 15:53 GMT+01:00 Stephan Ewen <sewen@apache.org>:
> Hey!
>
> Here is a brief description how to use rich functions:
> http://flink.incubator.apache.org/docs/0.7-incubating/programming_guide.html#passing-functions-to-flink
>
> Greetings,
> Stephan
>
>
> On Wed, Dec 3, 2014 at 3:52 PM, Stephan Ewen <sewen@apache.org> wrote:
>>
>> Hi!
>>
>> You can always use the "rich" version of the function, for example the
>> "RichMapFunction". Inside that function, you can call "getRuntimeContext()",
>> which gives you access to many things, among them the partition number.
>>
>> Stephan
>>
>>
>> On Wed, Dec 3, 2014 at 3:49 PM, Attila BernĂ¡th <bernath.athos@gmail.com>
>> wrote:
>>>
>>> Dear Developers,
>>>
>>> Datasets are partitioned between machines. I wonder if there is a way
>>> to get some identifier of a partition. I see that the class
>>> HashPartition has a getPartitionNumber method, but I don't see how I
>>> could use this.
>>> (For example, I would like to see the partition identifier in a
>>> MapFunction, or in a MapPartitionFunction).
>>>
>>> Attila
>>
>>
>

Mime
View raw message