Hello Ufuk,

thank you very much for the answer. You helped me to bring a great deal of context into the problem :).

I have one final question: What is a good indicator that the transfer of data contained in a single ResultPartition is finished? Is there any? Or can the amount of retrieved data be retrieved from the consumer?

So far the only indicator I could come up with is the release of the ResultPartition or the state change to "FINISHED" of the task. However, as far as I understand the assigned resources will only be released after all ResultPartitions are transferred and the task is finished, so that seems to be a rather impractical indicator for the end of the data exchange.

Sorry for the late reply.

Cheers,
Niklas

On 13.07.2015 15:04, Ufuk Celebi wrote:
Hey Niklas,

there is also this Wiki entry: 
https://cwiki.apache.org/confluence/display/FLINK/Data+exchange+between+tasks

On 09 Jul 2015, at 21:32, Niklas Semmler <nsemm...@inet.tu-berlin.de> wrote:

1. What does the number of ResultSubpartition instances in the ResultPartition 
correspond to? Is one assigned to each consuming task? If so, how can I find 
for each ResultSubpartition the corresponding Task, Slot or similar? If not how 
is decided which piece of the data is routed to which consuming task?

Yes, for each consuming task. The wiring depends on the DistributionPattern and 
the parallelism of the producing and consuming operator. You can look into the 
ExecutionGraph to see how the wiring works (see connect* methods in 
ExecutionVertex class). Each subpartition corresponds to an ExecutionEdge, 
which connects two ExecutionVertex instances, which is an abstraction for tasks 
at runtime. This is essentially also where the routing is set.

Currently there is no way to get from the subpartition to the corresponding 
task. You would have to look into the places where the instances are created 
and pass the reference. The RuntimeEnvironmenet or Task class create these 
instances when a new task is submitted to a task manager.


2. What defines the number of Buffer instances per ResultSubpartition? Does one 
Buffer correspond to exactly one serialized Record? Is a Record the single 
output of an operator, are there multiple records per operator, or
does it differ depending on the operator?

The number of produced buffers depends on the data the corresponding 
operator/user function produces. Each produced record is serialized into a 
buffer. It can span multiple buffers depending on the record size.

There can be zero or more records per produced partition. (There will always be 
at least a single buffer containing an end-of-partition event per partition 
though.)

3. Or are the Buffers defined in a completely different manner? In that case, 
could you give me a pointer to understand how Buffer instances are used?

The buffers is a wrapper for a MemorySegment with a reference to a buffer pool, 
which owns the buffer. Buffers are recycled after they have been consumed (e.g. 
after being written to the TCP channel or by the user code).


Feel free to ask further questions or give feedback if you encounter anything 
you find weird. :-)

– Ufuk


--
PhD Student / Research Assistant
INET, TU Berlin
Room 4.029
Marchstr 23
10587 Berlin
Tel: +49 30 314 78752

Reply via email to