Skip to content

Commit

Permalink
Set version numbers for the 1.0.rc2 release
Browse files Browse the repository at this point in the history
  • Loading branch information
rescrv committed Feb 5, 2013
2 parents e107a4d + 601b953 commit c830453
Show file tree
Hide file tree
Showing 69 changed files with 1,771 additions and 930 deletions.
7 changes: 7 additions & 0 deletions .gitignore
Expand Up @@ -11,6 +11,7 @@ client/python/hyperclient.c
config.guess
config.h
config.h.in
config.h.in~
config.log
config.status
config.sub
Expand All @@ -24,6 +25,7 @@ doc/HyperDex-0.5.dev.pdf
doc/man/hyperdex-daemon.1
doc/man/hyperdex-replication-stress-test.1
doc/man/hyperdex-simple-consistency-stress-test.1
hyperclient.pc
hyperdex
hyperdex-add-space
hyperdex-binary-test
Expand Down Expand Up @@ -61,3 +63,8 @@ missing
py-compile
stamp-h1
ylwrap
*.cxx
client/java/hyperclient
*.jar
*.stamp

73 changes: 58 additions & 15 deletions Makefile.am
Expand Up @@ -71,13 +71,18 @@ noinst_PROGRAMS = \

dist_man_MANS = doc/man/hyperdex-daemon.1

CONFIG_CLEAN_FILES = hyperclient.pc

CLEANFILES = \
$(java_bindings_cleanfiles) \
doc/HyperDex-$(VERSION).pdf \
$(ycsb_cleanfiles)

JAVAROOT = $(abs_top_srcdir)

pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = hyperclient.pc

.PHONY: coverage doc/HyperDex-$(VERSION).pdf

dist-hook:
Expand Down Expand Up @@ -245,8 +250,46 @@ libhypercoordinator_la_LIBADD = -le

libhyperclient_extra_dist = \
client/keyop_info.gperf \
hyperclient/java/hyperclient.i \
client/python/hyperclient.pyx
client/java/examples/HyperBinaryTest.java \
client/java/examples/HyperSearchFloatRange.java \
client/java/examples/HyperTest.java \
client/java/examples/README.txt \
client/java/examples/source_me \
client/java/extra_src/AttributeError.java \
client/java/extra_src/ByteArray.java \
client/java/extra_src/ByteArrayKeyedMap.java \
client/java/extra_src/ByteArrayKeyedSortedMap.java \
client/java/extra_src/ByteArraySortedSet.java \
client/java/extra_src/ByteArrayVector.java \
client/java/extra_src/DeferredCondPut.java \
client/java/extra_src/DeferredCount.java \
client/java/extra_src/DeferredDelete.java \
client/java/extra_src/DeferredFromAttrs.java \
client/java/extra_src/DeferredGet.java \
client/java/extra_src/DeferredGroupDel.java \
client/java/extra_src/Deferred.java \
client/java/extra_src/DeferredMapOp.java \
client/java/extra_src/GreaterEqual.java \
client/java/extra_src/HyperClientException.java \
client/java/extra_src/LessEqual.java \
client/java/extra_src/MapOp.java \
client/java/extra_src/MemoryError.java \
client/java/extra_src/Pending.java \
client/java/extra_src/Predicate.java \
client/java/extra_src/Range.java \
client/java/extra_src/SearchBase.java \
client/java/extra_src/Search.java \
client/java/extra_src/SimpleOp.java \
client/java/extra_src/SortedSearch.java \
client/java/extra_src/TypeError.java \
client/java/extra_src/ValueError.java \
client/java/hyperclient.i \
client/java/proxies/hyperclient_attribute_check.i \
client/java/proxies/hyperclient_attribute.i \
client/java/proxies/HyperClient.i \
client/java/proxies/hyperclient_map_attribute.i \
client/python/hyperclient.pyx \
hyperclient.pc

libhyperclient_includedir = $(includedir)
libhyperclient_include_HEADERS = \
Expand Down Expand Up @@ -314,12 +357,12 @@ client/keyop_info.cc: client/keyop_info.gperf

java_bindings_cleanfiles = \
$(hyperclient_jarfile) \
hyperclient/java/hyperclient_wrap.cxx \
hyperclient/java/hyperclient/*.java \
hyperclient/java/hyperclient/*.class \
client/java/hyperclient_wrap.cxx \
client/java/hyperclient/*.java \
client/java/hyperclient/*.class \
hyperclient-java.stamp

nodist_libhyperclient_java_la_SOURCES = hyperclient/java/hyperclient_wrap.cxx
nodist_libhyperclient_java_la_SOURCES = client/java/hyperclient_wrap.cxx
libhyperclient_java_la_CPPFLAGS = \
$(JNI_CPPFLAGS) \
$(CPPFLAGS)
Expand All @@ -329,20 +372,20 @@ libhyperclient_java_la_LIBADD = \
libhyperclient.la \
$(PYTHON_LDFLAGS)

hyperclient/java/hyperclient_wrap.cxx: hyperclient/java/hyperclient.i hyperclient/hyperclient.h
mkdir -p hyperclient/java/hyperclient
${SWIG} -java -package hyperclient -outdir $(abs_builddir)/hyperclient/java/hyperclient \
-o $(abs_builddir)/hyperclient/java/hyperclient_wrap.cxx -w518 $(abs_top_srcdir)/hyperclient/java/hyperclient.i
client/java/hyperclient_wrap.cxx: client/java/hyperclient.i client/hyperclient.h
mkdir -p client/java/hyperclient
${SWIG} -I${abs_srcdir} -java -package hyperclient -outdir $(abs_builddir)/client/java/hyperclient \
-o $(abs_builddir)/client/java/hyperclient_wrap.cxx -w518 $(abs_top_srcdir)/client/java/hyperclient.i

hyperclient_jarfile = hyperclient-$(VERSION).jar

hyperclient-java.stamp: hyperclient/java/hyperclient_wrap.cxx
cp hyperclient/java/extra_src/*.java hyperclient/java/hyperclient/.
javac hyperclient/java/hyperclient/*.java
date > hyperclient-java.stamp
hyperclient-java.stamp: client/java/hyperclient_wrap.cxx
cp ${abs_srcdir}/client/java/extra_src/*.java ${abs_builddir}/client/java/hyperclient/.
javac ${abs_builddir}/client/java/hyperclient/*.java
date > ${abs_builddir}/hyperclient-java.stamp

$(hyperclient_jarfile): hyperclient-java.stamp
cd $(abs_top_builddir)/hyperclient/java ; $(JAR) cvf $(JARFLAGS) $(abs_top_builddir)/$(hyperclient_jarfile) hyperclient/*.class
cd $(abs_top_builddir)/client/java ; $(JAR) cvf $(JARFLAGS) $(abs_top_builddir)/$(hyperclient_jarfile) hyperclient/*.class

if ENABLE_JAVA_BINDINGS
lib_LTLIBRARIES += libhyperclient-java.la
Expand Down
3 changes: 1 addition & 2 deletions client/coordinator_link.cc
Expand Up @@ -357,8 +357,7 @@ coordinator_link :: make_rpc(const char* func,
bool
coordinator_link :: initiate_wait_for_config(hyperclient_returncode* status)
{
uint64_t wait_for = m_config.version() > 0 ? m_config.version() - 1 : 0;
m_wait_config_id = m_repl.wait("hyperdex", "config", wait_for, &m_wait_config_status);
m_wait_config_id = m_repl.wait("hyperdex", "config", m_config.version(), &m_wait_config_status);

if (m_wait_config_id < 0)
{
Expand Down
108 changes: 108 additions & 0 deletions client/java/examples/HyperBinaryTest.java
@@ -0,0 +1,108 @@
import hyperclient.*;
import java.util.*;

public class HyperBinaryTest
{
public static void printRawBytes(byte[] bytes)
{
System.out.print("{" + (bytes[0] & 0x000000ff)); // zero out the negative
// spilly talky bits

int i = 1;

do
{
System.out.print(", " + (bytes[i++] & 0x000000ff));
} while ( i < bytes.length );

System.out.println("}");
}

public static void main(String[] args) throws Exception
{
HyperClient c = new HyperClient("127.0.0.1",1982);

String desc = "space phonebook "
+ "key username "
+ "attributes first, last, int phone "
+ "subspace first, last, phone";

System.out.println("\n\nSpace Description:\n\n" + desc + "\n\n");

c.add_space(desc);

try
{
HashMap<Object,Object> attrs = new HashMap<Object,Object>();

// Make up some arbitrary bytes
byte[] inBytes = new byte[256];

for (int i=0; i<inBytes.length; i++) inBytes[i] = (byte)i;

// Put the bytes in the field for the first name, 'first'
attrs.put("first",inBytes);
attrs.put("last","Tolomiczenko");
attrs.put("phone",4165551024L);

System.out.println("put success: " + c.put("phonebook", "mykey", attrs));

Map map = c.get("phonebook", "mykey");

// String values are returned in the form of a ByteArray.
// Instance method 'getBytes()' will yield the byte[] that
// it wraps.
byte[] outBytes = ((ByteArray)(map.get("first"))).getBytes();

System.out.println("bytes in:");
printRawBytes(inBytes);
System.out.println("\nbytes out:");
printRawBytes(outBytes);

// Let's put a proper first name now
attrs.put("first","Nick");

// "Nick" will be encoded using encoding "UTF-8"
// no matter what the environment is set at.
//
System.out.println("put success: " + c.put("phonebook", "mykey", attrs));

map = c.get("phonebook", "mykey");
System.out.println(map);

// ByteArray value returned inherits default encoding
// of "UTF-8" (from the client)
System.out.println(((ByteArray)(map.get("first"))).getDefaultEncoding());

// That's why we can print it ie., its 'toString()' method
// is implicitly called below.
System.out.println((ByteArray)(map.get("first")));

// Let's the change the client's default
c.setDefaultStringEncoding("ISO-8859-1");

// Re-retrieve ...
map = c.get("phonebook", "mykey");

System.out.println(((ByteArray)(map.get("first"))).getDefaultEncoding());
System.out.println((ByteArray)(map.get("first")));

// Or you, the coder, can just defy the client's default
// string encoding altogether ...

// in the form of ByteArray
attrs.put("first",new ByteArray("Nick","UTF-16BE"));

// or in the form of bytes
attrs.put("first",ByteArray.encode("Nick","UTF-16BE"));

System.out.println("put success: " + c.put("phonebook", "mykey", attrs));
map = c.get("phonebook", "mykey");
System.out.println(((ByteArray)(map.get("first"))).decode("UTF-16BE"));
}
finally
{
c.rm_space("phonebook");
}
}
}
99 changes: 99 additions & 0 deletions client/java/examples/HyperSearchFloatRange.java
@@ -0,0 +1,99 @@
import hyperclient.*;
import java.util.*;

public class HyperSearchFloatRange
{
public static void main(String[] args) throws Exception
{
HashMap<String,Object> values = new HashMap<String,Object>();

HyperClient c = new HyperClient("127.0.0.1",1982);

String desc = "space weightbook "
+ "key username "
+ "attributes first, last, float weight "
+ "subspace first, last, weight";

System.out.println("\n\nSpace Description:\n\n" + desc + "\n\n");

c.add_space(desc);

try
{
values.put("first","Nick");
values.put("last","Tolomiczenko");
values.put("weight",175.2);

System.out.println("ntolomic put: " + c.put("weightbook","ntolomic",values));

values.put("first","George");
values.put("last","Tolomiczenko");
values.put("weight",160.7);

System.out.println("gtolomic put: " + c.put("weightbook","gtolomic",values));

values.put("first","Paul");
values.put("last","Tolomiczenko");
values.put("weight",162.3);

System.out.println("ptolomic put: " + c.put("weightbook","ptolomic",values));

System.out.println("\nAbout retrieve key ntolomic:\n");

Map row = c.get("weightbook","ntolomic");

System.out.println("Got back: " + row);

System.out.println("\nSearching for last name of 'Tolomiczenko':\n");

// We'll use the same 'values' map for our search predicate

// This leaves us with only the last name entry
values.remove("first");
values.remove("weight");

SearchBase s = c.search("weightbook",values);

while(s.hasNext())
{
System.out.println(s.next());
}

// Now add a range stipulation on the weight: [160.1,165]
values.put("weight",
new AbstractMap.SimpleEntry<Double,Double>(160.1D,165D));

System.out.println("\nSearching for last name of 'Tolomiczenko'\n\n AND\n\nweight in the range [160.1,165]:\n");

// Do the search again
s = c.search("weightbook",values);

while(s.hasNext())
{
System.out.println(s.next());
}

// Stipulate the range using a List of Predicate based classes.
// In particular, use a Vector implementation of a List and LessEqual,
// GreaterEqual both derived from Predicate.
//
Vector<Predicate> predicates = new Vector<Predicate>(2);
predicates.add(new GreaterEqual(160.1D));
predicates.add(new LessEqual(165D));
values.put("weight",predicates);

System.out.println("\nDo the search again using a List of Predicate based classes:\n");
// Do the search again
s = c.search("weightbook",values);

while(s.hasNext())
{
System.out.println(s.next());
}
}
finally
{
c.rm_space("weightbook");
}
}
}

0 comments on commit c830453

Please sign in to comment.