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.raidb2;
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 RAIDb2PassThroughScheduler 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 RAIDb2PassThroughScheduler(VirtualDatabase vdb) {
069: super (RAIDbLevels.RAIDb2, ParsingGranularities.NO_PARSING);
070: }
071:
072: //
073: // Request Handling
074: //
075:
076: /**
077: * @see org.continuent.sequoia.controller.scheduler.AbstractScheduler#scheduleNonSuspendedReadRequest(SelectRequest)
078: */
079: public final void scheduleNonSuspendedReadRequest(
080: SelectRequest request) {
081: }
082:
083: /**
084: * @see org.continuent.sequoia.controller.scheduler.AbstractScheduler#readCompletedNotify(SelectRequest)
085: */
086: public final void readCompletedNotify(SelectRequest request) {
087: }
088:
089: /**
090: * @see org.continuent.sequoia.controller.scheduler.AbstractScheduler#scheduleWriteRequest(AbstractWriteRequest)
091: */
092: public final void scheduleNonSuspendedWriteRequest(
093: AbstractWriteRequest request) {
094: }
095:
096: /**
097: * @see org.continuent.sequoia.controller.scheduler.AbstractScheduler#notifyWriteCompleted(AbstractWriteRequest)
098: */
099: public final void notifyWriteCompleted(AbstractWriteRequest request) {
100: }
101:
102: /**
103: * @see org.continuent.sequoia.controller.scheduler.AbstractScheduler#scheduleNonSuspendedStoredProcedure(org.continuent.sequoia.controller.requests.StoredProcedure)
104: */
105: public final void scheduleNonSuspendedStoredProcedure(
106: StoredProcedure proc) throws SQLException,
107: RollbackException {
108: }
109:
110: /**
111: * @see org.continuent.sequoia.controller.scheduler.AbstractScheduler#notifyStoredProcedureCompleted(org.continuent.sequoia.controller.requests.StoredProcedure)
112: */
113: public final void notifyStoredProcedureCompleted(
114: StoredProcedure proc) {
115: }
116:
117: //
118: // Transaction Management
119: //
120:
121: /**
122: * @see org.continuent.sequoia.controller.scheduler.AbstractScheduler#commitTransaction(long)
123: */
124: protected final void commitTransaction(long transactionId) {
125: }
126:
127: /**
128: * @see org.continuent.sequoia.controller.scheduler.AbstractScheduler#rollbackTransaction(long)
129: */
130: protected final void rollbackTransaction(long transactionId) {
131: }
132:
133: /**
134: * @see org.continuent.sequoia.controller.scheduler.AbstractScheduler#rollbackTransaction(long,
135: * String)
136: */
137: protected final void rollbackTransaction(long transactionId,
138: String savepointName) {
139: }
140:
141: /**
142: * @see org.continuent.sequoia.controller.scheduler.AbstractScheduler#setSavepointTransaction(long,
143: * String)
144: */
145: protected final void setSavepointTransaction(long transactionId,
146: String name) {
147: }
148:
149: /**
150: * @see org.continuent.sequoia.controller.scheduler.AbstractScheduler#releaseSavepointTransaction(long,
151: * String)
152: */
153: protected final void releaseSavepointTransaction(
154: long transactionId, String name) {
155: }
156:
157: /**
158: * @see org.continuent.sequoia.controller.scheduler.AbstractScheduler#getXmlImpl()
159: */
160: public String getXmlImpl() {
161: StringBuffer info = new StringBuffer();
162: info.append("<" + DatabasesXmlTags.ELT_RAIDb2Scheduler + " "
163: + DatabasesXmlTags.ATT_level + "=\""
164: + DatabasesXmlTags.VAL_passThrough + "\"/>");
165: info.append(System.getProperty("line.separator"));
166: return info.toString();
167: }
168: }
|