Skip to content

BitMatrix is a Java-based relational database management system supporting schema definition, data manipulation, indexing, and querying for both in-memory and file-backed tables.

Notifications You must be signed in to change notification settings

r-siddiq/BitMatrix

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BitMatrix

BitMatrix is a Java-based relational database management system. It provides functionalities for creating tables with defined schemas, inserting, deleting, and looking up data. The system supports both in-memory and file-backed tables, along with indexing for faster data retrieval.

Project Structure

BitMatrix_extracted/
└── BitMatrix
    ├── .mvn
    │   └── wrapper
    │       └── maven-wrapper.properties
    ├── src
    │   ├── main
    │   │   └── java
    │   │       └── bitmatrix
    │   │           ├── resource
    │   │           │   ├── AndCondition.java
    │   │           │   ├── Condition.java
    │   │           │   ├── EqCondition.java
    │   │           │   ├── OrCondition.java
    │   │           │   └── SelectQuery.java
    │   │           ├── BitMap.java
    │   │           ├── BlockedFile.java
    │   │           ├── Constants.java
    │   │           ├── Index.java
    │   │           ├── ITable.java
    │   │           ├── IType.java
    │   │           ├── MainApplication.java
    │   │           ├── OrderedIndex.java
    │   │           ├── Schema.java
    │   │           ├── Table.java
    │   │           ├── TableHeap.java
    │   │           ├── Tuple.java
    │   │           ├── TypeInt.java
    │   │           └── TypeVarchar.java
    │   └── test
    │       └── java
    │           └── bitmatrix
    │               ├── IndexPerformance.java
    │               ├── IndexTableTest.java
    │               ├── IndexTest.java
    │               ├── JoinTest.java
    │               ├── ManyRowsTest.java
    │               ├── QueryTest.java
    │               ├── TableHeapTest.java
    │               ├── TableTest.java
    │               └── TupleTest.java
    ├── insertMany
    ├── mvnw
    ├── mvnw.cmd
    ├── pom.xml
    ├── rows1000
    └── test.db

Build & Run

This project is built using Apache Maven.

Prerequisites

  • Java Development Kit (JDK) version 17 or later.
  • Build system: Maven (optional)

Option A: Compile with javac (no build tool)

# from repo root
find . -name "*.java" > sources.txt
mkdir -p out
javac -d out @sources.txt
# run a main class (if present)
java -cp out bitmatrix.MainApplication

Option B: Maven

To build the project and run the tests, execute the following command in the root directory:

./mvnw clean install

Running the Application

The MainApplication class provides a simple demonstration of the database's features. To run it, execute the following command after building the project:

java -cp target/classes bitmatrix.MainApplication

Usage

This library provides a bit-matrix (boolean matrix backed by bits) with typical operations:

  • Set/clear/get bits
  • Row/column operations
  • Logical operations (AND/OR/XOR)
  • Transpose, population count, serialization

Explore classes under src/ for the API (e.g., BitMatrix, BitVector, and utilities).

Features

  • Schema Definition: Create tables with a defined schema, specifying column names, data types (integer and varchar), and primary keys.
  • Data Manipulation: Insert, delete, and look up data in tables.
  • In-Memory and File-Backed Tables: Choose between Table for in-memory operations and TableHeap for file-backed storage.
  • Indexing: Create indexes on integer columns to speed up data retrieval.
  • Querying: Perform select queries with conditions (e.g., equality, AND, OR) and projections.
  • Natural Joins: Join tables based on common column names.

Testing

The project includes a comprehensive suite of JUnit tests to ensure the correctness of the database's functionality. The tests cover various aspects of the system, including:

  • Tuple and schema creation.
  • Data insertion, deletion, and lookup.
  • Indexing.
  • Querying with different conditions.
  • Table joins.

Packages

  • bitmatrix
  • bitmatrix.resource

About

BitMatrix is a Java-based relational database management system supporting schema definition, data manipulation, indexing, and querying for both in-memory and file-backed tables.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages