[jira] [Created] (CASSANDRA-7144) CassandraDaemon RowMutation exception
Maxime Lamothe-Brassard created CASSANDRA-7144: -- Summary: CassandraDaemon RowMutation exception Key: CASSANDRA-7144 URL: https://issues.apache.org/jira/browse/CASSANDRA-7144 Project: Cassandra Issue Type: Bug Components: Core Environment: Ubuntu 12.04 w/ Oracle JVM, 5 nodes cluster. Nodes 2GB / 2 Cores in DigitalOcean. Reporter: Maxime Lamothe-Brassard Fix For: 2.0.7 First time reporting a bug here, apologies if I'm not posting it in the right space. At what seems like random interval, on random nodes in random situations I will get the following exception. After this the hinted handoff start timing out and the node stops participating in the cluster. I started seeing these after switching to the Cassandra Python-Driver from the Python-CQL driver. ERROR [MutationStage:82] 2014-05-03 08:08:04,275 CassandraDaemon.java (line 198) Exception in thread Thread[MutationStage:82,5,main] java.lang.AssertionError at org.apache.cassandra.db.RowMutation$RowMutationSerializer.serialize(RowMutation.java:271) at org.apache.cassandra.db.RowMutation$RowMutationSerializer.serialize(RowMutation.java:259) at org.apache.cassandra.utils.FBUtilities.serialize(FBUtilities.java:654) at org.apache.cassandra.db.HintedHandOffManager.hintFor(HintedHandOffManager.java:137) at org.apache.cassandra.service.StorageProxy.writeHintForMutation(StorageProxy.java:908) at org.apache.cassandra.service.StorageProxy$6.runMayThrow(StorageProxy.java:881) at org.apache.cassandra.service.StorageProxy$HintRunnable.run(StorageProxy.java:1981) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at java.util.concurrent.FutureTask.run(FutureTask.java:262) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:744) The service must be restarted for the node to come back online. Let me know any additional configuration details needed. -- This message was sent by Atlassian JIRA (v6.2#6252)
[1/3] git commit: fix changes merge mess
Repository: cassandra Updated Branches: refs/heads/cassandra-2.1 8e897de68 - c7c5f6841 refs/heads/trunk b8c0199c3 - 2bb867a2d fix changes merge mess Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/c7c5f684 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/c7c5f684 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/c7c5f684 Branch: refs/heads/cassandra-2.1 Commit: c7c5f684124b365cc80a4ee1d617ce8861b329fc Parents: 8e897de Author: Brandon Williams brandonwilli...@apache.org Authored: Sat May 3 08:13:05 2014 -0500 Committer: Brandon Williams brandonwilli...@apache.org Committed: Sat May 3 08:13:05 2014 -0500 -- CHANGES.txt | 32 +--- 1 file changed, 1 insertion(+), 31 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/c7c5f684/CHANGES.txt -- diff --git a/CHANGES.txt b/CHANGES.txt index eece557..4afad9d 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -3,9 +3,9 @@ Merged from 2.0: * Make batchlog replica selection rack-aware (CASSANDRA-6551) * Add Google Compute Engine snitch (CASSANDRA-7132) +Merged from 1.2: * Update system.peers correctly when relocating tokens (CASSANDRA-7126) - 2.1.0-beta2 * Increase default CL space to 8GB (CASSANDRA-7031) * Add range tombstones to read repair digests (CASSANDRA-6863) @@ -70,35 +70,6 @@ Merged from 2.0: * Set JMX RMI port to 7199 (CASSANDRA-7087) * Use LOCAL_QUORUM for data reads at LOCAL_SERIAL (CASSANDRA-6939) * Log a warning for large batches (CASSANDRA-6487) - * Queries on compact tables can return more rows that requested (CASSANDRA-7052) - * USING TIMESTAMP for batches does not work (CASSANDRA-7053) - * Fix performance regression from CASSANDRA-5614 (CASSANDRA-6949) - * Merge groupable mutations in TriggerExecutor#execute() (CASSANDRA-7047) - * Fix CFMetaData#getColumnDefinitionFromColumnName() (CASSANDRA-7074) - * Plug holes in resource release when wiring up StreamSession (CASSANDRA-7073) - * Re-add parameter columns to tracing session (CASSANDRA-6942) - * Fix writetime/ttl functions for static columns (CASSANDRA-7081) -Merged from 1.2: - * Fix nodetool display with vnodes (CASSANDRA-7082) - * Fix schema concurrency exceptions (CASSANDRA-6841) - * Fix BatchlogManager#deleteBatch() use of millisecond timsestamps - (CASSANDRA-6822) - * Continue assassinating even if the endpoint vanishes (CASSANDRA-6787) - * Schedule schema pulls on change (CASSANDRA-6971) - * Non-droppable verbs shouldn't be dropped from OTC (CASSANDRA-6980) - * Shutdown batchlog executor in SS#drain() (CASSANDRA-7025) - * Fix batchlog to account for CF truncation records (CASSANDRA-6999) - * Fix CQLSH parsing of functions and BLOB literals (CASSANDRA-7018) - * Require nodetool rebuild_index to specify index names (CASSANDRA-7038) - * Ensure that batchlog and hint timeouts do not produce hints (CASSANDRA-7058) - * Always clean up references in SerializingCache (CASSANDRA-6994) - * Don't shut MessagingService down when replacing a node (CASSANDRA-6476) - * fix npe when doing -Dcassandra.fd_initial_value_ms (CASSANDRA-6751) - * Preserves CQL metadata when updating table from thrift (CASSANDRA-6831) - - -2.0.7 - cassandra-2.0 * Put nodes in hibernate when join_ring is false (CASSANDRA-6961) * Avoid early loading of non-system keyspaces before compaction-leftovers cleanup at startup (CASSANDRA-6913) @@ -177,7 +148,6 @@ Merged from 1.2: * Don't shut MessagingService down when replacing a node (CASSANDRA-6476) * fix npe when doing -Dcassandra.fd_initial_value_ms (CASSANDRA-6751) - 2.0.6 * Avoid race-prone second scrub of system keyspace (CASSANDRA-6797) * Pool CqlRecordWriter clients by inetaddress rather than Range
[3/3] git commit: Merge branch 'cassandra-2.1' into trunk
Merge branch 'cassandra-2.1' into trunk Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/2bb867a2 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/2bb867a2 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/2bb867a2 Branch: refs/heads/trunk Commit: 2bb867a2d4af6bc7e16ac31d187a5d1e3b39f856 Parents: b8c0199 c7c5f68 Author: Brandon Williams brandonwilli...@apache.org Authored: Sat May 3 08:13:15 2014 -0500 Committer: Brandon Williams brandonwilli...@apache.org Committed: Sat May 3 08:13:15 2014 -0500 -- CHANGES.txt | 32 +--- 1 file changed, 1 insertion(+), 31 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/2bb867a2/CHANGES.txt --
[2/3] git commit: fix changes merge mess
fix changes merge mess Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/c7c5f684 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/c7c5f684 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/c7c5f684 Branch: refs/heads/trunk Commit: c7c5f684124b365cc80a4ee1d617ce8861b329fc Parents: 8e897de Author: Brandon Williams brandonwilli...@apache.org Authored: Sat May 3 08:13:05 2014 -0500 Committer: Brandon Williams brandonwilli...@apache.org Committed: Sat May 3 08:13:05 2014 -0500 -- CHANGES.txt | 32 +--- 1 file changed, 1 insertion(+), 31 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/c7c5f684/CHANGES.txt -- diff --git a/CHANGES.txt b/CHANGES.txt index eece557..4afad9d 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -3,9 +3,9 @@ Merged from 2.0: * Make batchlog replica selection rack-aware (CASSANDRA-6551) * Add Google Compute Engine snitch (CASSANDRA-7132) +Merged from 1.2: * Update system.peers correctly when relocating tokens (CASSANDRA-7126) - 2.1.0-beta2 * Increase default CL space to 8GB (CASSANDRA-7031) * Add range tombstones to read repair digests (CASSANDRA-6863) @@ -70,35 +70,6 @@ Merged from 2.0: * Set JMX RMI port to 7199 (CASSANDRA-7087) * Use LOCAL_QUORUM for data reads at LOCAL_SERIAL (CASSANDRA-6939) * Log a warning for large batches (CASSANDRA-6487) - * Queries on compact tables can return more rows that requested (CASSANDRA-7052) - * USING TIMESTAMP for batches does not work (CASSANDRA-7053) - * Fix performance regression from CASSANDRA-5614 (CASSANDRA-6949) - * Merge groupable mutations in TriggerExecutor#execute() (CASSANDRA-7047) - * Fix CFMetaData#getColumnDefinitionFromColumnName() (CASSANDRA-7074) - * Plug holes in resource release when wiring up StreamSession (CASSANDRA-7073) - * Re-add parameter columns to tracing session (CASSANDRA-6942) - * Fix writetime/ttl functions for static columns (CASSANDRA-7081) -Merged from 1.2: - * Fix nodetool display with vnodes (CASSANDRA-7082) - * Fix schema concurrency exceptions (CASSANDRA-6841) - * Fix BatchlogManager#deleteBatch() use of millisecond timsestamps - (CASSANDRA-6822) - * Continue assassinating even if the endpoint vanishes (CASSANDRA-6787) - * Schedule schema pulls on change (CASSANDRA-6971) - * Non-droppable verbs shouldn't be dropped from OTC (CASSANDRA-6980) - * Shutdown batchlog executor in SS#drain() (CASSANDRA-7025) - * Fix batchlog to account for CF truncation records (CASSANDRA-6999) - * Fix CQLSH parsing of functions and BLOB literals (CASSANDRA-7018) - * Require nodetool rebuild_index to specify index names (CASSANDRA-7038) - * Ensure that batchlog and hint timeouts do not produce hints (CASSANDRA-7058) - * Always clean up references in SerializingCache (CASSANDRA-6994) - * Don't shut MessagingService down when replacing a node (CASSANDRA-6476) - * fix npe when doing -Dcassandra.fd_initial_value_ms (CASSANDRA-6751) - * Preserves CQL metadata when updating table from thrift (CASSANDRA-6831) - - -2.0.7 - cassandra-2.0 * Put nodes in hibernate when join_ring is false (CASSANDRA-6961) * Avoid early loading of non-system keyspaces before compaction-leftovers cleanup at startup (CASSANDRA-6913) @@ -177,7 +148,6 @@ Merged from 1.2: * Don't shut MessagingService down when replacing a node (CASSANDRA-6476) * fix npe when doing -Dcassandra.fd_initial_value_ms (CASSANDRA-6751) - 2.0.6 * Avoid race-prone second scrub of system keyspace (CASSANDRA-6797) * Pool CqlRecordWriter clients by inetaddress rather than Range
[jira] [Updated] (CASSANDRA-7144) CassandraDaemon RowMutation exception
[ https://issues.apache.org/jira/browse/CASSANDRA-7144?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Maxime Lamothe-Brassard updated CASSANDRA-7144: --- Description: First time reporting a bug here, apologies if I'm not posting it in the right space. At what seems like random interval, on random nodes in random situations I will get the following exception. After this the hinted handoff start timing out and the node stops participating in the cluster. I started seeing these after switching to the Cassandra Python-Driver from the Python-CQL driver. ERROR [WRITE-/10.128.180.108] 2014-05-03 13:45:12,843 CassandraDaemon.java (line 198) Exception in thread Thread[WRITE-/10.128.180.108,5,main] java.lang.AssertionError at org.apache.cassandra.db.RowMutation$RowMutationSerializer.serialize(RowMutation.java:271) at org.apache.cassandra.db.RowMutation$RowMutationSerializer.serialize(RowMutation.java:259) at org.apache.cassandra.net.MessageOut.serialize(MessageOut.java:120) at org.apache.cassandra.net.OutboundTcpConnection.writeInternal(OutboundTcpConnection.java:251) at org.apache.cassandra.net.OutboundTcpConnection.writeConnected(OutboundTcpConnection.java:203) at org.apache.cassandra.net.OutboundTcpConnection.run(OutboundTcpConnection.java:151) ERROR [WRITE-/10.128.194.70] 2014-05-03 13:45:12,843 CassandraDaemon.java (line 198) Exception in thread Thread[WRITE-/10.128.194.70,5,main] java.lang.AssertionError at org.apache.cassandra.db.RowMutation$RowMutationSerializer.serialize(RowMutation.java:271) at org.apache.cassandra.db.RowMutation$RowMutationSerializer.serialize(RowMutation.java:259) at org.apache.cassandra.net.MessageOut.serialize(MessageOut.java:120) at org.apache.cassandra.net.OutboundTcpConnection.writeInternal(OutboundTcpConnection.java:251) at org.apache.cassandra.net.OutboundTcpConnection.writeConnected(OutboundTcpConnection.java:203) at org.apache.cassandra.net.OutboundTcpConnection.run(OutboundTcpConnection.java:151) ERROR [MutationStage:118] 2014-05-03 13:45:15,048 CassandraDaemon.java (line 198) Exception in thread Thread[MutationStage:118,5,main] java.lang.AssertionError at org.apache.cassandra.db.RowMutation$RowMutationSerializer.serialize(RowMutation.java:271) at org.apache.cassandra.db.RowMutation$RowMutationSerializer.serialize(RowMutation.java:259) at org.apache.cassandra.utils.FBUtilities.serialize(FBUtilities.java:654) at org.apache.cassandra.db.HintedHandOffManager.hintFor(HintedHandOffManager.java:137) at org.apache.cassandra.service.StorageProxy.writeHintForMutation(StorageProxy.java:908) at org.apache.cassandra.service.StorageProxy$6.runMayThrow(StorageProxy.java:881) at org.apache.cassandra.service.StorageProxy$HintRunnable.run(StorageProxy.java:1981) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at java.util.concurrent.FutureTask.run(FutureTask.java:262) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:744) ERROR [MutationStage:117] 2014-05-03 13:45:15,048 CassandraDaemon.java (line 198) Exception in thread Thread[MutationStage:117,5,main] java.lang.AssertionError at org.apache.cassandra.db.RowMutation$RowMutationSerializer.serialize(RowMutation.java:271) at org.apache.cassandra.db.RowMutation$RowMutationSerializer.serialize(RowMutation.java:259) at org.apache.cassandra.utils.FBUtilities.serialize(FBUtilities.java:654) at org.apache.cassandra.db.HintedHandOffManager.hintFor(HintedHandOffManager.java:137) at org.apache.cassandra.service.StorageProxy.writeHintForMutation(StorageProxy.java:908) at org.apache.cassandra.service.StorageProxy$6.runMayThrow(StorageProxy.java:881) at org.apache.cassandra.service.StorageProxy$HintRunnable.run(StorageProxy.java:1981) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at java.util.concurrent.FutureTask.run(FutureTask.java:262) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:744) The service must be restarted for the node to come back online. Let me know any additional configuration details needed. was: First time reporting a bug here, apologies if I'm not posting it in the right space. At what seems like random interval, on random nodes in random situations I will get the following exception. After this the hinted handoff start timing out and the node stops participating in the
[jira] [Created] (CASSANDRA-7145) FileNotFoundException during compaction
PJ created CASSANDRA-7145: - Summary: FileNotFoundException during compaction Key: CASSANDRA-7145 URL: https://issues.apache.org/jira/browse/CASSANDRA-7145 Project: Cassandra Issue Type: Bug Environment: CentOS 6.3, Datastax Enterprise 4.0.1 (Cassandra 2.0.5), Java 1.7.0_55 Reporter: PJ Priority: Blocker Attachments: compaction - FileNotFoundException.txt, repair - RuntimeException.txt, startup - AssertionError.txt I can't finish any compaction because my nodes always throw a FileNotFoundException. I've already tried the following but nothing helped: 1. nodetool flush 2. nodetool repair (ends with RuntimeException; see attachment) 3. node restart (via dse cassandra-stop) Somewhere near the end of startup process, another type of exception is logged (see attachment) but the nodes are still able to finish the startup and eventually become online. My questions now are: 1. Have I already lost data? I'm in the middle of migrating 4.8 billion rows from MySQL and I'd like to know whether I should already abort and start over 2. What caused the sstable files to go missing? 3. How can I proceed with compaction and repair? Obviously, not being able to do so would eventually lead to serious performance and data issues Related StackOverflow question (mine): http://stackoverflow.com/questions/23435847/filenotfoundexception-during-compaction Notes: 1. I didn't drop and recreate the keyspace (so probably not related to CASSANDRA-4857) 2. I use sstableloader for the migration. However, since it is designed to wait for the secondary index build to complete before exiting, the overall throughput becomes unacceptable. Due to this, I devised a mechanism that would kill the sstableloader process and cancel the secondary index build when the bulk-loading total progress reaches 100%. So far, I've done this more than 100 times already 3. There are times when I had to restart the nodes because the OS load reached high levels. It's possible that there are compactions in-progress when I restarted the nodes -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Created] (CASSANDRA-7146) Cassandra returns to life deleted entries
Rodion created CASSANDRA-7146: - Summary: Cassandra returns to life deleted entries Key: CASSANDRA-7146 URL: https://issues.apache.org/jira/browse/CASSANDRA-7146 Project: Cassandra Issue Type: Bug Reporter: Rodion Fix For: 2.0.7 I'm testing Cassandra Version: 2.1.0~beta1 and getting into a very strange thing. This is my schema: CREATE TABLE userlines ( username text, time timeuuid, msg_id uuid, PRIMARY KEY (username, time) ) WITH CLUSTERING ORDER BY (time DESC) First, I'm trying to INSERT something into this empty Columns Family: cqlsh:cequel select * from userlines; (0 rows) cqlsh:cequel INSERT INTO userlines (username, msg_id, time) VALUES ('admin', ad18dbf8-d2bc-11e3-9bc1-47ba2f5b0f02, c9553f3c-d2bc-11e3-b650-255df2f099c5); cqlsh:cequel select * from userlines; username | time | msg_id --+--+-- admin | c9553f3c-d2bc-11e3-b650-255df2f099c5 | ad18dbf8-d2bc-11e3-9bc1-47ba2f5b0f02 (1 rows) Then DELETE this entry: cqlsh:cequel DELETE FROM userlines WHERE username = 'admin' and time = c9553f3c-d2bc-11e3-b650-255df2f099c5; cqlsh:cequel select * from userlines; (0 rows) And then INSERT same entry, but increment the last digit of Time column: cqlsh:cequel INSERT INTO userlines (username, msg_id, time) VALUES ('admin', ad18dbf8-d2bc-11e3-9bc1-47ba2f5b0f02, c9553f3c-d2bc-11e3-b650-255df2f099c6); cqlsh:cequel select * from userlines; username | time | msg_id --+--+-- admin | c9553f3c-d2bc-11e3-b650-255df2f099c6 | ad18dbf8-d2bc-11e3-9bc1-47ba2f5b0f02 admin | c9553f3c-d2bc-11e3-b650-255df2f099c5 | ad18dbf8-d2bc-11e3-9bc1-47ba2f5b0f02 (2 rows) Now, after inserting just a one entry, I get two. So, an old entry returns after another INSERT operation. In Version 2.0.7 All is fine. -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Updated] (CASSANDRA-7146) Cassandra returns to life deleted entries
[ https://issues.apache.org/jira/browse/CASSANDRA-7146?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Rodion updated CASSANDRA-7146: -- Fix Version/s: (was: 2.0.7) Cassandra returns to life deleted entries - Key: CASSANDRA-7146 URL: https://issues.apache.org/jira/browse/CASSANDRA-7146 Project: Cassandra Issue Type: Bug Reporter: Rodion Fix For: 2.0.7 I'm testing Cassandra Version: 2.1.0~beta1 and getting into a very strange thing. This is my schema: CREATE TABLE userlines ( username text, time timeuuid, msg_id uuid, PRIMARY KEY (username, time) ) WITH CLUSTERING ORDER BY (time DESC) First, I'm trying to INSERT something into this empty Columns Family: cqlsh:cequel select * from userlines; (0 rows) cqlsh:cequel INSERT INTO userlines (username, msg_id, time) VALUES ('admin', ad18dbf8-d2bc-11e3-9bc1-47ba2f5b0f02, c9553f3c-d2bc-11e3-b650-255df2f099c5); cqlsh:cequel select * from userlines; username | time | msg_id --+--+-- admin | c9553f3c-d2bc-11e3-b650-255df2f099c5 | ad18dbf8-d2bc-11e3-9bc1-47ba2f5b0f02 (1 rows) Then DELETE this entry: cqlsh:cequel DELETE FROM userlines WHERE username = 'admin' and time = c9553f3c-d2bc-11e3-b650-255df2f099c5; cqlsh:cequel select * from userlines; (0 rows) And then INSERT same entry, but increment the last digit of Time column: cqlsh:cequel INSERT INTO userlines (username, msg_id, time) VALUES ('admin', ad18dbf8-d2bc-11e3-9bc1-47ba2f5b0f02, c9553f3c-d2bc-11e3-b650-255df2f099c6); cqlsh:cequel select * from userlines; username | time | msg_id --+--+-- admin | c9553f3c-d2bc-11e3-b650-255df2f099c6 | ad18dbf8-d2bc-11e3-9bc1-47ba2f5b0f02 admin | c9553f3c-d2bc-11e3-b650-255df2f099c5 | ad18dbf8-d2bc-11e3-9bc1-47ba2f5b0f02 (2 rows) Now, after inserting just a one entry, I get two. So, an old entry returns after another INSERT operation. In Version 2.0.7 All is fine. -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Updated] (CASSANDRA-7146) Cassandra returns to life deleted entries
[ https://issues.apache.org/jira/browse/CASSANDRA-7146?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Rodion updated CASSANDRA-7146: -- Fix Version/s: 2.0.7 Cassandra returns to life deleted entries - Key: CASSANDRA-7146 URL: https://issues.apache.org/jira/browse/CASSANDRA-7146 Project: Cassandra Issue Type: Bug Reporter: Rodion Fix For: 2.0.7 I'm testing Cassandra Version: 2.1.0~beta1 and getting into a very strange thing. This is my schema: CREATE TABLE userlines ( username text, time timeuuid, msg_id uuid, PRIMARY KEY (username, time) ) WITH CLUSTERING ORDER BY (time DESC) First, I'm trying to INSERT something into this empty Columns Family: cqlsh:cequel select * from userlines; (0 rows) cqlsh:cequel INSERT INTO userlines (username, msg_id, time) VALUES ('admin', ad18dbf8-d2bc-11e3-9bc1-47ba2f5b0f02, c9553f3c-d2bc-11e3-b650-255df2f099c5); cqlsh:cequel select * from userlines; username | time | msg_id --+--+-- admin | c9553f3c-d2bc-11e3-b650-255df2f099c5 | ad18dbf8-d2bc-11e3-9bc1-47ba2f5b0f02 (1 rows) Then DELETE this entry: cqlsh:cequel DELETE FROM userlines WHERE username = 'admin' and time = c9553f3c-d2bc-11e3-b650-255df2f099c5; cqlsh:cequel select * from userlines; (0 rows) And then INSERT same entry, but increment the last digit of Time column: cqlsh:cequel INSERT INTO userlines (username, msg_id, time) VALUES ('admin', ad18dbf8-d2bc-11e3-9bc1-47ba2f5b0f02, c9553f3c-d2bc-11e3-b650-255df2f099c6); cqlsh:cequel select * from userlines; username | time | msg_id --+--+-- admin | c9553f3c-d2bc-11e3-b650-255df2f099c6 | ad18dbf8-d2bc-11e3-9bc1-47ba2f5b0f02 admin | c9553f3c-d2bc-11e3-b650-255df2f099c5 | ad18dbf8-d2bc-11e3-9bc1-47ba2f5b0f02 (2 rows) Now, after inserting just a one entry, I get two. So, an old entry returns after another INSERT operation. In Version 2.0.7 All is fine. -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Created] (CASSANDRA-7147) Add a new snitch for Apache Cloudstack platforms
Pierre-Yves Ritschard created CASSANDRA-7147: Summary: Add a new snitch for Apache Cloudstack platforms Key: CASSANDRA-7147 URL: https://issues.apache.org/jira/browse/CASSANDRA-7147 Project: Cassandra Issue Type: Improvement Components: Core Environment: Virtual machine on Apache Cloudstack environments Reporter: Pierre-Yves Ritschard Priority: Minor Fix For: 2.0.8, 2.1 beta2 Attachments: 0001-initial-work-on-a-cloudstack-snitch.patch The attached patch adds a new Snitch that queries meta data for a host on Apache Cloudstack environments. Since the metadata service is colocated with the DHCP service in Cloudstack, common lease file locations are looked up to retrieve. Since zone naming is freeform in Apache Cloudstack, the widely used country-location-az notation is assumed. The patch includes a simple unit test and has been tested on exoscale.ch, a public cloud based on Apache Cloudstack -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Commented] (CASSANDRA-7147) Add a new snitch for Apache Cloudstack platforms
[ https://issues.apache.org/jira/browse/CASSANDRA-7147?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13988724#comment-13988724 ] Pierre-Yves Ritschard commented on CASSANDRA-7147: -- I should note that I based this work on CASSANDRA-7132 Add a new snitch for Apache Cloudstack platforms Key: CASSANDRA-7147 URL: https://issues.apache.org/jira/browse/CASSANDRA-7147 Project: Cassandra Issue Type: Improvement Components: Core Environment: Virtual machine on Apache Cloudstack environments Reporter: Pierre-Yves Ritschard Priority: Minor Fix For: 2.0.8, 2.1 beta2 Attachments: 0001-initial-work-on-a-cloudstack-snitch.patch The attached patch adds a new Snitch that queries meta data for a host on Apache Cloudstack environments. Since the metadata service is colocated with the DHCP service in Cloudstack, common lease file locations are looked up to retrieve. Since zone naming is freeform in Apache Cloudstack, the widely used country-location-az notation is assumed. The patch includes a simple unit test and has been tested on exoscale.ch, a public cloud based on Apache Cloudstack -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Created] (CASSANDRA-7148) Auto pagination finds 999 791 out of 1 000 000 rows
bodrin created CASSANDRA-7148: - Summary: Auto pagination finds 999 791 out of 1 000 000 rows Key: CASSANDRA-7148 URL: https://issues.apache.org/jira/browse/CASSANDRA-7148 Project: Cassandra Issue Type: Bug Reporter: bodrin In a cluster of 3 nodes cassandra 2.0.6 with replication factor=3 and with the following schema: CREATE TABLE IF NOT EXISTS test ( org varchar, department varchar, id varchar, area varchar, value text, // json PRIMARY KEY ((org), department, id) ); CREATE INDEX IF NOT EXISTS ON test(area); I have inserted 1 000 000 rows this way: String insert = INSERT INTO test (org, department, id, area, value) VALUES (?, ?, ?, ?, ?); for (int organization = 0; organization 500; organization++) { for (int department = 0; department 2; department++) { for (int area = 0; area 2; area++) { for (int id = 0; id 500; id++) { String orgValue = org + organization; String departmentValue = department + department; String areaValue = area + area; String idValue = UUID.randomUUID().toString(); // insert a single row here ... Then just read them all: int count = 0; ResultSet rs = session.execute(select * from test limit 100); IteratorRow i = rs.iterator(); while (i.hasNext()) { Row row = i.next(); count++; } and the count is 999791 (this tooks 33 seconds) while at the same time cqlsh:t2 select count(*) from test limit 100; count - 100 I have also verified that all the queries of kind select * from test where area=areaXXX return 500 entries as expected and 2000*500 is 1 000 000 -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Commented] (CASSANDRA-7147) Add a new snitch for Apache Cloudstack platforms
[ https://issues.apache.org/jira/browse/CASSANDRA-7147?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13988741#comment-13988741 ] Brandon Williams commented on CASSANDRA-7147: - With freeform zone naming, I'm not sure this complexity is completely worth it over just configuring GossipingPropertyFileSnitch. How is inter-dc/private routing handled in openstack? Add a new snitch for Apache Cloudstack platforms Key: CASSANDRA-7147 URL: https://issues.apache.org/jira/browse/CASSANDRA-7147 Project: Cassandra Issue Type: Improvement Components: Core Environment: Virtual machine on Apache Cloudstack environments Reporter: Pierre-Yves Ritschard Priority: Minor Fix For: 2.0.8, 2.1 beta2 Attachments: 0001-initial-work-on-a-cloudstack-snitch.patch The attached patch adds a new Snitch that queries meta data for a host on Apache Cloudstack environments. Since the metadata service is colocated with the DHCP service in Cloudstack, common lease file locations are looked up to retrieve. Since zone naming is freeform in Apache Cloudstack, the widely used country-location-az notation is assumed. The patch includes a simple unit test and has been tested on exoscale.ch, a public cloud based on Apache Cloudstack -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Updated] (CASSANDRA-7146) Cassandra returns to life deleted entries
[ https://issues.apache.org/jira/browse/CASSANDRA-7146?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Brandon Williams updated CASSANDRA-7146: Fix Version/s: (was: 2.0.7) Cassandra returns to life deleted entries - Key: CASSANDRA-7146 URL: https://issues.apache.org/jira/browse/CASSANDRA-7146 Project: Cassandra Issue Type: Bug Reporter: Rodion I'm testing Cassandra Version: 2.1.0~beta1 and getting into a very strange thing. This is my schema: CREATE TABLE userlines ( username text, time timeuuid, msg_id uuid, PRIMARY KEY (username, time) ) WITH CLUSTERING ORDER BY (time DESC) First, I'm trying to INSERT something into this empty Columns Family: cqlsh:cequel select * from userlines; (0 rows) cqlsh:cequel INSERT INTO userlines (username, msg_id, time) VALUES ('admin', ad18dbf8-d2bc-11e3-9bc1-47ba2f5b0f02, c9553f3c-d2bc-11e3-b650-255df2f099c5); cqlsh:cequel select * from userlines; username | time | msg_id --+--+-- admin | c9553f3c-d2bc-11e3-b650-255df2f099c5 | ad18dbf8-d2bc-11e3-9bc1-47ba2f5b0f02 (1 rows) Then DELETE this entry: cqlsh:cequel DELETE FROM userlines WHERE username = 'admin' and time = c9553f3c-d2bc-11e3-b650-255df2f099c5; cqlsh:cequel select * from userlines; (0 rows) And then INSERT same entry, but increment the last digit of Time column: cqlsh:cequel INSERT INTO userlines (username, msg_id, time) VALUES ('admin', ad18dbf8-d2bc-11e3-9bc1-47ba2f5b0f02, c9553f3c-d2bc-11e3-b650-255df2f099c6); cqlsh:cequel select * from userlines; username | time | msg_id --+--+-- admin | c9553f3c-d2bc-11e3-b650-255df2f099c6 | ad18dbf8-d2bc-11e3-9bc1-47ba2f5b0f02 admin | c9553f3c-d2bc-11e3-b650-255df2f099c5 | ad18dbf8-d2bc-11e3-9bc1-47ba2f5b0f02 (2 rows) Now, after inserting just a one entry, I get two. So, an old entry returns after another INSERT operation. In Version 2.0.7 All is fine. -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Resolved] (CASSANDRA-7146) Cassandra returns to life deleted entries
[ https://issues.apache.org/jira/browse/CASSANDRA-7146?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Brandon Williams resolved CASSANDRA-7146. - Resolution: Cannot Reproduce Doesn't reproduce against 2.1 head. I recommend trying beta2 when it's released on Monday and reopening if it happens there. Cassandra returns to life deleted entries - Key: CASSANDRA-7146 URL: https://issues.apache.org/jira/browse/CASSANDRA-7146 Project: Cassandra Issue Type: Bug Reporter: Rodion I'm testing Cassandra Version: 2.1.0~beta1 and getting into a very strange thing. This is my schema: CREATE TABLE userlines ( username text, time timeuuid, msg_id uuid, PRIMARY KEY (username, time) ) WITH CLUSTERING ORDER BY (time DESC) First, I'm trying to INSERT something into this empty Columns Family: cqlsh:cequel select * from userlines; (0 rows) cqlsh:cequel INSERT INTO userlines (username, msg_id, time) VALUES ('admin', ad18dbf8-d2bc-11e3-9bc1-47ba2f5b0f02, c9553f3c-d2bc-11e3-b650-255df2f099c5); cqlsh:cequel select * from userlines; username | time | msg_id --+--+-- admin | c9553f3c-d2bc-11e3-b650-255df2f099c5 | ad18dbf8-d2bc-11e3-9bc1-47ba2f5b0f02 (1 rows) Then DELETE this entry: cqlsh:cequel DELETE FROM userlines WHERE username = 'admin' and time = c9553f3c-d2bc-11e3-b650-255df2f099c5; cqlsh:cequel select * from userlines; (0 rows) And then INSERT same entry, but increment the last digit of Time column: cqlsh:cequel INSERT INTO userlines (username, msg_id, time) VALUES ('admin', ad18dbf8-d2bc-11e3-9bc1-47ba2f5b0f02, c9553f3c-d2bc-11e3-b650-255df2f099c6); cqlsh:cequel select * from userlines; username | time | msg_id --+--+-- admin | c9553f3c-d2bc-11e3-b650-255df2f099c6 | ad18dbf8-d2bc-11e3-9bc1-47ba2f5b0f02 admin | c9553f3c-d2bc-11e3-b650-255df2f099c5 | ad18dbf8-d2bc-11e3-9bc1-47ba2f5b0f02 (2 rows) Now, after inserting just a one entry, I get two. So, an old entry returns after another INSERT operation. In Version 2.0.7 All is fine. -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Updated] (CASSANDRA-7144) CassandraDaemon RowMutation exception
[ https://issues.apache.org/jira/browse/CASSANDRA-7144?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Brandon Williams updated CASSANDRA-7144: Fix Version/s: (was: 2.0.7) CassandraDaemon RowMutation exception - Key: CASSANDRA-7144 URL: https://issues.apache.org/jira/browse/CASSANDRA-7144 Project: Cassandra Issue Type: Bug Components: Core Environment: Ubuntu 12.04 w/ Oracle JVM, 5 nodes cluster. Nodes 2GB / 2 Cores in DigitalOcean. Reporter: Maxime Lamothe-Brassard First time reporting a bug here, apologies if I'm not posting it in the right space. At what seems like random interval, on random nodes in random situations I will get the following exception. After this the hinted handoff start timing out and the node stops participating in the cluster. I started seeing these after switching to the Cassandra Python-Driver from the Python-CQL driver. ERROR [WRITE-/10.128.180.108] 2014-05-03 13:45:12,843 CassandraDaemon.java (line 198) Exception in thread Thread[WRITE-/10.128.180.108,5,main] java.lang.AssertionError at org.apache.cassandra.db.RowMutation$RowMutationSerializer.serialize(RowMutation.java:271) at org.apache.cassandra.db.RowMutation$RowMutationSerializer.serialize(RowMutation.java:259) at org.apache.cassandra.net.MessageOut.serialize(MessageOut.java:120) at org.apache.cassandra.net.OutboundTcpConnection.writeInternal(OutboundTcpConnection.java:251) at org.apache.cassandra.net.OutboundTcpConnection.writeConnected(OutboundTcpConnection.java:203) at org.apache.cassandra.net.OutboundTcpConnection.run(OutboundTcpConnection.java:151) ERROR [WRITE-/10.128.194.70] 2014-05-03 13:45:12,843 CassandraDaemon.java (line 198) Exception in thread Thread[WRITE-/10.128.194.70,5,main] java.lang.AssertionError at org.apache.cassandra.db.RowMutation$RowMutationSerializer.serialize(RowMutation.java:271) at org.apache.cassandra.db.RowMutation$RowMutationSerializer.serialize(RowMutation.java:259) at org.apache.cassandra.net.MessageOut.serialize(MessageOut.java:120) at org.apache.cassandra.net.OutboundTcpConnection.writeInternal(OutboundTcpConnection.java:251) at org.apache.cassandra.net.OutboundTcpConnection.writeConnected(OutboundTcpConnection.java:203) at org.apache.cassandra.net.OutboundTcpConnection.run(OutboundTcpConnection.java:151) ERROR [MutationStage:118] 2014-05-03 13:45:15,048 CassandraDaemon.java (line 198) Exception in thread Thread[MutationStage:118,5,main] java.lang.AssertionError at org.apache.cassandra.db.RowMutation$RowMutationSerializer.serialize(RowMutation.java:271) at org.apache.cassandra.db.RowMutation$RowMutationSerializer.serialize(RowMutation.java:259) at org.apache.cassandra.utils.FBUtilities.serialize(FBUtilities.java:654) at org.apache.cassandra.db.HintedHandOffManager.hintFor(HintedHandOffManager.java:137) at org.apache.cassandra.service.StorageProxy.writeHintForMutation(StorageProxy.java:908) at org.apache.cassandra.service.StorageProxy$6.runMayThrow(StorageProxy.java:881) at org.apache.cassandra.service.StorageProxy$HintRunnable.run(StorageProxy.java:1981) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at java.util.concurrent.FutureTask.run(FutureTask.java:262) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:744) ERROR [MutationStage:117] 2014-05-03 13:45:15,048 CassandraDaemon.java (line 198) Exception in thread Thread[MutationStage:117,5,main] java.lang.AssertionError at org.apache.cassandra.db.RowMutation$RowMutationSerializer.serialize(RowMutation.java:271) at org.apache.cassandra.db.RowMutation$RowMutationSerializer.serialize(RowMutation.java:259) at org.apache.cassandra.utils.FBUtilities.serialize(FBUtilities.java:654) at org.apache.cassandra.db.HintedHandOffManager.hintFor(HintedHandOffManager.java:137) at org.apache.cassandra.service.StorageProxy.writeHintForMutation(StorageProxy.java:908) at org.apache.cassandra.service.StorageProxy$6.runMayThrow(StorageProxy.java:881) at org.apache.cassandra.service.StorageProxy$HintRunnable.run(StorageProxy.java:1981) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at java.util.concurrent.FutureTask.run(FutureTask.java:262) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at
[jira] [Commented] (CASSANDRA-7147) Add a new snitch for Apache Cloudstack platforms
[ https://issues.apache.org/jira/browse/CASSANDRA-7147?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13988748#comment-13988748 ] Pierre-Yves Ritschard commented on CASSANDRA-7147: -- The rationale is that there are now large providers based on Cloudstack (disclaimer: I'm CTO at one of them) who follow the standard notation. This gives the same flexibility than you get with EC2Snitch or GoogleCloudSnitch I don't know how openstack handles this. Add a new snitch for Apache Cloudstack platforms Key: CASSANDRA-7147 URL: https://issues.apache.org/jira/browse/CASSANDRA-7147 Project: Cassandra Issue Type: Improvement Components: Core Environment: Virtual machine on Apache Cloudstack environments Reporter: Pierre-Yves Ritschard Priority: Minor Fix For: 2.0.8, 2.1 beta2 Attachments: 0001-initial-work-on-a-cloudstack-snitch.patch The attached patch adds a new Snitch that queries meta data for a host on Apache Cloudstack environments. Since the metadata service is colocated with the DHCP service in Cloudstack, common lease file locations are looked up to retrieve. Since zone naming is freeform in Apache Cloudstack, the widely used country-location-az notation is assumed. The patch includes a simple unit test and has been tested on exoscale.ch, a public cloud based on Apache Cloudstack -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Commented] (CASSANDRA-7147) Add a new snitch for Apache Cloudstack platforms
[ https://issues.apache.org/jira/browse/CASSANDRA-7147?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13988755#comment-13988755 ] Brandon Williams commented on CASSANDRA-7147: - bq. I don't know how openstack handles this. How can we assume that eth0 is the correct interface then? Add a new snitch for Apache Cloudstack platforms Key: CASSANDRA-7147 URL: https://issues.apache.org/jira/browse/CASSANDRA-7147 Project: Cassandra Issue Type: Improvement Components: Core Environment: Virtual machine on Apache Cloudstack environments Reporter: Pierre-Yves Ritschard Priority: Minor Fix For: 2.0.8, 2.1 beta2 Attachments: 0001-initial-work-on-a-cloudstack-snitch.patch The attached patch adds a new Snitch that queries meta data for a host on Apache Cloudstack environments. Since the metadata service is colocated with the DHCP service in Cloudstack, common lease file locations are looked up to retrieve. Since zone naming is freeform in Apache Cloudstack, the widely used country-location-az notation is assumed. The patch includes a simple unit test and has been tested on exoscale.ch, a public cloud based on Apache Cloudstack -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Commented] (CASSANDRA-7122) Replacement nodes have null entries in system.peers
[ https://issues.apache.org/jira/browse/CASSANDRA-7122?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13988757#comment-13988757 ] Brandon Williams commented on CASSANDRA-7122: - Actually, I may have fixed this more simply in CASSANDRA-7126, can you try that? Replacement nodes have null entries in system.peers --- Key: CASSANDRA-7122 URL: https://issues.apache.org/jira/browse/CASSANDRA-7122 Project: Cassandra Issue Type: Bug Reporter: Richard Low If a node is replaced with -Dcassandra.replace_address, the new node has mostly null entries in system.peers: {code} select * from system.peers; peer | data_center | host_id | rack | release_version | rpc_address | schema_version | tokens ---+-+-+--+-+-++-- 127.0.0.3 |null |null | null |null |null | null | {'-3074457345618258602'} {code} To reproduce, simply kill a node and replace it. The entries are correctly populated if the replacement node is restarted but they are never populated if it isn't. I can think of at least two bad consequences of this: 1. Drivers like Datastax java-driver use the peers table to find the rpc_address and location info of a node. If the entires are null it assumes rpc_address=ip and the node is in the local DC. 2. When using GossipingPropertyFileSnitch and node won't persist the DC/rack of another node so may not be able to locate it during restarts. I reproduced in 1.2.15 but from inspection it looks to be present in 1.2.16 and 2.0.7. -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Commented] (CASSANDRA-7147) Add a new snitch for Apache Cloudstack platforms
[ https://issues.apache.org/jira/browse/CASSANDRA-7147?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13988760#comment-13988760 ] Brandon Williams commented on CASSANDRA-7147: - Oops, sorry, I got my stack names mixed up there. bq. of course in 90% of cases it will work properly for advanced networking set-ups as well What is the 10% that won't work? What I'm getting at here is, if someone wants to run Cassandra on a private interface (the only sane way) but have it work between datacenters, do we need to use ReconnectableSnitchHelper to handle the public/private connection dance? Add a new snitch for Apache Cloudstack platforms Key: CASSANDRA-7147 URL: https://issues.apache.org/jira/browse/CASSANDRA-7147 Project: Cassandra Issue Type: Improvement Components: Core Environment: Virtual machine on Apache Cloudstack environments Reporter: Pierre-Yves Ritschard Priority: Minor Fix For: 2.0.8, 2.1 beta2 Attachments: 0001-initial-work-on-a-cloudstack-snitch.patch The attached patch adds a new Snitch that queries meta data for a host on Apache Cloudstack environments. Since the metadata service is colocated with the DHCP service in Cloudstack, common lease file locations are looked up to retrieve. Since zone naming is freeform in Apache Cloudstack, the widely used country-location-az notation is assumed. The patch includes a simple unit test and has been tested on exoscale.ch, a public cloud based on Apache Cloudstack -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Commented] (CASSANDRA-7147) Add a new snitch for Apache Cloudstack platforms
[ https://issues.apache.org/jira/browse/CASSANDRA-7147?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13988761#comment-13988761 ] Brandon Williams commented on CASSANDRA-7147: - CASSANDRA-7132 didn't need this because of this statement: Due to the cross-regional availability of networks on Google, there is no need for a separate Multi-region Snitch to compensate for cross-region communication. All communication can occur on private ip addresses within the same logical network. so I'm wondering if cloudstack is any different here. Add a new snitch for Apache Cloudstack platforms Key: CASSANDRA-7147 URL: https://issues.apache.org/jira/browse/CASSANDRA-7147 Project: Cassandra Issue Type: Improvement Components: Core Environment: Virtual machine on Apache Cloudstack environments Reporter: Pierre-Yves Ritschard Priority: Minor Fix For: 2.0.8, 2.1 beta2 Attachments: 0001-initial-work-on-a-cloudstack-snitch.patch The attached patch adds a new Snitch that queries meta data for a host on Apache Cloudstack environments. Since the metadata service is colocated with the DHCP service in Cloudstack, common lease file locations are looked up to retrieve. Since zone naming is freeform in Apache Cloudstack, the widely used country-location-az notation is assumed. The patch includes a simple unit test and has been tested on exoscale.ch, a public cloud based on Apache Cloudstack -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Commented] (CASSANDRA-7147) Add a new snitch for Apache Cloudstack platforms
[ https://issues.apache.org/jira/browse/CASSANDRA-7147?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13988764#comment-13988764 ] Pierre-Yves Ritschard commented on CASSANDRA-7147: -- So the 10% that won't work is people having specific network setups. Back to Basic Networking setups, since you are fed a single IP With the help of security groups, the most obvious way to run cassandra on a Basic Networking set-up would be to create a security-group rule allowing traffic only between cassandra machines, which gives the same level of isolation that what you would get on EC2 private IPs for instance (since the private network is shared). Add a new snitch for Apache Cloudstack platforms Key: CASSANDRA-7147 URL: https://issues.apache.org/jira/browse/CASSANDRA-7147 Project: Cassandra Issue Type: Improvement Components: Core Environment: Virtual machine on Apache Cloudstack environments Reporter: Pierre-Yves Ritschard Priority: Minor Fix For: 2.0.8, 2.1 beta2 Attachments: 0001-initial-work-on-a-cloudstack-snitch.patch The attached patch adds a new Snitch that queries meta data for a host on Apache Cloudstack environments. Since the metadata service is colocated with the DHCP service in Cloudstack, common lease file locations are looked up to retrieve. Since zone naming is freeform in Apache Cloudstack, the widely used country-location-az notation is assumed. The patch includes a simple unit test and has been tested on exoscale.ch, a public cloud based on Apache Cloudstack -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Commented] (CASSANDRA-7147) Add a new snitch for Apache Cloudstack platforms
[ https://issues.apache.org/jira/browse/CASSANDRA-7147?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13988767#comment-13988767 ] Brandon Williams commented on CASSANDRA-7147: - Alright. Can you fix the huge amounts of whitespace indentation? 4 is enough. Add a new snitch for Apache Cloudstack platforms Key: CASSANDRA-7147 URL: https://issues.apache.org/jira/browse/CASSANDRA-7147 Project: Cassandra Issue Type: Improvement Components: Core Environment: Virtual machine on Apache Cloudstack environments Reporter: Pierre-Yves Ritschard Priority: Minor Fix For: 2.0.8, 2.1 beta2 Attachments: 0001-initial-work-on-a-cloudstack-snitch.patch The attached patch adds a new Snitch that queries meta data for a host on Apache Cloudstack environments. Since the metadata service is colocated with the DHCP service in Cloudstack, common lease file locations are looked up to retrieve. Since zone naming is freeform in Apache Cloudstack, the widely used country-location-az notation is assumed. The patch includes a simple unit test and has been tested on exoscale.ch, a public cloud based on Apache Cloudstack -- This message was sent by Atlassian JIRA (v6.2#6252)
[5/6] git commit: Merge branch 'cassandra-2.0' into cassandra-2.1
Merge branch 'cassandra-2.0' into cassandra-2.1 Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/3bc4de96 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/3bc4de96 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/3bc4de96 Branch: refs/heads/cassandra-2.1 Commit: 3bc4de96da07865498a7b3cda96daded68145d75 Parents: c7c5f68 aa2b769 Author: Brandon Williams brandonwilli...@apache.org Authored: Sat May 3 12:44:15 2014 -0500 Committer: Brandon Williams brandonwilli...@apache.org Committed: Sat May 3 12:44:15 2014 -0500 -- src/java/org/apache/cassandra/locator/GoogleCloudSnitch.java | 8 1 file changed, 4 insertions(+), 4 deletions(-) --
[3/6] git commit: fix indentation
fix indentation Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/aa2b769a Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/aa2b769a Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/aa2b769a Branch: refs/heads/trunk Commit: aa2b769aacd968de9ace314a9219996d9ec7d097 Parents: af96d40 Author: Brandon Williams brandonwilli...@apache.org Authored: Sat May 3 12:44:02 2014 -0500 Committer: Brandon Williams brandonwilli...@apache.org Committed: Sat May 3 12:44:05 2014 -0500 -- src/java/org/apache/cassandra/locator/GoogleCloudSnitch.java | 8 1 file changed, 4 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/aa2b769a/src/java/org/apache/cassandra/locator/GoogleCloudSnitch.java -- diff --git a/src/java/org/apache/cassandra/locator/GoogleCloudSnitch.java b/src/java/org/apache/cassandra/locator/GoogleCloudSnitch.java index 05fbea2..b4d3b19 100644 --- a/src/java/org/apache/cassandra/locator/GoogleCloudSnitch.java +++ b/src/java/org/apache/cassandra/locator/GoogleCloudSnitch.java @@ -53,15 +53,15 @@ public class GoogleCloudSnitch extends AbstractNetworkTopologySnitch public GoogleCloudSnitch() throws IOException, ConfigurationException { String response = gceApiCall(ZONE_NAME_QUERY_URL); - String[] splits = response.split(/); - String az = splits[splits.length - 1]; +String[] splits = response.split(/); +String az = splits[splits.length - 1]; // Split us-central1-a or asia-east1-a into us-central1/a and asia-east1/a. splits = az.split(-); gceZone = splits[splits.length - 1]; - int lastRegionIndex = az.lastIndexOf(-); - gceRegion = az.substring(0, lastRegionIndex); +int lastRegionIndex = az.lastIndexOf(-); +gceRegion = az.substring(0, lastRegionIndex); String datacenterSuffix = (new SnitchProperties()).get(dc_suffix, ); gceRegion = gceRegion.concat(datacenterSuffix);
[2/6] git commit: fix indentation
fix indentation Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/aa2b769a Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/aa2b769a Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/aa2b769a Branch: refs/heads/cassandra-2.1 Commit: aa2b769aacd968de9ace314a9219996d9ec7d097 Parents: af96d40 Author: Brandon Williams brandonwilli...@apache.org Authored: Sat May 3 12:44:02 2014 -0500 Committer: Brandon Williams brandonwilli...@apache.org Committed: Sat May 3 12:44:05 2014 -0500 -- src/java/org/apache/cassandra/locator/GoogleCloudSnitch.java | 8 1 file changed, 4 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/aa2b769a/src/java/org/apache/cassandra/locator/GoogleCloudSnitch.java -- diff --git a/src/java/org/apache/cassandra/locator/GoogleCloudSnitch.java b/src/java/org/apache/cassandra/locator/GoogleCloudSnitch.java index 05fbea2..b4d3b19 100644 --- a/src/java/org/apache/cassandra/locator/GoogleCloudSnitch.java +++ b/src/java/org/apache/cassandra/locator/GoogleCloudSnitch.java @@ -53,15 +53,15 @@ public class GoogleCloudSnitch extends AbstractNetworkTopologySnitch public GoogleCloudSnitch() throws IOException, ConfigurationException { String response = gceApiCall(ZONE_NAME_QUERY_URL); - String[] splits = response.split(/); - String az = splits[splits.length - 1]; +String[] splits = response.split(/); +String az = splits[splits.length - 1]; // Split us-central1-a or asia-east1-a into us-central1/a and asia-east1/a. splits = az.split(-); gceZone = splits[splits.length - 1]; - int lastRegionIndex = az.lastIndexOf(-); - gceRegion = az.substring(0, lastRegionIndex); +int lastRegionIndex = az.lastIndexOf(-); +gceRegion = az.substring(0, lastRegionIndex); String datacenterSuffix = (new SnitchProperties()).get(dc_suffix, ); gceRegion = gceRegion.concat(datacenterSuffix);
[1/6] git commit: fix indentation
Repository: cassandra Updated Branches: refs/heads/cassandra-2.0 af96d405b - aa2b769aa refs/heads/cassandra-2.1 c7c5f6841 - 3bc4de96d refs/heads/trunk 2bb867a2d - 2bf6d8a68 fix indentation Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/aa2b769a Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/aa2b769a Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/aa2b769a Branch: refs/heads/cassandra-2.0 Commit: aa2b769aacd968de9ace314a9219996d9ec7d097 Parents: af96d40 Author: Brandon Williams brandonwilli...@apache.org Authored: Sat May 3 12:44:02 2014 -0500 Committer: Brandon Williams brandonwilli...@apache.org Committed: Sat May 3 12:44:05 2014 -0500 -- src/java/org/apache/cassandra/locator/GoogleCloudSnitch.java | 8 1 file changed, 4 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/aa2b769a/src/java/org/apache/cassandra/locator/GoogleCloudSnitch.java -- diff --git a/src/java/org/apache/cassandra/locator/GoogleCloudSnitch.java b/src/java/org/apache/cassandra/locator/GoogleCloudSnitch.java index 05fbea2..b4d3b19 100644 --- a/src/java/org/apache/cassandra/locator/GoogleCloudSnitch.java +++ b/src/java/org/apache/cassandra/locator/GoogleCloudSnitch.java @@ -53,15 +53,15 @@ public class GoogleCloudSnitch extends AbstractNetworkTopologySnitch public GoogleCloudSnitch() throws IOException, ConfigurationException { String response = gceApiCall(ZONE_NAME_QUERY_URL); - String[] splits = response.split(/); - String az = splits[splits.length - 1]; +String[] splits = response.split(/); +String az = splits[splits.length - 1]; // Split us-central1-a or asia-east1-a into us-central1/a and asia-east1/a. splits = az.split(-); gceZone = splits[splits.length - 1]; - int lastRegionIndex = az.lastIndexOf(-); - gceRegion = az.substring(0, lastRegionIndex); +int lastRegionIndex = az.lastIndexOf(-); +gceRegion = az.substring(0, lastRegionIndex); String datacenterSuffix = (new SnitchProperties()).get(dc_suffix, ); gceRegion = gceRegion.concat(datacenterSuffix);
[6/6] git commit: Merge branch 'cassandra-2.1' into trunk
Merge branch 'cassandra-2.1' into trunk Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/2bf6d8a6 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/2bf6d8a6 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/2bf6d8a6 Branch: refs/heads/trunk Commit: 2bf6d8a68ddfa60dce7b2c3bdf531c5b51b650be Parents: 2bb867a 3bc4de9 Author: Brandon Williams brandonwilli...@apache.org Authored: Sat May 3 12:44:23 2014 -0500 Committer: Brandon Williams brandonwilli...@apache.org Committed: Sat May 3 12:44:23 2014 -0500 -- src/java/org/apache/cassandra/locator/GoogleCloudSnitch.java | 8 1 file changed, 4 insertions(+), 4 deletions(-) --
[jira] [Updated] (CASSANDRA-7147) Add a new snitch for Apache Cloudstack platforms
[ https://issues.apache.org/jira/browse/CASSANDRA-7147?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Brandon Williams updated CASSANDRA-7147: Reviewer: Brandon Williams Add a new snitch for Apache Cloudstack platforms Key: CASSANDRA-7147 URL: https://issues.apache.org/jira/browse/CASSANDRA-7147 Project: Cassandra Issue Type: Improvement Components: Core Environment: Virtual machine on Apache Cloudstack environments Reporter: Pierre-Yves Ritschard Priority: Minor Fix For: 2.0.8, 2.1 beta2 Attachments: 0001-initial-work-on-a-cloudstack-snitch.patch The attached patch adds a new Snitch that queries meta data for a host on Apache Cloudstack environments. Since the metadata service is colocated with the DHCP service in Cloudstack, common lease file locations are looked up to retrieve. Since zone naming is freeform in Apache Cloudstack, the widely used country-location-az notation is assumed. The patch includes a simple unit test and has been tested on exoscale.ch, a public cloud based on Apache Cloudstack -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Updated] (CASSANDRA-7147) Add a new snitch for Apache Cloudstack platforms
[ https://issues.apache.org/jira/browse/CASSANDRA-7147?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Brandon Williams updated CASSANDRA-7147: Assignee: Pierre-Yves Ritschard Add a new snitch for Apache Cloudstack platforms Key: CASSANDRA-7147 URL: https://issues.apache.org/jira/browse/CASSANDRA-7147 Project: Cassandra Issue Type: Improvement Components: Core Environment: Virtual machine on Apache Cloudstack environments Reporter: Pierre-Yves Ritschard Assignee: Pierre-Yves Ritschard Priority: Minor Fix For: 2.0.8, 2.1 beta2 Attachments: 0001-initial-work-on-a-cloudstack-snitch.patch The attached patch adds a new Snitch that queries meta data for a host on Apache Cloudstack environments. Since the metadata service is colocated with the DHCP service in Cloudstack, common lease file locations are looked up to retrieve. Since zone naming is freeform in Apache Cloudstack, the widely used country-location-az notation is assumed. The patch includes a simple unit test and has been tested on exoscale.ch, a public cloud based on Apache Cloudstack -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Updated] (CASSANDRA-7143) shuffle broken on 2.0
[ https://issues.apache.org/jira/browse/CASSANDRA-7143?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Brandon Williams updated CASSANDRA-7143: Since Version: 2.0.0 shuffle broken on 2.0 - Key: CASSANDRA-7143 URL: https://issues.apache.org/jira/browse/CASSANDRA-7143 Project: Cassandra Issue Type: Bug Components: Core Reporter: Brandon Williams Assignee: Brandon Williams Fix For: 2.0.8 In 1.2, shuffle works correctly, creating the list of relocations and then following it, pausing correctly as needed: {noformat} WARN 20:45:58,153 Pausing until token count stabilizes (target=3, actual=4) {noformat} However on 2.0, it relocates all the ranges in one shot and never deletes entries from the list of tokens to relocate. -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Commented] (CASSANDRA-7147) Add a new snitch for Apache Cloudstack platforms
[ https://issues.apache.org/jira/browse/CASSANDRA-7147?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13988778#comment-13988778 ] Pierre-Yves Ritschard commented on CASSANDRA-7147: -- will do Add a new snitch for Apache Cloudstack platforms Key: CASSANDRA-7147 URL: https://issues.apache.org/jira/browse/CASSANDRA-7147 Project: Cassandra Issue Type: Improvement Components: Core Environment: Virtual machine on Apache Cloudstack environments Reporter: Pierre-Yves Ritschard Assignee: Pierre-Yves Ritschard Priority: Minor Fix For: 2.0.8, 2.1 beta2 Attachments: 0001-initial-work-on-a-cloudstack-snitch.patch The attached patch adds a new Snitch that queries meta data for a host on Apache Cloudstack environments. Since the metadata service is colocated with the DHCP service in Cloudstack, common lease file locations are looked up to retrieve. Since zone naming is freeform in Apache Cloudstack, the widely used country-location-az notation is assumed. The patch includes a simple unit test and has been tested on exoscale.ch, a public cloud based on Apache Cloudstack -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Updated] (CASSANDRA-7147) Add a new snitch for Apache Cloudstack platforms
[ https://issues.apache.org/jira/browse/CASSANDRA-7147?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Pierre-Yves Ritschard updated CASSANDRA-7147: - Attachment: (was: 0001-initial-work-on-a-cloudstack-snitch.patch) Add a new snitch for Apache Cloudstack platforms Key: CASSANDRA-7147 URL: https://issues.apache.org/jira/browse/CASSANDRA-7147 Project: Cassandra Issue Type: Improvement Components: Core Environment: Virtual machine on Apache Cloudstack environments Reporter: Pierre-Yves Ritschard Assignee: Pierre-Yves Ritschard Priority: Minor Fix For: 2.0.8, 2.1 beta2 Attachments: 0001-initial-work-on-a-cloudstack-snitch.patch The attached patch adds a new Snitch that queries meta data for a host on Apache Cloudstack environments. Since the metadata service is colocated with the DHCP service in Cloudstack, common lease file locations are looked up to retrieve. Since zone naming is freeform in Apache Cloudstack, the widely used country-location-az notation is assumed. The patch includes a simple unit test and has been tested on exoscale.ch, a public cloud based on Apache Cloudstack -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Updated] (CASSANDRA-7147) Add a new snitch for Apache Cloudstack platforms
[ https://issues.apache.org/jira/browse/CASSANDRA-7147?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Pierre-Yves Ritschard updated CASSANDRA-7147: - Attachment: 0001-initial-work-on-a-cloudstack-snitch.patch Updated patch with better whitespace rules Add a new snitch for Apache Cloudstack platforms Key: CASSANDRA-7147 URL: https://issues.apache.org/jira/browse/CASSANDRA-7147 Project: Cassandra Issue Type: Improvement Components: Core Environment: Virtual machine on Apache Cloudstack environments Reporter: Pierre-Yves Ritschard Assignee: Pierre-Yves Ritschard Priority: Minor Fix For: 2.0.8, 2.1 beta2 Attachments: 0001-initial-work-on-a-cloudstack-snitch.patch The attached patch adds a new Snitch that queries meta data for a host on Apache Cloudstack environments. Since the metadata service is colocated with the DHCP service in Cloudstack, common lease file locations are looked up to retrieve. Since zone naming is freeform in Apache Cloudstack, the widely used country-location-az notation is assumed. The patch includes a simple unit test and has been tested on exoscale.ch, a public cloud based on Apache Cloudstack -- This message was sent by Atlassian JIRA (v6.2#6252)
[4/6] git commit: Merge branch 'cassandra-2.0' into cassandra-2.1
Merge branch 'cassandra-2.0' into cassandra-2.1 Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/34115352 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/34115352 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/34115352 Branch: refs/heads/trunk Commit: 341153526e9a99fb6bf8c013a24cbc256044ab28 Parents: 3bc4de9 02e0eb6 Author: Brandon Williams brandonwilli...@apache.org Authored: Sat May 3 13:33:45 2014 -0500 Committer: Brandon Williams brandonwilli...@apache.org Committed: Sat May 3 13:33:45 2014 -0500 -- src/java/org/apache/cassandra/db/ColumnFamilyStore.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/34115352/src/java/org/apache/cassandra/db/ColumnFamilyStore.java --
[5/6] git commit: Merge branch 'cassandra-2.0' into cassandra-2.1
Merge branch 'cassandra-2.0' into cassandra-2.1 Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/34115352 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/34115352 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/34115352 Branch: refs/heads/cassandra-2.1 Commit: 341153526e9a99fb6bf8c013a24cbc256044ab28 Parents: 3bc4de9 02e0eb6 Author: Brandon Williams brandonwilli...@apache.org Authored: Sat May 3 13:33:45 2014 -0500 Committer: Brandon Williams brandonwilli...@apache.org Committed: Sat May 3 13:33:45 2014 -0500 -- src/java/org/apache/cassandra/db/ColumnFamilyStore.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/34115352/src/java/org/apache/cassandra/db/ColumnFamilyStore.java --
[2/6] git commit: don't log retry policy so often
don't log retry policy so often Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/02e0eb63 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/02e0eb63 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/02e0eb63 Branch: refs/heads/cassandra-2.1 Commit: 02e0eb6378f926984df393870733e5462dd72361 Parents: aa2b769 Author: Brandon Williams brandonwilli...@apache.org Authored: Sat May 3 13:33:38 2014 -0500 Committer: Brandon Williams brandonwilli...@apache.org Committed: Sat May 3 13:33:38 2014 -0500 -- src/java/org/apache/cassandra/db/ColumnFamilyStore.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/02e0eb63/src/java/org/apache/cassandra/db/ColumnFamilyStore.java -- diff --git a/src/java/org/apache/cassandra/db/ColumnFamilyStore.java b/src/java/org/apache/cassandra/db/ColumnFamilyStore.java index bfd3b08..3fac640 100644 --- a/src/java/org/apache/cassandra/db/ColumnFamilyStore.java +++ b/src/java/org/apache/cassandra/db/ColumnFamilyStore.java @@ -290,12 +290,12 @@ public class ColumnFamilyStore implements ColumnFamilyStoreMBean { throw new RuntimeException(e); } +logger.debug(retryPolicy for {} is {}, name, this.metadata.getSpeculativeRetry()); StorageService.optionalTasks.scheduleWithFixedDelay(new Runnable() { public void run() { SpeculativeRetry retryPolicy = ColumnFamilyStore.this.metadata.getSpeculativeRetry(); -logger.debug(retryPolicy for {} is {}, name, retryPolicy.value); switch (retryPolicy.type) { case PERCENTILE:
[6/6] git commit: Merge branch 'cassandra-2.1' into trunk
Merge branch 'cassandra-2.1' into trunk Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/53c91426 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/53c91426 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/53c91426 Branch: refs/heads/trunk Commit: 53c91426e70182f644718a83248ddafc34cc66aa Parents: 2bf6d8a 3411535 Author: Brandon Williams brandonwilli...@apache.org Authored: Sat May 3 13:33:51 2014 -0500 Committer: Brandon Williams brandonwilli...@apache.org Committed: Sat May 3 13:33:51 2014 -0500 -- src/java/org/apache/cassandra/db/ColumnFamilyStore.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --
[3/6] git commit: don't log retry policy so often
don't log retry policy so often Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/02e0eb63 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/02e0eb63 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/02e0eb63 Branch: refs/heads/trunk Commit: 02e0eb6378f926984df393870733e5462dd72361 Parents: aa2b769 Author: Brandon Williams brandonwilli...@apache.org Authored: Sat May 3 13:33:38 2014 -0500 Committer: Brandon Williams brandonwilli...@apache.org Committed: Sat May 3 13:33:38 2014 -0500 -- src/java/org/apache/cassandra/db/ColumnFamilyStore.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/02e0eb63/src/java/org/apache/cassandra/db/ColumnFamilyStore.java -- diff --git a/src/java/org/apache/cassandra/db/ColumnFamilyStore.java b/src/java/org/apache/cassandra/db/ColumnFamilyStore.java index bfd3b08..3fac640 100644 --- a/src/java/org/apache/cassandra/db/ColumnFamilyStore.java +++ b/src/java/org/apache/cassandra/db/ColumnFamilyStore.java @@ -290,12 +290,12 @@ public class ColumnFamilyStore implements ColumnFamilyStoreMBean { throw new RuntimeException(e); } +logger.debug(retryPolicy for {} is {}, name, this.metadata.getSpeculativeRetry()); StorageService.optionalTasks.scheduleWithFixedDelay(new Runnable() { public void run() { SpeculativeRetry retryPolicy = ColumnFamilyStore.this.metadata.getSpeculativeRetry(); -logger.debug(retryPolicy for {} is {}, name, retryPolicy.value); switch (retryPolicy.type) { case PERCENTILE:
[1/6] git commit: don't log retry policy so often
Repository: cassandra Updated Branches: refs/heads/cassandra-2.0 aa2b769aa - 02e0eb637 refs/heads/cassandra-2.1 3bc4de96d - 341153526 refs/heads/trunk 2bf6d8a68 - 53c91426e don't log retry policy so often Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/02e0eb63 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/02e0eb63 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/02e0eb63 Branch: refs/heads/cassandra-2.0 Commit: 02e0eb6378f926984df393870733e5462dd72361 Parents: aa2b769 Author: Brandon Williams brandonwilli...@apache.org Authored: Sat May 3 13:33:38 2014 -0500 Committer: Brandon Williams brandonwilli...@apache.org Committed: Sat May 3 13:33:38 2014 -0500 -- src/java/org/apache/cassandra/db/ColumnFamilyStore.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/02e0eb63/src/java/org/apache/cassandra/db/ColumnFamilyStore.java -- diff --git a/src/java/org/apache/cassandra/db/ColumnFamilyStore.java b/src/java/org/apache/cassandra/db/ColumnFamilyStore.java index bfd3b08..3fac640 100644 --- a/src/java/org/apache/cassandra/db/ColumnFamilyStore.java +++ b/src/java/org/apache/cassandra/db/ColumnFamilyStore.java @@ -290,12 +290,12 @@ public class ColumnFamilyStore implements ColumnFamilyStoreMBean { throw new RuntimeException(e); } +logger.debug(retryPolicy for {} is {}, name, this.metadata.getSpeculativeRetry()); StorageService.optionalTasks.scheduleWithFixedDelay(new Runnable() { public void run() { SpeculativeRetry retryPolicy = ColumnFamilyStore.this.metadata.getSpeculativeRetry(); -logger.debug(retryPolicy for {} is {}, name, retryPolicy.value); switch (retryPolicy.type) { case PERCENTILE:
[jira] [Updated] (CASSANDRA-7147) Add a new snitch for Apache Cloudstack platforms
[ https://issues.apache.org/jira/browse/CASSANDRA-7147?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Pierre-Yves Ritschard updated CASSANDRA-7147: - Attachment: (was: 0001-initial-work-on-a-cloudstack-snitch.patch) Add a new snitch for Apache Cloudstack platforms Key: CASSANDRA-7147 URL: https://issues.apache.org/jira/browse/CASSANDRA-7147 Project: Cassandra Issue Type: Improvement Components: Core Environment: Virtual machine on Apache Cloudstack environments Reporter: Pierre-Yves Ritschard Assignee: Pierre-Yves Ritschard Priority: Minor Fix For: 2.0.8, 2.1 beta2 Attachments: 0001-initial-work-on-a-cloudstack-snitch.patch The attached patch adds a new Snitch that queries meta data for a host on Apache Cloudstack environments. Since the metadata service is colocated with the DHCP service in Cloudstack, common lease file locations are looked up to retrieve. Since zone naming is freeform in Apache Cloudstack, the widely used country-location-az notation is assumed. The patch includes a simple unit test and has been tested on exoscale.ch, a public cloud based on Apache Cloudstack -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Updated] (CASSANDRA-7147) Add a new snitch for Apache Cloudstack platforms
[ https://issues.apache.org/jira/browse/CASSANDRA-7147?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Pierre-Yves Ritschard updated CASSANDRA-7147: - Attachment: 0001-initial-work-on-a-cloudstack-snitch.patch Attaching the right file, with real 4-space indents this time Add a new snitch for Apache Cloudstack platforms Key: CASSANDRA-7147 URL: https://issues.apache.org/jira/browse/CASSANDRA-7147 Project: Cassandra Issue Type: Improvement Components: Core Environment: Virtual machine on Apache Cloudstack environments Reporter: Pierre-Yves Ritschard Assignee: Pierre-Yves Ritschard Priority: Minor Fix For: 2.0.8, 2.1 beta2 Attachments: 0001-initial-work-on-a-cloudstack-snitch.patch The attached patch adds a new Snitch that queries meta data for a host on Apache Cloudstack environments. Since the metadata service is colocated with the DHCP service in Cloudstack, common lease file locations are looked up to retrieve. Since zone naming is freeform in Apache Cloudstack, the widely used country-location-az notation is assumed. The patch includes a simple unit test and has been tested on exoscale.ch, a public cloud based on Apache Cloudstack -- This message was sent by Atlassian JIRA (v6.2#6252)
[02/13] git commit: Add Cloudstack snitch
Add Cloudstack snitch Patch by Pierre-Yves Ritschard, reviewed by brandonwilliams for CASSANDRA-7147 Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/6f4853e7 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/6f4853e7 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/6f4853e7 Branch: refs/heads/trunk Commit: 6f4853e78a289c5fd55c523290309b6e87f2014b Parents: 837bded Author: Brandon Williams brandonwilli...@apache.org Authored: Sat May 3 13:43:40 2014 -0500 Committer: Brandon Williams brandonwilli...@apache.org Committed: Sat May 3 13:43:40 2014 -0500 -- CHANGES.txt | 1 + .../cassandra/locator/CloudstackSnitch.java | 187 +++ .../cassandra/locator/CloudstackSnitchTest.java | 111 +++ 3 files changed, 299 insertions(+) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/6f4853e7/CHANGES.txt -- diff --git a/CHANGES.txt b/CHANGES.txt index 1c67331..484f4bd 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,4 +1,5 @@ 1.2.17 + * Add Cloudstack snitch (CASSANDRA-7147) * Update system.peers correctly when relocating tokens (CASSANDRA-7126) * Add Google Compute Engine snitch (CASSANDRA-7132) * Fix nodetool display with vnodes (CASSANDRA-7082) http://git-wip-us.apache.org/repos/asf/cassandra/blob/6f4853e7/src/java/org/apache/cassandra/locator/CloudstackSnitch.java -- diff --git a/src/java/org/apache/cassandra/locator/CloudstackSnitch.java b/src/java/org/apache/cassandra/locator/CloudstackSnitch.java new file mode 100644 index 000..6d06556 --- /dev/null +++ b/src/java/org/apache/cassandra/locator/CloudstackSnitch.java @@ -0,0 +1,187 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * License); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.cassandra.locator; + +import java.io.InputStream; +import java.io.BufferedInputStream; +import java.io.FilterInputStream; +import java.io.BufferedReader; +import java.io.FileReader; +import java.io.IOException; +import java.io.File; +import java.net.HttpURLConnection; +import java.net.InetAddress; +import java.net.URL; +import java.net.URI; +import java.nio.charset.StandardCharsets; +import java.util.Map; +import java.util.regex.Pattern; +import java.util.regex.Matcher; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.apache.cassandra.db.SystemTable; +import org.apache.cassandra.exceptions.ConfigurationException; +import org.apache.cassandra.gms.ApplicationState; +import org.apache.cassandra.gms.EndpointState; +import org.apache.cassandra.gms.Gossiper; +import org.apache.cassandra.io.util.FileUtils; +import org.apache.cassandra.utils.FBUtilities; + +/** + * A snitch that assumes a Cloudstack Zone follows the typical convention + * country-location-availability zone and uses the country/location + * tuple as a datacenter and the availability zone as a rack + */ + +public class CloudstackSnitch extends AbstractNetworkTopologySnitch +{ +protected static final Logger logger = LoggerFactory.getLogger(CloudstackSnitch.class); +protected static final String ZONE_NAME_QUERY_URI = /latest/meta-data/availability-zone; + +private MapInetAddress, MapString, String savedEndpoints; + +private static final String DEFAULT_DC = UNKNOWN-DC; +private static final String DEFAULT_RACK = UNKNOWN-RACK; +private static final String[] LEASE_FILES = { +file:///var/lib/dhcp/dhclient.eth0.leases, +file:///var/lib/dhclient/dhclient.eth0.leases +}; + +protected String csZoneDc; +protected String csZoneRack; + +public CloudstackSnitch() throws IOException, ConfigurationException +{ +String endpoint = csMetadataEndpoint(); +String zone = csQueryMetadata(endpoint + ZONE_NAME_QUERY_URI); +String zone_parts[] = zone.split(-); + +if (zone_parts.length != 3) { +throw new ConfigurationException(CloudstackSnitch cannot
[13/13] git commit: Merge branch 'cassandra-2.1' into trunk
Merge branch 'cassandra-2.1' into trunk Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/2b674656 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/2b674656 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/2b674656 Branch: refs/heads/trunk Commit: 2b674656e955ec466e5d1fb60d2d7d567c3d459b Parents: 53c9142 b53442b Author: Brandon Williams brandonwilli...@apache.org Authored: Sat May 3 13:53:38 2014 -0500 Committer: Brandon Williams brandonwilli...@apache.org Committed: Sat May 3 13:53:38 2014 -0500 -- CHANGES.txt | 3 +- .../cassandra/locator/CloudstackSnitch.java | 187 +++ .../cassandra/locator/CloudstackSnitchTest.java | 112 +++ 3 files changed, 301 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/2b674656/CHANGES.txt --
[09/13] git commit: Add Cloudstack snitch
Add Cloudstack snitch Patch by Pierre-Yves Ritschard, reviewed by brandonwilliams for CASSANDRA-7147 Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/3047ab63 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/3047ab63 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/3047ab63 Branch: refs/heads/trunk Commit: 3047ab63875b3ac5dd716bddd5eb3e321af09eaf Parents: d3e7780 Author: Brandon Williams brandonwilli...@apache.org Authored: Sat May 3 13:46:20 2014 -0500 Committer: Brandon Williams brandonwilli...@apache.org Committed: Sat May 3 13:47:48 2014 -0500 -- CHANGES.txt | 3 +- .../cassandra/locator/CloudstackSnitch.java | 187 +++ .../cassandra/locator/CloudstackSnitchTest.java | 111 +++ 3 files changed, 300 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/3047ab63/CHANGES.txt -- diff --git a/CHANGES.txt b/CHANGES.txt index 5799659..8570784 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,6 +1,5 @@ 2.0.8 * Make batchlog replica selection rack-aware (CASSANDRA-6551) - * Add Google Compute Engine snitch (CASSANDRA-7132) * Allow overriding cassandra-rackdc.properties file (CASSANDRA-7072) * Set JMX RMI port to 7199 (CASSANDRA-7087) * Use LOCAL_QUORUM for data reads at LOCAL_SERIAL (CASSANDRA-6939) @@ -14,7 +13,9 @@ * Re-add parameter columns to tracing session (CASSANDRA-6942) * Fix writetime/ttl functions for static columns (CASSANDRA-7081) Merged from 1.2: + * Add Cloudstack snitch (CASSANDRA-7147) * Update system.peers correctly when relocating tokens (CASSANDRA-7126) + * Add Google Compute Engine snitch (CASSANDRA-7132) * Fix nodetool display with vnodes (CASSANDRA-7082) * Fix schema concurrency exceptions (CASSANDRA-6841) * Fix BatchlogManager#deleteBatch() use of millisecond timsestamps http://git-wip-us.apache.org/repos/asf/cassandra/blob/3047ab63/src/java/org/apache/cassandra/locator/CloudstackSnitch.java -- diff --git a/src/java/org/apache/cassandra/locator/CloudstackSnitch.java b/src/java/org/apache/cassandra/locator/CloudstackSnitch.java new file mode 100644 index 000..ecf0f20 --- /dev/null +++ b/src/java/org/apache/cassandra/locator/CloudstackSnitch.java @@ -0,0 +1,187 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * License); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.cassandra.locator; + +import java.io.InputStream; +import java.io.BufferedInputStream; +import java.io.FilterInputStream; +import java.io.BufferedReader; +import java.io.FileReader; +import java.io.IOException; +import java.io.File; +import java.net.HttpURLConnection; +import java.net.InetAddress; +import java.net.URL; +import java.net.URI; +import java.nio.charset.StandardCharsets; +import java.util.Map; +import java.util.regex.Pattern; +import java.util.regex.Matcher; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.apache.cassandra.db.SystemKeyspace; +import org.apache.cassandra.exceptions.ConfigurationException; +import org.apache.cassandra.gms.ApplicationState; +import org.apache.cassandra.gms.EndpointState; +import org.apache.cassandra.gms.Gossiper; +import org.apache.cassandra.io.util.FileUtils; +import org.apache.cassandra.utils.FBUtilities; + +/** + * A snitch that assumes a Cloudstack Zone follows the typical convention + * country-location-availability zone and uses the country/location + * tuple as a datacenter and the availability zone as a rack + */ + +public class CloudstackSnitch extends AbstractNetworkTopologySnitch +{ +protected static final Logger logger = LoggerFactory.getLogger(CloudstackSnitch.class); +protected static final String ZONE_NAME_QUERY_URI = /latest/meta-data/availability-zone; + +private MapInetAddress, MapString, String savedEndpoints; + +private static final String DEFAULT_DC = UNKNOWN-DC; +private static final String
[06/13] git commit: Merge branch 'cassandra-1.2' into cassandra-2.0
Merge branch 'cassandra-1.2' into cassandra-2.0 Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/d3e77804 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/d3e77804 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/d3e77804 Branch: refs/heads/trunk Commit: d3e778041b988b386b55b0060830d88684e79de6 Parents: 02e0eb6 6f4853e Author: Brandon Williams brandonwilli...@apache.org Authored: Sat May 3 13:44:30 2014 -0500 Committer: Brandon Williams brandonwilli...@apache.org Committed: Sat May 3 13:44:30 2014 -0500 -- --
[08/13] git commit: Add Cloudstack snitch
Add Cloudstack snitch Patch by Pierre-Yves Ritschard, reviewed by brandonwilliams for CASSANDRA-7147 Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/3047ab63 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/3047ab63 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/3047ab63 Branch: refs/heads/cassandra-2.1 Commit: 3047ab63875b3ac5dd716bddd5eb3e321af09eaf Parents: d3e7780 Author: Brandon Williams brandonwilli...@apache.org Authored: Sat May 3 13:46:20 2014 -0500 Committer: Brandon Williams brandonwilli...@apache.org Committed: Sat May 3 13:47:48 2014 -0500 -- CHANGES.txt | 3 +- .../cassandra/locator/CloudstackSnitch.java | 187 +++ .../cassandra/locator/CloudstackSnitchTest.java | 111 +++ 3 files changed, 300 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/3047ab63/CHANGES.txt -- diff --git a/CHANGES.txt b/CHANGES.txt index 5799659..8570784 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,6 +1,5 @@ 2.0.8 * Make batchlog replica selection rack-aware (CASSANDRA-6551) - * Add Google Compute Engine snitch (CASSANDRA-7132) * Allow overriding cassandra-rackdc.properties file (CASSANDRA-7072) * Set JMX RMI port to 7199 (CASSANDRA-7087) * Use LOCAL_QUORUM for data reads at LOCAL_SERIAL (CASSANDRA-6939) @@ -14,7 +13,9 @@ * Re-add parameter columns to tracing session (CASSANDRA-6942) * Fix writetime/ttl functions for static columns (CASSANDRA-7081) Merged from 1.2: + * Add Cloudstack snitch (CASSANDRA-7147) * Update system.peers correctly when relocating tokens (CASSANDRA-7126) + * Add Google Compute Engine snitch (CASSANDRA-7132) * Fix nodetool display with vnodes (CASSANDRA-7082) * Fix schema concurrency exceptions (CASSANDRA-6841) * Fix BatchlogManager#deleteBatch() use of millisecond timsestamps http://git-wip-us.apache.org/repos/asf/cassandra/blob/3047ab63/src/java/org/apache/cassandra/locator/CloudstackSnitch.java -- diff --git a/src/java/org/apache/cassandra/locator/CloudstackSnitch.java b/src/java/org/apache/cassandra/locator/CloudstackSnitch.java new file mode 100644 index 000..ecf0f20 --- /dev/null +++ b/src/java/org/apache/cassandra/locator/CloudstackSnitch.java @@ -0,0 +1,187 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * License); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.cassandra.locator; + +import java.io.InputStream; +import java.io.BufferedInputStream; +import java.io.FilterInputStream; +import java.io.BufferedReader; +import java.io.FileReader; +import java.io.IOException; +import java.io.File; +import java.net.HttpURLConnection; +import java.net.InetAddress; +import java.net.URL; +import java.net.URI; +import java.nio.charset.StandardCharsets; +import java.util.Map; +import java.util.regex.Pattern; +import java.util.regex.Matcher; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.apache.cassandra.db.SystemKeyspace; +import org.apache.cassandra.exceptions.ConfigurationException; +import org.apache.cassandra.gms.ApplicationState; +import org.apache.cassandra.gms.EndpointState; +import org.apache.cassandra.gms.Gossiper; +import org.apache.cassandra.io.util.FileUtils; +import org.apache.cassandra.utils.FBUtilities; + +/** + * A snitch that assumes a Cloudstack Zone follows the typical convention + * country-location-availability zone and uses the country/location + * tuple as a datacenter and the availability zone as a rack + */ + +public class CloudstackSnitch extends AbstractNetworkTopologySnitch +{ +protected static final Logger logger = LoggerFactory.getLogger(CloudstackSnitch.class); +protected static final String ZONE_NAME_QUERY_URI = /latest/meta-data/availability-zone; + +private MapInetAddress, MapString, String savedEndpoints; + +private static final String DEFAULT_DC = UNKNOWN-DC; +private static final String
[10/13] git commit: Add Cloudstack snitch
Add Cloudstack snitch Patch by Pierre-Yves Ritschard, reviewed by brandonwilliams for CASSANDRA-7147 Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/3047ab63 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/3047ab63 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/3047ab63 Branch: refs/heads/cassandra-2.0 Commit: 3047ab63875b3ac5dd716bddd5eb3e321af09eaf Parents: d3e7780 Author: Brandon Williams brandonwilli...@apache.org Authored: Sat May 3 13:46:20 2014 -0500 Committer: Brandon Williams brandonwilli...@apache.org Committed: Sat May 3 13:47:48 2014 -0500 -- CHANGES.txt | 3 +- .../cassandra/locator/CloudstackSnitch.java | 187 +++ .../cassandra/locator/CloudstackSnitchTest.java | 111 +++ 3 files changed, 300 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/3047ab63/CHANGES.txt -- diff --git a/CHANGES.txt b/CHANGES.txt index 5799659..8570784 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,6 +1,5 @@ 2.0.8 * Make batchlog replica selection rack-aware (CASSANDRA-6551) - * Add Google Compute Engine snitch (CASSANDRA-7132) * Allow overriding cassandra-rackdc.properties file (CASSANDRA-7072) * Set JMX RMI port to 7199 (CASSANDRA-7087) * Use LOCAL_QUORUM for data reads at LOCAL_SERIAL (CASSANDRA-6939) @@ -14,7 +13,9 @@ * Re-add parameter columns to tracing session (CASSANDRA-6942) * Fix writetime/ttl functions for static columns (CASSANDRA-7081) Merged from 1.2: + * Add Cloudstack snitch (CASSANDRA-7147) * Update system.peers correctly when relocating tokens (CASSANDRA-7126) + * Add Google Compute Engine snitch (CASSANDRA-7132) * Fix nodetool display with vnodes (CASSANDRA-7082) * Fix schema concurrency exceptions (CASSANDRA-6841) * Fix BatchlogManager#deleteBatch() use of millisecond timsestamps http://git-wip-us.apache.org/repos/asf/cassandra/blob/3047ab63/src/java/org/apache/cassandra/locator/CloudstackSnitch.java -- diff --git a/src/java/org/apache/cassandra/locator/CloudstackSnitch.java b/src/java/org/apache/cassandra/locator/CloudstackSnitch.java new file mode 100644 index 000..ecf0f20 --- /dev/null +++ b/src/java/org/apache/cassandra/locator/CloudstackSnitch.java @@ -0,0 +1,187 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * License); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.cassandra.locator; + +import java.io.InputStream; +import java.io.BufferedInputStream; +import java.io.FilterInputStream; +import java.io.BufferedReader; +import java.io.FileReader; +import java.io.IOException; +import java.io.File; +import java.net.HttpURLConnection; +import java.net.InetAddress; +import java.net.URL; +import java.net.URI; +import java.nio.charset.StandardCharsets; +import java.util.Map; +import java.util.regex.Pattern; +import java.util.regex.Matcher; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.apache.cassandra.db.SystemKeyspace; +import org.apache.cassandra.exceptions.ConfigurationException; +import org.apache.cassandra.gms.ApplicationState; +import org.apache.cassandra.gms.EndpointState; +import org.apache.cassandra.gms.Gossiper; +import org.apache.cassandra.io.util.FileUtils; +import org.apache.cassandra.utils.FBUtilities; + +/** + * A snitch that assumes a Cloudstack Zone follows the typical convention + * country-location-availability zone and uses the country/location + * tuple as a datacenter and the availability zone as a rack + */ + +public class CloudstackSnitch extends AbstractNetworkTopologySnitch +{ +protected static final Logger logger = LoggerFactory.getLogger(CloudstackSnitch.class); +protected static final String ZONE_NAME_QUERY_URI = /latest/meta-data/availability-zone; + +private MapInetAddress, MapString, String savedEndpoints; + +private static final String DEFAULT_DC = UNKNOWN-DC; +private static final String
[03/13] git commit: Add Cloudstack snitch
Add Cloudstack snitch Patch by Pierre-Yves Ritschard, reviewed by brandonwilliams for CASSANDRA-7147 Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/6f4853e7 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/6f4853e7 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/6f4853e7 Branch: refs/heads/cassandra-2.0 Commit: 6f4853e78a289c5fd55c523290309b6e87f2014b Parents: 837bded Author: Brandon Williams brandonwilli...@apache.org Authored: Sat May 3 13:43:40 2014 -0500 Committer: Brandon Williams brandonwilli...@apache.org Committed: Sat May 3 13:43:40 2014 -0500 -- CHANGES.txt | 1 + .../cassandra/locator/CloudstackSnitch.java | 187 +++ .../cassandra/locator/CloudstackSnitchTest.java | 111 +++ 3 files changed, 299 insertions(+) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/6f4853e7/CHANGES.txt -- diff --git a/CHANGES.txt b/CHANGES.txt index 1c67331..484f4bd 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,4 +1,5 @@ 1.2.17 + * Add Cloudstack snitch (CASSANDRA-7147) * Update system.peers correctly when relocating tokens (CASSANDRA-7126) * Add Google Compute Engine snitch (CASSANDRA-7132) * Fix nodetool display with vnodes (CASSANDRA-7082) http://git-wip-us.apache.org/repos/asf/cassandra/blob/6f4853e7/src/java/org/apache/cassandra/locator/CloudstackSnitch.java -- diff --git a/src/java/org/apache/cassandra/locator/CloudstackSnitch.java b/src/java/org/apache/cassandra/locator/CloudstackSnitch.java new file mode 100644 index 000..6d06556 --- /dev/null +++ b/src/java/org/apache/cassandra/locator/CloudstackSnitch.java @@ -0,0 +1,187 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * License); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.cassandra.locator; + +import java.io.InputStream; +import java.io.BufferedInputStream; +import java.io.FilterInputStream; +import java.io.BufferedReader; +import java.io.FileReader; +import java.io.IOException; +import java.io.File; +import java.net.HttpURLConnection; +import java.net.InetAddress; +import java.net.URL; +import java.net.URI; +import java.nio.charset.StandardCharsets; +import java.util.Map; +import java.util.regex.Pattern; +import java.util.regex.Matcher; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.apache.cassandra.db.SystemTable; +import org.apache.cassandra.exceptions.ConfigurationException; +import org.apache.cassandra.gms.ApplicationState; +import org.apache.cassandra.gms.EndpointState; +import org.apache.cassandra.gms.Gossiper; +import org.apache.cassandra.io.util.FileUtils; +import org.apache.cassandra.utils.FBUtilities; + +/** + * A snitch that assumes a Cloudstack Zone follows the typical convention + * country-location-availability zone and uses the country/location + * tuple as a datacenter and the availability zone as a rack + */ + +public class CloudstackSnitch extends AbstractNetworkTopologySnitch +{ +protected static final Logger logger = LoggerFactory.getLogger(CloudstackSnitch.class); +protected static final String ZONE_NAME_QUERY_URI = /latest/meta-data/availability-zone; + +private MapInetAddress, MapString, String savedEndpoints; + +private static final String DEFAULT_DC = UNKNOWN-DC; +private static final String DEFAULT_RACK = UNKNOWN-RACK; +private static final String[] LEASE_FILES = { +file:///var/lib/dhcp/dhclient.eth0.leases, +file:///var/lib/dhclient/dhclient.eth0.leases +}; + +protected String csZoneDc; +protected String csZoneRack; + +public CloudstackSnitch() throws IOException, ConfigurationException +{ +String endpoint = csMetadataEndpoint(); +String zone = csQueryMetadata(endpoint + ZONE_NAME_QUERY_URI); +String zone_parts[] = zone.split(-); + +if (zone_parts.length != 3) { +throw new ConfigurationException(CloudstackSnitch
[11/13] git commit: Merge branch 'cassandra-2.0' into cassandra-2.1
Merge branch 'cassandra-2.0' into cassandra-2.1 Conflicts: CHANGES.txt Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/b53442b2 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/b53442b2 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/b53442b2 Branch: refs/heads/cassandra-2.1 Commit: b53442b20cd0b74a84e88e1ba578621984eb1ecd Parents: 3411535 3047ab6 Author: Brandon Williams brandonwilli...@apache.org Authored: Sat May 3 13:51:13 2014 -0500 Committer: Brandon Williams brandonwilli...@apache.org Committed: Sat May 3 13:53:28 2014 -0500 -- CHANGES.txt | 3 +- .../cassandra/locator/CloudstackSnitch.java | 187 +++ .../cassandra/locator/CloudstackSnitchTest.java | 112 +++ 3 files changed, 301 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/b53442b2/CHANGES.txt -- diff --cc CHANGES.txt index 4afad9d,8570784..4b8dfe6 --- a/CHANGES.txt +++ b/CHANGES.txt @@@ -1,75 -1,40 +1,76 @@@ -2.0.8 +2.1.0-rc1 + * Parallel streaming for sstableloader (CASSANDRA-3668) +Merged from 2.0: * Make batchlog replica selection rack-aware (CASSANDRA-6551) - * Add Google Compute Engine snitch (CASSANDRA-7132) - * Allow overriding cassandra-rackdc.properties file (CASSANDRA-7072) - * Set JMX RMI port to 7199 (CASSANDRA-7087) - * Use LOCAL_QUORUM for data reads at LOCAL_SERIAL (CASSANDRA-6939) - * Log a warning for large batches (CASSANDRA-6487) - * Queries on compact tables can return more rows that requested (CASSANDRA-7052) - * USING TIMESTAMP for batches does not work (CASSANDRA-7053) - * Fix performance regression from CASSANDRA-5614 (CASSANDRA-6949) - * Merge groupable mutations in TriggerExecutor#execute() (CASSANDRA-7047) - * Fix CFMetaData#getColumnDefinitionFromColumnName() (CASSANDRA-7074) - * Plug holes in resource release when wiring up StreamSession (CASSANDRA-7073) - * Re-add parameter columns to tracing session (CASSANDRA-6942) - * Fix writetime/ttl functions for static columns (CASSANDRA-7081) Merged from 1.2: + * Add Cloudstack snitch (CASSANDRA-7147) * Update system.peers correctly when relocating tokens (CASSANDRA-7126) + * Add Google Compute Engine snitch (CASSANDRA-7132) - * Fix nodetool display with vnodes (CASSANDRA-7082) - * Fix schema concurrency exceptions (CASSANDRA-6841) - * Fix BatchlogManager#deleteBatch() use of millisecond timsestamps - (CASSANDRA-6822) - * Continue assassinating even if the endpoint vanishes (CASSANDRA-6787) - * Schedule schema pulls on change (CASSANDRA-6971) - * Non-droppable verbs shouldn't be dropped from OTC (CASSANDRA-6980) - * Shutdown batchlog executor in SS#drain() (CASSANDRA-7025) - * Fix batchlog to account for CF truncation records (CASSANDRA-6999) - * Fix CQLSH parsing of functions and BLOB literals (CASSANDRA-7018) - * Require nodetool rebuild_index to specify index names (CASSANDRA-7038) - * Ensure that batchlog and hint timeouts do not produce hints (CASSANDRA-7058) - * Always clean up references in SerializingCache (CASSANDRA-6994) - * Don't shut MessagingService down when replacing a node (CASSANDRA-6476) - * fix npe when doing -Dcassandra.fd_initial_value_ms (CASSANDRA-6751) - * Preserves CQL metadata when updating table from thrift (CASSANDRA-6831) - -2.0.7 +2.1.0-beta2 + * Increase default CL space to 8GB (CASSANDRA-7031) + * Add range tombstones to read repair digests (CASSANDRA-6863) + * Fix BTree.clear for large updates (CASSANDRA-6943) + * Fail write instead of logging a warning when unable to append to CL + (CASSANDRA-6764) + * Eliminate possibility of CL segment appearing twice in active list + (CASSANDRA-6557) + * Apply DONTNEED fadvise to commitlog segments (CASSANDRA-6759) + * Switch CRC component to Adler and include it for compressed sstables + (CASSANDRA-4165) + * Allow cassandra-stress to set compaction strategy options (CASSANDRA-6451) + * Add broadcast_rpc_address option to cassandra.yaml (CASSANDRA-5899) + * Auto reload GossipingPropertyFileSnitch config (CASSANDRA-5897) + * Fix overflow of memtable_total_space_in_mb (CASSANDRA-6573) + * Fix ABTC NPE and apply update function correctly (CASSANDRA-6692) + * Allow nodetool to use a file or prompt for password (CASSANDRA-6660) + * Fix AIOOBE when concurrently accessing ABSC (CASSANDRA-6742) + * Fix assertion error in ALTER TYPE RENAME (CASSANDRA-6705) + * Scrub should not always clear out repaired status (CASSANDRA-5351) + * Improve handling of range tombstone for wide partitions (CASSANDRA-6446) + * Fix ClassCastException for compact table with composites (CASSANDRA-6738) + * Fix potentially repairing with
[07/13] git commit: Merge branch 'cassandra-1.2' into cassandra-2.0
Merge branch 'cassandra-1.2' into cassandra-2.0 Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/d3e77804 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/d3e77804 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/d3e77804 Branch: refs/heads/cassandra-2.0 Commit: d3e778041b988b386b55b0060830d88684e79de6 Parents: 02e0eb6 6f4853e Author: Brandon Williams brandonwilli...@apache.org Authored: Sat May 3 13:44:30 2014 -0500 Committer: Brandon Williams brandonwilli...@apache.org Committed: Sat May 3 13:44:30 2014 -0500 -- --
[01/13] git commit: Add Cloudstack snitch
Repository: cassandra Updated Branches: refs/heads/cassandra-1.2 837bded79 - 6f4853e78 refs/heads/cassandra-2.0 02e0eb637 - 3047ab638 refs/heads/cassandra-2.1 341153526 - b53442b20 refs/heads/trunk 53c91426e - 2b674656e Add Cloudstack snitch Patch by Pierre-Yves Ritschard, reviewed by brandonwilliams for CASSANDRA-7147 Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/6f4853e7 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/6f4853e7 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/6f4853e7 Branch: refs/heads/cassandra-1.2 Commit: 6f4853e78a289c5fd55c523290309b6e87f2014b Parents: 837bded Author: Brandon Williams brandonwilli...@apache.org Authored: Sat May 3 13:43:40 2014 -0500 Committer: Brandon Williams brandonwilli...@apache.org Committed: Sat May 3 13:43:40 2014 -0500 -- CHANGES.txt | 1 + .../cassandra/locator/CloudstackSnitch.java | 187 +++ .../cassandra/locator/CloudstackSnitchTest.java | 111 +++ 3 files changed, 299 insertions(+) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/6f4853e7/CHANGES.txt -- diff --git a/CHANGES.txt b/CHANGES.txt index 1c67331..484f4bd 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,4 +1,5 @@ 1.2.17 + * Add Cloudstack snitch (CASSANDRA-7147) * Update system.peers correctly when relocating tokens (CASSANDRA-7126) * Add Google Compute Engine snitch (CASSANDRA-7132) * Fix nodetool display with vnodes (CASSANDRA-7082) http://git-wip-us.apache.org/repos/asf/cassandra/blob/6f4853e7/src/java/org/apache/cassandra/locator/CloudstackSnitch.java -- diff --git a/src/java/org/apache/cassandra/locator/CloudstackSnitch.java b/src/java/org/apache/cassandra/locator/CloudstackSnitch.java new file mode 100644 index 000..6d06556 --- /dev/null +++ b/src/java/org/apache/cassandra/locator/CloudstackSnitch.java @@ -0,0 +1,187 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * License); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.cassandra.locator; + +import java.io.InputStream; +import java.io.BufferedInputStream; +import java.io.FilterInputStream; +import java.io.BufferedReader; +import java.io.FileReader; +import java.io.IOException; +import java.io.File; +import java.net.HttpURLConnection; +import java.net.InetAddress; +import java.net.URL; +import java.net.URI; +import java.nio.charset.StandardCharsets; +import java.util.Map; +import java.util.regex.Pattern; +import java.util.regex.Matcher; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.apache.cassandra.db.SystemTable; +import org.apache.cassandra.exceptions.ConfigurationException; +import org.apache.cassandra.gms.ApplicationState; +import org.apache.cassandra.gms.EndpointState; +import org.apache.cassandra.gms.Gossiper; +import org.apache.cassandra.io.util.FileUtils; +import org.apache.cassandra.utils.FBUtilities; + +/** + * A snitch that assumes a Cloudstack Zone follows the typical convention + * country-location-availability zone and uses the country/location + * tuple as a datacenter and the availability zone as a rack + */ + +public class CloudstackSnitch extends AbstractNetworkTopologySnitch +{ +protected static final Logger logger = LoggerFactory.getLogger(CloudstackSnitch.class); +protected static final String ZONE_NAME_QUERY_URI = /latest/meta-data/availability-zone; + +private MapInetAddress, MapString, String savedEndpoints; + +private static final String DEFAULT_DC = UNKNOWN-DC; +private static final String DEFAULT_RACK = UNKNOWN-RACK; +private static final String[] LEASE_FILES = { +file:///var/lib/dhcp/dhclient.eth0.leases, +file:///var/lib/dhclient/dhclient.eth0.leases +}; + +protected String csZoneDc; +protected String csZoneRack; + +public CloudstackSnitch() throws IOException, ConfigurationException +{ +String endpoint =
[jira] [Resolved] (CASSANDRA-7147) Add a new snitch for Apache Cloudstack platforms
[ https://issues.apache.org/jira/browse/CASSANDRA-7147?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Brandon Williams resolved CASSANDRA-7147. - Resolution: Fixed Fix Version/s: (was: 2.1 beta2) 2.1 rc1 1.2.17 Went ahead and backported this to 1.2 as well. Committed, thanks. Add a new snitch for Apache Cloudstack platforms Key: CASSANDRA-7147 URL: https://issues.apache.org/jira/browse/CASSANDRA-7147 Project: Cassandra Issue Type: Improvement Components: Core Environment: Virtual machine on Apache Cloudstack environments Reporter: Pierre-Yves Ritschard Assignee: Pierre-Yves Ritschard Priority: Minor Fix For: 1.2.17, 2.0.8, 2.1 rc1 Attachments: 0001-initial-work-on-a-cloudstack-snitch.patch The attached patch adds a new Snitch that queries meta data for a host on Apache Cloudstack environments. Since the metadata service is colocated with the DHCP service in Cloudstack, common lease file locations are looked up to retrieve. Since zone naming is freeform in Apache Cloudstack, the widely used country-location-az notation is assumed. The patch includes a simple unit test and has been tested on exoscale.ch, a public cloud based on Apache Cloudstack -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Commented] (CASSANDRA-7147) Add a new snitch for Apache Cloudstack platforms
[ https://issues.apache.org/jira/browse/CASSANDRA-7147?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13988791#comment-13988791 ] Pierre-Yves Ritschard commented on CASSANDRA-7147: -- Thanks! Add a new snitch for Apache Cloudstack platforms Key: CASSANDRA-7147 URL: https://issues.apache.org/jira/browse/CASSANDRA-7147 Project: Cassandra Issue Type: Improvement Components: Core Environment: Virtual machine on Apache Cloudstack environments Reporter: Pierre-Yves Ritschard Assignee: Pierre-Yves Ritschard Priority: Minor Fix For: 1.2.17, 2.0.8, 2.1 rc1 Attachments: 0001-initial-work-on-a-cloudstack-snitch.patch The attached patch adds a new Snitch that queries meta data for a host on Apache Cloudstack environments. Since the metadata service is colocated with the DHCP service in Cloudstack, common lease file locations are looked up to retrieve. Since zone naming is freeform in Apache Cloudstack, the widely used country-location-az notation is assumed. The patch includes a simple unit test and has been tested on exoscale.ch, a public cloud based on Apache Cloudstack -- This message was sent by Atlassian JIRA (v6.2#6252)
git commit: fix npe if configURL is null (new URL(null) throws)
Repository: cassandra Updated Branches: refs/heads/cassandra-2.0 3047ab638 - 3fb2dcdf0 fix npe if configURL is null (new URL(null) throws) Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/3fb2dcdf Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/3fb2dcdf Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/3fb2dcdf Branch: refs/heads/cassandra-2.0 Commit: 3fb2dcdf06fa74db14891abb76a447c040f32436 Parents: 3047ab6 Author: Dave Brosius dbros...@mebigfatguy.com Authored: Sat May 3 16:39:16 2014 -0400 Committer: Dave Brosius dbros...@mebigfatguy.com Committed: Sat May 3 16:39:16 2014 -0400 -- src/java/org/apache/cassandra/locator/SnitchProperties.java | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/3fb2dcdf/src/java/org/apache/cassandra/locator/SnitchProperties.java -- diff --git a/src/java/org/apache/cassandra/locator/SnitchProperties.java b/src/java/org/apache/cassandra/locator/SnitchProperties.java index 52268da..36fec7f 100644 --- a/src/java/org/apache/cassandra/locator/SnitchProperties.java +++ b/src/java/org/apache/cassandra/locator/SnitchProperties.java @@ -38,9 +38,12 @@ public class SnitchProperties String configURL = System.getProperty(RACKDC_PROPERTY_FILENAME); try { -URL url = new URL(configURL); +URL url; if (configURL == null) url = SnitchProperties.class.getClassLoader().getResource(RACKDC_PROPERTY_FILENAME); +else + url = new URL(configURL); + stream = url.openStream(); // catch block handles potential NPE properties.load(stream); }
[2/2] git commit: Merge branch 'cassandra-2.0' into cassandra-2.1
Merge branch 'cassandra-2.0' into cassandra-2.1 Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/38a48b12 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/38a48b12 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/38a48b12 Branch: refs/heads/cassandra-2.1 Commit: 38a48b1238fb57278b87215ff7046daf7f49920d Parents: b53442b 3fb2dcd Author: Dave Brosius dbros...@mebigfatguy.com Authored: Sat May 3 16:40:14 2014 -0400 Committer: Dave Brosius dbros...@mebigfatguy.com Committed: Sat May 3 16:40:14 2014 -0400 -- src/java/org/apache/cassandra/locator/SnitchProperties.java | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/38a48b12/src/java/org/apache/cassandra/locator/SnitchProperties.java --
[1/3] git commit: fix npe if configURL is null (new URL(null) throws)
Repository: cassandra Updated Branches: refs/heads/trunk 2b674656e - 848494d5f fix npe if configURL is null (new URL(null) throws) Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/3fb2dcdf Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/3fb2dcdf Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/3fb2dcdf Branch: refs/heads/trunk Commit: 3fb2dcdf06fa74db14891abb76a447c040f32436 Parents: 3047ab6 Author: Dave Brosius dbros...@mebigfatguy.com Authored: Sat May 3 16:39:16 2014 -0400 Committer: Dave Brosius dbros...@mebigfatguy.com Committed: Sat May 3 16:39:16 2014 -0400 -- src/java/org/apache/cassandra/locator/SnitchProperties.java | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/3fb2dcdf/src/java/org/apache/cassandra/locator/SnitchProperties.java -- diff --git a/src/java/org/apache/cassandra/locator/SnitchProperties.java b/src/java/org/apache/cassandra/locator/SnitchProperties.java index 52268da..36fec7f 100644 --- a/src/java/org/apache/cassandra/locator/SnitchProperties.java +++ b/src/java/org/apache/cassandra/locator/SnitchProperties.java @@ -38,9 +38,12 @@ public class SnitchProperties String configURL = System.getProperty(RACKDC_PROPERTY_FILENAME); try { -URL url = new URL(configURL); +URL url; if (configURL == null) url = SnitchProperties.class.getClassLoader().getResource(RACKDC_PROPERTY_FILENAME); +else + url = new URL(configURL); + stream = url.openStream(); // catch block handles potential NPE properties.load(stream); }
[2/3] git commit: Merge branch 'cassandra-2.0' into cassandra-2.1
Merge branch 'cassandra-2.0' into cassandra-2.1 Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/38a48b12 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/38a48b12 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/38a48b12 Branch: refs/heads/trunk Commit: 38a48b1238fb57278b87215ff7046daf7f49920d Parents: b53442b 3fb2dcd Author: Dave Brosius dbros...@mebigfatguy.com Authored: Sat May 3 16:40:14 2014 -0400 Committer: Dave Brosius dbros...@mebigfatguy.com Committed: Sat May 3 16:40:14 2014 -0400 -- src/java/org/apache/cassandra/locator/SnitchProperties.java | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/38a48b12/src/java/org/apache/cassandra/locator/SnitchProperties.java --
git commit: fix node's broadcast address sanity check
Repository: cassandra Updated Branches: refs/heads/cassandra-2.0 3fb2dcdf0 - 65cd825d0 fix node's broadcast address sanity check Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/65cd825d Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/65cd825d Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/65cd825d Branch: refs/heads/cassandra-2.0 Commit: 65cd825d0d423b7473b7197b2d22a3dc169e2bb1 Parents: 3fb2dcd Author: Dave Brosius dbros...@mebigfatguy.com Authored: Sat May 3 16:51:14 2014 -0400 Committer: Dave Brosius dbros...@mebigfatguy.com Committed: Sat May 3 16:51:14 2014 -0400 -- .../apache/cassandra/locator/YamlFileNetworkTopologySnitch.java| 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/65cd825d/src/java/org/apache/cassandra/locator/YamlFileNetworkTopologySnitch.java -- diff --git a/src/java/org/apache/cassandra/locator/YamlFileNetworkTopologySnitch.java b/src/java/org/apache/cassandra/locator/YamlFileNetworkTopologySnitch.java index f299b61..99ab792 100644 --- a/src/java/org/apache/cassandra/locator/YamlFileNetworkTopologySnitch.java +++ b/src/java/org/apache/cassandra/locator/YamlFileNetworkTopologySnitch.java @@ -273,7 +273,7 @@ public class YamlFileNetworkTopologySnitch for (final Node node : rack.nodes) { -if (rack.rack_name == null) +if (node.broadcast_address == null) { throw new ConfigurationException( String.format(
[2/2] git commit: Merge branch 'cassandra-2.0' into cassandra-2.1
Merge branch 'cassandra-2.0' into cassandra-2.1 Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/f12a8a32 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/f12a8a32 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/f12a8a32 Branch: refs/heads/cassandra-2.1 Commit: f12a8a32e4ae72959b01931289231395d8949fc7 Parents: 38a48b1 65cd825 Author: Dave Brosius dbros...@mebigfatguy.com Authored: Sat May 3 16:54:36 2014 -0400 Committer: Dave Brosius dbros...@mebigfatguy.com Committed: Sat May 3 16:54:36 2014 -0400 -- .../apache/cassandra/locator/YamlFileNetworkTopologySnitch.java| 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --
[2/3] git commit: Merge branch 'cassandra-2.0' into cassandra-2.1
Merge branch 'cassandra-2.0' into cassandra-2.1 Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/f12a8a32 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/f12a8a32 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/f12a8a32 Branch: refs/heads/trunk Commit: f12a8a32e4ae72959b01931289231395d8949fc7 Parents: 38a48b1 65cd825 Author: Dave Brosius dbros...@mebigfatguy.com Authored: Sat May 3 16:54:36 2014 -0400 Committer: Dave Brosius dbros...@mebigfatguy.com Committed: Sat May 3 16:54:36 2014 -0400 -- .../apache/cassandra/locator/YamlFileNetworkTopologySnitch.java| 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --
[1/2] git commit: fix node's broadcast address sanity check
Repository: cassandra Updated Branches: refs/heads/cassandra-2.1 38a48b123 - f12a8a32e fix node's broadcast address sanity check Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/65cd825d Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/65cd825d Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/65cd825d Branch: refs/heads/cassandra-2.1 Commit: 65cd825d0d423b7473b7197b2d22a3dc169e2bb1 Parents: 3fb2dcd Author: Dave Brosius dbros...@mebigfatguy.com Authored: Sat May 3 16:51:14 2014 -0400 Committer: Dave Brosius dbros...@mebigfatguy.com Committed: Sat May 3 16:51:14 2014 -0400 -- .../apache/cassandra/locator/YamlFileNetworkTopologySnitch.java| 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/65cd825d/src/java/org/apache/cassandra/locator/YamlFileNetworkTopologySnitch.java -- diff --git a/src/java/org/apache/cassandra/locator/YamlFileNetworkTopologySnitch.java b/src/java/org/apache/cassandra/locator/YamlFileNetworkTopologySnitch.java index f299b61..99ab792 100644 --- a/src/java/org/apache/cassandra/locator/YamlFileNetworkTopologySnitch.java +++ b/src/java/org/apache/cassandra/locator/YamlFileNetworkTopologySnitch.java @@ -273,7 +273,7 @@ public class YamlFileNetworkTopologySnitch for (final Node node : rack.nodes) { -if (rack.rack_name == null) +if (node.broadcast_address == null) { throw new ConfigurationException( String.format(
[1/3] git commit: fix node's broadcast address sanity check
Repository: cassandra Updated Branches: refs/heads/trunk 848494d5f - aca945d79 fix node's broadcast address sanity check Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/65cd825d Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/65cd825d Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/65cd825d Branch: refs/heads/trunk Commit: 65cd825d0d423b7473b7197b2d22a3dc169e2bb1 Parents: 3fb2dcd Author: Dave Brosius dbros...@mebigfatguy.com Authored: Sat May 3 16:51:14 2014 -0400 Committer: Dave Brosius dbros...@mebigfatguy.com Committed: Sat May 3 16:51:14 2014 -0400 -- .../apache/cassandra/locator/YamlFileNetworkTopologySnitch.java| 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/65cd825d/src/java/org/apache/cassandra/locator/YamlFileNetworkTopologySnitch.java -- diff --git a/src/java/org/apache/cassandra/locator/YamlFileNetworkTopologySnitch.java b/src/java/org/apache/cassandra/locator/YamlFileNetworkTopologySnitch.java index f299b61..99ab792 100644 --- a/src/java/org/apache/cassandra/locator/YamlFileNetworkTopologySnitch.java +++ b/src/java/org/apache/cassandra/locator/YamlFileNetworkTopologySnitch.java @@ -273,7 +273,7 @@ public class YamlFileNetworkTopologySnitch for (final Node node : rack.nodes) { -if (rack.rack_name == null) +if (node.broadcast_address == null) { throw new ConfigurationException( String.format(
[3/3] git commit: Merge branch 'cassandra-2.1' into trunk
Merge branch 'cassandra-2.1' into trunk Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/aca945d7 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/aca945d7 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/aca945d7 Branch: refs/heads/trunk Commit: aca945d79c0a42e96d807f04f713f5e490c101c1 Parents: 848494d f12a8a3 Author: Dave Brosius dbros...@mebigfatguy.com Authored: Sat May 3 16:55:03 2014 -0400 Committer: Dave Brosius dbros...@mebigfatguy.com Committed: Sat May 3 16:55:03 2014 -0400 -- .../apache/cassandra/locator/YamlFileNetworkTopologySnitch.java| 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --
[jira] [Updated] (CASSANDRA-7143) shuffle broken on 2.0
[ https://issues.apache.org/jira/browse/CASSANDRA-7143?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Brandon Williams updated CASSANDRA-7143: Attachment: 7143.txt The main problem here was range xfers were not being deleted correctly, so it saw the token didn't need moving and just kept looping over it. Cleaned up some log messages as well. shuffle broken on 2.0 - Key: CASSANDRA-7143 URL: https://issues.apache.org/jira/browse/CASSANDRA-7143 Project: Cassandra Issue Type: Bug Components: Core Reporter: Brandon Williams Assignee: Brandon Williams Fix For: 2.0.8 Attachments: 7143.txt In 1.2, shuffle works correctly, creating the list of relocations and then following it, pausing correctly as needed: {noformat} WARN 20:45:58,153 Pausing until token count stabilizes (target=3, actual=4) {noformat} However on 2.0, it relocates all the ranges in one shot and never deletes entries from the list of tokens to relocate. -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Updated] (CASSANDRA-7107) General minor tidying of CollationController path
[ https://issues.apache.org/jira/browse/CASSANDRA-7107?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Aleksey Yeschenko updated CASSANDRA-7107: - Fix Version/s: (was: 2.1.0) 2.1 rc1 General minor tidying of CollationController path - Key: CASSANDRA-7107 URL: https://issues.apache.org/jira/browse/CASSANDRA-7107 Project: Cassandra Issue Type: Improvement Components: Core Reporter: Benedict Assignee: Benedict Priority: Minor Fix For: 2.1 rc1 There is a lot of unnecessary boiler plate when grabbing an iterator from an in-memory column family. This patch: * Removes FakeCellName * Avoids wrapping a non-OnDiskAtomIterator as an OnDiskAtomIterator except when the wrapping is useful * Removes ColumnSlice.NavigableSetIterator and creates a simpler more direct equivalent in ABTC * Does not construct a SliceIterator in either ABSC or ABTC if only one slice is requested (just returns that slice as an Iterator) * Does not construct multiple list indirections in ABSC when constructing a slice * Shares forward/reverse iterators in ABSC between slices and full-iteration * Avoids O(N) comparisons during collation of results into an ABSC, by using the knowledge that all columns are provided in insertion order from a merge iterator -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Commented] (CASSANDRA-7107) General minor tidying of CollationController path
[ https://issues.apache.org/jira/browse/CASSANDRA-7107?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13988856#comment-13988856 ] Aleksey Yeschenko commented on CASSANDRA-7107: -- Slightly worried about a potentiall off by one at https://github.com/iamaleksey/cassandra/blob/7107/src/java/org/apache/cassandra/db/ArrayBackedSortedColumns.java#L526, but the more I start at it, the more benign it looks to me. Wouldn't mind a second look by a third person at this particular code just to help me sleep better. General minor tidying of CollationController path - Key: CASSANDRA-7107 URL: https://issues.apache.org/jira/browse/CASSANDRA-7107 Project: Cassandra Issue Type: Improvement Components: Core Reporter: Benedict Assignee: Benedict Priority: Minor Fix For: 2.1 rc1 There is a lot of unnecessary boiler plate when grabbing an iterator from an in-memory column family. This patch: * Removes FakeCellName * Avoids wrapping a non-OnDiskAtomIterator as an OnDiskAtomIterator except when the wrapping is useful * Removes ColumnSlice.NavigableSetIterator and creates a simpler more direct equivalent in ABTC * Does not construct a SliceIterator in either ABSC or ABTC if only one slice is requested (just returns that slice as an Iterator) * Does not construct multiple list indirections in ABSC when constructing a slice * Shares forward/reverse iterators in ABSC between slices and full-iteration * Avoids O(N) comparisons during collation of results into an ABSC, by using the knowledge that all columns are provided in insertion order from a merge iterator -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Comment Edited] (CASSANDRA-7107) General minor tidying of CollationController path
[ https://issues.apache.org/jira/browse/CASSANDRA-7107?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13988856#comment-13988856 ] Aleksey Yeschenko edited comment on CASSANDRA-7107 at 5/3/14 11:55 PM: --- Slightly worried about a potentiall off by one at https://github.com/iamaleksey/cassandra/blob/7107/src/java/org/apache/cassandra/db/ArrayBackedSortedColumns.java#L526, but the more I stare at it, the more benign it looks to me. Wouldn't mind a second look by a third person at this particular code just to help me sleep better. was (Author: iamaleksey): Slightly worried about a potentiall off by one at https://github.com/iamaleksey/cassandra/blob/7107/src/java/org/apache/cassandra/db/ArrayBackedSortedColumns.java#L526, but the more I start at it, the more benign it looks to me. Wouldn't mind a second look by a third person at this particular code just to help me sleep better. General minor tidying of CollationController path - Key: CASSANDRA-7107 URL: https://issues.apache.org/jira/browse/CASSANDRA-7107 Project: Cassandra Issue Type: Improvement Components: Core Reporter: Benedict Assignee: Benedict Priority: Minor Fix For: 2.1 rc1 There is a lot of unnecessary boiler plate when grabbing an iterator from an in-memory column family. This patch: * Removes FakeCellName * Avoids wrapping a non-OnDiskAtomIterator as an OnDiskAtomIterator except when the wrapping is useful * Removes ColumnSlice.NavigableSetIterator and creates a simpler more direct equivalent in ABTC * Does not construct a SliceIterator in either ABSC or ABTC if only one slice is requested (just returns that slice as an Iterator) * Does not construct multiple list indirections in ABSC when constructing a slice * Shares forward/reverse iterators in ABSC between slices and full-iteration * Avoids O(N) comparisons during collation of results into an ABSC, by using the knowledge that all columns are provided in insertion order from a merge iterator -- This message was sent by Atlassian JIRA (v6.2#6252)
git commit: Move BatchlogEndpointSelector to BatchlogManager.EndpointFilter + minor refactorings
Repository: cassandra Updated Branches: refs/heads/cassandra-2.1 f12a8a32e - f486193ab Move BatchlogEndpointSelector to BatchlogManager.EndpointFilter + minor refactorings Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/f486193a Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/f486193a Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/f486193a Branch: refs/heads/cassandra-2.1 Commit: f486193ab5654881986a7f7b655fee3aedabad15 Parents: f12a8a3 Author: Aleksey Yeschenko alek...@apache.org Authored: Sun May 4 03:33:03 2014 +0300 Committer: Aleksey Yeschenko alek...@apache.org Committed: Sun May 4 03:33:03 2014 +0300 -- .../apache/cassandra/db/BatchlogManager.java| 80 - .../service/BatchlogEndpointSelector.java | 110 - .../apache/cassandra/service/StorageProxy.java | 7 +- .../service/BatchlogEndpointFilterTest.java | 117 +++ .../service/BatchlogEndpointSelectorTest.java | 116 -- 5 files changed, 197 insertions(+), 233 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/f486193a/src/java/org/apache/cassandra/db/BatchlogManager.java -- diff --git a/src/java/org/apache/cassandra/db/BatchlogManager.java b/src/java/org/apache/cassandra/db/BatchlogManager.java index fee686b..de51c8d 100644 --- a/src/java/org/apache/cassandra/db/BatchlogManager.java +++ b/src/java/org/apache/cassandra/db/BatchlogManager.java @@ -30,7 +30,7 @@ import javax.management.MBeanServer; import javax.management.ObjectName; import com.google.common.annotations.VisibleForTesting; -import com.google.common.collect.Iterables; +import com.google.common.collect.*; import com.google.common.util.concurrent.RateLimiter; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -364,4 +364,82 @@ public class BatchlogManager implements BatchlogManagerMBean { return QueryProcessor.processInternal(String.format(format, args)); } + +public static class EndpointFilter +{ +private final String localRack; +private final MultimapString, InetAddress endpoints; + +public EndpointFilter(String localRack, MultimapString, InetAddress endpoints) +{ +this.localRack = localRack; +this.endpoints = endpoints; +} + +/** + * @return list of candidates for batchlog hosting. If possible these will be two nodes from different racks. + */ +public CollectionInetAddress filter() +{ +// special case for single-node data centers +if (endpoints.values().size() == 1) +return endpoints.values(); + +// strip out dead endpoints and localhost +ListMultimapString, InetAddress validated = ArrayListMultimap.create(); +for (Map.EntryString, InetAddress entry : endpoints.entries()) +if (isValid(entry.getValue())) +validated.put(entry.getKey(), entry.getValue()); + +if (validated.size() = 2) +return validated.values(); + +if (validated.size() - validated.get(localRack).size() = 2) +{ +// we have enough endpoints in other racks +validated.removeAll(localRack); +} + +if (validated.keySet().size() == 1) +{ +// we have only 1 `other` rack +CollectionInetAddress otherRack = Iterables.getOnlyElement(validated.asMap().values()); +return Lists.newArrayList(Iterables.limit(otherRack, 2)); +} + +// randomize which racks we pick from if more than 2 remaining +CollectionString racks; +if (validated.keySet().size() == 2) +{ +racks = validated.keySet(); +} +else +{ +racks = Lists.newArrayList(validated.keySet()); +Collections.shuffle((List) racks); +} + +// grab a random member of up to two racks +ListInetAddress result = new ArrayList(2); +for (String rack : Iterables.limit(racks, 2)) +{ +ListInetAddress rackMembers = validated.get(rack); +result.add(rackMembers.get(getRandomInt(rackMembers.size(; +} + +return result; +} + +@VisibleForTesting +protected boolean isValid(InetAddress input) +{ +return !input.equals(FBUtilities.getBroadcastAddress()) FailureDetector.instance.isAlive(input); +} + +@VisibleForTesting +protected int getRandomInt(int bound)
[2/2] git commit: Merge branch 'cassandra-2.1' into trunk
Merge branch 'cassandra-2.1' into trunk Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/f7df2fec Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/f7df2fec Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/f7df2fec Branch: refs/heads/trunk Commit: f7df2fec8464a587aed963e642352454f94dd0ff Parents: aca945d f486193 Author: Aleksey Yeschenko alek...@apache.org Authored: Sun May 4 03:33:51 2014 +0300 Committer: Aleksey Yeschenko alek...@apache.org Committed: Sun May 4 03:33:51 2014 +0300 -- .../apache/cassandra/db/BatchlogManager.java| 80 - .../service/BatchlogEndpointSelector.java | 110 - .../apache/cassandra/service/StorageProxy.java | 7 +- .../service/BatchlogEndpointFilterTest.java | 117 +++ .../service/BatchlogEndpointSelectorTest.java | 116 -- 5 files changed, 197 insertions(+), 233 deletions(-) --
[1/2] git commit: Move BatchlogEndpointSelector to BatchlogManager.EndpointFilter + minor refactorings
Repository: cassandra Updated Branches: refs/heads/trunk aca945d79 - f7df2fec8 Move BatchlogEndpointSelector to BatchlogManager.EndpointFilter + minor refactorings Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/f486193a Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/f486193a Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/f486193a Branch: refs/heads/trunk Commit: f486193ab5654881986a7f7b655fee3aedabad15 Parents: f12a8a3 Author: Aleksey Yeschenko alek...@apache.org Authored: Sun May 4 03:33:03 2014 +0300 Committer: Aleksey Yeschenko alek...@apache.org Committed: Sun May 4 03:33:03 2014 +0300 -- .../apache/cassandra/db/BatchlogManager.java| 80 - .../service/BatchlogEndpointSelector.java | 110 - .../apache/cassandra/service/StorageProxy.java | 7 +- .../service/BatchlogEndpointFilterTest.java | 117 +++ .../service/BatchlogEndpointSelectorTest.java | 116 -- 5 files changed, 197 insertions(+), 233 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/f486193a/src/java/org/apache/cassandra/db/BatchlogManager.java -- diff --git a/src/java/org/apache/cassandra/db/BatchlogManager.java b/src/java/org/apache/cassandra/db/BatchlogManager.java index fee686b..de51c8d 100644 --- a/src/java/org/apache/cassandra/db/BatchlogManager.java +++ b/src/java/org/apache/cassandra/db/BatchlogManager.java @@ -30,7 +30,7 @@ import javax.management.MBeanServer; import javax.management.ObjectName; import com.google.common.annotations.VisibleForTesting; -import com.google.common.collect.Iterables; +import com.google.common.collect.*; import com.google.common.util.concurrent.RateLimiter; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -364,4 +364,82 @@ public class BatchlogManager implements BatchlogManagerMBean { return QueryProcessor.processInternal(String.format(format, args)); } + +public static class EndpointFilter +{ +private final String localRack; +private final MultimapString, InetAddress endpoints; + +public EndpointFilter(String localRack, MultimapString, InetAddress endpoints) +{ +this.localRack = localRack; +this.endpoints = endpoints; +} + +/** + * @return list of candidates for batchlog hosting. If possible these will be two nodes from different racks. + */ +public CollectionInetAddress filter() +{ +// special case for single-node data centers +if (endpoints.values().size() == 1) +return endpoints.values(); + +// strip out dead endpoints and localhost +ListMultimapString, InetAddress validated = ArrayListMultimap.create(); +for (Map.EntryString, InetAddress entry : endpoints.entries()) +if (isValid(entry.getValue())) +validated.put(entry.getKey(), entry.getValue()); + +if (validated.size() = 2) +return validated.values(); + +if (validated.size() - validated.get(localRack).size() = 2) +{ +// we have enough endpoints in other racks +validated.removeAll(localRack); +} + +if (validated.keySet().size() == 1) +{ +// we have only 1 `other` rack +CollectionInetAddress otherRack = Iterables.getOnlyElement(validated.asMap().values()); +return Lists.newArrayList(Iterables.limit(otherRack, 2)); +} + +// randomize which racks we pick from if more than 2 remaining +CollectionString racks; +if (validated.keySet().size() == 2) +{ +racks = validated.keySet(); +} +else +{ +racks = Lists.newArrayList(validated.keySet()); +Collections.shuffle((List) racks); +} + +// grab a random member of up to two racks +ListInetAddress result = new ArrayList(2); +for (String rack : Iterables.limit(racks, 2)) +{ +ListInetAddress rackMembers = validated.get(rack); +result.add(rackMembers.get(getRandomInt(rackMembers.size(; +} + +return result; +} + +@VisibleForTesting +protected boolean isValid(InetAddress input) +{ +return !input.equals(FBUtilities.getBroadcastAddress()) FailureDetector.instance.isAlive(input); +} + +@VisibleForTesting +protected int getRandomInt(int bound) +{ +
[jira] [Commented] (CASSANDRA-6551) Rack-aware batchlog replication
[ https://issues.apache.org/jira/browse/CASSANDRA-6551?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13988870#comment-13988870 ] Aleksey Yeschenko commented on CASSANDRA-6551: -- Ninja-d in f486193ab5654881986a7f7b655fee3aedabad15 - moved BatchlogEndpointSelector to BatchlogManager.EndpointFilter - moved the single-node DC special-case logic from StorageProxy to EndpointFilter - moved the endpoints argument of chooseEndpoints() to the EndpointFilter constuctor + renamed chooseEndpoints() to filter() Left everything else alone. Rack-aware batchlog replication --- Key: CASSANDRA-6551 URL: https://issues.apache.org/jira/browse/CASSANDRA-6551 Project: Cassandra Issue Type: Improvement Components: Core Reporter: Rick Branson Assignee: Mikhail Stepura Priority: Minor Fix For: 2.1 rc1 Attachments: 6551-v2.txt, 6551-v3.patch, cassandra-2.0-6551-2.patch Right now the batchlog replication code just randomly picks 2 other nodes in the same DC, regardless of rack. Ideally we'd pick 2 replicas in other racks to achieve higher fault tolerance. -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Comment Edited] (CASSANDRA-6551) Rack-aware batchlog replication
[ https://issues.apache.org/jira/browse/CASSANDRA-6551?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13988870#comment-13988870 ] Aleksey Yeschenko edited comment on CASSANDRA-6551 at 5/4/14 12:38 AM: --- Ninja-d in https://github.com/apache/cassandra/commit/f486193ab5654881986a7f7b655fee3aedabad15 - moved BatchlogEndpointSelector to BatchlogManager.EndpointFilter - moved the single-node DC special-case logic from StorageProxy to EndpointFilter - moved the endpoints argument of chooseEndpoints() to the EndpointFilter constuctor + renamed chooseEndpoints() to filter() Left everything else alone. was (Author: iamaleksey): Ninja-d in f486193ab5654881986a7f7b655fee3aedabad15 - moved BatchlogEndpointSelector to BatchlogManager.EndpointFilter - moved the single-node DC special-case logic from StorageProxy to EndpointFilter - moved the endpoints argument of chooseEndpoints() to the EndpointFilter constuctor + renamed chooseEndpoints() to filter() Left everything else alone. Rack-aware batchlog replication --- Key: CASSANDRA-6551 URL: https://issues.apache.org/jira/browse/CASSANDRA-6551 Project: Cassandra Issue Type: Improvement Components: Core Reporter: Rick Branson Assignee: Mikhail Stepura Priority: Minor Fix For: 2.1 rc1 Attachments: 6551-v2.txt, 6551-v3.patch, cassandra-2.0-6551-2.patch Right now the batchlog replication code just randomly picks 2 other nodes in the same DC, regardless of rack. Ideally we'd pick 2 replicas in other racks to achieve higher fault tolerance. -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Updated] (CASSANDRA-6134) More efficient BatchlogManager
[ https://issues.apache.org/jira/browse/CASSANDRA-6134?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Aleksey Yeschenko updated CASSANDRA-6134: - Fix Version/s: 2.1 rc1 More efficient BatchlogManager -- Key: CASSANDRA-6134 URL: https://issues.apache.org/jira/browse/CASSANDRA-6134 Project: Cassandra Issue Type: Improvement Reporter: Oleg Anastasyev Assignee: Oleg Anastasyev Priority: Minor Fix For: 2.1 rc1 Attachments: 6134-async.txt, 6134-cleanup.txt, BatchlogManager.txt As we discussed earlier in CASSANDRA-6079 this is the new BatchManager. It stores batch records in {code} CREATE TABLE batchlog ( id_partition int, id timeuuid, data blob, PRIMARY KEY (id_partition, id) ) WITH COMPACT STORAGE AND CLUSTERING ORDER BY (id DESC) {code} where id_partition is minute-since-epoch of id uuid. So when it scans for batches to replay ot scans within a single partition for a slice of ids since last processed date till now minus write timeout. So no full batchlog CF scan and lot of randrom reads are made on normal cycle. Other improvements: 1. It runs every 1/2 of write timeout and replays all batches written within 0.9 * write timeout from now. This way we ensure, that batched updates will be replayed to th moment client times out from coordinator. 2. It submits all mutations from single batch in parallel (Like StorageProxy do). Old implementation played them one-by-one, so client can see half applied batches in CF for a long time (depending on size of batch). 3. It fixes a subtle racing bug with incorrect hint ttl calculation -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Updated] (CASSANDRA-6134) Asynchronous batchlog replay
[ https://issues.apache.org/jira/browse/CASSANDRA-6134?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Aleksey Yeschenko updated CASSANDRA-6134: - Summary: Asynchronous batchlog replay (was: More efficient BatchlogManager) Asynchronous batchlog replay Key: CASSANDRA-6134 URL: https://issues.apache.org/jira/browse/CASSANDRA-6134 Project: Cassandra Issue Type: Improvement Reporter: Oleg Anastasyev Assignee: Oleg Anastasyev Priority: Minor Fix For: 2.1 rc1 Attachments: 6134-async.txt, 6134-cleanup.txt, BatchlogManager.txt As we discussed earlier in CASSANDRA-6079 this is the new BatchManager. It stores batch records in {code} CREATE TABLE batchlog ( id_partition int, id timeuuid, data blob, PRIMARY KEY (id_partition, id) ) WITH COMPACT STORAGE AND CLUSTERING ORDER BY (id DESC) {code} where id_partition is minute-since-epoch of id uuid. So when it scans for batches to replay ot scans within a single partition for a slice of ids since last processed date till now minus write timeout. So no full batchlog CF scan and lot of randrom reads are made on normal cycle. Other improvements: 1. It runs every 1/2 of write timeout and replays all batches written within 0.9 * write timeout from now. This way we ensure, that batched updates will be replayed to th moment client times out from coordinator. 2. It submits all mutations from single batch in parallel (Like StorageProxy do). Old implementation played them one-by-one, so client can see half applied batches in CF for a long time (depending on size of batch). 3. It fixes a subtle racing bug with incorrect hint ttl calculation -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Comment Edited] (CASSANDRA-7107) General minor tidying of CollationController path
[ https://issues.apache.org/jira/browse/CASSANDRA-7107?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13988852#comment-13988852 ] Aleksey Yeschenko edited comment on CASSANDRA-7107 at 5/4/14 3:31 AM: -- Overall LGTM, some very welcome cleanup. Nice catch with the empty check in CollationController#collectTimeOrderedData(), too. Squashed commit #1 and #3 together and added to extra commits with suggested changes, pushed to https://github.com/iamaleksey/cassandra/commits/7107 The second original commit is not included b/c I'm very uncomfortable with leaving a ColumnFamily#append() method around - it's going to be abused by some innocent sole, and there will be hard to debug suffering as a result. Inlined it into a new CF#maybeAppendColumn() method instead, that's less likely to be called by mistake (see the last commit). The second commit has a bugfix, some improvements, nits fixed, some extra cleanup and prettiness: - discovered only one bug - ABSC.CellCollection#size() was not calling maybeSortCells() - fixed in the commit #2 - refactored ABSC#slice() and ABTC#slice() for obviousness - made the second binary search in ABSC#slice() use the updated lowerBound, reducing the range to search - in CollationController#collectAllData(), in the memtable loop, using Iterables#transform() instead of copying the cells into a temporary ArrayList, to potentially reduce the amount of localCopy()-ing (esp. for low query LIMITs) - killed off MergeIterator#getSimple(), instead simply using toCollate.get(0) in QF#collateColumns(), avoiding creating a Reducer instance in the trivial case w/ a single source was (Author: iamaleksey): Overall LGTM, some very welcome cleanup. Nice catch with the empty check in CollationController#collectTimeOrderedData(), too. Squashed commit #1 and #3 together and added to extra commits with suggested changes, pushed to https://github.com/iamaleksey/cassandra/commits/7107 The second original commit is not included b/c I'm very uncomfortable with leaving a ColumnFamily#append() method around - it's going to be abused by some innocent sole, and there will be hard to debug suffering as a result. Inlined it into a new CF#maybeAppendColumn() method instead, that's less likely to be called by mistake (see the last commit). The second commit has a bugfix, some improvements, nits fixed, some extra cleanup and prettiness: - discovered only one bug - ABSC.CellCollection#size() was not calling maybeSortCells() - fixed in the commit #2 - refactored ABSC#slice() and ABTC#slice() for obviousness - made the second binary search in ABSC#slice() use the updated lowerBound, reducing the range to search - in CollationController#collectAllData(), in the memtable loop, using Iterables#transform() instead of copying the cells into a temporary ArrayList, to potentially reduce the amount of localCopy()-ing (esp. for low query LIMITs) - rolled back MergeIterator#getSimple() - here, I don't think that 1-1 duplication of MergeIterator#get() is worth removing a little bit of indirection, sorry. Hope you don't have a strong opinion here, because I, weirdly, do. General minor tidying of CollationController path - Key: CASSANDRA-7107 URL: https://issues.apache.org/jira/browse/CASSANDRA-7107 Project: Cassandra Issue Type: Improvement Components: Core Reporter: Benedict Assignee: Benedict Priority: Minor Fix For: 2.1 rc1 There is a lot of unnecessary boiler plate when grabbing an iterator from an in-memory column family. This patch: * Removes FakeCellName * Avoids wrapping a non-OnDiskAtomIterator as an OnDiskAtomIterator except when the wrapping is useful * Removes ColumnSlice.NavigableSetIterator and creates a simpler more direct equivalent in ABTC * Does not construct a SliceIterator in either ABSC or ABTC if only one slice is requested (just returns that slice as an Iterator) * Does not construct multiple list indirections in ABSC when constructing a slice * Shares forward/reverse iterators in ABSC between slices and full-iteration * Avoids O(N) comparisons during collation of results into an ABSC, by using the knowledge that all columns are provided in insertion order from a merge iterator -- This message was sent by Atlassian JIRA (v6.2#6252)
git commit: make sure zone info gets completely read
Repository: cassandra Updated Branches: refs/heads/cassandra-1.2 6f4853e78 - 2f32783bd make sure zone info gets completely read Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/2f32783b Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/2f32783b Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/2f32783b Branch: refs/heads/cassandra-1.2 Commit: 2f32783bd60081b7798b73c58f9d973776dfd7b5 Parents: 6f4853e Author: Dave Brosius dbros...@mebigfatguy.com Authored: Sun May 4 00:07:40 2014 -0400 Committer: Dave Brosius dbros...@mebigfatguy.com Committed: Sun May 4 00:07:40 2014 -0400 -- src/java/org/apache/cassandra/locator/CloudstackSnitch.java | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/2f32783b/src/java/org/apache/cassandra/locator/CloudstackSnitch.java -- diff --git a/src/java/org/apache/cassandra/locator/CloudstackSnitch.java b/src/java/org/apache/cassandra/locator/CloudstackSnitch.java index 6d06556..af26ef9 100644 --- a/src/java/org/apache/cassandra/locator/CloudstackSnitch.java +++ b/src/java/org/apache/cassandra/locator/CloudstackSnitch.java @@ -17,9 +17,8 @@ */ package org.apache.cassandra.locator; -import java.io.InputStream; +import java.io.DataInputStream; import java.io.BufferedInputStream; -import java.io.FilterInputStream; import java.io.BufferedReader; import java.io.FileReader; import java.io.IOException; @@ -112,7 +111,7 @@ public class CloudstackSnitch extends AbstractNetworkTopologySnitch String csQueryMetadata(String url) throws ConfigurationException, IOException { HttpURLConnection conn = null; -BufferedInputStream is = null; +DataInputStream is = null; try { conn = (HttpURLConnection) new URL(url).openConnection(); @@ -127,8 +126,8 @@ public class CloudstackSnitch extends AbstractNetworkTopologySnitch int cl = conn.getContentLength(); byte[] b = new byte[cl]; -is = new BufferedInputStream(conn.getInputStream()); -is.read(b, 0, cl); +is = new DataInputStream(new BufferedInputStream(conn.getInputStream())); +is.readFully(b); return new String(b, StandardCharsets.UTF_8); } finally { FileUtils.close(is);
[1/2] git commit: make sure zone info gets completely read
Repository: cassandra Updated Branches: refs/heads/cassandra-2.0 65cd825d0 - 4233ee43d make sure zone info gets completely read Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/2f32783b Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/2f32783b Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/2f32783b Branch: refs/heads/cassandra-2.0 Commit: 2f32783bd60081b7798b73c58f9d973776dfd7b5 Parents: 6f4853e Author: Dave Brosius dbros...@mebigfatguy.com Authored: Sun May 4 00:07:40 2014 -0400 Committer: Dave Brosius dbros...@mebigfatguy.com Committed: Sun May 4 00:07:40 2014 -0400 -- src/java/org/apache/cassandra/locator/CloudstackSnitch.java | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/2f32783b/src/java/org/apache/cassandra/locator/CloudstackSnitch.java -- diff --git a/src/java/org/apache/cassandra/locator/CloudstackSnitch.java b/src/java/org/apache/cassandra/locator/CloudstackSnitch.java index 6d06556..af26ef9 100644 --- a/src/java/org/apache/cassandra/locator/CloudstackSnitch.java +++ b/src/java/org/apache/cassandra/locator/CloudstackSnitch.java @@ -17,9 +17,8 @@ */ package org.apache.cassandra.locator; -import java.io.InputStream; +import java.io.DataInputStream; import java.io.BufferedInputStream; -import java.io.FilterInputStream; import java.io.BufferedReader; import java.io.FileReader; import java.io.IOException; @@ -112,7 +111,7 @@ public class CloudstackSnitch extends AbstractNetworkTopologySnitch String csQueryMetadata(String url) throws ConfigurationException, IOException { HttpURLConnection conn = null; -BufferedInputStream is = null; +DataInputStream is = null; try { conn = (HttpURLConnection) new URL(url).openConnection(); @@ -127,8 +126,8 @@ public class CloudstackSnitch extends AbstractNetworkTopologySnitch int cl = conn.getContentLength(); byte[] b = new byte[cl]; -is = new BufferedInputStream(conn.getInputStream()); -is.read(b, 0, cl); +is = new DataInputStream(new BufferedInputStream(conn.getInputStream())); +is.readFully(b); return new String(b, StandardCharsets.UTF_8); } finally { FileUtils.close(is);
[2/2] git commit: Merge branch 'cassandra-1.2' into cassandra-2.0
Merge branch 'cassandra-1.2' into cassandra-2.0 Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/4233ee43 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/4233ee43 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/4233ee43 Branch: refs/heads/cassandra-2.0 Commit: 4233ee43d0fa38f2a4f73975b3c96990ac4ca4eb Parents: 65cd825 2f32783 Author: Dave Brosius dbros...@mebigfatguy.com Authored: Sun May 4 00:08:21 2014 -0400 Committer: Dave Brosius dbros...@mebigfatguy.com Committed: Sun May 4 00:08:21 2014 -0400 -- src/java/org/apache/cassandra/locator/CloudstackSnitch.java | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/4233ee43/src/java/org/apache/cassandra/locator/CloudstackSnitch.java --
[1/3] git commit: make sure zone info gets completely read
Repository: cassandra Updated Branches: refs/heads/cassandra-2.1 f486193ab - a79ad681f make sure zone info gets completely read Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/2f32783b Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/2f32783b Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/2f32783b Branch: refs/heads/cassandra-2.1 Commit: 2f32783bd60081b7798b73c58f9d973776dfd7b5 Parents: 6f4853e Author: Dave Brosius dbros...@mebigfatguy.com Authored: Sun May 4 00:07:40 2014 -0400 Committer: Dave Brosius dbros...@mebigfatguy.com Committed: Sun May 4 00:07:40 2014 -0400 -- src/java/org/apache/cassandra/locator/CloudstackSnitch.java | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/2f32783b/src/java/org/apache/cassandra/locator/CloudstackSnitch.java -- diff --git a/src/java/org/apache/cassandra/locator/CloudstackSnitch.java b/src/java/org/apache/cassandra/locator/CloudstackSnitch.java index 6d06556..af26ef9 100644 --- a/src/java/org/apache/cassandra/locator/CloudstackSnitch.java +++ b/src/java/org/apache/cassandra/locator/CloudstackSnitch.java @@ -17,9 +17,8 @@ */ package org.apache.cassandra.locator; -import java.io.InputStream; +import java.io.DataInputStream; import java.io.BufferedInputStream; -import java.io.FilterInputStream; import java.io.BufferedReader; import java.io.FileReader; import java.io.IOException; @@ -112,7 +111,7 @@ public class CloudstackSnitch extends AbstractNetworkTopologySnitch String csQueryMetadata(String url) throws ConfigurationException, IOException { HttpURLConnection conn = null; -BufferedInputStream is = null; +DataInputStream is = null; try { conn = (HttpURLConnection) new URL(url).openConnection(); @@ -127,8 +126,8 @@ public class CloudstackSnitch extends AbstractNetworkTopologySnitch int cl = conn.getContentLength(); byte[] b = new byte[cl]; -is = new BufferedInputStream(conn.getInputStream()); -is.read(b, 0, cl); +is = new DataInputStream(new BufferedInputStream(conn.getInputStream())); +is.readFully(b); return new String(b, StandardCharsets.UTF_8); } finally { FileUtils.close(is);
[3/4] git commit: Merge branch 'cassandra-2.0' into cassandra-2.1
Merge branch 'cassandra-2.0' into cassandra-2.1 Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/a79ad681 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/a79ad681 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/a79ad681 Branch: refs/heads/trunk Commit: a79ad681ff17dea668fd39581be7ba48e55e634e Parents: f486193 4233ee4 Author: Dave Brosius dbros...@mebigfatguy.com Authored: Sun May 4 00:09:17 2014 -0400 Committer: Dave Brosius dbros...@mebigfatguy.com Committed: Sun May 4 00:09:17 2014 -0400 -- src/java/org/apache/cassandra/locator/CloudstackSnitch.java | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) --
[1/4] git commit: make sure zone info gets completely read
Repository: cassandra Updated Branches: refs/heads/trunk f7df2fec8 - 425d31849 make sure zone info gets completely read Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/2f32783b Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/2f32783b Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/2f32783b Branch: refs/heads/trunk Commit: 2f32783bd60081b7798b73c58f9d973776dfd7b5 Parents: 6f4853e Author: Dave Brosius dbros...@mebigfatguy.com Authored: Sun May 4 00:07:40 2014 -0400 Committer: Dave Brosius dbros...@mebigfatguy.com Committed: Sun May 4 00:07:40 2014 -0400 -- src/java/org/apache/cassandra/locator/CloudstackSnitch.java | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/2f32783b/src/java/org/apache/cassandra/locator/CloudstackSnitch.java -- diff --git a/src/java/org/apache/cassandra/locator/CloudstackSnitch.java b/src/java/org/apache/cassandra/locator/CloudstackSnitch.java index 6d06556..af26ef9 100644 --- a/src/java/org/apache/cassandra/locator/CloudstackSnitch.java +++ b/src/java/org/apache/cassandra/locator/CloudstackSnitch.java @@ -17,9 +17,8 @@ */ package org.apache.cassandra.locator; -import java.io.InputStream; +import java.io.DataInputStream; import java.io.BufferedInputStream; -import java.io.FilterInputStream; import java.io.BufferedReader; import java.io.FileReader; import java.io.IOException; @@ -112,7 +111,7 @@ public class CloudstackSnitch extends AbstractNetworkTopologySnitch String csQueryMetadata(String url) throws ConfigurationException, IOException { HttpURLConnection conn = null; -BufferedInputStream is = null; +DataInputStream is = null; try { conn = (HttpURLConnection) new URL(url).openConnection(); @@ -127,8 +126,8 @@ public class CloudstackSnitch extends AbstractNetworkTopologySnitch int cl = conn.getContentLength(); byte[] b = new byte[cl]; -is = new BufferedInputStream(conn.getInputStream()); -is.read(b, 0, cl); +is = new DataInputStream(new BufferedInputStream(conn.getInputStream())); +is.readFully(b); return new String(b, StandardCharsets.UTF_8); } finally { FileUtils.close(is);
git commit: make sure streams get closed
Repository: cassandra Updated Branches: refs/heads/cassandra-1.2 2f32783bd - c454807a7 make sure streams get closed Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/c454807a Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/c454807a Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/c454807a Branch: refs/heads/cassandra-1.2 Commit: c454807a75a55bf7a12dbe7c641266bcaf33d6e1 Parents: 2f32783 Author: Dave Brosius dbros...@mebigfatguy.com Authored: Sun May 4 00:19:51 2014 -0400 Committer: Dave Brosius dbros...@mebigfatguy.com Committed: Sun May 4 00:19:51 2014 -0400 -- .../cassandra/locator/CloudstackSnitch.java | 78 +--- 1 file changed, 51 insertions(+), 27 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/c454807a/src/java/org/apache/cassandra/locator/CloudstackSnitch.java -- diff --git a/src/java/org/apache/cassandra/locator/CloudstackSnitch.java b/src/java/org/apache/cassandra/locator/CloudstackSnitch.java index af26ef9..57c973b 100644 --- a/src/java/org/apache/cassandra/locator/CloudstackSnitch.java +++ b/src/java/org/apache/cassandra/locator/CloudstackSnitch.java @@ -57,7 +57,8 @@ public class CloudstackSnitch extends AbstractNetworkTopologySnitch private static final String DEFAULT_DC = UNKNOWN-DC; private static final String DEFAULT_RACK = UNKNOWN-RACK; -private static final String[] LEASE_FILES = { +private static final String[] LEASE_FILES = +{ file:///var/lib/dhcp/dhclient.eth0.leases, file:///var/lib/dhclient/dhclient.eth0.leases }; @@ -71,7 +72,8 @@ public class CloudstackSnitch extends AbstractNetworkTopologySnitch String zone = csQueryMetadata(endpoint + ZONE_NAME_QUERY_URI); String zone_parts[] = zone.split(-); -if (zone_parts.length != 3) { +if (zone_parts.length != 3) +{ throw new ConfigurationException(CloudstackSnitch cannot handle invalid zone format: + zone); } csZoneDc = zone_parts[0] + - + zone_parts[1]; @@ -83,7 +85,8 @@ public class CloudstackSnitch extends AbstractNetworkTopologySnitch if (endpoint.equals(FBUtilities.getBroadcastAddress())) return csZoneRack; EndpointState state = Gossiper.instance.getEndpointStateForEndpoint(endpoint); -if (state == null || state.getApplicationState(ApplicationState.RACK) == null) { +if (state == null || state.getApplicationState(ApplicationState.RACK) == null) +{ if (savedEndpoints == null) savedEndpoints = SystemTable.loadDcRackInfo(); if (savedEndpoints.containsKey(endpoint)) @@ -98,7 +101,8 @@ public class CloudstackSnitch extends AbstractNetworkTopologySnitch if (endpoint.equals(FBUtilities.getBroadcastAddress())) return csZoneDc; EndpointState state = Gossiper.instance.getEndpointStateForEndpoint(endpoint); -if (state == null || state.getApplicationState(ApplicationState.DC) == null) { +if (state == null || state.getApplicationState(ApplicationState.DC) == null) +{ if (savedEndpoints == null) savedEndpoints = SystemTable.loadDcRackInfo(); if (savedEndpoints.containsKey(endpoint)) @@ -113,14 +117,19 @@ public class CloudstackSnitch extends AbstractNetworkTopologySnitch HttpURLConnection conn = null; DataInputStream is = null; -try { +try +{ conn = (HttpURLConnection) new URL(url).openConnection(); -} catch (Exception e) { +} +catch (Exception e) +{ throw new ConfigurationException(CloudstackSnitch cannot query wrong metadata URL: + url); } -try { +try +{ conn.setRequestMethod(GET); -if (conn.getResponseCode() != 200) { +if (conn.getResponseCode() != 200) +{ throw new ConfigurationException(CloudstackSnitch was unable to query metadata.); } @@ -129,27 +138,31 @@ public class CloudstackSnitch extends AbstractNetworkTopologySnitch is = new DataInputStream(new BufferedInputStream(conn.getInputStream())); is.readFully(b); return new String(b, StandardCharsets.UTF_8); -} finally { +} +finally +{ FileUtils.close(is); conn.disconnect(); } - } String csMetadataEndpoint() throws ConfigurationException { -for (String lease_uri: LEASE_FILES) { -try { +for (String lease_uri: LEASE_FILES) +{ +
[3/3] git commit: Merge branch 'cassandra-2.0' into cassandra-2.1
Merge branch 'cassandra-2.0' into cassandra-2.1 Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/b2fad366 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/b2fad366 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/b2fad366 Branch: refs/heads/cassandra-2.1 Commit: b2fad3662275648a72a870c3abcc9bbe27badafa Parents: a79ad68 2e955d4 Author: Dave Brosius dbros...@mebigfatguy.com Authored: Sun May 4 00:20:48 2014 -0400 Committer: Dave Brosius dbros...@mebigfatguy.com Committed: Sun May 4 00:20:48 2014 -0400 -- .../cassandra/locator/CloudstackSnitch.java | 78 +--- 1 file changed, 51 insertions(+), 27 deletions(-) --
[2/3] git commit: Merge branch 'cassandra-1.2' into cassandra-2.0
Merge branch 'cassandra-1.2' into cassandra-2.0 Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/2e955d48 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/2e955d48 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/2e955d48 Branch: refs/heads/cassandra-2.1 Commit: 2e955d4818708ff865898bd0f57a29cb4e93f0a8 Parents: 4233ee4 c454807 Author: Dave Brosius dbros...@mebigfatguy.com Authored: Sun May 4 00:20:21 2014 -0400 Committer: Dave Brosius dbros...@mebigfatguy.com Committed: Sun May 4 00:20:21 2014 -0400 -- .../cassandra/locator/CloudstackSnitch.java | 78 +--- 1 file changed, 51 insertions(+), 27 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/2e955d48/src/java/org/apache/cassandra/locator/CloudstackSnitch.java -- diff --cc src/java/org/apache/cassandra/locator/CloudstackSnitch.java index 43ae996,57c973b..0200f0f --- a/src/java/org/apache/cassandra/locator/CloudstackSnitch.java +++ b/src/java/org/apache/cassandra/locator/CloudstackSnitch.java @@@ -83,9 -85,10 +85,10 @@@ public class CloudstackSnitch extends A if (endpoint.equals(FBUtilities.getBroadcastAddress())) return csZoneRack; EndpointState state = Gossiper.instance.getEndpointStateForEndpoint(endpoint); - if (state == null || state.getApplicationState(ApplicationState.RACK) == null) { + if (state == null || state.getApplicationState(ApplicationState.RACK) == null) + { if (savedEndpoints == null) -savedEndpoints = SystemTable.loadDcRackInfo(); +savedEndpoints = SystemKeyspace.loadDcRackInfo(); if (savedEndpoints.containsKey(endpoint)) return savedEndpoints.get(endpoint).get(rack); return DEFAULT_RACK; @@@ -98,9 -101,10 +101,10 @@@ if (endpoint.equals(FBUtilities.getBroadcastAddress())) return csZoneDc; EndpointState state = Gossiper.instance.getEndpointStateForEndpoint(endpoint); - if (state == null || state.getApplicationState(ApplicationState.DC) == null) { + if (state == null || state.getApplicationState(ApplicationState.DC) == null) + { if (savedEndpoints == null) -savedEndpoints = SystemTable.loadDcRackInfo(); +savedEndpoints = SystemKeyspace.loadDcRackInfo(); if (savedEndpoints.containsKey(endpoint)) return savedEndpoints.get(endpoint).get(data_center); return DEFAULT_DC;
[1/2] git commit: make sure streams get closed
Repository: cassandra Updated Branches: refs/heads/cassandra-2.0 4233ee43d - 2e955d481 make sure streams get closed Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/c454807a Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/c454807a Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/c454807a Branch: refs/heads/cassandra-2.0 Commit: c454807a75a55bf7a12dbe7c641266bcaf33d6e1 Parents: 2f32783 Author: Dave Brosius dbros...@mebigfatguy.com Authored: Sun May 4 00:19:51 2014 -0400 Committer: Dave Brosius dbros...@mebigfatguy.com Committed: Sun May 4 00:19:51 2014 -0400 -- .../cassandra/locator/CloudstackSnitch.java | 78 +--- 1 file changed, 51 insertions(+), 27 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/c454807a/src/java/org/apache/cassandra/locator/CloudstackSnitch.java -- diff --git a/src/java/org/apache/cassandra/locator/CloudstackSnitch.java b/src/java/org/apache/cassandra/locator/CloudstackSnitch.java index af26ef9..57c973b 100644 --- a/src/java/org/apache/cassandra/locator/CloudstackSnitch.java +++ b/src/java/org/apache/cassandra/locator/CloudstackSnitch.java @@ -57,7 +57,8 @@ public class CloudstackSnitch extends AbstractNetworkTopologySnitch private static final String DEFAULT_DC = UNKNOWN-DC; private static final String DEFAULT_RACK = UNKNOWN-RACK; -private static final String[] LEASE_FILES = { +private static final String[] LEASE_FILES = +{ file:///var/lib/dhcp/dhclient.eth0.leases, file:///var/lib/dhclient/dhclient.eth0.leases }; @@ -71,7 +72,8 @@ public class CloudstackSnitch extends AbstractNetworkTopologySnitch String zone = csQueryMetadata(endpoint + ZONE_NAME_QUERY_URI); String zone_parts[] = zone.split(-); -if (zone_parts.length != 3) { +if (zone_parts.length != 3) +{ throw new ConfigurationException(CloudstackSnitch cannot handle invalid zone format: + zone); } csZoneDc = zone_parts[0] + - + zone_parts[1]; @@ -83,7 +85,8 @@ public class CloudstackSnitch extends AbstractNetworkTopologySnitch if (endpoint.equals(FBUtilities.getBroadcastAddress())) return csZoneRack; EndpointState state = Gossiper.instance.getEndpointStateForEndpoint(endpoint); -if (state == null || state.getApplicationState(ApplicationState.RACK) == null) { +if (state == null || state.getApplicationState(ApplicationState.RACK) == null) +{ if (savedEndpoints == null) savedEndpoints = SystemTable.loadDcRackInfo(); if (savedEndpoints.containsKey(endpoint)) @@ -98,7 +101,8 @@ public class CloudstackSnitch extends AbstractNetworkTopologySnitch if (endpoint.equals(FBUtilities.getBroadcastAddress())) return csZoneDc; EndpointState state = Gossiper.instance.getEndpointStateForEndpoint(endpoint); -if (state == null || state.getApplicationState(ApplicationState.DC) == null) { +if (state == null || state.getApplicationState(ApplicationState.DC) == null) +{ if (savedEndpoints == null) savedEndpoints = SystemTable.loadDcRackInfo(); if (savedEndpoints.containsKey(endpoint)) @@ -113,14 +117,19 @@ public class CloudstackSnitch extends AbstractNetworkTopologySnitch HttpURLConnection conn = null; DataInputStream is = null; -try { +try +{ conn = (HttpURLConnection) new URL(url).openConnection(); -} catch (Exception e) { +} +catch (Exception e) +{ throw new ConfigurationException(CloudstackSnitch cannot query wrong metadata URL: + url); } -try { +try +{ conn.setRequestMethod(GET); -if (conn.getResponseCode() != 200) { +if (conn.getResponseCode() != 200) +{ throw new ConfigurationException(CloudstackSnitch was unable to query metadata.); } @@ -129,27 +138,31 @@ public class CloudstackSnitch extends AbstractNetworkTopologySnitch is = new DataInputStream(new BufferedInputStream(conn.getInputStream())); is.readFully(b); return new String(b, StandardCharsets.UTF_8); -} finally { +} +finally +{ FileUtils.close(is); conn.disconnect(); } - } String csMetadataEndpoint() throws ConfigurationException { -for (String lease_uri: LEASE_FILES) { -try { +for (String lease_uri: LEASE_FILES) +{ +
[3/4] git commit: Merge branch 'cassandra-2.0' into cassandra-2.1
Merge branch 'cassandra-2.0' into cassandra-2.1 Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/b2fad366 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/b2fad366 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/b2fad366 Branch: refs/heads/trunk Commit: b2fad3662275648a72a870c3abcc9bbe27badafa Parents: a79ad68 2e955d4 Author: Dave Brosius dbros...@mebigfatguy.com Authored: Sun May 4 00:20:48 2014 -0400 Committer: Dave Brosius dbros...@mebigfatguy.com Committed: Sun May 4 00:20:48 2014 -0400 -- .../cassandra/locator/CloudstackSnitch.java | 78 +--- 1 file changed, 51 insertions(+), 27 deletions(-) --
[2/4] git commit: Merge branch 'cassandra-1.2' into cassandra-2.0
Merge branch 'cassandra-1.2' into cassandra-2.0 Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/2e955d48 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/2e955d48 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/2e955d48 Branch: refs/heads/trunk Commit: 2e955d4818708ff865898bd0f57a29cb4e93f0a8 Parents: 4233ee4 c454807 Author: Dave Brosius dbros...@mebigfatguy.com Authored: Sun May 4 00:20:21 2014 -0400 Committer: Dave Brosius dbros...@mebigfatguy.com Committed: Sun May 4 00:20:21 2014 -0400 -- .../cassandra/locator/CloudstackSnitch.java | 78 +--- 1 file changed, 51 insertions(+), 27 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/2e955d48/src/java/org/apache/cassandra/locator/CloudstackSnitch.java -- diff --cc src/java/org/apache/cassandra/locator/CloudstackSnitch.java index 43ae996,57c973b..0200f0f --- a/src/java/org/apache/cassandra/locator/CloudstackSnitch.java +++ b/src/java/org/apache/cassandra/locator/CloudstackSnitch.java @@@ -83,9 -85,10 +85,10 @@@ public class CloudstackSnitch extends A if (endpoint.equals(FBUtilities.getBroadcastAddress())) return csZoneRack; EndpointState state = Gossiper.instance.getEndpointStateForEndpoint(endpoint); - if (state == null || state.getApplicationState(ApplicationState.RACK) == null) { + if (state == null || state.getApplicationState(ApplicationState.RACK) == null) + { if (savedEndpoints == null) -savedEndpoints = SystemTable.loadDcRackInfo(); +savedEndpoints = SystemKeyspace.loadDcRackInfo(); if (savedEndpoints.containsKey(endpoint)) return savedEndpoints.get(endpoint).get(rack); return DEFAULT_RACK; @@@ -98,9 -101,10 +101,10 @@@ if (endpoint.equals(FBUtilities.getBroadcastAddress())) return csZoneDc; EndpointState state = Gossiper.instance.getEndpointStateForEndpoint(endpoint); - if (state == null || state.getApplicationState(ApplicationState.DC) == null) { + if (state == null || state.getApplicationState(ApplicationState.DC) == null) + { if (savedEndpoints == null) -savedEndpoints = SystemTable.loadDcRackInfo(); +savedEndpoints = SystemKeyspace.loadDcRackInfo(); if (savedEndpoints.containsKey(endpoint)) return savedEndpoints.get(endpoint).get(data_center); return DEFAULT_DC;
[4/4] git commit: Merge branch 'cassandra-2.1' into trunk
Merge branch 'cassandra-2.1' into trunk Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/e5f08867 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/e5f08867 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/e5f08867 Branch: refs/heads/trunk Commit: e5f08867e905803b25a5f2f068656ae6c4d76340 Parents: 425d318 b2fad36 Author: Dave Brosius dbros...@mebigfatguy.com Authored: Sun May 4 00:21:13 2014 -0400 Committer: Dave Brosius dbros...@mebigfatguy.com Committed: Sun May 4 00:21:13 2014 -0400 -- .../cassandra/locator/CloudstackSnitch.java | 78 +--- 1 file changed, 51 insertions(+), 27 deletions(-) --
[1/3] git commit: make sure streams get closed
Repository: cassandra Updated Branches: refs/heads/cassandra-2.1 a79ad681f - b2fad3662 make sure streams get closed Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/c454807a Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/c454807a Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/c454807a Branch: refs/heads/cassandra-2.1 Commit: c454807a75a55bf7a12dbe7c641266bcaf33d6e1 Parents: 2f32783 Author: Dave Brosius dbros...@mebigfatguy.com Authored: Sun May 4 00:19:51 2014 -0400 Committer: Dave Brosius dbros...@mebigfatguy.com Committed: Sun May 4 00:19:51 2014 -0400 -- .../cassandra/locator/CloudstackSnitch.java | 78 +--- 1 file changed, 51 insertions(+), 27 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/c454807a/src/java/org/apache/cassandra/locator/CloudstackSnitch.java -- diff --git a/src/java/org/apache/cassandra/locator/CloudstackSnitch.java b/src/java/org/apache/cassandra/locator/CloudstackSnitch.java index af26ef9..57c973b 100644 --- a/src/java/org/apache/cassandra/locator/CloudstackSnitch.java +++ b/src/java/org/apache/cassandra/locator/CloudstackSnitch.java @@ -57,7 +57,8 @@ public class CloudstackSnitch extends AbstractNetworkTopologySnitch private static final String DEFAULT_DC = UNKNOWN-DC; private static final String DEFAULT_RACK = UNKNOWN-RACK; -private static final String[] LEASE_FILES = { +private static final String[] LEASE_FILES = +{ file:///var/lib/dhcp/dhclient.eth0.leases, file:///var/lib/dhclient/dhclient.eth0.leases }; @@ -71,7 +72,8 @@ public class CloudstackSnitch extends AbstractNetworkTopologySnitch String zone = csQueryMetadata(endpoint + ZONE_NAME_QUERY_URI); String zone_parts[] = zone.split(-); -if (zone_parts.length != 3) { +if (zone_parts.length != 3) +{ throw new ConfigurationException(CloudstackSnitch cannot handle invalid zone format: + zone); } csZoneDc = zone_parts[0] + - + zone_parts[1]; @@ -83,7 +85,8 @@ public class CloudstackSnitch extends AbstractNetworkTopologySnitch if (endpoint.equals(FBUtilities.getBroadcastAddress())) return csZoneRack; EndpointState state = Gossiper.instance.getEndpointStateForEndpoint(endpoint); -if (state == null || state.getApplicationState(ApplicationState.RACK) == null) { +if (state == null || state.getApplicationState(ApplicationState.RACK) == null) +{ if (savedEndpoints == null) savedEndpoints = SystemTable.loadDcRackInfo(); if (savedEndpoints.containsKey(endpoint)) @@ -98,7 +101,8 @@ public class CloudstackSnitch extends AbstractNetworkTopologySnitch if (endpoint.equals(FBUtilities.getBroadcastAddress())) return csZoneDc; EndpointState state = Gossiper.instance.getEndpointStateForEndpoint(endpoint); -if (state == null || state.getApplicationState(ApplicationState.DC) == null) { +if (state == null || state.getApplicationState(ApplicationState.DC) == null) +{ if (savedEndpoints == null) savedEndpoints = SystemTable.loadDcRackInfo(); if (savedEndpoints.containsKey(endpoint)) @@ -113,14 +117,19 @@ public class CloudstackSnitch extends AbstractNetworkTopologySnitch HttpURLConnection conn = null; DataInputStream is = null; -try { +try +{ conn = (HttpURLConnection) new URL(url).openConnection(); -} catch (Exception e) { +} +catch (Exception e) +{ throw new ConfigurationException(CloudstackSnitch cannot query wrong metadata URL: + url); } -try { +try +{ conn.setRequestMethod(GET); -if (conn.getResponseCode() != 200) { +if (conn.getResponseCode() != 200) +{ throw new ConfigurationException(CloudstackSnitch was unable to query metadata.); } @@ -129,27 +138,31 @@ public class CloudstackSnitch extends AbstractNetworkTopologySnitch is = new DataInputStream(new BufferedInputStream(conn.getInputStream())); is.readFully(b); return new String(b, StandardCharsets.UTF_8); -} finally { +} +finally +{ FileUtils.close(is); conn.disconnect(); } - } String csMetadataEndpoint() throws ConfigurationException { -for (String lease_uri: LEASE_FILES) { -try { +for (String lease_uri: LEASE_FILES) +{ +