diff options
author | Benoit Foucher <benoit@zeroc.com> | 2013-09-03 15:42:19 +0200 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2013-09-03 15:42:19 +0200 |
commit | 91f6ebb998532b36fc70187b641a5b7404060422 (patch) | |
tree | ac88e961c68e4b09eb819f4b57b9ecac56854567 /cpp/src/IceGrid/IceGridRegistry.cpp | |
parent | ICE-5378 - Remove slice35d.dll from Windows installer (diff) | |
download | ice-91f6ebb998532b36fc70187b641a5b7404060422.tar.bz2 ice-91f6ebb998532b36fc70187b641a5b7404060422.tar.xz ice-91f6ebb998532b36fc70187b641a5b7404060422.zip |
Fixed ICE-5358 - allow IceGrid replica to initialize its database from another replica
Diffstat (limited to 'cpp/src/IceGrid/IceGridRegistry.cpp')
-rw-r--r-- | cpp/src/IceGrid/IceGridRegistry.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/cpp/src/IceGrid/IceGridRegistry.cpp b/cpp/src/IceGrid/IceGridRegistry.cpp index 5e8bac2b512..7f53c4c6b25 100644 --- a/cpp/src/IceGrid/IceGridRegistry.cpp +++ b/cpp/src/IceGrid/IceGridRegistry.cpp @@ -67,12 +67,14 @@ RegistryService::start(int argc, char* argv[], int& status) { bool nowarn; bool readonly; + std::string initFromReplica; IceUtilInternal::Options opts; opts.addOpt("h", "help"); opts.addOpt("v", "version"); opts.addOpt("", "nowarn"); opts.addOpt("", "readonly"); + opts.addOpt("", "initdb-from-replica", IceUtilInternal::Options::NeedArg); vector<string> args; try @@ -100,6 +102,10 @@ RegistryService::start(int argc, char* argv[], int& status) } nowarn = opts.isSet("nowarn"); readonly = opts.isSet("readonly"); + if(opts.isSet("initdb-from-replica")) + { + initFromReplica = opts.optArg("initdb-from-replica"); + } if(!args.empty()) { @@ -123,7 +129,7 @@ RegistryService::start(int argc, char* argv[], int& status) TraceLevelsPtr traceLevels = new TraceLevels(communicator(), "IceGrid.Registry"); - _registry = new RegistryI(communicator(), traceLevels, nowarn, readonly); + _registry = new RegistryI(communicator(), traceLevels, nowarn, readonly, initFromReplica); if(!_registry->start()) { return false; @@ -187,7 +193,9 @@ RegistryService::usage(const string& appName) "-h, --help Show this message.\n" "-v, --version Display the Ice version.\n" "--nowarn Don't print any security warnings.\n" - "--readonly Start the master registry in read-only mode."; + "--readonly Start the master registry in read-only mode.\n" + "--initdb-from-replica=<replica>\n" + " Initialize the database from the given replica."; #ifndef _WIN32 options.append( "\n" |