Lightweight Bartering Grid

lbg.peer.strategy.scheduling.consumption
Class ReliableMLConsumptionScheduling

java.lang.Object
  extended by lbg.peer.strategy.scheduling.consumption.CommonConsumptionScheduling
      extended by lbg.peer.strategy.scheduling.consumption.ReliableMLConsumptionScheduling
All Implemented Interfaces:
ConsumptionSchedulingPolicy

public class ReliableMLConsumptionScheduling
extends CommonConsumptionScheduling
implements ConsumptionSchedulingPolicy

Reliability-ranked use of Consumption Grants.

Author:
Cyril Briquet

Constructor Summary
ReliableMLConsumptionScheduling(Peer managed_peer, Scheduler scheduler)
           
 
Method Summary
protected  LocalQueueCursor getLocalQueueCursor()
          Local Queue Cursor accessor.
protected  Ranking rankSuppliers(ConsumptionGrantsContainer c_g, RequestContainer rc)
          Rank Suppliers.
 int scheduleConsumptionTasks()
          ConsumptionSchedulingPolicy implementation.
 java.lang.String toString()
           
 
Methods inherited from class lbg.peer.strategy.scheduling.consumption.CommonConsumptionScheduling
assertConsumptionGrantsAvailability, scheduleFirstConsumptionTask, scheduleNextConsumptionTask
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ReliableMLConsumptionScheduling

public ReliableMLConsumptionScheduling(Peer managed_peer,
                                       Scheduler scheduler)
                                throws GridException
Throws:
GridException
Method Detail

toString

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

scheduleConsumptionTasks

public int scheduleConsumptionTasks()
                             throws GridException
ConsumptionSchedulingPolicy implementation.

Note: this implementation updates the target Tasks scheduling contexts.

Specified by:
scheduleConsumptionTasks in interface ConsumptionSchedulingPolicy
Overrides:
scheduleConsumptionTasks in class CommonConsumptionScheduling
Returns:
number of successfully scheduled Consumption Tasks
Throws:
GridException - if an error occurs while using Consumption Grants to schedule Consumption Tasks

rankSuppliers

protected Ranking rankSuppliers(ConsumptionGrantsContainer c_g,
                                RequestContainer rc)
                         throws GridException
Rank Suppliers.

Specified by:
rankSuppliers in class CommonConsumptionScheduling
Parameters:
c_g - collected Consumption Grants container
rc - target Task container
Returns:
Suppliers Ranking
Throws:
GridException - if a problem occured while ranking Suppliers

getLocalQueueCursor

protected LocalQueueCursor getLocalQueueCursor()
Local Queue Cursor accessor.

Specified by:
getLocalQueueCursor in class CommonConsumptionScheduling
Returns:
Local Queue Cursor, or null if none has been defined

Lightweight Bartering Grid

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