Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FLINK-8087] Decouple Slot from AllocatedSlot #5088

Closed

Conversation

tillrohrmann
Copy link
Contributor

What is the purpose of the change

This commit introduces the SlotContext which is an abstraction for the SimpleSlot
to obtain the relevant slot information to do the communication with the
TaskManager without relying on the AllocatedSlot which is now only used by the
SlotPool.

This PR is based on #5087.

Brief change log

  • Introduce SlotContext as simple abstraction for slot related information
  • Remove dependency of Slot on AllocatedSlot which is now only used internally by the SlotPool.
  • Introduce SimpleSlotContext which implements SlotContext and acts as the slot context for the SimpleSlot.

Does this pull request potentially affect one of the following parts:

  • Dependencies (does it add or upgrade a dependency): (no)
  • The public API, i.e., is any changed class annotated with @Public(Evolving): (no)
  • The serializers: (no)
  • The runtime per-record code paths (performance sensitive): (no)
  • Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Yarn/Mesos, ZooKeeper: (yes)
  • The S3 file system connector: (no)

Documentation

  • Does this pull request introduce a new feature? (no)
  • If yes, how is the feature documented? (not applicable)

CC: @GJL

tillrohrmann added a commit to tillrohrmann/flink that referenced this pull request Dec 1, 2017
This commit introduces the SlotContext which is an abstraction for the SimpleSlot
to obtain the relevant slot information to do the communication with the
TaskManager without relying on the AllocatedSlot which is now only used by the
SlotPool.

This closes apache#5088.
tillrohrmann added a commit to tillrohrmann/flink that referenced this pull request Dec 1, 2017
This commit introduces the SlotContext which is an abstraction for the SimpleSlot
to obtain the relevant slot information to do the communication with the
TaskManager without relying on the AllocatedSlot which is now only used by the
SlotPool.

This closes apache#5088.
tillrohrmann added a commit to tillrohrmann/flink that referenced this pull request Dec 3, 2017
This commit introduces the SlotContext which is an abstraction for the SimpleSlot
to obtain the relevant slot information to do the communication with the
TaskManager without relying on the AllocatedSlot which is now only used by the
SlotPool.

This closes apache#5088.
@@ -31,7 +30,7 @@
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

public class AllocatedSlotsTest {
public class SlotsTestImplContext {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was this renamed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a mistake. Will correct it.

* <p>
* This method should be removed once the new interface-based RPC abstraction is in place
*
* @return The actor gateway that can be used to send messages to the TaskManager.
Copy link
Member

@GJL GJL Dec 6, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fact that TaskManagerGateway can be an actor gateway is not something that is relevant for the reader of the Javadoc.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will remove it.

@@ -312,24 +312,36 @@ public void returnAllocatedSlot(Slot slot) {
// (1) do we have a slot available already?
SlotAndLocality slotFromPool = availableSlots.poll(resources, locationPreferences);
if (slotFromPool != null) {
SimpleSlot slot = createSimpleSlot(slotFromPool.slot(), slotFromPool.locality());
Copy link
Member

@GJL GJL Dec 6, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Method createSimpleSlot is no longer in use and can be deleted.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True. Will do it.

return true;
}
} else {
throw new RuntimeException("Unsupported logical slot type encounterd " + logicalSlot.getClass());
Copy link
Member

@GJL GJL Dec 6, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo: encounterd

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. Will correct it.

The cluster entrypoints start the ResourceManager with the web interface URL.
This URL is used to set the correct tracking URL in Yarn when registering the
Yarn application.

This closes apache#5128.
This commit introduces the SlotContext which is an abstraction for the SimpleSlot
to obtain the relevant slot information to do the communication with the
TaskManager without relying on the AllocatedSlot which is now only used by the
SlotPool.

This closes apache#5088.
@tillrohrmann
Copy link
Contributor Author

Thanks for the review @GJL. Merging this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants