cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r1061955 - in /cassandra/trunk: ./ conf/ contrib/bmt_example/ contrib/stress/ contrib/stress/bin/ contrib/stress/src/org/apache/cassandra/contrib/stress/ contrib/stress/src/org/apache/cassandra/contrib/stress/operations/ contrib/stress/src/...
Date Fri, 21 Jan 2011 18:33:10 GMT
Author: jbellis
Date: Fri Jan 21 18:33:09 2011
New Revision: 1061955

URL: http://svn.apache.org/viewvc?rev=1061955&view=rev
Log:
merge from 0.7

Added:
    cassandra/trunk/contrib/stress/README.txt
      - copied unchanged from r1061950, cassandra/branches/cassandra-0.7/contrib/stress/README.txt
    cassandra/trunk/contrib/stress/src/org/apache/cassandra/contrib/stress/operations/
      - copied from r1061950, cassandra/branches/cassandra-0.7/contrib/stress/src/org/apache/cassandra/contrib/stress/operations/
    cassandra/trunk/contrib/stress/src/org/apache/cassandra/contrib/stress/operations/IndexedRangeSlicer.java
      - copied unchanged from r1061950, cassandra/branches/cassandra-0.7/contrib/stress/src/org/apache/cassandra/contrib/stress/operations/IndexedRangeSlicer.java
    cassandra/trunk/contrib/stress/src/org/apache/cassandra/contrib/stress/operations/Inserter.java
      - copied unchanged from r1061950, cassandra/branches/cassandra-0.7/contrib/stress/src/org/apache/cassandra/contrib/stress/operations/Inserter.java
    cassandra/trunk/contrib/stress/src/org/apache/cassandra/contrib/stress/operations/MultiGetter.java
      - copied unchanged from r1061950, cassandra/branches/cassandra-0.7/contrib/stress/src/org/apache/cassandra/contrib/stress/operations/MultiGetter.java
    cassandra/trunk/contrib/stress/src/org/apache/cassandra/contrib/stress/operations/RangeSlicer.java
      - copied unchanged from r1061950, cassandra/branches/cassandra-0.7/contrib/stress/src/org/apache/cassandra/contrib/stress/operations/RangeSlicer.java
    cassandra/trunk/contrib/stress/src/org/apache/cassandra/contrib/stress/operations/Reader.java
      - copied unchanged from r1061950, cassandra/branches/cassandra-0.7/contrib/stress/src/org/apache/cassandra/contrib/stress/operations/Reader.java
Removed:
    cassandra/trunk/contrib/stress/src/org/apache/cassandra/contrib/stress/tests/
Modified:
    cassandra/trunk/   (props changed)
    cassandra/trunk/conf/cassandra.yaml
    cassandra/trunk/contrib/bmt_example/CassandraBulkLoader.java
    cassandra/trunk/contrib/stress/bin/stress
    cassandra/trunk/contrib/stress/src/org/apache/cassandra/contrib/stress/Session.java
    cassandra/trunk/contrib/stress/src/org/apache/cassandra/contrib/stress/Stress.java
    cassandra/trunk/debian/init
    cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java 
 (props changed)
    cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java   (props
changed)
    cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java
  (props changed)
    cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java
  (props changed)
    cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java
  (props changed)
    cassandra/trunk/src/java/org/apache/cassandra/config/Config.java
    cassandra/trunk/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
    cassandra/trunk/src/java/org/apache/cassandra/db/commitlog/CommitLog.java
    cassandra/trunk/src/java/org/apache/cassandra/gms/Gossiper.java
    cassandra/trunk/src/java/org/apache/cassandra/io/util/ColumnSortedMap.java
    cassandra/trunk/src/java/org/apache/cassandra/locator/AbstractReplicationStrategy.java
    cassandra/trunk/src/java/org/apache/cassandra/service/RepairCallback.java
    cassandra/trunk/src/java/org/apache/cassandra/service/StorageProxy.java
    cassandra/trunk/src/java/org/apache/cassandra/service/StorageProxyMBean.java
    cassandra/trunk/src/java/org/apache/cassandra/service/StorageService.java
    cassandra/trunk/src/java/org/apache/cassandra/utils/BloomFilterSerializer.java
    cassandra/trunk/src/java/org/apache/cassandra/utils/LegacyBloomFilterSerializer.java

Propchange: cassandra/trunk/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Jan 21 18:33:09 2011
@@ -1,5 +1,5 @@
 /cassandra/branches/cassandra-0.6:922689-1052356,1052358-1053452,1053454,1053456-1055311,1056121,1057932
-/cassandra/branches/cassandra-0.7:1026516-1061062
+/cassandra/branches/cassandra-0.7:1026516-1061950
 /cassandra/branches/cassandra-0.7.0:1053690-1055654
 /cassandra/tags/cassandra-0.7.0-rc3:1051699-1053689
 /incubator/cassandra/branches/cassandra-0.3:774578-796573

Modified: cassandra/trunk/conf/cassandra.yaml
URL: http://svn.apache.org/viewvc/cassandra/trunk/conf/cassandra.yaml?rev=1061955&r1=1061954&r2=1061955&view=diff
==============================================================================
--- cassandra/trunk/conf/cassandra.yaml (original)
+++ cassandra/trunk/conf/cassandra.yaml Fri Jan 21 18:33:09 2011
@@ -31,6 +31,9 @@ auto_bootstrap: false
 
 # See http://wiki.apache.org/cassandra/HintedHandoff
 hinted_handoff_enabled: true
+# this defines the maximum amount of time a dead host will have hints
+# generated.  After it has been dead this long, hints will be dropped.
+max_hint_window_in_ms: 3600000 # one hour
 
 # authentication backend, implementing IAuthenticator; used to identify users
 authenticator: org.apache.cassandra.auth.AllowAllAuthenticator

Modified: cassandra/trunk/contrib/bmt_example/CassandraBulkLoader.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/contrib/bmt_example/CassandraBulkLoader.java?rev=1061955&r1=1061954&r2=1061955&view=diff
==============================================================================
--- cassandra/trunk/contrib/bmt_example/CassandraBulkLoader.java (original)
+++ cassandra/trunk/contrib/bmt_example/CassandraBulkLoader.java Fri Jan 21 18:33:09 2011
@@ -62,6 +62,7 @@ import java.util.concurrent.TimeoutExcep
 import com.google.common.base.Charsets;
 
 import org.apache.cassandra.config.CFMetaData;
+import org.apache.cassandra.config.ConfigurationException;
 import org.apache.cassandra.config.DatabaseDescriptor;
 import org.apache.cassandra.db.Column;
 import org.apache.cassandra.db.ColumnFamily;
@@ -112,7 +113,7 @@ public class CassandraBulkLoader {
             {
                 StorageService.instance.initClient();
             }
-            catch (IOException e)
+            catch (Exception e)
             {
                 throw new RuntimeException(e);
             }

Modified: cassandra/trunk/contrib/stress/bin/stress
URL: http://svn.apache.org/viewvc/cassandra/trunk/contrib/stress/bin/stress?rev=1061955&r1=1061954&r2=1061955&view=diff
==============================================================================
--- cassandra/trunk/contrib/stress/bin/stress (original)
+++ cassandra/trunk/contrib/stress/bin/stress Fri Jan 21 18:33:09 2011
@@ -23,7 +23,7 @@ if [ "x$CLASSPATH" = "x" ]; then
         exit 1
     fi
 
-    # Circuit class files.
+    # Stress class files.
     if [ ! -d `dirname $0`/../build/classes ]; then
         echo "Unable to locate stress class files" >&2
         exit 1

Modified: cassandra/trunk/contrib/stress/src/org/apache/cassandra/contrib/stress/Session.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/contrib/stress/src/org/apache/cassandra/contrib/stress/Session.java?rev=1061955&r1=1061954&r2=1061955&view=diff
==============================================================================
--- cassandra/trunk/contrib/stress/src/org/apache/cassandra/contrib/stress/Session.java (original)
+++ cassandra/trunk/contrib/stress/src/org/apache/cassandra/contrib/stress/Session.java Fri
Jan 21 18:33:09 2011
@@ -45,28 +45,28 @@ public class Session
 
     static
     {
-        availableOptions.addOption("h",  "help",                 false,  "show this help
message and exit.");
-        availableOptions.addOption("n",  "num-keys",             true,   "Number of keys,
default:1000000.");
-        availableOptions.addOption("N",  "skip-keys",            true,   "Fraction of keys
to skip initially, default:0.");
-        availableOptions.addOption("t",  "threads",              true,   "Number of threads
to use, default:50.");
-        availableOptions.addOption("c",  "columns",              true,   "Number of columns
per key, default:5.");
-        availableOptions.addOption("S",  "column-size",          true,   "Size of column
values in bytes, default:34.");
-        availableOptions.addOption("C",  "cardinality",          true,   "Number of unique
values stored in columns, default:50.");
-        availableOptions.addOption("d",  "nodes",                true,   "Host nodes (comma
separated), default:locahost.");
-        availableOptions.addOption("s",  "stdev",                true,   "Standard Deviation
Factor, default:0.1.");
-        availableOptions.addOption("r",  "random",               false,  "Use random key
generator (STDEV will have no effect), default:false.");
-        availableOptions.addOption("f",  "file",                 true,   "Write output to
file");
-        availableOptions.addOption("p",  "port",                 true,   "Thrift port, default:9160.");
-        availableOptions.addOption("m",  "unframed",             false,  "Use unframed transport,
default:false.");
-        availableOptions.addOption("o",  "operation",            true,   "Operation to perform
(INSERT, READ, RANGE_SLICE, INDEXED_RANGE_SLICE, MULTI_GET), default:INSERT.");
-        availableOptions.addOption("u",  "supercolumns",         true,   "Number of super
columns per key, default:1.");
-        availableOptions.addOption("y",  "family-type",          true,   "Column Family Type
(Super, Standard), default:Standard.");
-        availableOptions.addOption("k",  "keep-going",           false,  "Ignore errors inserting
or reading, default:false.");
-        availableOptions.addOption("i",  "progress-interval",    true,   "Progress Report
Interval (seconds), default:10.");
-        availableOptions.addOption("g",  "keys-per-call",        true,   "Amount of keys
to get_range_slices or multiget per call, default:1000.");
-        availableOptions.addOption("l",  "replication-factor",   true,   "Replication Factor
to use when creating needed column families, default:1.");
-        availableOptions.addOption("e",  "consistency-level",    true,   "Consistency Level
to use (ONE, QUORUM, LOCAL_QUORUM, EACH_QUORUM, ALL, ANY), default:ONE.");
-        availableOptions.addOption("x",  "create-index",         true,   "Type of index to
create on needed column families (KEYS).");
+        availableOptions.addOption("h",  "help",                 false,  "Show this help
message and exit");
+        availableOptions.addOption("n",  "num-keys",             true,   "Number of keys,
default:1000000");
+        availableOptions.addOption("N",  "skip-keys",            true,   "Fraction of keys
to skip initially, default:0");
+        availableOptions.addOption("t",  "threads",              true,   "Number of threads
to use, default:50");
+        availableOptions.addOption("c",  "columns",              true,   "Number of columns
per key, default:5");
+        availableOptions.addOption("S",  "column-size",          true,   "Size of column
values in bytes, default:34");
+        availableOptions.addOption("C",  "cardinality",          true,   "Number of unique
values stored in columns, default:50");
+        availableOptions.addOption("d",  "nodes",                true,   "Host nodes (comma
separated), default:locahost");
+        availableOptions.addOption("s",  "stdev",                true,   "Standard Deviation
Factor, default:0.1");
+        availableOptions.addOption("r",  "random",               false,  "Use random key
generator (STDEV will have no effect), default:false");
+        availableOptions.addOption("f",  "file",                 true,   "Write output to
given file");
+        availableOptions.addOption("p",  "port",                 true,   "Thrift port, default:9160");
+        availableOptions.addOption("m",  "unframed",             false,  "Use unframed transport,
default:false");
+        availableOptions.addOption("o",  "operation",            true,   "Operation to perform
(INSERT, READ, RANGE_SLICE, INDEXED_RANGE_SLICE, MULTI_GET), default:INSERT");
+        availableOptions.addOption("u",  "supercolumns",         true,   "Number of super
columns per key, default:1");
+        availableOptions.addOption("y",  "family-type",          true,   "Column Family Type
(Super, Standard), default:Standard");
+        availableOptions.addOption("k",  "keep-going",           false,  "Ignore errors inserting
or reading, default:false");
+        availableOptions.addOption("i",  "progress-interval",    true,   "Progress Report
Interval (seconds), default:10");
+        availableOptions.addOption("g",  "keys-per-call",        true,   "Number of keys
to get_range_slices or multiget per call, default:1000");
+        availableOptions.addOption("l",  "replication-factor",   true,   "Replication Factor
to use when creating needed column families, default:1");
+        availableOptions.addOption("e",  "consistency-level",    true,   "Consistency Level
to use (ONE, QUORUM, LOCAL_QUORUM, EACH_QUORUM, ALL, ANY), default:ONE");
+        availableOptions.addOption("x",  "create-index",         true,   "Type of index to
create on needed column families (KEYS)");
     }
 
     private int numKeys          = 1000 * 1000;

Modified: cassandra/trunk/contrib/stress/src/org/apache/cassandra/contrib/stress/Stress.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/contrib/stress/src/org/apache/cassandra/contrib/stress/Stress.java?rev=1061955&r1=1061954&r2=1061955&view=diff
==============================================================================
--- cassandra/trunk/contrib/stress/src/org/apache/cassandra/contrib/stress/Stress.java (original)
+++ cassandra/trunk/contrib/stress/src/org/apache/cassandra/contrib/stress/Stress.java Fri
Jan 21 18:33:09 2011
@@ -17,7 +17,7 @@
  */
 package org.apache.cassandra.contrib.stress;
 
-import org.apache.cassandra.contrib.stress.tests.*;
+import org.apache.cassandra.contrib.stress.operations.*;
 import org.apache.cassandra.contrib.stress.util.OperationThread;
 import org.apache.commons.cli.Option;
 

Modified: cassandra/trunk/debian/init
URL: http://svn.apache.org/viewvc/cassandra/trunk/debian/init?rev=1061955&r1=1061954&r2=1061955&view=diff
==============================================================================
--- cassandra/trunk/debian/init (original)
+++ cassandra/trunk/debian/init Fri Jan 21 18:33:09 2011
@@ -119,6 +119,9 @@ do_start()
     #   2 if daemon could not be started
     is_running && return 1
 
+    cassandra_home=`getent passwd cassandra | awk -F ':' '{ print $6; }'`
+    cd /    # jsvc doesn't chdir() for us
+
     $JSVC \
         -user cassandra \
         -home $JAVA_HOME \
@@ -127,6 +130,8 @@ do_start()
         -outfile /var/log/$NAME/output.log \
         -cp `classpath` \
         -Dlog4j.configuration=log4j-server.properties \
+        -XX:HeapDumpPath="$cassandra_home/java_`date +%s`.hprof" \
+        -XX:ErrorFile="$cassandra_home/hs_err_`date +%s`.log" \
         $JVM_OPTS \
         org.apache.cassandra.thrift.CassandraDaemon
 

Propchange: cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Jan 21 18:33:09 2011
@@ -1,5 +1,5 @@
 /cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:922689-1052356,1052358-1053452,1053454,1053456-1055311,1056121,1057932
-/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:1026516-1061062
+/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:1026516-1061950
 /cassandra/branches/cassandra-0.7.0/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:1053690-1055654
 /cassandra/tags/cassandra-0.7.0-rc3/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:1051699-1053689
 /incubator/cassandra/branches/cassandra-0.3/interface/gen-java/org/apache/cassandra/service/Cassandra.java:774578-796573

Propchange: cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Jan 21 18:33:09 2011
@@ -1,5 +1,5 @@
 /cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:922689-1052356,1052358-1053452,1053454,1053456-1055311,1056121,1057932
-/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:1026516-1061062
+/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:1026516-1061950
 /cassandra/branches/cassandra-0.7.0/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:1053690-1055654
 /cassandra/tags/cassandra-0.7.0-rc3/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:1051699-1053689
 /incubator/cassandra/branches/cassandra-0.3/interface/gen-java/org/apache/cassandra/service/column_t.java:774578-792198

Propchange: cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Jan 21 18:33:09 2011
@@ -1,5 +1,5 @@
 /cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:922689-1052356,1052358-1053452,1053454,1053456-1055311,1056121,1057932
-/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:1026516-1061062
+/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:1026516-1061950
 /cassandra/branches/cassandra-0.7.0/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:1053690-1055654
 /cassandra/tags/cassandra-0.7.0-rc3/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:1051699-1053689
 /incubator/cassandra/branches/cassandra-0.3/interface/gen-java/org/apache/cassandra/service/InvalidRequestException.java:774578-796573

Propchange: cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Jan 21 18:33:09 2011
@@ -1,5 +1,5 @@
 /cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:922689-1052356,1052358-1053452,1053454,1053456-1055311,1056121,1057932
-/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:1026516-1061062
+/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:1026516-1061950
 /cassandra/branches/cassandra-0.7.0/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:1053690-1055654
 /cassandra/tags/cassandra-0.7.0-rc3/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:1051699-1053689
 /incubator/cassandra/branches/cassandra-0.3/interface/gen-java/org/apache/cassandra/service/NotFoundException.java:774578-796573

Propchange: cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Jan 21 18:33:09 2011
@@ -1,5 +1,5 @@
 /cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:922689-1052356,1052358-1053452,1053454,1053456-1055311,1056121,1057932
-/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:1026516-1061062
+/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:1026516-1061950
 /cassandra/branches/cassandra-0.7.0/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:1053690-1055654
 /cassandra/tags/cassandra-0.7.0-rc3/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:1051699-1053689
 /incubator/cassandra/branches/cassandra-0.3/interface/gen-java/org/apache/cassandra/service/superColumn_t.java:774578-792198

Modified: cassandra/trunk/src/java/org/apache/cassandra/config/Config.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/config/Config.java?rev=1061955&r1=1061954&r2=1061955&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/config/Config.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/config/Config.java Fri Jan 21 18:33:09 2011
@@ -34,6 +34,7 @@ public class Config
     
     public Boolean auto_bootstrap = false;
     public Boolean hinted_handoff_enabled = true;
+    public Integer max_hint_window_in_ms = Integer.MAX_VALUE;
     
     public SeedProviderDef seed_provider;
     public DiskAccessMode disk_access_mode = DiskAccessMode.auto;

Modified: cassandra/trunk/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/config/DatabaseDescriptor.java?rev=1061955&r1=1061954&r2=1061955&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/config/DatabaseDescriptor.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/config/DatabaseDescriptor.java Fri Jan 21
18:33:09 2011
@@ -101,8 +101,9 @@ public class DatabaseDescriptor
         try
         {
             url = new URL(configUrl);
+            url.openStream(); // catches well-formed but bogus URLs
         }
-        catch (MalformedURLException e)
+        catch (Exception e)
         {
             ClassLoader loader = DatabaseDescriptor.class.getClassLoader();
             url = loader.getResource(configUrl);
@@ -1092,6 +1093,11 @@ public class DatabaseDescriptor
         return conf.hinted_handoff_enabled;
     }
 
+    public static int getMaxHintWindow()
+    {
+        return conf.max_hint_window_in_ms;
+    }
+
     public static AbstractType getValueValidator(String keyspace, String cf, ByteBuffer column)
     {
         return getCFMetaData(keyspace, cf).getValueValidator(column);

Modified: cassandra/trunk/src/java/org/apache/cassandra/db/commitlog/CommitLog.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/db/commitlog/CommitLog.java?rev=1061955&r1=1061954&r2=1061955&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/commitlog/CommitLog.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/commitlog/CommitLog.java Fri Jan 21 18:33:09
2011
@@ -43,6 +43,7 @@ import org.apache.cassandra.db.Unseriali
 import org.apache.cassandra.io.DeletionService;
 import org.apache.cassandra.io.util.BufferedRandomAccessFile;
 import org.apache.cassandra.io.util.FileUtils;
+import org.apache.cassandra.utils.ByteBufferUtil;
 import org.apache.cassandra.utils.FBUtilities;
 import org.apache.cassandra.utils.WrappedRunnable;
 
@@ -298,7 +299,7 @@ public class CommitLog
                     if (logger.isDebugEnabled())
                         logger.debug(String.format("replaying mutation for %s.%s: %s",
                                                     rm.getTable(),
-                                                    rm.key(),
+                                                    ByteBufferUtil.bytesToHex(rm.key()),
                                                     "{" + StringUtils.join(rm.getColumnFamilies(),
", ") + "}"));
                     final Table table = Table.open(rm.getTable());
                     tablesRecovered.add(table);

Modified: cassandra/trunk/src/java/org/apache/cassandra/gms/Gossiper.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/gms/Gossiper.java?rev=1061955&r1=1061954&r2=1061955&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/gms/Gossiper.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/gms/Gossiper.java Fri Jan 21 18:33:09 2011
@@ -128,7 +128,7 @@ public class Gossiper implements IFailur
     private Set<InetAddress> liveEndpoints_ = new ConcurrentSkipListSet<InetAddress>(inetcomparator);
 
     /* unreachable member set */
-    private Set<InetAddress> unreachableEndpoints_ = new ConcurrentSkipListSet<InetAddress>(inetcomparator);
+    private Map<InetAddress, Long> unreachableEndpoints_ = new ConcurrentHashMap<InetAddress,
Long>();
 
     /* initial seeds for joining the cluster */
     private Set<InetAddress> seeds_ = new ConcurrentSkipListSet<InetAddress>(inetcomparator);
@@ -179,7 +179,16 @@ public class Gossiper implements IFailur
 
     public Set<InetAddress> getUnreachableMembers()
     {
-        return new HashSet<InetAddress>(unreachableEndpoints_);
+        return unreachableEndpoints_.keySet();
+    }
+
+    public long getEndpointDowntime(InetAddress ep)
+    {
+        Long downtime = unreachableEndpoints_.get(ep);
+        if (downtime != null)
+            return System.currentTimeMillis() - downtime;
+        else
+            return 0L;
     }
 
     /**
@@ -353,7 +362,7 @@ public class Gossiper implements IFailur
             double prob = unreachableEndpoints / (liveEndpoints + 1);
             double randDbl = random_.nextDouble();
             if ( randDbl < prob )
-                sendGossip(message, unreachableEndpoints_);
+                sendGossip(message, unreachableEndpoints_.keySet());
         }
     }
 
@@ -735,7 +744,7 @@ public class Gossiper implements IFailur
         else
         {
             liveEndpoints_.remove(addr);
-            unreachableEndpoints_.add(addr);
+            unreachableEndpoints_.put(addr, System.currentTimeMillis());
             for (IEndpointStateChangeSubscriber subscriber : subscribers_)
                 subscriber.onDead(addr, epState);
         }
@@ -871,7 +880,7 @@ public class Gossiper implements IFailur
             epState.isAGossiper(true);
             epState.setHasToken(true);
             endpointStateMap_.put(ep, epState);
-            unreachableEndpoints_.add(ep);
+            unreachableEndpoints_.put(ep, System.currentTimeMillis());
         }
     }
 

Modified: cassandra/trunk/src/java/org/apache/cassandra/io/util/ColumnSortedMap.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/io/util/ColumnSortedMap.java?rev=1061955&r1=1061954&r2=1061955&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/io/util/ColumnSortedMap.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/io/util/ColumnSortedMap.java Fri Jan 21
18:33:09 2011
@@ -1,4 +1,25 @@
 package org.apache.cassandra.io.util;
+/*
+ * 
+ * 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.
+ * 
+ */
+
 
 import java.io.DataInput;
 import java.io.IOException;
@@ -261,4 +282,4 @@ class ColumnIterator implements Iterator
     {
         throw new UnsupportedOperationException();
     }
-}
\ No newline at end of file
+}

Modified: cassandra/trunk/src/java/org/apache/cassandra/locator/AbstractReplicationStrategy.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/locator/AbstractReplicationStrategy.java?rev=1061955&r1=1061954&r2=1061955&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/locator/AbstractReplicationStrategy.java
(original)
+++ cassandra/trunk/src/java/org/apache/cassandra/locator/AbstractReplicationStrategy.java
Fri Jan 21 18:33:09 2011
@@ -25,6 +25,7 @@ import java.util.*;
 
 import com.google.common.collect.HashMultimap;
 import com.google.common.collect.Multimap;
+import org.apache.cassandra.gms.Gossiper;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -163,6 +164,12 @@ public abstract class AbstractReplicatio
         {
             if (map.containsKey(ep))
                 continue;
+            if (!StorageProxy.shouldHint(ep))
+            {
+                if (logger.isDebugEnabled())
+                    logger.debug("not hinting " + ep + " which has been down " + Gossiper.instance.getEndpointDowntime(ep)
+ "ms");
+                continue;
+            }
 
             InetAddress destination = map.isEmpty()
                                     ? localAddress

Modified: cassandra/trunk/src/java/org/apache/cassandra/service/RepairCallback.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/service/RepairCallback.java?rev=1061955&r1=1061954&r2=1061955&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/service/RepairCallback.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/service/RepairCallback.java Fri Jan 21 18:33:09
2011
@@ -1,4 +1,25 @@
 package org.apache.cassandra.service;
+/*
+ * 
+ * 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.
+ * 
+ */
+
 
 import java.io.IOException;
 import java.net.InetAddress;

Modified: cassandra/trunk/src/java/org/apache/cassandra/service/StorageProxy.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/service/StorageProxy.java?rev=1061955&r1=1061954&r2=1061955&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/service/StorageProxy.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/service/StorageProxy.java Fri Jan 21 18:33:09
2011
@@ -83,6 +83,7 @@ public class StorageProxy implements Sto
     // consistency > CL.ONE involves a read in the write path
     private static final LatencyTracker counterWriteStats = new LatencyTracker();
     private static boolean hintedHandoffEnabled = DatabaseDescriptor.hintedHandoffEnabled();
+    private static int maxHintWindow = DatabaseDescriptor.getMaxHintWindow();
     private static final String UNREACHABLE = "UNREACHABLE";
 
     private static final WritePerformer standardWritePerformer;
@@ -528,18 +529,17 @@ public class StorageProxy implements Sto
             ReadCallback<Row> handler = getReadCallback(resolver, command.table, consistency_level);
             handler.assureSufficientLiveNodes(endpoints);
 
-            int targets;
+            // if we're not going to read repair, cut the endpoints list down to the ones
required to satisfy ConsistencyLevel
             if (randomlyReadRepair(command))
             {
-                targets = endpoints.size();
-                if (targets > handler.blockfor)
+                if (endpoints.size() > handler.blockfor)
                     repairs.add(command);
             }
             else
             {
-                targets = handler.blockfor;
+                endpoints = endpoints.subList(0, handler.blockfor);
             }
-            Message[] messages = new Message[targets];
+            Message[] messages = new Message[endpoints.size()];
 
             // data-request message is sent to dataPoint, the node that will actually get
             // the data for us. The other replicas are only sent a digest query.
@@ -1001,6 +1001,21 @@ public class StorageProxy implements Sto
         return hintedHandoffEnabled;
     }
 
+    public int getMaxHintWindow()
+    {
+        return maxHintWindow;
+    }
+
+    public void setMaxHintWindow(int ms)
+    {
+        maxHintWindow = ms;
+    }
+
+    public static boolean shouldHint(InetAddress ep)
+    {
+        return Gossiper.instance.getEndpointDowntime(ep) <= maxHintWindow;
+    }
+
     /**
      * Performs the truncate operatoin, which effectively deletes all data from
      * the column family cfname

Modified: cassandra/trunk/src/java/org/apache/cassandra/service/StorageProxyMBean.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/service/StorageProxyMBean.java?rev=1061955&r1=1061954&r2=1061955&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/service/StorageProxyMBean.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/service/StorageProxyMBean.java Fri Jan 21
18:33:09 2011
@@ -46,4 +46,6 @@ public interface StorageProxyMBean
 
     public boolean getHintedHandoffEnabled();
     public void setHintedHandoffEnabled(boolean b);
+    public int getMaxHintWindow();
+    public void setMaxHintWindow(int ms);
 }

Modified: cassandra/trunk/src/java/org/apache/cassandra/service/StorageService.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/service/StorageService.java?rev=1061955&r1=1061954&r2=1061955&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/service/StorageService.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/service/StorageService.java Fri Jan 21 18:33:09
2011
@@ -627,22 +627,24 @@ public class StorageService implements I
             logger_.info("Node " + endpoint + " state jump to normal");
 
         // we don't want to update if this node is responsible for the token and it has a
later startup time than endpoint.
-        InetAddress currentNode = tokenMetadata_.getEndpoint(token);
-        if (currentNode == null)
+        InetAddress currentOwner = tokenMetadata_.getEndpoint(token);
+        if (currentOwner == null)
         {
             logger_.debug("New node " + endpoint + " at token " + token);
             tokenMetadata_.updateNormalToken(token, endpoint);
             if (!isClientMode)
                 SystemTable.updateToken(endpoint, token);
         }
-        else if (endpoint.equals(currentNode))
+        else if (endpoint.equals(currentOwner))
         {
-            // nothing to do
+            // set state back to normal, since the node may have tried to leave, but failed
and is now back up
+            // no need to persist, token/ip did not change
+            tokenMetadata_.updateNormalToken(token, endpoint);
         }
-        else if (Gossiper.instance.compareEndpointStartup(endpoint, currentNode) > 0)
+        else if (Gossiper.instance.compareEndpointStartup(endpoint, currentOwner) > 0)
         {
             logger_.info(String.format("Nodes %s and %s have the same token %s.  %s is the
new owner",
-                                       endpoint, currentNode, token, endpoint));
+                                       endpoint, currentOwner, token, endpoint));
             tokenMetadata_.updateNormalToken(token, endpoint);
             if (!isClientMode)
                 SystemTable.updateToken(endpoint, token);
@@ -650,7 +652,7 @@ public class StorageService implements I
         else
         {
             logger_.info(String.format("Nodes %s and %s have the same token %s.  Ignoring
%s",
-                                       endpoint, currentNode, token, endpoint));
+                                       endpoint, currentOwner, token, endpoint));
         }
 
         if (pieces.length > 2)

Modified: cassandra/trunk/src/java/org/apache/cassandra/utils/BloomFilterSerializer.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/utils/BloomFilterSerializer.java?rev=1061955&r1=1061954&r2=1061955&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/utils/BloomFilterSerializer.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/utils/BloomFilterSerializer.java Fri Jan
21 18:33:09 2011
@@ -1,4 +1,25 @@
 package org.apache.cassandra.utils;
+/*
+ * 
+ * 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.
+ * 
+ */
+
 
 import java.io.DataInputStream;
 import java.io.DataOutputStream;

Modified: cassandra/trunk/src/java/org/apache/cassandra/utils/LegacyBloomFilterSerializer.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/utils/LegacyBloomFilterSerializer.java?rev=1061955&r1=1061954&r2=1061955&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/utils/LegacyBloomFilterSerializer.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/utils/LegacyBloomFilterSerializer.java Fri
Jan 21 18:33:09 2011
@@ -1,4 +1,25 @@
 package org.apache.cassandra.utils;
+/*
+ * 
+ * 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.
+ * 
+ */
+
 
 import java.util.BitSet;
 import java.io.DataInputStream;



Mime
View raw message