public class Instance extends Object
TaskManager
registered at a JobManager and ready to receive work.| Constructor and Description |
|---|
Instance(akka.actor.ActorRef taskManager,
InstanceConnectionInfo connectionInfo,
InstanceID id,
HardwareDescription resources,
int numberOfSlots)
Constructs an instance reflecting a registered TaskManager.
|
public Instance(akka.actor.ActorRef taskManager,
InstanceConnectionInfo connectionInfo,
InstanceID id,
HardwareDescription resources,
int numberOfSlots)
taskManager - The actor reference of the represented task manager.connectionInfo - The remote connection where the task manager receives requests.id - The id under which the taskManager is registered.resources - The resources available on the machine.numberOfSlots - The number of task slots offered by this taskManager.public InstanceID getId()
public HardwareDescription getResources()
public int getTotalNumberOfSlots()
public boolean isAlive()
public void markDead()
public long getLastHeartBeat()
public void reportHeartBeat()
public void setMetricsReport(byte[] lastMetricsReport)
public byte[] getLastMetricsReport()
public boolean isStillAlive(long now,
long cleanUpInterval)
n milliseconds
before the given timestamp now.now - The timestamp representing the current time.cleanUpInterval - The maximum time (in msecs) that the last heartbeat may lie in the past.public SimpleSlot allocateSimpleSlot(JobID jobID) throws InstanceDiedException
InstanceDiedExceptionpublic SimpleSlot allocateSimpleSlot(JobID jobID, AbstractID groupID) throws InstanceDiedException
InstanceDiedExceptionpublic SharedSlot allocateSharedSlot(JobID jobID, SlotSharingGroupAssignment sharingGroupAssignment, AbstractID groupID) throws InstanceDiedException
InstanceDiedExceptionpublic boolean returnAllocatedSlot(Slot slot)
public void cancelAndReleaseAllSlots()
public akka.actor.ActorRef getTaskManager()
public String getPath()
public InstanceConnectionInfo getInstanceConnectionInfo()
public int getNumberOfAvailableSlots()
public int getNumberOfAllocatedSlots()
public boolean hasResourcesAvailable()
public void setSlotAvailabilityListener(SlotAvailabilityListener slotAvailabilityListener)
public void removeSlotListener()
Copyright © 2014–2015 The Apache Software Foundation. All rights reserved.