Row Adapters

13 views
Skip to first unread message

Evan Prothro

unread,
Sep 13, 2017, 11:38:02 AM9/13/17
to DataStax Ruby Driver for Apache Cassandra User Mailing List
I wanted to see what discussion has been (if any) over the years regarding adding the ability for cassandra-driver to delegate row object instantiation and attribute assignment in a user-defined way.


The user benefit would be a performant way to receive model objects back from the driver -- avoiding the middle-man Hash object when the pattern of using the hash as a data object doesn't satisfy the needs of the client.

For a visualization, here is a rough sequence diagram, showing the wasted iteration in this use case.

I'm addressing a few issues in our code base around this concept and wanted to gauge y'alls opinion / temperature on this as I proceeded.

Cheers,

Evan Prothro

Sandeep Tamhankar

unread,
Sep 25, 2017, 12:53:21 PM9/25/17
to DataStax Ruby Driver for Apache Cassandra User Mailing List
This is a very interesting idea that afaik hasn't been discussed before. I think it's a great idea. At the lowest level, rows are created in coder.rb in read_values_v4. I'd start there with adding some kind of hook and working outwards.

Good luck, and let me know if you run into issues.

-Sandeep

Evan Prothro

unread,
Sep 25, 2017, 1:20:56 PM9/25/17
to ruby-dri...@lists.datastax.com
Yes, I “spiked” an implementation just to see what the overhead looked like.

Since the lookup has to be done per-row to work with certain metadata use cases, the overhead is about 10%.


Is a JIRA ticket the right next step to discuss implications and design?

-Evan


--
You received this message because you are subscribed to a topic in the Google Groups "DataStax Ruby Driver for Apache Cassandra User Mailing List" group.
To unsubscribe from this topic, visit https://groups.google.com/a/lists.datastax.com/d/topic/ruby-driver-user/Ts6c6jgoc9g/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ruby-driver-us...@lists.datastax.com.

Sandeep Tamhankar

unread,
Sep 25, 2017, 3:34:00 PM9/25/17
to DataStax Ruby Driver for Apache Cassandra User Mailing List
Yes, please file a Jira and we'll go from there.

Thanks!

-Sandeep


On Monday, September 25, 2017 at 10:20:56 AM UTC-7, Evan Prothro wrote:
Yes, I “spiked” an implementation just to see what the overhead looked like.

Since the lookup has to be done per-row to work with certain metadata use cases, the overhead is about 10%.


Is a JIRA ticket the right next step to discuss implications and design?

-Evan

On Sep 25, 2017, at 11:53 AM, Sandeep Tamhankar <sandeep.tamhankar@datastax.com> wrote:

This is a very interesting idea that afaik hasn't been discussed before. I think it's a great idea. At the lowest level, rows are created in coder.rb in read_values_v4. I'd start there with adding some kind of hook and working outwards.

Good luck, and let me know if you run into issues.

-Sandeep

On Wednesday, September 13, 2017 at 8:38:02 AM UTC-7, Evan Prothro wrote:
I wanted to see what discussion has been (if any) over the years regarding adding the ability for cassandra-driver to delegate row object instantiation and attribute assignment in a user-defined way.


The user benefit would be a performant way to receive model objects back from the driver -- avoiding the middle-man Hash object when the pattern of using the hash as a data object doesn't satisfy the needs of the client.

For a visualization, here is a rough sequence diagram, showing the wasted iteration in this use case.

I'm addressing a few issues in our code base around this concept and wanted to gauge y'alls opinion / temperature on this as I proceeded.

Cheers,

Evan Prothro

--
You received this message because you are subscribed to a topic in the Google Groups "DataStax Ruby Driver for Apache Cassandra User Mailing List" group.
To unsubscribe from this topic, visit https://groups.google.com/a/lists.datastax.com/d/topic/ruby-driver-user/Ts6c6jgoc9g/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ruby-driver-user+unsubscribe@lists.datastax.com.

Reply all
Reply to author
Forward
0 new messages