[jira] [Updated] (CASSANDRA-10789) Allow DBAs to kill individual client sessions from certain IP(s) and temporarily block subsequent connections without bouncing JVM
[ https://issues.apache.org/jira/browse/CASSANDRA-10789?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] N L updated CASSANDRA-10789: -- Status: Ready to Commit (was: Patch Available) > Allow DBAs to kill individual client sessions from certain IP(s) and > temporarily block subsequent connections without bouncing JVM > -- > > Key: CASSANDRA-10789 > URL: https://issues.apache.org/jira/browse/CASSANDRA-10789 > Project: Cassandra > Issue Type: Improvement > Components: Coordination >Reporter: Wei Deng >Assignee: Damien Stevenson >Priority: Major > Labels: 4.0-feature-freeze-review-requested > Fix For: 4.x > > Attachments: 10789-trunk-dtest.txt, 10789-trunk.txt > > > In production, there could be hundreds of clients connected to a Cassandra > cluster (maybe even from different applications), and if they use DataStax > Java Driver, each client will establish at least one TCP connection to a > Cassandra server (see > https://datastax.github.io/java-driver/2.1.9/features/pooling/). This is all > normal and at any given time, you can indeed see hundreds of ESTABLISHED > connections to port 9042 on a C* server (from netstat -na). The problem is > that sometimes when a C* cluster is under heavy load, when the DBA identifies > some client session that sends abusive amount of traffic to the C* server and > would like to stop it, they would like a lightweight approach rather than > shutting down the JVM or rolling restart the whole cluster to kill all > hundreds of connections in order to kill a single client session. If the DBA > had root privilege, they would have been able to do something at the OS > network level to achieve the same goal but oftentimes enterprise DBA role is > separate from OS sysadmin role, so the DBAs usually don't have that privilege. > This is especially helpful when you have a multi-tenant C* cluster and you > want to have the impact for handling such client to be minimal to the other > applications. This feature (killing individual session) seems to be a common > feature in other databases (regardless of whether the client has some > reconnect logic or not). It could be implemented as a JMX MBean method and > exposed through nodetool to the DBAs. > Note due to CQL driver's automated reconnection, simply killing the currently > connected client session will not work well, so the JMX parameter should be > an IP address or a list of IP addresses, so that the Cassandra server can > terminate existing connection with that IP, and block future connection > attempts from that IP for the remaining time until the JVM is restarted. -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org
[jira] [Commented] (CASSANDRA-14796) Provide a tool which allows users to force manual compaction by ks.table and partition key
[ https://issues.apache.org/jira/browse/CASSANDRA-14796?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16632519#comment-16632519 ] Jeff Jirsa commented on CASSANDRA-14796: Sounds like a really useful feature, especially easy since we can already compact by token range. > Provide a tool which allows users to force manual compaction by ks.table and > partition key > -- > > Key: CASSANDRA-14796 > URL: https://issues.apache.org/jira/browse/CASSANDRA-14796 > Project: Cassandra > Issue Type: Wish >Reporter: Joseph Lynch >Priority: Minor > > It's somewhat common to have a "hot partition" or otherwise "bad partition" > that is causing neighbors to fail. In addition to CASSANDRA-12106, I think it > would be really useful to have an optional partition key argument to > {{nodetool compact}} (similar to {{getendpoints}}) which would determine > which sstables a partition resides in (similar to {{getsstables}}) and then > run manual compaction on just those sstables. > I know at Netflix a common way that we "mitigate" these bad partitions is to > delete them, but if the partition is really large it would be nice to be able > to delete them _and_ then force compaction of sstables containing them. > Obviously {{gc_grace}} get's in the way but it seems like a cheap/useful tool > either way. -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org
[jira] [Commented] (CASSANDRA-9633) Add ability to encrypt sstables
[ https://issues.apache.org/jira/browse/CASSANDRA-9633?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16632507#comment-16632507 ] Jean Duclair TAGU commented on CASSANDRA-9633: -- Hi Jason Brown, just checking if this feature is included in the 4.0 release currently being tested. Thanks > Add ability to encrypt sstables > --- > > Key: CASSANDRA-9633 > URL: https://issues.apache.org/jira/browse/CASSANDRA-9633 > Project: Cassandra > Issue Type: New Feature >Reporter: Jason Brown >Assignee: Jason Brown >Priority: Major > Labels: encryption, security, sstable > Fix For: 4.x > > > Add option to allow encrypting of sstables. > I have a version of this functionality built on cassandra 2.0 that > piggy-backs on the existing sstable compression functionality and ICompressor > interface (similar in nature to what DataStax Enterprise does). However, if > we're adding the feature to the main OSS product, I'm not sure if we want to > use the pluggable compression framework or if it's worth investigating a > different path. I think there's a lot of upside in reusing the sstable > compression scheme, but perhaps add a new component in cqlsh for table > encryption and a corresponding field in CFMD. > Encryption configuration in the yaml can use the same mechanism as > CASSANDRA-6018 (which is currently pending internal review). -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org
[jira] [Commented] (CASSANDRA-14796) Provide a tool which allows users to force manual compaction by ks.table and partition key
[ https://issues.apache.org/jira/browse/CASSANDRA-14796?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16632504#comment-16632504 ] Chris Lohfink commented on CASSANDRA-14796: --- Can be a convenience wrapper over [forceKeyspaceCompactionForTokenRange|https://github.com/apache/cassandra/blob/trunk/src/java/org/apache/cassandra/service/StorageServiceMBean.java#L286], you can calculate the token and do this with {{nodetool compact}} with {{-st}} and {{-et}} for now > Provide a tool which allows users to force manual compaction by ks.table and > partition key > -- > > Key: CASSANDRA-14796 > URL: https://issues.apache.org/jira/browse/CASSANDRA-14796 > Project: Cassandra > Issue Type: Wish >Reporter: Joseph Lynch >Priority: Minor > > It's somewhat common to have a "hot partition" or otherwise "bad partition" > that is causing neighbors to fail. In addition to CASSANDRA-12106, I think it > would be really useful to have an optional partition key argument to > {{nodetool compact}} (similar to {{getendpoints}}) which would determine > which sstables a partition resides in (similar to {{getsstables}}) and then > run manual compaction on just those sstables. > I know at Netflix a common way that we "mitigate" these bad partitions is to > delete them, but if the partition is really large it would be nice to be able > to delete them _and_ then force compaction of sstables containing them. > Obviously {{gc_grace}} get's in the way but it seems like a cheap/useful tool > either way. -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org
[jira] [Created] (CASSANDRA-14796) Provide a tool which allows users to force manual compaction by ks.table and partition key
Joseph Lynch created CASSANDRA-14796: Summary: Provide a tool which allows users to force manual compaction by ks.table and partition key Key: CASSANDRA-14796 URL: https://issues.apache.org/jira/browse/CASSANDRA-14796 Project: Cassandra Issue Type: Wish Reporter: Joseph Lynch It's somewhat common to have a "hot partition" or otherwise "bad partition" that is causing neighbors to fail. In addition to CASSANDRA-12106, I think it would be really useful to have an optional partition key argument to {{nodetool compact}} (similar to {{getendpoints}}) which would determine which sstables a partition resides in (similar to {{getsstables}}) and then run manual compaction on just those sstables. I know at Netflix a common way that we "mitigate" these bad partitions is to delete them, but if the partition is really large it would be nice to be able to delete them _and_ then force compaction of sstables containing them. Obviously {{gc_grace}} get's in the way but it seems like a cheap/useful tool either way. -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org
[jira] [Updated] (CASSANDRA-12942) ClassCastException during Status
[ https://issues.apache.org/jira/browse/CASSANDRA-12942?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Chris Donati updated CASSANDRA-12942: - Fix Version/s: 3.0.18 Attachment: 12942-3.0.txt Reproduced In: 3.11.2 Status: Patch Available (was: Open) This fix avoids the issue by skipping CFs where the tokens can't be compared to BOP tokens. > ClassCastException during Status > > > Key: CASSANDRA-12942 > URL: https://issues.apache.org/jira/browse/CASSANDRA-12942 > Project: Cassandra > Issue Type: Bug > Components: Tools > Environment: Cassandra 3.7 > OpenJDK 8 > Ubuntu 14.04 >Reporter: Chris Donati >Priority: Minor > Fix For: 3.0.18 > > Attachments: 12942-3.0.txt > > > I often encounter a ClassCastException when trying to run `nodetool status` > on a particular cluster. Occasionally, the command will work on one of the > nodes (and report all of the nodes as 'UN'), but the majority of the time, > nodetool raises the following exception: > {noformat} > error: null > -- StackTrace -- > java.lang.ClassCastException > {noformat} > A couple of times, I've gotten lucky and nodetool has provided a more verbose > error message: > {noformat} > error: org.apache.cassandra.dht.LocalPartitioner$LocalToken cannot be cast to > org.apache.cassandra.dht.ByteOrderedPartitioner$BytesToken > -- StackTrace -- > java.lang.ClassCastException: > org.apache.cassandra.dht.LocalPartitioner$LocalToken cannot be cast to > org.apache.cassandra.dht.ByteOrderedPartitioner$BytesToken > at > org.apache.cassandra.dht.ByteOrderedPartitioner$BytesToken.compareTo(ByteOrderedPartitioner.java:79) > at > org.apache.cassandra.dht.ByteOrderedPartitioner$BytesToken.compareTo(ByteOrderedPartitioner.java:55) > at org.apache.cassandra.dht.Token$KeyBound.compareTo(Token.java:166) > at org.apache.cassandra.dht.Token$KeyBound.compareTo(Token.java:145) > at org.apache.cassandra.db.DecoratedKey.compareTo(DecoratedKey.java:93) > at > org.apache.cassandra.io.sstable.IndexSummary.binarySearch(IndexSummary.java:122) > at > org.apache.cassandra.io.sstable.format.SSTableReader.getSampleIndexesForRanges(SSTableReader.java:1345) > at > org.apache.cassandra.io.sstable.format.SSTableReader.getKeySamples(SSTableReader.java:1379) > at > org.apache.cassandra.db.ColumnFamilyStore.keySamples(ColumnFamilyStore.java:2058) > at > org.apache.cassandra.service.StorageService.keySamples(StorageService.java:3722) > at > org.apache.cassandra.service.StorageService.getSplits(StorageService.java:3678) > at > org.apache.cassandra.dht.ByteOrderedPartitioner.describeOwnership(ByteOrderedPartitioner.java:284) > at > org.apache.cassandra.service.StorageService.effectiveOwnership(StorageService.java:4460) > at > org.apache.cassandra.service.StorageService.effectiveOwnership(StorageService.java:184) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > at java.lang.reflect.Method.invoke(Method.java:498) > at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:71) > at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > at java.lang.reflect.Method.invoke(Method.java:498) > at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:275) > at > com.sun.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(StandardMBeanIntrospector.java:112) > at > com.sun.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(StandardMBeanIntrospector.java:46) > at > com.sun.jmx.mbeanserver.MBeanIntrospector.invokeM(MBeanIntrospector.java:237) > at com.sun.jmx.mbeanserver.PerInterface.invoke(PerInterface.java:138) > at com.sun.jmx.mbeanserver.MBeanSupport.invoke(MBeanSupport.java:252) > at > com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819) > at > com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801) > at > javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1468) > at > javax.management.remote.rmi.RMIConnectionImpl.access$300(RMIConnectionImpl.java:76) > at > javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1309) > at > javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1401) > at > javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:829) > at
[jira] [Commented] (CASSANDRA-14373) Allow using custom script for chronicle queue BinLog archival
[ https://issues.apache.org/jira/browse/CASSANDRA-14373?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16632164#comment-16632164 ] Pramod K Sivaraju commented on CASSANDRA-14373: --- Thanks [~krummas]. Sorry for the trouble. I should have raised the pull request earlier in the release cycle. Let me know if any other fixes are required. > Allow using custom script for chronicle queue BinLog archival > - > > Key: CASSANDRA-14373 > URL: https://issues.apache.org/jira/browse/CASSANDRA-14373 > Project: Cassandra > Issue Type: Improvement >Reporter: Stefan Podkowinski >Assignee: Pramod K Sivaraju >Priority: Major > Labels: lhf, pull-request-available > Fix For: 4.x > > Time Spent: 10m > Remaining Estimate: 0h > > It would be nice to allow the user to configure an archival script that will > be executed in {{BinLog.onReleased(cycle, file)}} for every deleted bin log, > just as we do in {{CommitLogArchiver}}. The script should be able to copy the > released file to an external location or do whatever the author hand in mind. > Deleting the log file should be delegated to the script as well. > See CASSANDRA-13983, CASSANDRA-12151 for use cases. > -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org
[jira] [Updated] (CASSANDRA-14794) Avoid calling iter.next() in a loop when notifying indexers about range tombstones
[ https://issues.apache.org/jira/browse/CASSANDRA-14794?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Marcus Eriksson updated CASSANDRA-14794: Resolution: Fixed Fix Version/s: (was: 3.11.x) (was: 4.x) (was: 3.0.x) 4.0 3.11.4 3.0.18 Status: Resolved (was: Ready to Commit) and committed as {{30d2835809e119173b1124b3eecb134e3a8c19b6}} to 3.0 and merged up, thanks! tests for the other branches: [3.11|https://circleci.com/workflow-run/6af0ef35-4be8-4f7c-8a8a-30ccaddc7b1f] [trunk|https://circleci.com/workflow-run/ff02648a-a795-4af1-a742-9673acccde41] > Avoid calling iter.next() in a loop when notifying indexers about range > tombstones > -- > > Key: CASSANDRA-14794 > URL: https://issues.apache.org/jira/browse/CASSANDRA-14794 > Project: Cassandra > Issue Type: Bug >Reporter: Marcus Eriksson >Assignee: Marcus Eriksson >Priority: Major > Fix For: 3.0.18, 3.11.4, 4.0 > > > In > [SecondaryIndexManager|https://github.com/apache/cassandra/blob/914c66685c5bebe1624d827a9b4562b73a08c297/src/java/org/apache/cassandra/index/SecondaryIndexManager.java#L901-L902] > - avoid calling {{.next()}} in the {{.forEach(..)}} -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org
[4/6] cassandra git commit: Merge branch 'cassandra-3.0' into cassandra-3.11
Merge branch 'cassandra-3.0' into cassandra-3.11 Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/c7e6eee5 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/c7e6eee5 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/c7e6eee5 Branch: refs/heads/trunk Commit: c7e6eee58d0ef207224a24fe0d99507f1af06771 Parents: c34a0f5 30d2835 Author: Marcus Eriksson Authored: Fri Sep 28 12:54:08 2018 +0200 Committer: Marcus Eriksson Committed: Fri Sep 28 12:54:08 2018 +0200 -- CHANGES.txt | 1 + .../cassandra/index/SecondaryIndexManager.java | 5 ++- .../apache/cassandra/index/CustomIndexTest.java | 32 3 files changed, 37 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/c7e6eee5/CHANGES.txt -- diff --cc CHANGES.txt index 20cec87,70b2996..dfc0eeb --- a/CHANGES.txt +++ b/CHANGES.txt @@@ -1,5 -1,5 +1,6 @@@ -3.0.18 +3.11.4 +Merged from 3.0: + * Avoid calling iter.next() in a loop when notifying indexers about range tombstones (CASSANDRA-14794) * Fix purging semi-expired RT boundaries in reversed iterators (CASSANDRA-14672) * DESC order reads can fail to return the last Unfiltered in the partition (CASSANDRA-14766) * Fix corrupted collection deletions for dropped columns in 3.0 <-> 2.{1,2} messages (CASSANDRA-14568) http://git-wip-us.apache.org/repos/asf/cassandra/blob/c7e6eee5/src/java/org/apache/cassandra/index/SecondaryIndexManager.java -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/c7e6eee5/test/unit/org/apache/cassandra/index/CustomIndexTest.java -- - To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org
[5/6] cassandra git commit: Merge branch 'cassandra-3.0' into cassandra-3.11
Merge branch 'cassandra-3.0' into cassandra-3.11 Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/c7e6eee5 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/c7e6eee5 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/c7e6eee5 Branch: refs/heads/cassandra-3.11 Commit: c7e6eee58d0ef207224a24fe0d99507f1af06771 Parents: c34a0f5 30d2835 Author: Marcus Eriksson Authored: Fri Sep 28 12:54:08 2018 +0200 Committer: Marcus Eriksson Committed: Fri Sep 28 12:54:08 2018 +0200 -- CHANGES.txt | 1 + .../cassandra/index/SecondaryIndexManager.java | 5 ++- .../apache/cassandra/index/CustomIndexTest.java | 32 3 files changed, 37 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/c7e6eee5/CHANGES.txt -- diff --cc CHANGES.txt index 20cec87,70b2996..dfc0eeb --- a/CHANGES.txt +++ b/CHANGES.txt @@@ -1,5 -1,5 +1,6 @@@ -3.0.18 +3.11.4 +Merged from 3.0: + * Avoid calling iter.next() in a loop when notifying indexers about range tombstones (CASSANDRA-14794) * Fix purging semi-expired RT boundaries in reversed iterators (CASSANDRA-14672) * DESC order reads can fail to return the last Unfiltered in the partition (CASSANDRA-14766) * Fix corrupted collection deletions for dropped columns in 3.0 <-> 2.{1,2} messages (CASSANDRA-14568) http://git-wip-us.apache.org/repos/asf/cassandra/blob/c7e6eee5/src/java/org/apache/cassandra/index/SecondaryIndexManager.java -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/c7e6eee5/test/unit/org/apache/cassandra/index/CustomIndexTest.java -- - To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org
[1/6] cassandra git commit: Avoid calling iter.next() in a loop when notifying indexers about range tombstones
Repository: cassandra Updated Branches: refs/heads/cassandra-3.0 d496dca67 -> 30d283580 refs/heads/cassandra-3.11 c34a0f520 -> c7e6eee58 refs/heads/trunk a0636881f -> 42c92b976 Avoid calling iter.next() in a loop when notifying indexers about range tombstones Patch by marcuse; reviewed by Alex Petrov and Sam Tunnicliffe for CASSANDRA-14794 Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/30d28358 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/30d28358 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/30d28358 Branch: refs/heads/cassandra-3.0 Commit: 30d2835809e119173b1124b3eecb134e3a8c19b6 Parents: d496dca Author: Marcus Eriksson Authored: Thu Sep 27 11:23:03 2018 +0200 Committer: Marcus Eriksson Committed: Fri Sep 28 12:52:20 2018 +0200 -- CHANGES.txt | 1 + .../cassandra/index/SecondaryIndexManager.java | 5 ++- .../apache/cassandra/index/CustomIndexTest.java | 32 3 files changed, 37 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/30d28358/CHANGES.txt -- diff --git a/CHANGES.txt b/CHANGES.txt index 2c2f4f5..70b2996 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,4 +1,5 @@ 3.0.18 + * Avoid calling iter.next() in a loop when notifying indexers about range tombstones (CASSANDRA-14794) * Fix purging semi-expired RT boundaries in reversed iterators (CASSANDRA-14672) * DESC order reads can fail to return the last Unfiltered in the partition (CASSANDRA-14766) * Fix corrupted collection deletions for dropped columns in 3.0 <-> 2.{1,2} messages (CASSANDRA-14568) http://git-wip-us.apache.org/repos/asf/cassandra/blob/30d28358/src/java/org/apache/cassandra/index/SecondaryIndexManager.java -- diff --git a/src/java/org/apache/cassandra/index/SecondaryIndexManager.java b/src/java/org/apache/cassandra/index/SecondaryIndexManager.java index 5976ddf..c5ecd25 100644 --- a/src/java/org/apache/cassandra/index/SecondaryIndexManager.java +++ b/src/java/org/apache/cassandra/index/SecondaryIndexManager.java @@ -596,7 +596,10 @@ public class SecondaryIndexManager implements IndexRegistry { Iterator iter = deletionInfo.rangeIterator(false); while (iter.hasNext()) -indexers.forEach(indexer -> indexer.rangeTombstone(iter.next())); +{ +RangeTombstone rt = iter.next(); +indexers.forEach(indexer -> indexer.rangeTombstone(rt)); +} } indexers.forEach(Index.Indexer::finish); http://git-wip-us.apache.org/repos/asf/cassandra/blob/30d28358/test/unit/org/apache/cassandra/index/CustomIndexTest.java -- diff --git a/test/unit/org/apache/cassandra/index/CustomIndexTest.java b/test/unit/org/apache/cassandra/index/CustomIndexTest.java index 81e1745..66e9fe5 100644 --- a/test/unit/org/apache/cassandra/index/CustomIndexTest.java +++ b/test/unit/org/apache/cassandra/index/CustomIndexTest.java @@ -28,6 +28,7 @@ import java.util.stream.Collectors; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Sets; import org.junit.Test; import com.datastax.driver.core.exceptions.QueryValidationException; @@ -792,6 +793,37 @@ public class CustomIndexTest extends CQLTester assertEquals(1, index.finishCalls); } +@Test +public void rangeTombstoneTest() throws Throwable +{ +createTable("CREATE TABLE %s(k int, c int, v int, v2 int, PRIMARY KEY(k,c))"); +ColumnFamilyStore cfs = getCurrentColumnFamilyStore(); +SecondaryIndexManager indexManager = cfs.indexManager; + +// Insert a single range tombstone +execute("DELETE FROM %s WHERE k=1 and c > 2"); +cfs.forceBlockingFlush(); + +// Create the index, which won't automatically start building +String indexName = "range_tombstone_idx"; +createIndex(String.format("CREATE CUSTOM INDEX %s ON %%s(v) USING '%s'", + indexName, StubIndex.class.getName())); +String indexName2 = "range_tombstone_idx2"; +createIndex(String.format("CREATE CUSTOM INDEX %s ON %%s(v2) USING '%s'", + indexName2, StubIndex.class.getName())); + +StubIndex index = (StubIndex) indexManager.getIndexByName(indexName); +StubIndex
[3/6] cassandra git commit: Avoid calling iter.next() in a loop when notifying indexers about range tombstones
Avoid calling iter.next() in a loop when notifying indexers about range tombstones Patch by marcuse; reviewed by Alex Petrov and Sam Tunnicliffe for CASSANDRA-14794 Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/30d28358 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/30d28358 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/30d28358 Branch: refs/heads/trunk Commit: 30d2835809e119173b1124b3eecb134e3a8c19b6 Parents: d496dca Author: Marcus Eriksson Authored: Thu Sep 27 11:23:03 2018 +0200 Committer: Marcus Eriksson Committed: Fri Sep 28 12:52:20 2018 +0200 -- CHANGES.txt | 1 + .../cassandra/index/SecondaryIndexManager.java | 5 ++- .../apache/cassandra/index/CustomIndexTest.java | 32 3 files changed, 37 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/30d28358/CHANGES.txt -- diff --git a/CHANGES.txt b/CHANGES.txt index 2c2f4f5..70b2996 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,4 +1,5 @@ 3.0.18 + * Avoid calling iter.next() in a loop when notifying indexers about range tombstones (CASSANDRA-14794) * Fix purging semi-expired RT boundaries in reversed iterators (CASSANDRA-14672) * DESC order reads can fail to return the last Unfiltered in the partition (CASSANDRA-14766) * Fix corrupted collection deletions for dropped columns in 3.0 <-> 2.{1,2} messages (CASSANDRA-14568) http://git-wip-us.apache.org/repos/asf/cassandra/blob/30d28358/src/java/org/apache/cassandra/index/SecondaryIndexManager.java -- diff --git a/src/java/org/apache/cassandra/index/SecondaryIndexManager.java b/src/java/org/apache/cassandra/index/SecondaryIndexManager.java index 5976ddf..c5ecd25 100644 --- a/src/java/org/apache/cassandra/index/SecondaryIndexManager.java +++ b/src/java/org/apache/cassandra/index/SecondaryIndexManager.java @@ -596,7 +596,10 @@ public class SecondaryIndexManager implements IndexRegistry { Iterator iter = deletionInfo.rangeIterator(false); while (iter.hasNext()) -indexers.forEach(indexer -> indexer.rangeTombstone(iter.next())); +{ +RangeTombstone rt = iter.next(); +indexers.forEach(indexer -> indexer.rangeTombstone(rt)); +} } indexers.forEach(Index.Indexer::finish); http://git-wip-us.apache.org/repos/asf/cassandra/blob/30d28358/test/unit/org/apache/cassandra/index/CustomIndexTest.java -- diff --git a/test/unit/org/apache/cassandra/index/CustomIndexTest.java b/test/unit/org/apache/cassandra/index/CustomIndexTest.java index 81e1745..66e9fe5 100644 --- a/test/unit/org/apache/cassandra/index/CustomIndexTest.java +++ b/test/unit/org/apache/cassandra/index/CustomIndexTest.java @@ -28,6 +28,7 @@ import java.util.stream.Collectors; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Sets; import org.junit.Test; import com.datastax.driver.core.exceptions.QueryValidationException; @@ -792,6 +793,37 @@ public class CustomIndexTest extends CQLTester assertEquals(1, index.finishCalls); } +@Test +public void rangeTombstoneTest() throws Throwable +{ +createTable("CREATE TABLE %s(k int, c int, v int, v2 int, PRIMARY KEY(k,c))"); +ColumnFamilyStore cfs = getCurrentColumnFamilyStore(); +SecondaryIndexManager indexManager = cfs.indexManager; + +// Insert a single range tombstone +execute("DELETE FROM %s WHERE k=1 and c > 2"); +cfs.forceBlockingFlush(); + +// Create the index, which won't automatically start building +String indexName = "range_tombstone_idx"; +createIndex(String.format("CREATE CUSTOM INDEX %s ON %%s(v) USING '%s'", + indexName, StubIndex.class.getName())); +String indexName2 = "range_tombstone_idx2"; +createIndex(String.format("CREATE CUSTOM INDEX %s ON %%s(v2) USING '%s'", + indexName2, StubIndex.class.getName())); + +StubIndex index = (StubIndex) indexManager.getIndexByName(indexName); +StubIndex index2 = (StubIndex) indexManager.getIndexByName(indexName2); + +// Index the partition +DecoratedKey targetKey =
[2/6] cassandra git commit: Avoid calling iter.next() in a loop when notifying indexers about range tombstones
Avoid calling iter.next() in a loop when notifying indexers about range tombstones Patch by marcuse; reviewed by Alex Petrov and Sam Tunnicliffe for CASSANDRA-14794 Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/30d28358 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/30d28358 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/30d28358 Branch: refs/heads/cassandra-3.11 Commit: 30d2835809e119173b1124b3eecb134e3a8c19b6 Parents: d496dca Author: Marcus Eriksson Authored: Thu Sep 27 11:23:03 2018 +0200 Committer: Marcus Eriksson Committed: Fri Sep 28 12:52:20 2018 +0200 -- CHANGES.txt | 1 + .../cassandra/index/SecondaryIndexManager.java | 5 ++- .../apache/cassandra/index/CustomIndexTest.java | 32 3 files changed, 37 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/30d28358/CHANGES.txt -- diff --git a/CHANGES.txt b/CHANGES.txt index 2c2f4f5..70b2996 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,4 +1,5 @@ 3.0.18 + * Avoid calling iter.next() in a loop when notifying indexers about range tombstones (CASSANDRA-14794) * Fix purging semi-expired RT boundaries in reversed iterators (CASSANDRA-14672) * DESC order reads can fail to return the last Unfiltered in the partition (CASSANDRA-14766) * Fix corrupted collection deletions for dropped columns in 3.0 <-> 2.{1,2} messages (CASSANDRA-14568) http://git-wip-us.apache.org/repos/asf/cassandra/blob/30d28358/src/java/org/apache/cassandra/index/SecondaryIndexManager.java -- diff --git a/src/java/org/apache/cassandra/index/SecondaryIndexManager.java b/src/java/org/apache/cassandra/index/SecondaryIndexManager.java index 5976ddf..c5ecd25 100644 --- a/src/java/org/apache/cassandra/index/SecondaryIndexManager.java +++ b/src/java/org/apache/cassandra/index/SecondaryIndexManager.java @@ -596,7 +596,10 @@ public class SecondaryIndexManager implements IndexRegistry { Iterator iter = deletionInfo.rangeIterator(false); while (iter.hasNext()) -indexers.forEach(indexer -> indexer.rangeTombstone(iter.next())); +{ +RangeTombstone rt = iter.next(); +indexers.forEach(indexer -> indexer.rangeTombstone(rt)); +} } indexers.forEach(Index.Indexer::finish); http://git-wip-us.apache.org/repos/asf/cassandra/blob/30d28358/test/unit/org/apache/cassandra/index/CustomIndexTest.java -- diff --git a/test/unit/org/apache/cassandra/index/CustomIndexTest.java b/test/unit/org/apache/cassandra/index/CustomIndexTest.java index 81e1745..66e9fe5 100644 --- a/test/unit/org/apache/cassandra/index/CustomIndexTest.java +++ b/test/unit/org/apache/cassandra/index/CustomIndexTest.java @@ -28,6 +28,7 @@ import java.util.stream.Collectors; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Sets; import org.junit.Test; import com.datastax.driver.core.exceptions.QueryValidationException; @@ -792,6 +793,37 @@ public class CustomIndexTest extends CQLTester assertEquals(1, index.finishCalls); } +@Test +public void rangeTombstoneTest() throws Throwable +{ +createTable("CREATE TABLE %s(k int, c int, v int, v2 int, PRIMARY KEY(k,c))"); +ColumnFamilyStore cfs = getCurrentColumnFamilyStore(); +SecondaryIndexManager indexManager = cfs.indexManager; + +// Insert a single range tombstone +execute("DELETE FROM %s WHERE k=1 and c > 2"); +cfs.forceBlockingFlush(); + +// Create the index, which won't automatically start building +String indexName = "range_tombstone_idx"; +createIndex(String.format("CREATE CUSTOM INDEX %s ON %%s(v) USING '%s'", + indexName, StubIndex.class.getName())); +String indexName2 = "range_tombstone_idx2"; +createIndex(String.format("CREATE CUSTOM INDEX %s ON %%s(v2) USING '%s'", + indexName2, StubIndex.class.getName())); + +StubIndex index = (StubIndex) indexManager.getIndexByName(indexName); +StubIndex index2 = (StubIndex) indexManager.getIndexByName(indexName2); + +// Index the partition +DecoratedKey targetKey =
[6/6] cassandra git commit: Merge branch 'cassandra-3.11' into trunk
Merge branch 'cassandra-3.11' into trunk Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/42c92b97 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/42c92b97 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/42c92b97 Branch: refs/heads/trunk Commit: 42c92b9768b58884e426490e103583b82e892d4e Parents: a063688 c7e6eee Author: Marcus Eriksson Authored: Fri Sep 28 12:56:08 2018 +0200 Committer: Marcus Eriksson Committed: Fri Sep 28 12:56:08 2018 +0200 -- CHANGES.txt | 1 + .../cassandra/index/SecondaryIndexManager.java | 5 +++- .../apache/cassandra/index/CustomIndexTest.java | 31 3 files changed, 36 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/42c92b97/CHANGES.txt -- diff --cc CHANGES.txt index 0d3571d,dfc0eeb..e89c1c5 --- a/CHANGES.txt +++ b/CHANGES.txt @@@ -1,323 -1,6 +1,324 @@@ +4.0 + * Enable snapshot artifacts publish (CASSANDRA-12704) + * Introduce RangesAtEndpoint.unwrap to simplify StreamSession.addTransferRanges (CASSANDRA-14770) + * LOCAL_QUORUM may speculate to non-local nodes, resulting in Timeout instead of Unavailable (CASSANDRA-14735) + * Avoid creating empty compaction tasks after truncate (CASSANDRA-14780) + * Fail incremental repair prepare phase if it encounters sstables from un-finalized sessions (CASSANDRA-14763) + * Add a check for receiving digest response from transient node (CASSANDRA-14750) + * Fail query on transient replica if coordinator only expects full data (CASSANDRA-14704) + * Remove mentions of transient replication from repair path (CASSANDRA-14698) + * Fix handleRepairStatusChangedNotification to remove first then add (CASSANDRA-14720) + * Allow transient node to serve as a repair coordinator (CASSANDRA-14693) + * DecayingEstimatedHistogramReservoir.EstimatedHistogramReservoirSnapshot returns wrong value for size() and incorrectly calculates count (CASSANDRA-14696) + * AbstractReplicaCollection equals and hash code should throw due to conflict between order sensitive/insensitive uses (CASSANDRA-14700) + * Detect inconsistencies in repaired data on the read path (CASSANDRA-14145) + * Add checksumming to the native protocol (CASSANDRA-13304) + * Make AuthCache more easily extendable (CASSANDRA-14662) + * Extend RolesCache to include detailed role info (CASSANDRA-14497) + * Add fqltool compare (CASSANDRA-14619) + * Add fqltool replay (CASSANDRA-14618) + * Log keyspace in full query log (CASSANDRA-14656) + * Transient Replication and Cheap Quorums (CASSANDRA-14404) + * Log server-generated timestamp and nowInSeconds used by queries in FQL (CASSANDRA-14675) + * Add diagnostic events for read repairs (CASSANDRA-14668) + * Use consistent nowInSeconds and timestamps values within a request (CASSANDRA-14671) + * Add sampler for query time and expose with nodetool (CASSANDRA-14436) + * Clean up Message.Request implementations (CASSANDRA-14677) + * Disable old native protocol versions on demand (CASANDRA-14659) + * Allow specifying now-in-seconds in native protocol (CASSANDRA-14664) + * Improve BTree build performance by avoiding data copy (CASSANDRA-9989) + * Make monotonic read / read repair configurable (CASSANDRA-14635) + * Refactor CompactionStrategyManager (CASSANDRA-14621) + * Flush netty client messages immediately by default (CASSANDRA-13651) + * Improve read repair blocking behavior (CASSANDRA-10726) + * Add a virtual table to expose settings (CASSANDRA-14573) + * Fix up chunk cache handling of metrics (CASSANDRA-14628) + * Extend IAuthenticator to accept peer SSL certificates (CASSANDRA-14652) + * Incomplete handling of exceptions when decoding incoming messages (CASSANDRA-14574) + * Add diagnostic events for user audit logging (CASSANDRA-13668) + * Allow retrieving diagnostic events via JMX (CASSANDRA-14435) + * Add base classes for diagnostic events (CASSANDRA-13457) + * Clear view system metadata when dropping keyspace (CASSANDRA-14646) + * Allocate ReentrantLock on-demand in java11 AtomicBTreePartitionerBase (CASSANDRA-14637) + * Make all existing virtual tables use LocalPartitioner (CASSANDRA-14640) + * Revert 4.0 GC alg back to CMS (CASANDRA-14636) + * Remove hardcoded java11 jvm args in idea workspace files (CASSANDRA-14627) + * Update netty to 4.1.128 (CASSANDRA-14633) + * Add a virtual table to expose thread pools (CASSANDRA-14523) + * Add a virtual table to expose caches (CASSANDRA-14538, CASSANDRA-14626) + * Fix toDate function for timestamp arguments (CASSANDRA-14502) + * Revert running dtests by default in circleci (CASSANDRA-14614) + * Stream entire SSTables when possible (CASSANDRA-14556) +
[jira] [Comment Edited] (CASSANDRA-12126) CAS Reads Inconsistencies
[ https://issues.apache.org/jira/browse/CASSANDRA-12126?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16631226#comment-16631226 ] Benedict edited comment on CASSANDRA-12126 at 9/28/18 9:42 AM: --- {quote}We read nothing in node Y, yet node Z read something in the next request. {quote} I think the problem here is that, at the API level, there isn't enough information to say that X didn't simply 'occur' *after* both Y and Z. That is, unless the rejection of Y occurs after X's timeout. In this case, it would seem to be an API-visible error, as at the point of timeout the indeterminacy should be fixed. Timeouts should not ‘live forever’ as the bogeyman, ready to mess with history. I think, though, that the suggested mechanism could result in this. Take three nodes (RF=3) A, B and C; and any three CAS operations X, Y and Z such that: * X and Y can always succeed * Z can only succeed if X has succeeded Setup: # Prepare _and_ Propose X with ballot 1; proposal accepted only by A ** this will be the last and only node’s proposal acceptance # Prepare Y with ballot 2; reach B and C before ballot 1, so they do not accept # Now, lock X and Y in battle, always failing to proceed to the propose step before the other reaches the prepare step again # X and Y both timeout having failed to cleanly apply Part 2: # Z is now attempted; it prepares to only B and C, seeing no in-progress proposal # As a result, it does not see X; it is rejected, so there is no new proposal/commit # Z is attempted again; this time, A is consulted # Suddenly, a wild X appears. From nowhere. Z succeeds, despite no intervening operations. It does seem, in essence, to be an incidence of the bug (or a very similar one) described in the ticket. was (Author: benedict): bq. We read nothing in node Y, yet node Z read something in the next request. I think the problem here is that, at the API level, there isn't enough information to say that X didn't simply 'occur' *after* both Y and Z. That is, unless the rejection of Y occurs after X's timeout. In this case, it would seem to be an API-visible error, as at the point of timeout the indeterminacy should be fixed. Timeouts should not ‘live forever’ as the bogeyman, ready to mess with history. I think, though, that the suggested mechanism could result in this. Take three nodes (RF=3) A, B and C; and any three CAS operations X, Y and Z such that: * X and Y can always succeed * Z can only succeed if X has succeeded Setup: # Prepare _and_ Propose X with ballot 1; proposal accepted only by A #* this will be the last and only node’s proposal acceptance # Prepare Y with ballot 2; reach B and C before ballot 1, so they do not accept # Now, lock X and Y in battle, always failing to proceed to the propose step before the other reaches the prepare step again # X and Y both timeout having failed to cleanly apply Part 2: # Z is now attempted; it prepares to only B and C, seeing no in-progress proposal # As a result, it does not see X; it is rejected, so there is no new proposal/commit # Read at SERIAL is performed; this time, A is consulted # Suddenly, a wild X appears. From nowhere. It does seem, in essence, to be an incidence of the bug (or a very similar one) described in the ticket. > CAS Reads Inconsistencies > -- > > Key: CASSANDRA-12126 > URL: https://issues.apache.org/jira/browse/CASSANDRA-12126 > Project: Cassandra > Issue Type: Bug > Components: Coordination >Reporter: sankalp kohli >Priority: Major > Labels: LWT > > While looking at the CAS code in Cassandra, I found a potential issue with > CAS Reads. Here is how it can happen with RF=3 > 1) You issue a CAS Write and it fails in the propose phase. A machine replies > true to a propose and saves the commit in accepted filed. The other two > machines B and C does not get to the accept phase. > Current state is that machine A has this commit in paxos table as accepted > but not committed and B and C does not. > 2) Issue a CAS Read and it goes to only B and C. You wont be able to read the > value written in step 1. This step is as if nothing is inflight. > 3) Issue another CAS Read and it goes to A and B. Now we will discover that > there is something inflight from A and will propose and commit it with the > current ballot. Now we can read the value written in step 1 as part of this > CAS read. > If we skip step 3 and instead run step 4, we will never learn about value > written in step 1. > 4. Issue a CAS Write and it involves only B and C. This will succeed and > commit a different value than step 1. Step 1 value will never be seen again > and was never seen before. > If you read the Lamport “paxos made simple” paper and read section 2.3. It > talks about this issue which is
[jira] [Commented] (CASSANDRA-14794) Avoid calling iter.next() in a loop when notifying indexers about range tombstones
[ https://issues.apache.org/jira/browse/CASSANDRA-14794?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16631526#comment-16631526 ] Sam Tunnicliffe commented on CASSANDRA-14794: - +1 > Avoid calling iter.next() in a loop when notifying indexers about range > tombstones > -- > > Key: CASSANDRA-14794 > URL: https://issues.apache.org/jira/browse/CASSANDRA-14794 > Project: Cassandra > Issue Type: Bug >Reporter: Marcus Eriksson >Assignee: Marcus Eriksson >Priority: Major > Fix For: 3.0.x, 3.11.x, 4.x > > > In > [SecondaryIndexManager|https://github.com/apache/cassandra/blob/914c66685c5bebe1624d827a9b4562b73a08c297/src/java/org/apache/cassandra/index/SecondaryIndexManager.java#L901-L902] > - avoid calling {{.next()}} in the {{.forEach(..)}} -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org
[jira] [Updated] (CASSANDRA-14794) Avoid calling iter.next() in a loop when notifying indexers about range tombstones
[ https://issues.apache.org/jira/browse/CASSANDRA-14794?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Sam Tunnicliffe updated CASSANDRA-14794: Status: Ready to Commit (was: Patch Available) > Avoid calling iter.next() in a loop when notifying indexers about range > tombstones > -- > > Key: CASSANDRA-14794 > URL: https://issues.apache.org/jira/browse/CASSANDRA-14794 > Project: Cassandra > Issue Type: Bug >Reporter: Marcus Eriksson >Assignee: Marcus Eriksson >Priority: Major > Fix For: 3.0.x, 3.11.x, 4.x > > > In > [SecondaryIndexManager|https://github.com/apache/cassandra/blob/914c66685c5bebe1624d827a9b4562b73a08c297/src/java/org/apache/cassandra/index/SecondaryIndexManager.java#L901-L902] > - avoid calling {{.next()}} in the {{.forEach(..)}} -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org
cassandra git commit: ninja-add missing .hashCode() in new fqltool classes
Repository: cassandra Updated Branches: refs/heads/trunk 87abe -> a0636881f ninja-add missing .hashCode() in new fqltool classes Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/a0636881 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/a0636881 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/a0636881 Branch: refs/heads/trunk Commit: a0636881f4c8d5e79b179825f07fabf25c325db5 Parents: 87a Author: Marcus Eriksson Authored: Fri Sep 28 08:39:12 2018 +0200 Committer: Marcus Eriksson Committed: Fri Sep 28 08:39:12 2018 +0200 -- .../apache/cassandra/fqltool/DriverResultSet.java | 16 .../apache/cassandra/fqltool/StoredResultSet.java | 16 2 files changed, 32 insertions(+) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/a0636881/tools/fqltool/src/org/apache/cassandra/fqltool/DriverResultSet.java -- diff --git a/tools/fqltool/src/org/apache/cassandra/fqltool/DriverResultSet.java b/tools/fqltool/src/org/apache/cassandra/fqltool/DriverResultSet.java index ccff370..e85b23b 100644 --- a/tools/fqltool/src/org/apache/cassandra/fqltool/DriverResultSet.java +++ b/tools/fqltool/src/org/apache/cassandra/fqltool/DriverResultSet.java @@ -22,6 +22,7 @@ import java.nio.ByteBuffer; import java.util.Collections; import java.util.Iterator; import java.util.List; +import java.util.Objects; import java.util.stream.Collectors; import com.google.common.collect.AbstractIterator; @@ -137,6 +138,11 @@ public class DriverResultSet implements ResultHandler.ComparableResultSet return true; } +public int hashCode() +{ +return Objects.hash(row); +} + public String toString() { StringBuilder sb = new StringBuilder(); @@ -210,6 +216,11 @@ public class DriverResultSet implements ResultHandler.ComparableResultSet return asList().equals(o.asList()); } + +public int hashCode() +{ +return Objects.hash(columnDefinitions, failed, failureException); +} } public static class DriverDefinition implements ResultHandler.ComparableDefinition @@ -239,6 +250,11 @@ public class DriverResultSet implements ResultHandler.ComparableResultSet return def.equals(((DriverDefinition)oo).def); } +public int hashCode() +{ +return Objects.hash(def); +} + public String toString() { return getName() + ':' + getType(); http://git-wip-us.apache.org/repos/asf/cassandra/blob/a0636881/tools/fqltool/src/org/apache/cassandra/fqltool/StoredResultSet.java -- diff --git a/tools/fqltool/src/org/apache/cassandra/fqltool/StoredResultSet.java b/tools/fqltool/src/org/apache/cassandra/fqltool/StoredResultSet.java index b08861d..39c4734 100644 --- a/tools/fqltool/src/org/apache/cassandra/fqltool/StoredResultSet.java +++ b/tools/fqltool/src/org/apache/cassandra/fqltool/StoredResultSet.java @@ -23,6 +23,7 @@ import java.nio.ByteBuffer; import java.util.Collections; import java.util.Iterator; import java.util.List; +import java.util.Objects; import java.util.function.Supplier; import java.util.stream.Collectors; @@ -148,6 +149,11 @@ public class StoredResultSet implements ResultHandler.ComparableResultSet return row.equals(((StoredComparableRow)other).row); } +public int hashCode() +{ +return Objects.hash(row, cds); +} + public String toString() { return row.stream().map(ByteBufferUtil::bytesToHex).collect(Collectors.joining(",")); @@ -198,6 +204,11 @@ public class StoredResultSet implements ResultHandler.ComparableResultSet return defs.equals(((StoredComparableColumnDefinitions)other).defs); } +public int hashCode() +{ +return Objects.hash(defs, wasFailed, failureException); +} + public String toString() { return defs.toString(); @@ -229,6 +240,11 @@ public class StoredResultSet implements ResultHandler.ComparableResultSet return p.equals(((StoredComparableDefinition)other).p); } +public int hashCode() +{ +return Objects.hash(p); +} + public String toString() { return getName() + ':' + getType(); - To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org