[
https://issues.apache.org/jira/browse/CASSANDRA-3289?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13118806#comment-13118806
]
Sylvain Lebresne commented on CASSANDRA-3289:
---------------------------------------------
Unfortunately this doesn't work in the case of reading to put in the cache,
because in that case, we need to always use ThreadSafeSortedColumns (in CFS,
line 1128). I see a few solutions:
* make ABSC work even if the input doesn't arrive in sorted order (i.e,
remove the assertion since the code is already there). We had this debate
already, I still think that it is a solution that make sense and note that in
that case it would likely still be the more efficient solution. But I can
understand that feeling is not shared.
* make CollactionController only use non thread-safe CF (a little bit like
the attached patch, but using TreeMapSortedColumns in the
collectTimeOrderedData) *and* add a cloneMe towards TSSC in the 'read for
cache' case. But that involves a copy of the CF.
* instead of passing the Factory around, pass a boolean indicating if the
returned CF should be thread safe or not. In that way, if the boolean is true,
both collectTimeOrderedData and collectAddData would use TSSC, otherwise, cTOD
would use TMSC and cAD would use ABSC.
Again, I think the first one has my preference, but if we're afraid that by
doing so we'll start using ABSC in places where it's clearly not the most
efficient solution, then the last solution is probably the best one.
But I would agree that this passing of Factory around is not very easy to use
correctly and we should probably come up with a cleaner solution.
> assert err on
> ArrayBackedSortedColumns.addColumn(ArrayBackedSortedColumns.java:126)
> -----------------------------------------------------------------------------------
>
> Key: CASSANDRA-3289
> URL: https://issues.apache.org/jira/browse/CASSANDRA-3289
> Project: Cassandra
> Issue Type: Bug
> Components: Core
> Affects Versions: 1.0.0
> Reporter: Jackson Chung
> Assignee: Jonathan Ellis
> Priority: Critical
> Fix For: 1.0.0
>
> Attachments: 3289.txt
>
>
> I have the following in trunk:
> RowKey: b
> => (column=a, value=38383838383838383838, timestamp=1317421952793000)
> => (column=d, value=617364646661736466, timestamp=1317420968944000)
> => (column=e, value=38383838383838383838, timestamp=1317421096152000)
> => (column=f, value=33343334333433343334, timestamp=1317422838818000)
> => (column=g, value=33343334333433343334, timestamp=1317422565130000)
> => (column=i, value=33343334333433343334, timestamp=1317422879258000)
> => (column=j, value=33343334333433343334, timestamp=1317422814873000)
> => (column=o, value=33343334333433343334, timestamp=1317422867106000)
> => (column=x, value=33343334333433343334, timestamp=1317422394097000)
> => (column=z, value=38383838383838383838, timestamp=1317421982057000)
> Keyspace: testks:
> Replication Strategy: org.apache.cassandra.locator.NetworkTopologyStrategy
> Durable Writes: true
> Options: [168:1]
> Column Families:
> ColumnFamily: testcf
> Key Validation Class: org.apache.cassandra.db.marshal.BytesType
> Default column value validator:
> org.apache.cassandra.db.marshal.BytesType
> Columns sorted by: org.apache.cassandra.db.marshal.BytesType
> Row cache size / save period in seconds / keys to save : 0.0/0/all
> Key cache size / save period in seconds: 200000.0/14400
> GC grace seconds: 864000
> Compaction min/max thresholds: 4/32
> Read repair chance: 1.0
> Replicate on write: true
> Built indexes: []
> Compaction Strategy:
> org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy
> every thing is flushed to the sstables, but not in the same sstables, and the
> columns are in some what 'random' form:
> /var/lib/cassandra/data/testks/testcf-h-10-Data.db
> {
> "61": [["0c","76",1317405903119000], ["0d","76",1317405977002000],
> ["7a","38383838383838383838",1317422276322000]],
> "62": [["61","38383838383838383838",1317421952793000],
> ["63","4e864303",1317421827329000,"d"],
> ["64","617364646661736466",1317420968944000],
> ["65","38383838383838383838",1317421096152000],
> ["67","33343334333433343334",1317422565130000],
> ["78","33343334333433343334",1317422394097000],
> ["7a","38383838383838383838",1317421982057000]]
> }
> /var/lib/cassandra/data/testks/testcf-h-12-Data.db
> {
> "62": [["6a","33343334333433343334",1317422814873000]]
> }
> /var/lib/cassandra/data/testks/testcf-h-13-Data.db
> {
> "62": [["66","33343334333433343334",1317422838818000]]
> }
> /var/lib/cassandra/data/testks/testcf-h-14-Data.db
> {
> "62": [["6f","33343334333433343334",1317422867106000]]
> }
> /var/lib/cassandra/data/testks/testcf-h-15-Data.db
> {
> "62": [["69","33343334333433343334",1317422879258000]]
> }
> then i basically make a call to get key=b with all the column names (yes
> included column names that didn't exist to save time):
> ColumnFamilyResult<String, String> queryColumns = template.queryColumns("b",
> Arrays.asList("a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"));
> (let me know if it would be easier to just upload the sstables to the ticket)
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira