2.17.2: 2011-06-17

net.sf.basedb.clients.jobagent.slotmanager
Class RemoteSlotManager

java.lang.Object
  extended by net.sf.basedb.clients.jobagent.slotmanager.RemoteSlotManager
All Implemented Interfaces:
SlotManager

public class RemoteSlotManager
extends Object
implements SlotManager

Slot manager implementation that requests slots from another job agent. The other job agent should be using the MasterSlotManager. Communication between the job agents is made on the remote control port on the master job agent. Make sure that the master slot manager allows connections from this host by including it's ip address in the 'agent.remotecontrol' setting.

Configuration options for this slot manager:

Since:
2.16
Author:
Nicklas
Last modified
$Date: 2010-10-19 13:02:17 +0200 (Tue, 19 Oct 2010) $

Nested Class Summary
(package private) static class RemoteSlotManager.RemoteSlotPinger
          Task that is scheduled at regular intervals to send ping commands to the remote host.
 
Field Summary
private  Agent agent
           
private  int connectTimeout
           
private static Logger log
           
private  TimerTask pingerTask
           
private  String remoteHost
           
private  int remotePort
           
private  Map<String,Slot> remoteSlots
           
 
Constructor Summary
RemoteSlotManager()
           
 
Method Summary
 void close()
          This method is called when the job agent is shutting down.
 Slot getSlot(Job job)
          Get a slot for the specified job.
 void init(Agent agent)
          Initialize the slot manager.
(package private)  void pingRemoteSlots()
          Ping the the remote host with all active slots.
 void releaseSlot(Slot slot)
          Called by the job agent when the job has finished exeuting.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private static final Logger log

agent

private Agent agent

remoteHost

private String remoteHost

remotePort

private int remotePort

connectTimeout

private int connectTimeout

remoteSlots

private Map<String,Slot> remoteSlots

pingerTask

private TimerTask pingerTask
Constructor Detail

RemoteSlotManager

public RemoteSlotManager()
Method Detail

init

public void init(Agent agent)
Description copied from interface: SlotManager
Initialize the slot manager. This method is called once when the job agent is starting up. The slot manager may read configuration settings, and intialize local resources.

Specified by:
init in interface SlotManager
Parameters:
agent - The job agent

close

public void close()
Description copied from interface: SlotManager
This method is called when the job agent is shutting down. The slot manager should clean up any resources it is using.

Specified by:
close in interface SlotManager

getSlot

public Slot getSlot(Job job)
Description copied from interface: SlotManager
Get a slot for the specified job. If no free slot is available null is returned.

Specified by:
getSlot in interface SlotManager
Parameters:
job - The job that the job agent wants to execute
Returns:
A slot or null if no slot is available

releaseSlot

public void releaseSlot(Slot slot)
Description copied from interface: SlotManager
Called by the job agent when the job has finished exeuting.

Specified by:
releaseSlot in interface SlotManager
Parameters:
slot - The slot that was assigned to the job

pingRemoteSlots

void pingRemoteSlots()
Ping the the remote host with all active slots.


2.17.2: 2011-06-17