Skip to content

Commit 22f5a43

Browse files
committed
First Commit
0 parents  commit 22f5a43

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+5863
-0
lines changed

.classpath

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<classpath>
3+
<classpathentry kind="src" output="target/classes" path="src/main/java">
4+
<attributes>
5+
<attribute name="optional" value="true"/>
6+
<attribute name="maven.pomderived" value="true"/>
7+
</attributes>
8+
</classpathentry>
9+
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
10+
<attributes>
11+
<attribute name="maven.pomderived" value="true"/>
12+
</attributes>
13+
</classpathentry>
14+
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
15+
<attributes>
16+
<attribute name="optional" value="true"/>
17+
<attribute name="maven.pomderived" value="true"/>
18+
</attributes>
19+
</classpathentry>
20+
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
21+
<attributes>
22+
<attribute name="maven.pomderived" value="true"/>
23+
</attributes>
24+
</classpathentry>
25+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jdk1.8.0_144">
26+
<attributes>
27+
<attribute name="maven.pomderived" value="true"/>
28+
</attributes>
29+
</classpathentry>
30+
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
31+
<attributes>
32+
<attribute name="maven.pomderived" value="true"/>
33+
</attributes>
34+
</classpathentry>
35+
<classpathentry kind="output" path="target/classes"/>
36+
</classpath>

.project

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>study-indexdb</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>org.eclipse.jdt.core.javabuilder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
<buildCommand>
14+
<name>org.eclipse.m2e.core.maven2Builder</name>
15+
<arguments>
16+
</arguments>
17+
</buildCommand>
18+
</buildSpec>
19+
<natures>
20+
<nature>org.eclipse.jdt.core.javanature</nature>
21+
<nature>org.eclipse.m2e.core.maven2Nature</nature>
22+
</natures>
23+
</projectDescription>

.settings/org.eclipse.jdt.core.prefs

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
eclipse.preferences.version=1
2+
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning

.settings/org.eclipse.m2e.core.prefs

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
activeProfiles=
2+
eclipse.preferences.version=1
3+
resolveWorkspaceProjects=true
4+
version=1

pom.xml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
2+
<modelVersion>4.0.0</modelVersion>
3+
<groupId>com.cduvvuri</groupId>
4+
<artifactId>sindexdb</artifactId>
5+
<version>0.0.1-SNAPSHOT</version>
6+
7+
<dependencies>
8+
<!-- https://mvnrepository.com/artifact/junit/junit -->
9+
<dependency>
10+
<groupId>junit</groupId>
11+
<artifactId>junit</artifactId>
12+
<version>4.12</version>
13+
<scope>test</scope>
14+
</dependency>
15+
</dependencies>
16+
17+
</project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package com.cduvvuri.sidb.annotations;
2+
3+
import java.lang.annotation.ElementType;
4+
import java.lang.annotation.Retention;
5+
import java.lang.annotation.RetentionPolicy;
6+
import java.lang.annotation.Target;
7+
8+
/**
9+
* Entity that encapsulates the key and fields
10+
*
11+
* @author Chaitanya DS
12+
* 08-Nov-2017
13+
*
14+
*
15+
*/
16+
@Retention(RetentionPolicy.RUNTIME)
17+
@Target({ElementType.TYPE})
18+
public @interface Entity {
19+
20+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package com.cduvvuri.sidb.annotations;
2+
3+
import java.lang.annotation.ElementType;
4+
import java.lang.annotation.Retention;
5+
import java.lang.annotation.RetentionPolicy;
6+
import java.lang.annotation.Target;
7+
8+
/**
9+
* This is restricted to primitives.. for now
10+
* @author Chaitanya DS
11+
* 08-Nov-2017
12+
*
13+
* Fields represent the record associated with the key for each entity
14+
*/
15+
@Target(ElementType.FIELD)
16+
@Retention(RetentionPolicy.RUNTIME)
17+
public @interface Field {
18+
public String name();
19+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package com.cduvvuri.sidb.annotations;
2+
3+
import java.lang.annotation.ElementType;
4+
import java.lang.annotation.Retention;
5+
import java.lang.annotation.RetentionPolicy;
6+
import java.lang.annotation.Target;
7+
8+
/**
9+
* This is restricted to primitives.. for now
10+
* @author Chaitanya DS
11+
* 08-Nov-2017
12+
*
13+
* Fields represent the record associated with the key for each entity
14+
*/
15+
@Target(ElementType.TYPE)
16+
@Retention(RetentionPolicy.RUNTIME)
17+
public @interface Key {
18+
19+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package com.cduvvuri.sidb.annotations;
2+
3+
import java.lang.annotation.ElementType;
4+
import java.lang.annotation.Retention;
5+
import java.lang.annotation.RetentionPolicy;
6+
import java.lang.annotation.Target;
7+
8+
/**
9+
* This is restricted to string type
10+
* @author Chaitanya DS
11+
* 11-Nov-2017
12+
*/
13+
@Target(ElementType.FIELD)
14+
@Retention(RetentionPolicy.RUNTIME)
15+
public @interface TextField {
16+
int length() default 20;
17+
String name();
18+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package com.cduvvuri.sidb.common;
2+
3+
/**
4+
*
5+
* @author Chaitanya DS
6+
* 14-Nov-2017
7+
*/
8+
public interface Constatnts {
9+
public static final String BTREE_IDX_NAME = "btree.idx";
10+
public static final int BLOCK_SIZE_IN_KB = 8;
11+
public static final String EMPTY_STRING = "";
12+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
package com.cduvvuri.sidb.common;
2+
3+
import com.cduvvuri.sidb.annotations.Entity;
4+
import com.cduvvuri.sidb.annotations.Field;
5+
import com.cduvvuri.sidb.annotations.TextField;
6+
7+
/**
8+
*
9+
* @author Chaitanya DS
10+
* 08-Nov-2017
11+
*/
12+
@Entity
13+
public class SampleEntity {
14+
@Field(name = "field1")
15+
private Integer field1;
16+
17+
@TextField(name = "field2", length = 20)
18+
private String field2;
19+
20+
public SampleEntity() {
21+
22+
}
23+
24+
public SampleEntity(Integer field1, String field2) {
25+
this.field1 = field1;
26+
this.field2 = field2;
27+
}
28+
29+
public Integer getField1() {
30+
return field1;
31+
}
32+
33+
public void setField1(Integer field1) {
34+
this.field1 = field1;
35+
}
36+
37+
public String getField2() {
38+
return field2;
39+
}
40+
41+
public void setField2(String field2) {
42+
this.field2 = field2;
43+
}
44+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
package com.cduvvuri.sidb.common;
2+
3+
import com.cduvvuri.sidb.annotations.Field;
4+
import com.cduvvuri.sidb.annotations.Key;
5+
6+
/**
7+
*
8+
* @author Chaitanya DS
9+
* 30-Nov-2017
10+
*/
11+
@Key
12+
public class SampleKey implements Comparable<SampleKey> {
13+
@Field(name = "id")
14+
private Integer id;
15+
16+
public SampleKey() {
17+
18+
}
19+
20+
public SampleKey(Integer id) {
21+
this.id = id;
22+
}
23+
24+
public Integer getId() {
25+
return id;
26+
}
27+
28+
public void setId(Integer id) {
29+
this.id = id;
30+
}
31+
32+
@Override
33+
public int compareTo(SampleKey sk) {
34+
if (this.id < sk.id) {
35+
return -1;
36+
} else if (this.id > sk.id) {
37+
return 1;
38+
}
39+
40+
return 0;
41+
}
42+
43+
public String toString() {
44+
return String.valueOf(id);
45+
}
46+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
package com.cduvvuri.sidb.common;
2+
3+
/**
4+
*
5+
* @author Chaitanya DS
6+
* 15-Nov-2017
7+
*/
8+
public class SizeUtils {
9+
public static int sizeOf(int i) {
10+
return Integer.BYTES;
11+
}
12+
13+
public static int sizeOf(boolean b) {
14+
return 1;//1 byte
15+
}
16+
17+
public static int sizeOf(long l) {
18+
return Long.BYTES;
19+
}
20+
21+
/**
22+
* TODO
23+
* @param entity
24+
* @return
25+
*/
26+
public static int sizeOfEntity(Class<?> entity) {
27+
return -1;
28+
}
29+
30+
public static int sizeOf(byte[] fieldHeaderInBytes) {
31+
return fieldHeaderInBytes.length;
32+
}
33+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
package com.cduvvuri.sidb.common;
2+
3+
/**
4+
* TODO
5+
* @author Chaitanya DS
6+
* 13-Nov-2017
7+
*/
8+
public interface SpatialIndex {
9+
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package com.cduvvuri.sidb.error;
2+
3+
/**
4+
*
5+
* @author Chaitanya DS
6+
* 30-Nov-2017
7+
*/
8+
public class AVLException extends RuntimeException {
9+
private static final long serialVersionUID = 1L;
10+
11+
public AVLException() {
12+
super();
13+
}
14+
15+
public AVLException(String message) {
16+
super(message);
17+
}
18+
19+
public AVLException(String message, Throwable t) {
20+
super(message, t);
21+
}
22+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package com.cduvvuri.sidb.error;
2+
3+
/**
4+
*
5+
* @author Chaitanya DS
6+
* 15-Nov-2017
7+
*/
8+
public class BTreeException extends RuntimeException {
9+
private static final long serialVersionUID = 1L;
10+
11+
public BTreeException() {
12+
super();
13+
}
14+
15+
public BTreeException(String message) {
16+
super(message);
17+
}
18+
19+
public BTreeException(String message, Throwable t) {
20+
super(message, t);
21+
}
22+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package com.cduvvuri.sidb.error;
2+
3+
/**
4+
*
5+
* @author Chaitanya DS
6+
* 08-Nov-2017
7+
*
8+
*/
9+
public class ValidationException extends RuntimeException {
10+
private static final long serialVersionUID = -2209221617833800956L;
11+
12+
public ValidationException() {
13+
super();
14+
}
15+
16+
public ValidationException(String message) {
17+
super(message);
18+
}
19+
20+
public ValidationException(String message, Throwable t) {
21+
super(message, t);
22+
}
23+
24+
}

0 commit comments

Comments
 (0)