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: * Contact: sequoia@continuent.org
007: *
008: * Licensed under the Apache License, Version 2.0 (the "License");
009: * you may not use this file except in compliance with the License.
010: * You may obtain a copy of the License at
011: *
012: * http://www.apache.org/licenses/LICENSE-2.0
013: *
014: * Unless required by applicable law or agreed to in writing, software
015: * distributed under the License is distributed on an "AS IS" BASIS,
016: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
017: * See the License for the specific language governing permissions and
018: * limitations under the License.
019: *
020: * Initial developer(s): Emmanuel Cecchet.
021: * Contributor(s): Jean-Bernard van Zuylen.
022: */package org.continuent.sequoia.controller.scheduler.raidb0;
023:
024: import java.sql.SQLException;
025:
026: import org.continuent.sequoia.common.exceptions.RollbackException;
027: import org.continuent.sequoia.common.xml.DatabasesXmlTags;
028: import org.continuent.sequoia.controller.requestmanager.RAIDbLevels;
029: import org.continuent.sequoia.controller.requests.AbstractWriteRequest;
030: import org.continuent.sequoia.controller.requests.ParsingGranularities;
031: import org.continuent.sequoia.controller.requests.SelectRequest;
032: import org.continuent.sequoia.controller.requests.StoredProcedure;
033: import org.continuent.sequoia.controller.scheduler.AbstractScheduler;
034:
035: /**
036: * This scheduler provides scheduling for RAIDb-0 controllers. Read and write
037: * can occur in parallel, serializability being ensured by the load balancer.
038: *
039: * @author <a href="mailto:Emmanuel.Cecchet@inria.fr">Emmanuel Cecchet </a>
040: * @author <a href="mailto:jbvanzuylen@transwide.com">Jean-Bernard van Zuylen
041: * </a>
042: * @version 1.0
043: */
044: public class RAIDb0PassThroughLevelScheduler extends AbstractScheduler {
045:
046: //
047: // How the code is organized ?
048: //
049: // 1. Member variables
050: // 2. Constructor
051: // 3. Request handling
052: // 4. Transaction management
053: // 5. Debug/Monitoring
054: //
055:
056: /**
057: * Creates a new Single Database Scheduler
058: */
059: public RAIDb0PassThroughLevelScheduler() {
060: super (RAIDbLevels.RAIDb0, ParsingGranularities.NO_PARSING);
061: }
062:
063: //
064: // Request Handling
065: //
066:
067: /**
068: * @see org.continuent.sequoia.controller.scheduler.AbstractScheduler#scheduleNonSuspendedReadRequest(SelectRequest)
069: */
070: public final void scheduleNonSuspendedReadRequest(
071: SelectRequest request) {
072: }
073:
074: /**
075: * @see org.continuent.sequoia.controller.scheduler.AbstractScheduler#readCompletedNotify(SelectRequest)
076: */
077: public final void readCompletedNotify(SelectRequest request) {
078: }
079:
080: /**
081: * @see org.continuent.sequoia.controller.scheduler.AbstractScheduler#scheduleWriteRequest(AbstractWriteRequest)
082: */
083: public final void scheduleNonSuspendedWriteRequest(
084: AbstractWriteRequest request) {
085: }
086:
087: /**
088: * @see org.continuent.sequoia.controller.scheduler.AbstractScheduler#notifyWriteCompleted(AbstractWriteRequest)
089: */
090: public final void notifyWriteCompleted(AbstractWriteRequest request) {
091: }
092:
093: /**
094: * @see org.continuent.sequoia.controller.scheduler.AbstractScheduler#scheduleNonSuspendedStoredProcedure(org.continuent.sequoia.controller.requests.StoredProcedure)
095: */
096: public final void scheduleNonSuspendedStoredProcedure(
097: StoredProcedure proc) throws SQLException,
098: RollbackException {
099: }
100:
101: /**
102: * @see org.continuent.sequoia.controller.scheduler.AbstractScheduler#notifyStoredProcedureCompleted(org.continuent.sequoia.controller.requests.StoredProcedure)
103: */
104: public final void notifyStoredProcedureCompleted(
105: StoredProcedure proc) {
106: }
107:
108: //
109: // Transaction Management
110: //
111:
112: /**
113: * @see org.continuent.sequoia.controller.scheduler.AbstractScheduler#commitTransaction(long)
114: */
115: protected final void commitTransaction(long transactionId) {
116: }
117:
118: /**
119: * @see org.continuent.sequoia.controller.scheduler.AbstractScheduler#rollbackTransaction(long)
120: */
121: protected final void rollbackTransaction(long transactionId) {
122: }
123:
124: /**
125: * @see org.continuent.sequoia.controller.scheduler.AbstractScheduler#rollbackTransaction(long,
126: * String)
127: */
128: protected final void rollbackTransaction(long transactionId,
129: String savepointName) {
130: }
131:
132: /**
133: * @see org.continuent.sequoia.controller.scheduler.AbstractScheduler#setSavepointTransaction(long,
134: * String)
135: */
136: protected final void setSavepointTransaction(long transactionId,
137: String name) {
138: }
139:
140: /**
141: * @see org.continuent.sequoia.controller.scheduler.AbstractScheduler#releaseSavepointTransaction(long,
142: * String)
143: */
144: protected final void releaseSavepointTransaction(
145: long transactionId, String name) {
146: }
147:
148: //
149: // Debug/Monitoring
150: //
151: /**
152: * @see org.continuent.sequoia.controller.scheduler.AbstractScheduler#getXmlImpl()
153: */
154: public String getXmlImpl() {
155: StringBuffer info = new StringBuffer();
156: info.append("<" + DatabasesXmlTags.ELT_RAIDb0Scheduler + " "
157: + DatabasesXmlTags.ATT_level + "=\""
158: + DatabasesXmlTags.VAL_passThrough + "\"/>");
159: return info.toString();
160: }
161: }
|