Quadcap Embeddable Database

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 geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
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
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.