001: /**
002: * Sequoia: Database clustering technology.
003: * Copyright (C) 2002-2004 French National Institute For Research In Computer
004: * Science And Control (INRIA).
005: * Copyright (C) 2005 AmicoSoft, Inc. dba Emic Networks
006: * Copyright (C) 2005-2006 Continuent, Inc.
007: * Contact: sequoia@continuent.org
008: *
009: * Licensed under the Apache License, Version 2.0 (the "License");
010: * you may not use this file except in compliance with the License.
011: * You may obtain a copy of the License at
012: *
013: * http://www.apache.org/licenses/LICENSE-2.0
014: *
015: * Unless required by applicable law or agreed to in writing, software
016: * distributed under the License is distributed on an "AS IS" BASIS,
017: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
018: * See the License for the specific language governing permissions and
019: * limitations under the License.
020: *
021: * Initial developer(s): Emmanuel Cecchet.
022: * Contributor(s): Jean-Bernard van Zuylen.
023: */package org.continuent.sequoia.controller.scheduler.raidb1;
024:
025: import java.sql.SQLException;
026:
027: import org.continuent.sequoia.common.exceptions.RollbackException;
028: import org.continuent.sequoia.common.xml.DatabasesXmlTags;
029: import org.continuent.sequoia.controller.requestmanager.RAIDbLevels;
030: import org.continuent.sequoia.controller.requests.AbstractWriteRequest;
031: import org.continuent.sequoia.controller.requests.ParsingGranularities;
032: import org.continuent.sequoia.controller.requests.SelectRequest;
033: import org.continuent.sequoia.controller.requests.StoredProcedure;
034: import org.continuent.sequoia.controller.scheduler.AbstractScheduler;
035: import org.continuent.sequoia.controller.virtualdatabase.VirtualDatabase;
036:
037: /**
038: * This scheduler provides pass through scheduling for RAIDb-1 controllers.
039: * Requests are only assigned a unique id and passed to the load balancer.
040: *
041: * @author <a href="mailto:Emmanuel.Cecchet@inria.fr">Emmanuel Cecchet </a>
042: * @author <a href="mailto:jbvanzuylen@transwide.com">Jean-Bernard van Zuylen
043: * </a>
044: * @version 1.0
045: */
046: public class RAIDb1PassThroughScheduler extends AbstractScheduler {
047:
048: //
049: // How the code is organized ?
050: //
051: // 1. Member variables
052: // 2. Constructor
053: // 3. Request handling
054: // 4. Transaction management
055: // 5. Debug/Monitoring
056: //
057:
058: //
059: // Constructor
060: //
061:
062: /**
063: * Creates a new Pass Through Scheduler that will set a new total order queue
064: * on the virtual database.
065: *
066: * @param vdb the virtual database we belong to
067: */
068: public RAIDb1PassThroughScheduler(VirtualDatabase vdb,
069: long waitForSuspendedTransactionsTimeout,
070: long waitForPersistentConnectionsTimeout) {
071: super (RAIDbLevels.RAIDb1, ParsingGranularities.NO_PARSING, vdb,
072: waitForSuspendedTransactionsTimeout,
073: waitForPersistentConnectionsTimeout);
074: }
075:
076: //
077: // Request Handling
078: //
079:
080: /**
081: * @see org.continuent.sequoia.controller.scheduler.AbstractScheduler#scheduleNonSuspendedReadRequest(SelectRequest)
082: */
083: public final void scheduleNonSuspendedReadRequest(
084: SelectRequest request) {
085: }
086:
087: /**
088: * @see org.continuent.sequoia.controller.scheduler.AbstractScheduler#readCompletedNotify(SelectRequest)
089: */
090: public final void readCompletedNotify(SelectRequest request) {
091: }
092:
093: /**
094: * @see org.continuent.sequoia.controller.scheduler.AbstractScheduler#scheduleWriteRequest(AbstractWriteRequest)
095: */
096: public final void scheduleNonSuspendedWriteRequest(
097: AbstractWriteRequest request) {
098: }
099:
100: /**
101: * @see org.continuent.sequoia.controller.scheduler.AbstractScheduler#notifyWriteCompleted(AbstractWriteRequest)
102: */
103: public final void notifyWriteCompleted(AbstractWriteRequest request) {
104: }
105:
106: /**
107: * @see org.continuent.sequoia.controller.scheduler.AbstractScheduler#scheduleNonSuspendedStoredProcedure(org.continuent.sequoia.controller.requests.StoredProcedure)
108: */
109: public final void scheduleNonSuspendedStoredProcedure(
110: StoredProcedure proc) throws SQLException,
111: RollbackException {
112: }
113:
114: /**
115: * @see org.continuent.sequoia.controller.scheduler.AbstractScheduler#notifyStoredProcedureCompleted(org.continuent.sequoia.controller.requests.StoredProcedure)
116: */
117: public final void notifyStoredProcedureCompleted(
118: StoredProcedure proc) {
119: }
120:
121: //
122: // Transaction Management
123: //
124:
125: /**
126: * @see org.continuent.sequoia.controller.scheduler.AbstractScheduler#commitTransaction(long)
127: */
128: protected final void commitTransaction(long transactionId) {
129: }
130:
131: /**
132: * @see org.continuent.sequoia.controller.scheduler.AbstractScheduler#rollbackTransaction(long)
133: */
134: protected final void rollbackTransaction(long transactionId) {
135: }
136:
137: /**
138: * @see org.continuent.sequoia.controller.scheduler.AbstractScheduler#rollbackTransaction(long,
139: * String)
140: */
141: protected final void rollbackTransaction(long transactionId,
142: String savepointName) {
143: }
144:
145: /**
146: * @see org.continuent.sequoia.controller.scheduler.AbstractScheduler#setSavepointTransaction(long,
147: * String)
148: */
149: protected final void setSavepointTransaction(long transactionId,
150: String name) {
151: }
152:
153: /**
154: * @see org.continuent.sequoia.controller.scheduler.AbstractScheduler#releaseSavepointTransaction(long,
155: * String)
156: */
157: protected final void releaseSavepointTransaction(
158: long transactionId, String name) {
159: }
160:
161: /**
162: * @see org.continuent.sequoia.controller.scheduler.AbstractScheduler#getXmlImpl()
163: */
164: public String getXmlImpl() {
165: return "<" + DatabasesXmlTags.ELT_RAIDb1Scheduler + " "
166: + DatabasesXmlTags.ATT_level + "=\""
167: + DatabasesXmlTags.VAL_passThrough + "\"/>";
168: }
169: }
|