Skip to content
This repository was archived by the owner on Aug 13, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
ee9b42a
TTB Initial commit
srgg Dec 9, 2015
f43e250
Added proper handling of: TsPutReq (encoding), tsputresp(encoding), r…
srgg Dec 9, 2015
c28724e
RighTTBCodec is forced to be used by default
srgg Dec 9, 2015
01ef430
Netty Logger has been removed
srgg Dec 10, 2015
f43f0fa
TsGetReq Added TsGetReq and TsGetResp
srgg Dec 10, 2015
48dc9bd
Added ToggleTTBEncodingOperation and smart TTB/PB encoding/decodingю
srgg Jan 12, 2016
b46e1b1
Fix broken tests
srgg Jan 15, 2016
83e509f
TTB codec adjusted to RiakTS 1.1 changes
srgg Jan 15, 2016
65f2a92
Deferred encoding operation support was introduces for TS Store and F…
srgg Jan 20, 2016
970735c
Added proper handling of com.basho.riak.pbcport
srgg Jan 21, 2016
a59d9f3
rework preventive toggle the Native/TTB encoding to be toggled on per…
srgg Jan 22, 2016
914c215
getting rid of creation TsPutReq.Builder and TsGetReq.Builder
srgg Jan 25, 2016
fcc01e0
Fix error propogation in case of Channel fails to switch to use Nativ…
srgg Jan 27, 2016
c4e5e5c
Pull in change from another branch by @lehoff
alexmoore Apr 12, 2016
9281f24
Merge branch 'develop' into perf/ttb_encoding_v2
alexmoore Apr 12, 2016
5c09a18
Remove TTB Switch code, update PB dependency
alexmoore Apr 14, 2016
f743ff3
Add new TTB codec boilerplate
alexmoore Apr 18, 2016
6aa4237
Stubbing out Store operation
alexmoore Apr 18, 2016
d3a2d93
Encoding of tsgetreq to byte[] is complete.
lukebakken Apr 18, 2016
c061b25
Encode query and put TTB requests.
lukebakken Apr 18, 2016
e01e3fe
Stub out other TS operations to use TTB
alexmoore Apr 19, 2016
05df991
Remove TTB methods for TsDelReq - not supported yet.
lukebakken Apr 19, 2016
15834e6
Revert Delete to use PB
alexmoore Apr 19, 2016
51d60cc
Decode TTB Get/Query response
lukebakken Apr 19, 2016
519cea2
stub out test file
alexmoore Apr 20, 2016
e568a4c
Move error decoding into RiakMessage for pbuf and ttb messages.
lukebakken Apr 20, 2016
f34401c
Added tests for RiakMessage error decoding.
lukebakken Apr 20, 2016
572a031
Add test for TTB encoding TsGetReq
lukebakken Apr 20, 2016
b84619d
Add test for TTB encoding TsQueryReq
lukebakken Apr 21, 2016
d55c4ef
Add null cell handling to TTB PUT encoding, fix tuple/list mixup, add…
alexmoore Apr 21, 2016
ae6bbfe
fix example request tuple
alexmoore Apr 21, 2016
30a676f
Add a TsPutReq test
lukebakken Apr 21, 2016
e5e650c
Fix unit tests for TTB codec.
lukebakken Apr 21, 2016
92e31ea
Remove the double-header from TTB data.
lukebakken Apr 21, 2016
ac31017
Fix a few encoding/decoding issues
alexmoore Apr 22, 2016
e90065e
Fix codec to parse QueryResponses correctly, add some error handling …
alexmoore Apr 22, 2016
fe88d2b
Fix a ttb row read bug, change a test to match current behavior
alexmoore Apr 23, 2016
e4ef475
Simplify detection of when to read end of list.
lukebakken Apr 25, 2016
f99977e
Merge branch 'develop' into perf/ttb_encoding/v3
alexmoore Apr 25, 2016
8834f07
Add port option + TS testing to makefile
alexmoore Apr 25, 2016
7243f38
Small Makefile change to only set RIAK_PORT if it isn't set in the env.
lukebakken Apr 25, 2016
f497262
Remainder of TODOs for 611
alexmoore Apr 26, 2016
aa0d7a4
Code cleanup
alexmoore Apr 26, 2016
2bf1d8d
Remove unused case branch
alexmoore Apr 26, 2016
2edbd44
No need to use OtpErlangAtom when write_atom() exists.
lukebakken Apr 26, 2016
dd7f951
Add security test option to makefile
alexmoore Apr 28, 2016
75b92f6
Merge branch 'perf/ttb_encoding/v3' of https://github.com/basho/riak-…
alexmoore Apr 28, 2016
5b092d2
Remove PB objects entirely from TTB TS put path
alexmoore Apr 29, 2016
9ccf8e7
Some small optimizations
alexmoore May 3, 2016
1f353b4
Add test for PB error handling while using TTB operation
alexmoore May 4, 2016
a0beb8e
A few PR cleanup items
alexmoore May 4, 2016
3d7cd4d
The final final
alexmoore May 4, 2016
c748fbd
Merge pull request #617 from basho/perf/ttb_encoding/v4
alexmoore May 4, 2016
450a95e
Dont do error checking while writing TTB messages
alexmoore May 5, 2016
8918c5b
Dont convert to PB and back when creating a row
alexmoore May 5, 2016
09ee18f
Adding single atom response handling
alexmoore May 6, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions src/main/java/com/basho/riak/client/core/RiakMessage.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,10 @@
import com.ericsson.otp.erlang.OtpErlangDecodeException;
import com.ericsson.otp.erlang.OtpInputStream;
import com.google.protobuf.InvalidProtocolBufferException;
import java.nio.charset.StandardCharsets;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.nio.charset.StandardCharsets;
import java.util.logging.Level;

/**
* Encapsulates the raw bytes sent to or received from Riak.
*
Expand All @@ -25,8 +23,8 @@ public final class RiakMessage
private final byte code;
private final byte[] data;
private final OtpInputStream ttbInputStream;
// TODO offer output stream?
private final RiakResponseException riakError;
private static final String ERROR_RESP = "rpberrorresp";

public RiakMessage(byte code, byte[] data)
{
Expand Down Expand Up @@ -124,7 +122,7 @@ private RiakResponseException getRiakErrorFromTtb(OtpInputStream ttbInputStream)
throw new IllegalArgumentException(decodeErrorMsg, ex);
}

if ("rpberrorresp".equals(atom))
if (ERROR_RESP.equals(atom))
{
try
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,13 @@
import com.basho.riak.protobuf.RiakTsPB;
import com.ericsson.otp.erlang.*;
import com.google.protobuf.ByteString;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Locale;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class TermToBinaryCodec
{
Expand All @@ -23,14 +22,8 @@ public class TermToBinaryCodec
private static final String TS_QUERY_RESP = "tsqueryresp";
private static final String TS_INTERPOLATION = "tsinterpolation";
private static final String TS_PUT_REQ = "tsputreq";
private static final String ERROR_RESP = "rpberrorresp";
private static final String UNDEFINED = "undefined";
private static final OtpErlangAtom TS_GET_REQ_ATOM = new OtpErlangAtom(TS_GET_REQ);
private static final OtpErlangAtom TS_QUERY_REQ_ATOM = new OtpErlangAtom(TS_QUERY_REQ);
private static final OtpErlangAtom TS_INTERPOLATION_ATOM = new OtpErlangAtom(TS_INTERPOLATION);
private static final OtpErlangAtom TS_PUT_REQ_ATOM = new OtpErlangAtom(TS_PUT_REQ);
private static final OtpErlangAtom UNDEFINED_ATOM = new OtpErlangAtom(UNDEFINED);
private static Logger logger = LoggerFactory.getLogger(TermToBinaryCodec.class);
private static final Logger logger = LoggerFactory.getLogger(TermToBinaryCodec.class);

public static OtpOutputStream encodeTsGetRequest(String tableName, Collection<Cell> keyValues, int timeout)
{
Expand All @@ -39,7 +32,7 @@ public static OtpOutputStream encodeTsGetRequest(String tableName, Collection<Ce

// NB: TsGetReq is a 4-tuple: tsgetreq, tableName, [key values], timeout
os.write_tuple_head(4);
os.write_any(TS_GET_REQ_ATOM);
os.write_atom(TS_GET_REQ);
os.write_binary(tableName.getBytes(StandardCharsets.UTF_8));

os.write_list_head(keyValues.size());
Expand Down Expand Up @@ -67,12 +60,12 @@ public static OtpOutputStream encodeTsQueryRequest(String queryText)

// TsQueryReq is a 4-tuple: {'tsqueryreq', TsInt, boolIsStreaming, bytesCoverContext}
os.write_tuple_head(4);
os.write_any(TS_QUERY_REQ_ATOM);
os.write_atom(TS_QUERY_REQ);

// TsInterpolation is a 3-tuple
// {'tsinterpolation', query, []} empty list is interpolations
os.write_tuple_head(3);
os.write_any(TS_INTERPOLATION_ATOM);
os.write_atom(TS_INTERPOLATION);
os.write_binary(queryText.getBytes(StandardCharsets.UTF_8));
// interpolations is an empty list
os.write_nil();
Expand All @@ -81,7 +74,7 @@ public static OtpOutputStream encodeTsQueryRequest(String queryText)
os.write_boolean(false);

// cover_context is an undefined atom
os.write_any(UNDEFINED_ATOM);
os.write_atom(UNDEFINED);

return os;
}
Expand All @@ -94,7 +87,7 @@ public static OtpOutputStream encodeTsPutRequest(String tableName, Collection<Ro
// TsPutReq is a 4-tuple: {'tsputreq', tableName, [], [rows]}
// columns is empte
os.write_tuple_head(4);
os.write_any(TS_PUT_REQ_ATOM);
os.write_atom(TS_PUT_REQ);
os.write_binary(tableName.getBytes(StandardCharsets.UTF_8));
// columns is an empty list
os.write_nil();
Expand Down