cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alek...@apache.org
Subject git commit: Allow overriding superuser setup delay
Date Mon, 08 Apr 2013 16:17:09 GMT
Updated Branches:
  refs/heads/cassandra-1.2 1429c54b0 -> 22d107ff5


 Allow overriding superuser setup delay

 patch by Aleksey Yeschenko; reviewed by Jonathan Ellis for
 CASSANDRA-5430


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/22d107ff
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/22d107ff
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/22d107ff

Branch: refs/heads/cassandra-1.2
Commit: 22d107ff5276658a9d2927c29e9ecc53d63b150e
Parents: 1429c54
Author: Aleksey Yeschenko <aleksey@apache.org>
Authored: Mon Apr 8 19:16:06 2013 +0300
Committer: Aleksey Yeschenko <aleksey@apache.org>
Committed: Mon Apr 8 19:16:06 2013 +0300

----------------------------------------------------------------------
 CHANGES.txt                                        |    1 +
 NEWS.txt                                           |    5 +++++
 src/java/org/apache/cassandra/auth/Auth.java       |    8 ++++----
 .../cassandra/auth/PasswordAuthenticator.java      |   10 ++++------
 4 files changed, 14 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/22d107ff/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 5347f91..81d57ef 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -31,6 +31,7 @@
  * Allow unauthenticated set_keyspace() calls (CASSANDRA-5423)
  * Fix potential incremental backups race (CASSANDRA-5410)
  * Fix prepared BATCH statements with batch-level timestamps (CASSANDRA-5415)
+ * Allow overriding superuser setup delay (CASSANDRA-5430)
 Merged from 1.1:
  * cli: Quote ks and cf names in schema output when needed (CASSANDRA-5052)
  * Fix bad default for min/max timestamp in SSTableMetadata (CASSANDRA-5372)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/22d107ff/NEWS.txt
----------------------------------------------------------------------
diff --git a/NEWS.txt b/NEWS.txt
index b53411b..6509d6e 100644
--- a/NEWS.txt
+++ b/NEWS.txt
@@ -17,6 +17,11 @@ Upgrading
       on the current version (which is usually what you want). Use the new -a
       flag to recover the old behavior of rewriting all sstables.
 
+Features
+--------
+    - superuser setup delay (10 seconds) can now be overridden using
+      'cassandra.superuser_setup_delay_ms' property.
+
 
 1.2.3
 =====

http://git-wip-us.apache.org/repos/asf/cassandra/blob/22d107ff/src/java/org/apache/cassandra/auth/Auth.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/auth/Auth.java b/src/java/org/apache/cassandra/auth/Auth.java
index d8e79ca..7ec5a33 100644
--- a/src/java/org/apache/cassandra/auth/Auth.java
+++ b/src/java/org/apache/cassandra/auth/Auth.java
@@ -43,7 +43,7 @@ public class Auth
 
     public static final String DEFAULT_SUPERUSER_NAME = "cassandra";
 
-    private static final long SUPERUSER_SETUP_DELAY = 10; // seconds.
+    public static final long SUPERUSER_SETUP_DELAY = Long.getLong("cassandra.superuser_setup_delay_ms",
10000);
 
     public static final String AUTH_KS = "system_auth";
     public static final String USERS_CF = "users";
@@ -148,14 +148,14 @@ public class Auth
         if (DatabaseDescriptor.getSeeds().contains(FBUtilities.getBroadcastAddress()) ||
!DatabaseDescriptor.isAutoBootstrap())
         {
             StorageService.tasks.schedule(new Runnable()
-                                              {
+                                          {
                                               public void run()
                                               {
                                                   setupDefaultSuperuser();
-                                          }
+                                              }
                                           },
                                           SUPERUSER_SETUP_DELAY,
-                                          TimeUnit.SECONDS);
+                                          TimeUnit.MILLISECONDS);
         }
     }
 

http://git-wip-us.apache.org/repos/asf/cassandra/blob/22d107ff/src/java/org/apache/cassandra/auth/PasswordAuthenticator.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/auth/PasswordAuthenticator.java b/src/java/org/apache/cassandra/auth/PasswordAuthenticator.java
index e6e28ae..01adb1b 100644
--- a/src/java/org/apache/cassandra/auth/PasswordAuthenticator.java
+++ b/src/java/org/apache/cassandra/auth/PasswordAuthenticator.java
@@ -48,8 +48,6 @@ public class PasswordAuthenticator implements IAuthenticator
 {
     private static final Logger logger = LoggerFactory.getLogger(PasswordAuthenticator.class);
 
-    private static final long DEFAULT_USER_SETUP_DELAY = 10; // seconds
-
     // 2 ** GENSALT_LOG2_ROUNS rounds of hashing will be performed.
     private static final int GENSALT_LOG2_ROUNDS = 10;
 
@@ -167,14 +165,14 @@ public class PasswordAuthenticator implements IAuthenticator
         if (DatabaseDescriptor.getSeeds().contains(FBUtilities.getBroadcastAddress()) ||
!DatabaseDescriptor.isAutoBootstrap())
         {
             StorageService.tasks.schedule(new Runnable()
-                                              {
+                                          {
                                               public void run()
                                               {
                                                   setupDefaultUser();
-                                          }
+                                              }
                                           },
-                                          DEFAULT_USER_SETUP_DELAY,
-                                          TimeUnit.SECONDS);
+                                          Auth.SUPERUSER_SETUP_DELAY,
+                                          TimeUnit.MILLISECONDS);
         }
     }
 


Mime
View raw message