cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alek...@apache.org
Subject [9/10] git commit: Merge branch 'cassandra-1.1' into cassandra-1.2.0
Date Sat, 08 Dec 2012 15:40:41 GMT
Merge branch 'cassandra-1.1' into cassandra-1.2.0

Conflicts:
	src/java/org/apache/cassandra/service/MigrationManager.java
	src/java/org/apache/cassandra/service/StorageService.java


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

Branch: refs/heads/trunk
Commit: 904caea6ff08074684a9c35195bcf145fcf97d08
Parents: 44545d3 ec7a5f1
Author: Brandon Williams <brandonwilliams@apache.org>
Authored: Fri Dec 7 17:25:54 2012 -0600
Committer: Brandon Williams <brandonwilliams@apache.org>
Committed: Fri Dec 7 17:25:54 2012 -0600

----------------------------------------------------------------------
 .../apache/cassandra/service/MigrationManager.java |   13 ++++++++++---
 .../apache/cassandra/service/StorageService.java   |    6 ++----
 2 files changed, 12 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/904caea6/src/java/org/apache/cassandra/service/MigrationManager.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/service/MigrationManager.java
index cbe9127,9a82517..028ec8b
--- a/src/java/org/apache/cassandra/service/MigrationManager.java
+++ b/src/java/org/apache/cassandra/service/MigrationManager.java
@@@ -23,11 -25,17 +23,14 @@@ import java.io.IOException
  import java.net.InetAddress;
  import java.nio.ByteBuffer;
  import java.util.*;
 -import java.util.concurrent.Callable;
 +import java.util.concurrent.CopyOnWriteArrayList;
  import java.util.concurrent.ExecutionException;
  import java.util.concurrent.Future;
 -import java.util.ArrayList;
 -import java.util.Collection;
 -import java.util.UUID;
  import java.util.concurrent.TimeUnit;
  
+ import java.lang.management.ManagementFactory;
+ import java.lang.management.RuntimeMXBean;
+ 
  import org.slf4j.Logger;
  import org.slf4j.LoggerFactory;
  
@@@ -54,24 -64,14 +57,28 @@@ public class MigrationManager implement
  {
      private static final Logger logger = LoggerFactory.getLogger(MigrationManager.class);
  
 -    // try that many times to send migration request to the node before giving up
 -    private static final int MIGRATION_REQUEST_RETRIES = 3;
      private static final ByteBuffer LAST_MIGRATION_KEY = ByteBufferUtil.bytes("Last Migration");
  
 +    public static final MigrationManager instance = new MigrationManager();
 +
+     private static final RuntimeMXBean runtimeMXBean = ManagementFactory.getRuntimeMXBean();
+ 
+     public static final int MIGRATION_DELAY_IN_MS = 60000;
+ 
 +    private final List<IMigrationListener> listeners = new CopyOnWriteArrayList<IMigrationListener>();
 +
 +    private MigrationManager() {}
 +
 +    public void register(IMigrationListener listener)
 +    {
 +        listeners.add(listener);
 +    }
 +
 +    public void unregister(IMigrationListener listener)
 +    {
 +        listeners.remove(listener);
 +    }
 +
      public void onJoin(InetAddress endpoint, EndpointState epState)
      {}
  

http://git-wip-us.apache.org/repos/asf/cassandra/blob/904caea6/src/java/org/apache/cassandra/service/StorageService.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/service/StorageService.java
index 276136a,a948786..e5550f9
--- a/src/java/org/apache/cassandra/service/StorageService.java
+++ b/src/java/org/apache/cassandra/service/StorageService.java
@@@ -522,17 -544,13 +522,16 @@@ public class StorageService implements 
          Gossiper.instance.register(this);
          Gossiper.instance.register(migrationManager);
          Gossiper.instance.start(SystemTable.incrementAndGetGeneration()); // needed for
node-ring gathering.
 -
 -        // gossip Schema.emptyVersion forcing immediate check for schema updates (see MigrationManager#maybeScheduleSchemaPull)
 +        // gossip network proto version
 +        Gossiper.instance.addLocalApplicationState(ApplicationState.NET_VERSION, valueFactory.networkVersion());
 +        Gossiper.instance.addLocalApplicationState(ApplicationState.HOST_ID, valueFactory.hostId(SystemTable.getLocalHostId()));
 +        // gossip snitch infos (local DC and rack)
 +        gossipSnitchInfo();
-         // gossip Schema.emptyVersion forcing immediate check for schema updates (see MigrationManager#maybeScheduleSchemaPull)
-         Schema.instance.updateVersion(); // Ensure we know our own actual Schema UUID in
preparation for updates
-         MigrationManager.passiveAnnounce(Schema.emptyVersion);
+         Schema.instance.updateVersionAndAnnounce(); // Ensure we know our own actual Schema
UUID in preparation for updates
+ 
          // add rpc listening info
          Gossiper.instance.addLocalApplicationState(ApplicationState.RPC_ADDRESS, valueFactory.rpcaddress(DatabaseDescriptor.getRpcAddress()));
 -        if (null != DatabaseDescriptor.getReplaceToken())
 +        if (0 != DatabaseDescriptor.getReplaceTokens().size())
              Gossiper.instance.addLocalApplicationState(ApplicationState.STATUS, valueFactory.hibernate(true));
  
          MessagingService.instance().listen(FBUtilities.getLocalAddress());


Mime
View raw message