merge from cassandra-1.2
Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/3a3f612f Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/3a3f612f Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/3a3f612f Branch: refs/heads/trunk Commit: 3a3f612f871a5697187b59fba3c863d916011435 Parents: b59ca1f 7746225 Author: Jonathan Ellis <jbel...@apache.org> Authored: Mon Apr 22 09:39:48 2013 -0500 Committer: Jonathan Ellis <jbel...@apache.org> Committed: Mon Apr 22 09:42:55 2013 -0500 ---------------------------------------------------------------------- CHANGES.txt | 2 + conf/cassandra.yaml | 41 ++-- .../org/apache/cassandra/config/CFMetaData.java | 32 ++- .../cassandra/locator/NetworkTopologyStrategy.java | 3 +- .../apache/cassandra/service/StorageService.java | 46 +++- .../org/apache/cassandra/utils/SlabAllocator.java | 4 +- .../service/AntiEntropyServiceTestAbstract.java | 2 +- .../service/StorageServiceServerTest.java | 187 ++++++++++++++- 8 files changed, 268 insertions(+), 49 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/3a3f612f/CHANGES.txt ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/3a3f612f/conf/cassandra.yaml ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/3a3f612f/src/java/org/apache/cassandra/config/CFMetaData.java ---------------------------------------------------------------------- diff --cc src/java/org/apache/cassandra/config/CFMetaData.java index 2f27b87,a5fc5dd..ae210e6 --- a/src/java/org/apache/cassandra/config/CFMetaData.java +++ b/src/java/org/apache/cassandra/config/CFMetaData.java @@@ -165,97 -153,80 +165,97 @@@ public final class CFMetaDat + "PRIMARY KEY(keyspace_name, columnfamily_name, column_name)" + ") WITH COMMENT='ColumnFamily column attributes' AND gc_grace_seconds=8640"); - public static final CFMetaData HintsCf = compile(11, "CREATE TABLE " + SystemTable.HINTS_CF + " (" + public static final CFMetaData HintsCf = compile("CREATE TABLE " + SystemTable.HINTS_CF + " (" - + "target_id uuid," - + "hint_id timeuuid," - + "message_version int," - + "mutation blob," - + "PRIMARY KEY (target_id, hint_id, message_version)" - + ") WITH COMPACT STORAGE " - + "AND COMPACTION={'class' : 'SizeTieredCompactionStrategy', 'min_threshold' : 0, 'max_threshold' : 0} " - + "AND COMMENT='hints awaiting delivery'" - + "AND gc_grace_seconds=0"); + + "target_id uuid," + + "hint_id timeuuid," + + "message_version int," + + "mutation blob," + + "PRIMARY KEY (target_id, hint_id, message_version)" + + ") WITH COMPACT STORAGE " + + "AND COMPACTION={'class' : 'SizeTieredCompactionStrategy', 'enabled' : false} " + + "AND COMMENT='hints awaiting delivery'" + + "AND gc_grace_seconds=0"); - public static final CFMetaData PeersCf = compile(12, "CREATE TABLE " + SystemTable.PEERS_CF + " (" + public static final CFMetaData PeersCf = compile("CREATE TABLE " + SystemTable.PEERS_CF + " (" - + "peer inet PRIMARY KEY," - + "host_id uuid," - + "tokens set<varchar>," - + "schema_version uuid," - + "release_version text," - + "rpc_address inet," - + "data_center text," - + "rack text" - + ") WITH COMMENT='known peers in the cluster'"); + + "peer inet PRIMARY KEY," + + "host_id uuid," + + "tokens set<varchar>," + + "schema_version uuid," + + "release_version text," + + "rpc_address inet," + + "data_center text," + + "rack text" + + ") WITH COMMENT='known peers in the cluster'"); - public static final CFMetaData PeerEventsCf = compile(12, "CREATE TABLE " + SystemTable.PEER_EVENTS_CF + " (" + public static final CFMetaData PeerEventsCf = compile("CREATE TABLE " + SystemTable.PEER_EVENTS_CF + " (" - + "peer inet PRIMARY KEY," - + "hints_dropped map<uuid, int>" - + ") WITH COMMENT='cf contains events related to peers'"); + + "peer inet PRIMARY KEY," + + "hints_dropped map<uuid, int>" + + ") WITH COMMENT='cf contains events related to peers'"); - public static final CFMetaData LocalCf = compile(13, "CREATE TABLE " + SystemTable.LOCAL_CF + " (" + public static final CFMetaData LocalCf = compile("CREATE TABLE " + SystemTable.LOCAL_CF + " (" - + "key text PRIMARY KEY," - + "tokens set<varchar>," - + "cluster_name text," - + "gossip_generation int," - + "bootstrapped text," - + "host_id uuid," - + "release_version text," - + "thrift_version text," - + "cql_version text," - + "data_center text," - + "rack text," - + "partitioner text," - + "schema_version uuid," - + "truncated_at map<uuid, blob>" - + ") WITH COMMENT='information about the local node'"); + + "key text PRIMARY KEY," + + "tokens set<varchar>," + + "cluster_name text," + + "gossip_generation int," + + "bootstrapped text," + + "host_id uuid," + + "release_version text," + + "thrift_version text," + + "cql_version text," + + "data_center text," + + "rack text," + + "partitioner text," + + "schema_version uuid," + + "truncated_at map<uuid, blob>" + + ") WITH COMMENT='information about the local node'"); - public static final CFMetaData TraceSessionsCf = compile(14, "CREATE TABLE " + Tracing.SESSIONS_CF + " (" + public static final CFMetaData TraceSessionsCf = compile("CREATE TABLE " + Tracing.SESSIONS_CF + " (" - + " session_id uuid PRIMARY KEY," - + " coordinator inet," - + " request text," - + " started_at timestamp," - + " parameters map<text, text>," - + " duration int" - + ") WITH COMMENT='traced sessions'", Tracing.TRACE_KS); + + " session_id uuid PRIMARY KEY," + + " coordinator inet," + + " request text," + + " started_at timestamp," + + " parameters map<text, text>," + + " duration int" + + ") WITH COMMENT='traced sessions'", Tracing.TRACE_KS); - public static final CFMetaData TraceEventsCf = compile(15, "CREATE TABLE " + Tracing.EVENTS_CF + " (" + public static final CFMetaData TraceEventsCf = compile("CREATE TABLE " + Tracing.EVENTS_CF + " (" - + " session_id uuid," - + " event_id timeuuid," - + " source inet," - + " thread text," - + " activity text," - + " source_elapsed int," - + " PRIMARY KEY (session_id, event_id)" - + ");", Tracing.TRACE_KS); + + " session_id uuid," + + " event_id timeuuid," + + " source inet," + + " thread text," + + " activity text," + + " source_elapsed int," + + " PRIMARY KEY (session_id, event_id)" + + ");", Tracing.TRACE_KS); - public static final CFMetaData BatchlogCf = compile(16, "CREATE TABLE " + SystemTable.BATCHLOG_CF + " (" + public static final CFMetaData BatchlogCf = compile("CREATE TABLE " + SystemTable.BATCHLOG_CF + " (" - + "id uuid PRIMARY KEY," - + "written_at timestamp," - + "data blob" - + ") WITH COMMENT='uncommited batches' AND gc_grace_seconds=0 " - + "AND COMPACTION={'class' : 'SizeTieredCompactionStrategy', 'min_threshold' : 2}"); + + "id uuid PRIMARY KEY," + + "written_at timestamp," + + "data blob" + + ") WITH COMMENT='uncommited batches' AND gc_grace_seconds=0 " + + "AND COMPACTION={'class' : 'SizeTieredCompactionStrategy', 'min_threshold' : 2}"); - public static final CFMetaData RangeXfersCf = compile(17, "CREATE TABLE " + SystemTable.RANGE_XFERS_CF + " (" + public static final CFMetaData RangeXfersCf = compile("CREATE TABLE " + SystemTable.RANGE_XFERS_CF + " (" - + "token_bytes blob PRIMARY KEY," - + "requested_at timestamp" - + ") WITH COMMENT='ranges requested for transfer here'"); + + "token_bytes blob PRIMARY KEY," + + "requested_at timestamp" + + ") WITH COMMENT='ranges requested for transfer here'"); + - public static final CFMetaData CompactionLogCf = compile(18, "CREATE TABLE " + SystemTable.COMPACTION_LOG + " (" ++ public static final CFMetaData CompactionLogCf = compile("CREATE TABLE " + SystemTable.COMPACTION_LOG + " (" + + "id uuid PRIMARY KEY," + + "keyspace_name text," + + "columnfamily_name text," + + "inputs set<int>" + + ") WITH COMMENT='unfinished compactions'"); + - public static final CFMetaData PaxosCf = compile(18, "CREATE TABLE " + SystemTable.PAXOS_CF + " (" ++ public static final CFMetaData PaxosCf = compile("CREATE TABLE " + SystemTable.PAXOS_CF + " (" + + "row_key blob," + + "cf_id UUID," + + "in_progress_ballot timeuuid," + + "proposal blob," + + "most_recent_commit_at timeuuid," + + "most_recent_commit blob," + + "PRIMARY KEY (row_key, cf_id)" + + ") WITH COMMENT='in-progress paxos proposals'"); public enum Caching { http://git-wip-us.apache.org/repos/asf/cassandra/blob/3a3f612f/src/java/org/apache/cassandra/service/StorageService.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/3a3f612f/test/unit/org/apache/cassandra/service/AntiEntropyServiceTestAbstract.java ---------------------------------------------------------------------- diff --cc test/unit/org/apache/cassandra/service/AntiEntropyServiceTestAbstract.java index 50ae5e4,7124ecb..04930d3 --- a/test/unit/org/apache/cassandra/service/AntiEntropyServiceTestAbstract.java +++ b/test/unit/org/apache/cassandra/service/AntiEntropyServiceTestAbstract.java @@@ -102,13 -102,12 +102,13 @@@ public abstract class AntiEntropyServic Gossiper.instance.initializeNodeUnsafe(REMOTE, UUID.randomUUID(), 1); - local_range = StorageService.instance.getLocalPrimaryRange(); + local_range = StorageService.instance.getPrimaryRangesForEndpoint(tablename, LOCAL).iterator().next(); // (we use REMOTE instead of LOCAL so that the reponses for the validator.complete() get lost) - request = new TreeRequest(UUID.randomUUID().toString(), REMOTE, local_range, new CFPair(tablename, cfname)); + int gcBefore = (int)(System.currentTimeMillis()/1000) - store.metadata.getGcGraceSeconds(); + request = new TreeRequest(UUID.randomUUID().toString(), REMOTE, local_range, gcBefore, new CFPair(tablename, cfname)); // Set a fake session corresponding to this fake request - AntiEntropyService.instance.submitArtificialRepairSession(request, tablename, cfname); + ActiveRepairService.instance.submitArtificialRepairSession(request, tablename, cfname); } @After