Permalink
Browse files

Merge branch 'master' of git://github.com/edwardcapriolo/hector into …

…edc-1.1-merge
  • Loading branch information...
2 parents 4d91f03 + be6b55d commit 8f59bece67ce428b0a80aeeb454f8ff047763402 @zznate zznate committed May 5, 2012
View
@@ -101,6 +101,13 @@
<groupId>commons-pool</groupId>
<artifactId>commons-pool</artifactId>
</dependency>
+
+ <!--for abstract types? -->
+ <dependency>
+ <groupId>org.apache.cassandra</groupId>
+ <artifactId>cassandra-all</artifactId>
+ </dependency>
+
<dependency>
<groupId>org.apache.cassandra</groupId>
<artifactId>cassandra-thrift</artifactId>
@@ -388,7 +388,7 @@ public String recv_system_update_keyspace() throws InvalidRequestException,
@Override
public void recv_truncate() throws InvalidRequestException,
- UnavailableException, TException {
+ UnavailableException, TException, TimedOutException {
client.recv_truncate();
}
@@ -632,7 +632,7 @@ public String system_update_keyspace(KsDef ks_def)
@Override
public void truncate(String cfname) throws InvalidRequestException,
- UnavailableException, TException {
+ UnavailableException, TException, TimedOutException {
client.truncate(cfname);
}
}
@@ -1,5 +1,6 @@
package me.prettyprint.hector.api;
+import java.util.UUID;
import static me.prettyprint.hector.api.ddl.ComparatorType.UUIDTYPE;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
@@ -20,7 +21,6 @@
import me.prettyprint.hector.api.beans.AbstractComposite.ComponentEquality;
import me.prettyprint.hector.api.beans.Composite;
import me.prettyprint.hector.api.beans.DynamicComposite;
-
import org.apache.cassandra.db.marshal.AbstractType;
import org.apache.cassandra.db.marshal.AsciiType;
import org.apache.cassandra.db.marshal.BytesType;
@@ -33,6 +33,7 @@
import org.apache.cassandra.db.marshal.UUIDType;
import org.apache.cassandra.utils.ByteBufferUtil;
import org.apache.cassandra.utils.UUIDGen;
+
import org.junit.Test;
public class CompositeTest {
@@ -245,6 +246,7 @@ private ByteBuffer createDynamicCompositeKey(String s, UUID uuid, int i,
if (uuid != null) {
bb.putShort((short) (0x8000 | 't'));
bb.putShort((short) 16);
+
bb.put(UUIDGen.decompose(uuid));
bb.put((i == -1) && lastIsOne ? (byte) 1 : (byte) 0);
if (i != -1) {
@@ -306,7 +308,8 @@ static ByteBuffer createCompositeKey(String s, UUID uuid, int i,
@SuppressWarnings("rawtypes")
public DynamicCompositeType getDefaultDynamicComparator() {
- Map<Byte, AbstractType> aliases = new HashMap<Byte, AbstractType>();
+ //Well if ? makes you happy then :) Generics FTWhatever
+ Map<Byte, AbstractType<?>> aliases = new HashMap<Byte, AbstractType<?>>();
aliases.put((byte) 'a', AsciiType.instance);
aliases.put((byte) 'b', BytesType.instance);
aliases.put((byte) 'i', IntegerType.instance);
Oops, something went wrong.

0 comments on commit 8f59bec

Please sign in to comment.