Lightweight Bartering Grid

lbg.peer.core.scheduler
Class Scheduler

java.lang.Object
  extended by lbg.peer.core.scheduler.Scheduler
All Implemented Interfaces:
ISchedulerStats

public class Scheduler
extends java.lang.Object
implements ISchedulerStats

Schedules Local Tasks, both locally and as Consumption Tasks, and Supplying Tasks. Also Preempts Supplying Tasks as needed.

Author:
Cyril Briquet

Constructor Summary
Scheduler(Peer managed_peer, Negotiator negotiator, java.lang.String target_scheduling_local_policy, java.lang.String target_scheduling_running_preemption_policy, java.lang.String target_scheduling_waiting_preemption_policy, java.lang.String target_supplying_filtering_policy, java.lang.String target_scheduling_supplying_policy, java.lang.String target_scheduling_consumption_policy)
          Creates a new Scheduler.
 
Method Summary
 void accountSchedulerConsumptionDecision(long scheduled_tasks, double blacklisted_supplier_ratio)
           
 void accountSchedulerLocalDecision()
           
 void accountSchedulerPreemptionDecision()
           
 void accountSchedulerSupplyingDecision()
           
 boolean filterOutSupplyingTask(Task t)
          Indicates whether target Supplying Task should be filtered out, or may be safely queued.
 double getBlacklistedSupplierRatio()
           
 void preemptLocalResources(Task prioritary_task)
          Preempts some Supplying Tasks on Local Resources so as to enable the Local scheduling of target prioritary Local Task.
 void preemptWaitingSupplyingTasks()
          Preempts some waiting Supplying Tasks.
 void schedule(SchedulerControlFlags ctrl_flags)
          Activates scheduling of Local, Supplying and Consumption Tasks following target scheduling control flags.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Scheduler

public Scheduler(Peer managed_peer,
                 Negotiator negotiator,
                 java.lang.String target_scheduling_local_policy,
                 java.lang.String target_scheduling_running_preemption_policy,
                 java.lang.String target_scheduling_waiting_preemption_policy,
                 java.lang.String target_supplying_filtering_policy,
                 java.lang.String target_scheduling_supplying_policy,
                 java.lang.String target_scheduling_consumption_policy)
          throws GridException
Creates a new Scheduler.

Parameters:
managed_peer - managed Peer
negotiator - Negotiator of the managed Peer
target_scheduling_local_policy - selected Local scheduling policy
target_scheduling_running_preemption_policy - selected running Preemption policy
target_scheduling_waiting_preemption_policy - selected waiting Preemption policy
target_supplying_filtering_policy - selected Supplying filtering policy
target_scheduling_supplying_policy - selected Supplying scheduling policy
target_scheduling_consumption_policy - selected Consumption scheduling policy
Throws:
GridException
Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

schedule

public void schedule(SchedulerControlFlags ctrl_flags)
              throws GridException
Activates scheduling of Local, Supplying and Consumption Tasks following target scheduling control flags.

Also asks the Negotiator to generate Supplying Requests as needed.

Parameters:
ctrl_flags - target scheduling control flags
Throws:
GridException - if a parameter is illegal, or an error happens while scheduling

preemptLocalResources

public void preemptLocalResources(Task prioritary_task)
                           throws GridException
Preempts some Supplying Tasks on Local Resources so as to enable the Local scheduling of target prioritary Local Task.

Parameters:
prioritary_task - target prioritary Local Task
Throws:
GridException - if a parameter is illegal, or an error happens while preempting

preemptWaitingSupplyingTasks

public void preemptWaitingSupplyingTasks()
                                  throws GridException
Preempts some waiting Supplying Tasks.

Throws:
GridException

filterOutSupplyingTask

public boolean filterOutSupplyingTask(Task t)
                               throws GridException
Indicates whether target Supplying Task should be filtered out, or may be safely queued.

Returns:
true if target Supplying Task should be filtered out, false it it can be accepted
Throws:
GridException

accountSchedulerLocalDecision

public void accountSchedulerLocalDecision()

accountSchedulerPreemptionDecision

public void accountSchedulerPreemptionDecision()

accountSchedulerConsumptionDecision

public void accountSchedulerConsumptionDecision(long scheduled_tasks,
                                                double blacklisted_supplier_ratio)
                                         throws GridException
Throws:
GridException

accountSchedulerSupplyingDecision

public void accountSchedulerSupplyingDecision()

getBlacklistedSupplierRatio

public double getBlacklistedSupplierRatio()
Specified by:
getBlacklistedSupplierRatio in interface ISchedulerStats

Lightweight Bartering Grid

Copyright (c) 2005-2008, Cyril Briquet, parts Xavier Dalem.