Quadcap Embeddable Database

Home
Java Source Code / Java Documentation
1.6.0 JDK Core
2.6.0 JDK Modules
3.6.0 JDK Modules com.sun
4.6.0 JDK Modules com.sun.java
5.6.0 JDK Modules sun
6.6.0 JDK Platform
7.Ajax
8.Apache Harmony Java SE
9.Aspect oriented
10.Authentication Authorization
11.Blogger System
12.Build
13.Byte Code
14.Cache
15.Chart
16.Chat
17.Code Analyzer
18.Collaboration
19.Content Management System
20.Database Client
21.Database DBMS
22.Database JDBC Connection Pool
23.Database ORM
24.Development
25.EJB Server
26.ERP CRM Financial
27.ESB
28.Forum
29.Game
30.GIS
31.Graphic 3D
32.Graphic Library
33.Groupware
34.HTML Parser
35.IDE
36.IDE Eclipse
37.IDE Netbeans
38.Installer
39.Internationalization Localization
40.Inversion of Control
41.Issue Tracking
42.J2EE
43.J2ME
44.JBoss
45.JMS
46.JMX
47.Library
48.Mail Clients
49.Music
50.Natural Language Processing
51.Net
52.Parser
53.PDF
54.Portal
55.Profiler
56.Project Management
57.Report
58.RSS RDF
59.Rule Engine
60.Science
61.Scripting
62.Search Engine
63.Security
64.Sevlet Container
65.Source Control
66.Swing Library
67.Template Engine
68.Test Coverage
69.Testing
70.UML
71.Web Crawler
72.Web Framework
73.Web Mail
74.Web Server
75.Web Services
76.Web Services apache cxf 2.2.6
77.Web Services AXIS2
78.Wiki Engine
79.Workflow Engines
80.XML
81.XML UI
Java Source Code / Java Documentation  » Database DBMS » Quadcap Embeddable Database 
Quadcap Embeddable Database
License:
URL:http://www.quadcap.com/home.html
Description:
Package NameComment
com.quadcap.crypto A very lightweight crypto API, with implementations of RSA, AES (Rijndael), TEA, 256-bit TEA, and SHA1.
com.quadcap.io Useful InputStreams, OutputStreams, Readerss, and Writerss galore.
com.quadcap.io.dir This package defines an abstract directory access API which can be used to access directory structures in native filesystems or jar files.
com.quadcap.jdbc This package contains the implementation of the QED JDBC 2.0 Driver.
com.quadcap.jni Stuff that needs native code. (For debugging only.)
com.quadcap.sql SQL Database engine. Various design related information follows.

Tuples and Columns

public interface Tuple {
    public int numColumns();
    public Column getColumn(int i);
}

public interface Column {
    public String getName();
    public Type getType();
    public boolean isFixed();
    public int getOffset();
    public int getLength();
    public Enumeration getConstraints();
}

public interface Table extends Tuple {
    public int numRows();
    public Row getRow(int i);
    public Enumeration getConstraints();
    public Constraint getPrimaryKeyConstraint();
}

public interface Row extends Tuple {
    public Row(Tuple def, byte[] bytes);
}

public interface Index {
    public Tuple getBaseType();

    /**
     * Return an enumeration of the keys of this index, in order, starting
     * with the first index value not less than first
     */
    public Enumeration enumerate(TupleValue first);

    /**
     * Return an enumeration of the keys of this index, in reverse order,
     * starting with the first index value not greater than last
     */
    public Enumeration reverseEnumerate(TupleValue last);
}

public interface Type {
    public String getTypeName();
    public int compare(Type other);

    public void setBytes(byte[] buf, int offset, int cnt);
    public byte[] getBytes();

    public Object getObject();
    public void setObject(Object obj);
}


public interface Constraint {
    public Tuple get
}

public interface PrimaryKeyConstraint extends Constraint {
}

public interface ForeignKeyConstraint extends Constraint {
}

public interface UniqueConstraint extends Constraint {
}

Inheritance Tree for Tuple and Cursor

interface Tuple					// columns, qualifier	
  class TupleImpl

interface Cursor extends Tuple			// rows and movement
  abstract class CursorImpl extends TupleImpl implements Cursor
    class JoinCursor extends CursorImpl

interface Relation extends Tuple		// constraints, cursor mgmt
  class View extends TupleImpl implements Relation
  class Table extends TupleImpl implements Relation

Cursor
  CursorImpl
    Filter
      Aggregate
      Distinct
      GroupBy
      Having
      Predicate
    Index
    Items
    JoinCross
    JoinInner
    Merge
    OrderBy
    Static
    View

Table Expressions:
  Updatable
    SelectFromTable
  NonUpdatable
    JoinedTable
    MergeExpression
    VectorExpression (table value constructor)
  Possibly updatable
    SelectFromItem

TreeNode
  ClassOrInterfaceDef
    ClassDef
    interfaceDef
  Decl
    VariableDecl
    MethodDecl
    InnerClassDecl
    StaticBlockDecl
  Literal

Logging and recovery

Write-ahead logging
  Log entries:
    redo
    undo
    redo/undo
    CLR written when performing partial rollback
    begintransaction
    commit
    checkpoint

Recovery: redo, then undo
  Restore from last checkpoint.
  Redo all records from that point to the end of the log.
  Undo all loser transactions.

Checkpoint:
  Periodically, or at connection close, take checkpoint.
    Copy entire datafile
      Can optimize with 'modified pages' bitmap
    Compress log.
      Only save log records for pending uncommited transactions.

Join operations:

Break where clause down into "exp AND exp AND ..." form.
For each expression, classify it as one of:
  - table vs table (t1.fld == t2.fld)
  - table vs const (t1.fld == val)

All tables that don't appear in table vs table expressions go first in
the join order.

Tables that don't have any constant expressions go last in the join order.

All tables are joined using nested loops joins.  

Join over columns
  Natural (inner, left, right, full), Union
  Using : inner, left, right, full
Join on expression
  Cross
  On : inner, left, right, full

Stmt.execute(Session)
  • SelectStmt
  • StmtAddColumn
  • StmtAddConstraint
  • StmtAlterColumn
  • StmtCreateIndex
  • StmtCreateSchema
  • StmtCreateTable
  • StmtCreateView
  • StmtDelete
  • StmtDropConstraint
  • StmtDropIndex
  • StmtDropTable
  • StmtInsert
  • StmtNull
  • StmtUpdate
  • Table.insertRow
Session.doStep(LogStep)
  • AddColumn
  • AddConstraint
  • AddTable
  • AlterColumn
  • DeleteConstraint
  • DeleteRow
  • DropTable
  • InsertBlob
  • InsertRow
  • ModIndexEntry
  • UpdateRow
  • StmtCreateView
LogStep.redo(Session)
  • class View

Random stress testing

Dimensions
1. Number of tables
2. Number of columns
3. Datatypes
4. Field sizes
5. Integrity violations, statement rollback
6. Transaction rollback 
7. Views
8. Join, union, intersection, subquery,
com.quadcap.sql.file Implementation of a cached block/stream data store with write-ahead logging. Individual pages are accessed through an LRU cache. Subpage allocators implement smaller granularity allocations. Arbitrary size objects can accessesd as streams.
com.quadcap.sql.index Indexes in BlockFiles, implemented as B-trees, with logging.
com.quadcap.sql.io Serialization library for SQL objects, designed to be faster and more compact than standard Java serialization.
com.quadcap.sql.lock This package implements a read/write/intention lock manager on a hierarchical lock space.
com.quadcap.sql.meta Database metadata cursors for:
  • columns
  • cross-reference
  • indexes
  • primary keys
  • tables
  • table types
  • types
com.quadcap.sql.tools Some database loading tools:
  • SQL Loader
  • XML Dump
  • XML Load
com.quadcap.sql.types SQL datatypes and values, and operations.
com.quadcap.text Miscellaneous text utilities.
com.quadcap.text.sax Fast SAX Parser implementation.
com.quadcap.util Most-used general-purpose classes, Config, Debug, Util, etc.
com.quadcap.util.collections Interesting and useful collection classes:
com.quadcap.util.text General text manipulation utilities.
javax.concurrent
org.xml.sax
org.xml.sax.helpers
w_w__w___._j_ava___2__s.__c__o__m___ | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.