KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > continuent > sequoia > controller > recoverylog > HSQLEmbeddedRecoveryLog


1 /**
2  * Sequoia: Database clustering technology.
3  * Copyright (C) 2006 Continuent, Inc.
4  * Contact: sequoia@continuent.org
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  *
18  * Initial developer(s): Emmanuel Cecchet.
19  * Contributor(s): ______________________.
20  */

21
22 package org.continuent.sequoia.controller.recoverylog;
23
24 import org.continuent.sequoia.common.xml.DatabasesXmlTags;
25
26 /**
27  * This class defines a HSQLEmbeddedRecoveryLog
28  *
29  * @author <a HREF="mailto:emmanuel.cecchet@continuent.com">Emmanuel Cecchet</a>
30  * @version 1.0
31  */

32 public class HSQLEmbeddedRecoveryLog extends RecoveryLog
33 {
34   private String JavaDoc dataPath;
35
36   /**
37    * Creates a new <code>HSQLEmbeddedRecoveryLog</code> object
38    *
39    * @param dataPath path to store HSQL data
40    */

41   public HSQLEmbeddedRecoveryLog(String JavaDoc dataPath)
42   {
43     super(null, "org.hsqldb.jdbcDriver", "jdbc:hsqldb:file:" + dataPath
44         + ";hsqldb.cache_file_scale=8;shutdown=true", "SA", "", 60, 10);
45     this.setLogTableCreateStatement("CREATE CACHED TABLE", "RECOVERY",
46         "BIGINT NOT NULL", "VARCHAR NOT NULL", "sql", "VARCHAR NOT NULL",
47         "VARCHAR", "CHAR(1) NOT NULL", "BIGINT NOT NULL", "BIGINT", "BIGINT",
48         "INT", ",PRIMARY KEY (log_id)");
49     this.setCheckpointTableCreateStatement("CREATE CACHED TABLE", "CHECKPOINT",
50         "VARCHAR NOT NULL", "BIGINT", ",PRIMARY KEY (name)");
51     this.setBackendTableCreateStatement("CREATE CACHED TABLE", "BACKEND",
52         "VARCHAR NOT NULL", "VARCHAR NOT NULL", "INTEGER", "VARCHAR NOT NULL",
53         "");
54     this.setDumpTableCreateStatement("CREATE CACHED TABLE", "DUMP",
55         "VARCHAR NOT NULL", "TIMESTAMP", "VARCHAR NOT NULL",
56         "VARCHAR NOT NULL", "VARCHAR NOT NULL", "VARCHAR NOT NULL", "tables",
57         "VARCHAR NOT NULL", "");
58     this.dataPath = dataPath;
59   }
60
61   /**
62    * {@inheritDoc}
63    *
64    * @see org.continuent.sequoia.controller.recoverylog.RecoveryLog#getXml()
65    */

66   public String JavaDoc getXml()
67   {
68     return "<" + DatabasesXmlTags.ELT_EmbeddedRecoveryLog + " "
69         + DatabasesXmlTags.ATT_dataPath + "=" + dataPath + ">";
70   }
71
72 }
73
Popular Tags