Skip to content

Commit

Permalink
Initial Cut.
Browse files Browse the repository at this point in the history
Compatible to protobuf-java-2.3.0
  • Loading branch information
abhinashak committed Oct 19, 2012
0 parents commit 2ed54c1
Show file tree
Hide file tree
Showing 215 changed files with 12,171 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src/test"/>
<classpathentry kind="src" path="src/java"/>
<classpathentry kind="lib" path="lib/protobuf-java-2.3.0.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/3"/>
<classpathentry kind="lib" path="lib/1line-ferrari.jar"/>
<classpathentry kind="lib" path="lib/hbase-0.90.4-cdh3u3.jar"/>
<classpathentry kind="lib" path="lib/log4j-1.2.16.jar"/>
<classpathentry kind="lib" path="lib/hadoop-core-0.20.2-cdh3u3.jar"/>
<classpathentry kind="output" path="classes"/>
</classpath>
17 changes: 17 additions & 0 deletions .project
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>hsearch-core</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
11 changes: 11 additions & 0 deletions .settings/org.eclipse.jdt.core.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.6
21 changes: 21 additions & 0 deletions build.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name=hsearch-core
version=1.00

company=Bizosys Technologies Pvt Ltd.

basedir = .
src.dir = ${basedir}/src/java
lib.dir = ${basedir}/lib
buildlib.dir = ${basedir}/buildlib
conf.dir = ${basedir}/conf

build.dir = ${basedir}/build
build.classes = ${build.dir}/classes
build.encoding = UTF-8

context.root = ${name}

javac.debug=on
javac.optimize=on
javac.deprecation=off
javac.version=1.6
91 changes: 91 additions & 0 deletions build.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
<?xml version="1.0"?>

<!-- the normal classpath
* Copyright 2010 Bizosys Technologies Limited
*
* Licensed to the Bizosys Technologies Limited (Bizosys) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The Bizosys licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
-->

<project name="hsearch-core" basedir=".">

<property name="currdir" value="${basedir}" />
<property file="${currdir}/build.properties" />

<tstamp>
<format property="build.time" pattern="dd MMM yyyy hh:mm aa"/>
</tstamp>

<!-- the normal classpath -->
<path id="classpath">
<pathelement location="${build.classes}" />
<fileset dir="${lib.dir}">
<include name="*.jar" />
</fileset>
</path>

<!-- ====================================================== -->
<!-- Stuff needed by all targets -->
<!-- ====================================================== -->
<target name="init">
<mkdir dir="${build.dir}" />
<mkdir dir="${build.classes}" />
</target>

<!-- ====================================================== -->
<!-- Compile the Java files -->
<!-- TODO:: Add depends="init,generator" once the code generation is fixed -->
<!-- ====================================================== -->
<target name="compile" depends="compile-core" />

<target name="compile-core" depends="init">
<echo message="Java home: ${java.home} - ${ant.java.version} : javac.version - ${javac.version}"/>
<javac encoding="${build.encoding}"
destdir="${build.classes}" debug="${javac.debug}" optimize="${javac.optimize}"
target="${javac.version}" source="${javac.version}" deprecation="${javac.deprecation}">
<classpath refid="classpath" />
<src path="${src.dir}"/>
</javac>
</target>
<!-- ================================================================== -->
<!-- Make jar -->
<!-- ================================================================== -->
<!-- -->
<!-- ================================================================== -->
<target name="jar" depends="compile-core">
<jar jarfile="${build.dir}/${name}.jar" basedir="${build.classes}">
<manifest>
<attribute name="Version" value="${version}"/>
<attribute name="Company" value="${company}"/>
<attribute name="BuildDate" value="${build.time}"/>
</manifest>
</jar>
</target>

<!-- ================================================================== -->
<!-- D I S T R I B U T I O N Targets -->
<!-- ================================================================== -->
<target name="clean+build" depends="clean, jar">
</target>

<!-- ================================================================== -->
<!-- Clean. Delete the build files, and their directories -->
<!-- ================================================================== -->
<target name="clean">
<delete dir="${build.dir}" />
</target>

</project>
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added build/classes/com/bizosys/hsearch/hbase/NV.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added build/hsearch-core.jar
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added classes/com/bizosys/hsearch/byteutils/KVBytes.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
42 changes: 42 additions & 0 deletions classes/com/bizosys/hsearch/byteutils/byteArrays.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
package com.bizosys.hsearch.byteutils;

message ArrayDouble {

repeated double val = 1 [packed=true];
}


message ArrayFloat {

repeated float val = 1 [packed=true];
}


message ArrayInt {

repeated int32 val = 1 [packed=true];
}


message ArrayLong {

repeated int64 val = 1 [packed=true];
}


message ArrayBool {

repeated bool val = 1 [packed=true];
}


message ArrayString {

repeated string val = 1 ;
}


message ArrayBytes {

repeated bytes val = 1 ;
}
60 changes: 60 additions & 0 deletions classes/com/bizosys/hsearch/byteutils/multiHash.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
package com.bizosys.hsearch.byteutils;


message MultiHashDouble {

required bytes key = 1;

repeated double val = 2;
}


message MultiHashFloat {

required bytes key = 1;

repeated float val = 2;
}


message MultiHashInt {

required bytes key = 1;

repeated int32 val = 2;
}


message MultiHashLong {

required bytes key = 1;

repeated int64 val = 2;
}



message MultiHashBool {

required bytes key = 1;

repeated bool val = 2;
}



message MultiHashString {

required bytes key = 1;

repeated string val = 2;
}



message MultiHashBytes {

required bytes key = 1;

required bytes val = 2;
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added classes/com/bizosys/hsearch/hbase/HDML.class
Binary file not shown.
Binary file added classes/com/bizosys/hsearch/hbase/HReader.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added classes/com/bizosys/hsearch/hbase/HWriter.class
Binary file not shown.
Binary file added classes/com/bizosys/hsearch/hbase/HbaseLog.class
Binary file not shown.
Binary file not shown.
Binary file added classes/com/bizosys/hsearch/hbase/IUpdatePipe.class
Binary file not shown.
Binary file added classes/com/bizosys/hsearch/hbase/NV.class
Binary file not shown.
Binary file added classes/com/bizosys/hsearch/hbase/NVBytes.class
Binary file not shown.
Binary file not shown.
Binary file added classes/com/bizosys/hsearch/hbase/Record.class
Binary file not shown.
Binary file not shown.
Binary file added lib/1line-ferrari.jar
Binary file not shown.
Binary file added lib/commons-logging-1.1.1.jar
Binary file not shown.
Binary file added lib/hadoop-core-0.20.2-cdh3u3.jar
Binary file not shown.
Binary file added lib/hadoop-gpl-compression-0.1.0.jar
Binary file not shown.
Binary file added lib/hbase-0.90.4-cdh3u3.jar
Binary file not shown.
Binary file added lib/log4j-1.2.16.jar
Binary file not shown.
Binary file added lib/protobuf-java-2.3.0.jar
Binary file not shown.
68 changes: 68 additions & 0 deletions src/java/com/bizosys/hsearch/byteutils/BinaryFloat.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
/*
* Copyright 2010 Bizosys Technologies Limited
*
* Licensed to the Bizosys Technologies Limited (Bizosys) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The Bizosys licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.bizosys.hsearch.byteutils;

import java.util.ArrayList;
import java.util.List;

public class BinaryFloat {

public static final List<Float> emptyList = new ArrayList<Float>(0);

private boolean isEmpty = true;
public List<Float> values = emptyList;

public BinaryFloat() {

}

public void add(float aFloat) {
if ( isEmpty ) {
isEmpty = false;
values = new ArrayList<Float>(0);
}

values.add(aFloat);
}

public byte[] toBytes() {
int val = -1;
int valuesT = values.size();
byte[] b = new byte[4 * valuesT];
int arrII = 0;

for (int arrI=0 ; arrI< valuesT; arrI++) {
float f = values.get(arrI);
arrII = arrI * 4;

val = Float.floatToRawIntBits(f);
for(int i = 3; i > 0; i--) {
b[arrII + i] = (byte)(val);
val >>>= 8;
}
b[arrII] = (byte)(val);
}

return b;
}


}
Loading

0 comments on commit 2ed54c1

Please sign in to comment.