Exemplo n.º 1
0
        protected override void ProcessRecord()
        {
            RemoteConfigurationManager rcm = ConfigurationConnection.Current;

            rcm.MoveCollection(true, _databaseName, _collectionName, NewShard);
            WriteObject("Data Transfer has started. You can monitor the progress through Perfmon Counters.");
        }
Exemplo n.º 2
0
 public static void MoveCollection(ManagementInfo managementInfo)
 {
     try
     {
         RemoteConfigurationManager remoteConfigurationManager = InitializeRemoteConfigurationManager(managementInfo);
         remoteConfigurationManager.MoveCollection(true, managementInfo.DatabaseName,
                                                   managementInfo.CollectionName, managementInfo.ShardName);
     }
     catch (ManagementException)
     {
         throw;
     }
     catch (Exception exception)
     {
         throw new ManagementException(exception.Message, exception);
     }
 }