org.objectweb.cjdbc.controller.scheduler.raidb1
Class RAIDb1QueryLevelScheduler

java.lang.Object
  extended byorg.objectweb.cjdbc.controller.scheduler.AbstractScheduler
      extended byorg.objectweb.cjdbc.controller.scheduler.raidb1.RAIDb1QueryLevelScheduler

public class RAIDb1QueryLevelScheduler
extends AbstractScheduler

This scheduler provides query level scheduling for RAIDb-1 controllers. Reads can execute in parallel until a write comes in. Then the write waits for the completion of the reads. Any new read is stacked after the write and they are released together when the write has completed its execution.

Version:
1.0
Author:
Emmanuel Cecchet

Field Summary
private  java.lang.String groupName
           
private  int pendingReads
           
private  java.lang.Object readSync
           
private  int requestId
           
private  java.lang.Object writeSync
           
 
Fields inherited from class org.objectweb.cjdbc.controller.scheduler.AbstractScheduler
logger, needSQLMacroHandling, parsingGranularity, raidbLevel
 
Constructor Summary
RAIDb1QueryLevelScheduler()
          Creates a new Query Level Scheduler
RAIDb1QueryLevelScheduler(java.lang.String groupName)
          Creates a new Distributed Query Level Scheduler belonging to the specified group.
 
Method Summary
protected  void commitTransaction(int transactionId)
          Commit a transaction given its id.
 java.lang.String getInformation()
          Get information about the Request Scheduler
 java.lang.String getXmlInformation()
          Get information about the Request Scheduler in xml format
 void notifyWriteCompleted(AbstractWriteRequest request)
          Notify the completion of a write statement.
 void readCompleted(SelectRequest request)
          Notify the completion of a read statement.
protected  void rollbackTransaction(int transactionId)
          Rollback a transaction given its id.
 void scheduleNonSuspendedWriteRequest(AbstractWriteRequest request)
          Additionally to scheduling the request, this method replaces the SQL Date macros such as now() with the current date.
 void scheduleReadRequest(SelectRequest request)
          Additionally to scheduling the request, this method replaces the SQL Date macros such as now() with the current date.
 
Methods inherited from class org.objectweb.cjdbc.controller.scheduler.AbstractScheduler
begin, beginCompleted, commit, commitCompleted, getParsingGranularity, getPendingWrites, getRAIDbLevel, handleSQLMacros, hasSQLMacros, mergeDatabaseSchema, resumeNewTransactions, resumeWrites, rollback, rollbackCompleted, scheduleReadRequest, scheduleWriteRequest, setDatabaseSchema, setParsingGranularity, setRAIDbLevel, suspendNewTransactionsForCheckpoint, suspendWrites, writeCompleted
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

requestId

private int requestId

groupName

private java.lang.String groupName

pendingReads

private int pendingReads

readSync

private java.lang.Object readSync

writeSync

private java.lang.Object writeSync
Constructor Detail

RAIDb1QueryLevelScheduler

public RAIDb1QueryLevelScheduler()
Creates a new Query Level Scheduler


RAIDb1QueryLevelScheduler

public RAIDb1QueryLevelScheduler(java.lang.String groupName)
                          throws java.sql.SQLException
Creates a new Distributed Query Level Scheduler belonging to the specified group.

Parameters:
groupName - the multicast group name this scheduler belongs to
Throws:
java.sql.SQLException - if an error occurs
Method Detail

scheduleReadRequest

public void scheduleReadRequest(SelectRequest request)
                         throws java.sql.SQLException
Additionally to scheduling the request, this method replaces the SQL Date macros such as now() with the current date.

Specified by:
scheduleReadRequest in class AbstractScheduler
Parameters:
request - Select request to schedule (SQL macros are already handled if needed)
Throws:
java.sql.SQLException - if a timeout occurs
See Also:
AbstractScheduler.scheduleReadRequest(SelectRequest)

readCompleted

public final void readCompleted(SelectRequest request)
Description copied from class: AbstractScheduler
Notify the completion of a read statement.

Specified by:
readCompleted in class AbstractScheduler
Parameters:
request - the completed request
See Also:
AbstractScheduler.readCompleted(SelectRequest)

scheduleNonSuspendedWriteRequest

public void scheduleNonSuspendedWriteRequest(AbstractWriteRequest request)
                                      throws java.sql.SQLException
Additionally to scheduling the request, this method replaces the SQL Date macros such as now() with the current date.

Specified by:
scheduleNonSuspendedWriteRequest in class AbstractScheduler
Parameters:
request - Write request to schedule (SQL macros are already handled if needed)
Throws:
java.sql.SQLException - if a timeout occurs
See Also:
AbstractScheduler.scheduleWriteRequest(AbstractWriteRequest)

notifyWriteCompleted

public final void notifyWriteCompleted(AbstractWriteRequest request)
Description copied from class: AbstractScheduler
Notify the completion of a write statement. This method does not need to be synchronized, it is enforced by the caller.

Specified by:
notifyWriteCompleted in class AbstractScheduler
Parameters:
request - the completed request
See Also:
AbstractScheduler.notifyWriteCompleted(AbstractWriteRequest)

commitTransaction

protected final void commitTransaction(int transactionId)
Description copied from class: AbstractScheduler
Commit a transaction given its id.

Specified by:
commitTransaction in class AbstractScheduler
Parameters:
transactionId - the transaction id
See Also:
AbstractScheduler.commitTransaction(int)

rollbackTransaction

protected final void rollbackTransaction(int transactionId)
Description copied from class: AbstractScheduler
Rollback a transaction given its id.

Specified by:
rollbackTransaction in class AbstractScheduler
Parameters:
transactionId - the transaction id
See Also:
AbstractScheduler.rollbackTransaction(int)

getInformation

public java.lang.String getInformation()
Description copied from class: AbstractScheduler
Get information about the Request Scheduler

Specified by:
getInformation in class AbstractScheduler
Returns:
String containing information
See Also:
AbstractScheduler.getInformation()

getXmlInformation

public java.lang.String getXmlInformation()
Description copied from class: AbstractScheduler
Get information about the Request Scheduler in xml format

Specified by:
getXmlInformation in class AbstractScheduler
Returns:
String containing information in xml
See Also:
AbstractScheduler.getXmlInformation()


Copyright © 2002, 2003 - ObjectWeb Consortium - All Rights Reserved.