From 71260a48f28432caf83911c5952cedda52ce3f9f Mon Sep 17 00:00:00 2001 From: Joe George Date: Wed, 3 May 2017 15:23:06 -0400 Subject: [PATCH] Strip trailing whitespace --- cpp/BuildInstructionsOSX.md | 6 +- cpp/BuildInstructionsWindows.md | 6 +- cpp/demo/Freeze/backup/README.md | 16 +-- cpp/demo/Freeze/backup/backup | 14 +-- cpp/demo/Freeze/casino/BetResolver.h | 2 +- cpp/demo/Freeze/casino/Casino.ice | 6 +- cpp/demo/Freeze/casino/CasinoStore.ice | 4 +- cpp/demo/Freeze/casino/README.md | 8 +- cpp/demo/Freeze/casino/config.server | 6 +- cpp/demo/Freeze/customEvictor/Client.cpp | 12 +- .../Freeze/customEvictor/CurrentDatabase.h | 4 +- cpp/demo/Freeze/customEvictor/Evictor.cpp | 14 +-- cpp/demo/Freeze/customEvictor/ItemI.cpp | 26 ++-- cpp/demo/Freeze/customEvictor/ItemI.h | 6 +- cpp/demo/Freeze/customEvictor/Makefile.mk | 2 +- cpp/demo/Freeze/customEvictor/Server.cpp | 2 +- .../Freeze/customEvictor/SimpleEvictor.cpp | 8 +- cpp/demo/Freeze/customEvictor/SimpleEvictor.h | 2 +- cpp/demo/Freeze/library/config.collocated | 10 +- cpp/demo/Freeze/library/config.server | 8 +- cpp/demo/Freeze/phonebook/config.collocated | 6 +- cpp/demo/Freeze/phonebook/config.server | 4 +- cpp/demo/Freeze/transform/create.cpp | 16 +-- cpp/demo/Freeze/transform/read.cpp | 6 +- cpp/demo/Freeze/transform/readnew.cpp | 8 +- cpp/demo/Freeze/transform/recreate.cpp | 4 +- cpp/demo/Freeze/transform/transform.xml | 4 +- cpp/demo/Manual/evictorFilesystem/Parser.h | 4 +- .../Manual/evictorFilesystem/config.server | 8 +- cpp/demo/Manual/mapFilesystem/Makefile.mk | 4 +- cpp/demo/Manual/mapFilesystem/Parser.h | 4 +- cpp/demo/Manual/mapFilesystem/config.server | 4 +- cpp/include/Freeze/AbstractMutex.h | 2 +- cpp/include/Freeze/Cache.h | 104 ++++++++-------- cpp/include/Freeze/Index.h | 16 +-- cpp/include/Freeze/Initialize.h | 18 +-- cpp/include/Freeze/TransactionHolder.h | 8 +- cpp/msbuild/freeze.nuget.targets | 4 +- cpp/src/Freeze/BackgroundSaveEvictorI.h | 30 ++--- cpp/src/Freeze/ConnectionI.h | 12 +- cpp/src/Freeze/EvictorIteratorI.cpp | 22 ++-- cpp/src/Freeze/Index.cpp | 6 +- cpp/src/Freeze/IndexI.cpp | 58 ++++----- cpp/src/Freeze/IndexI.h | 10 +- cpp/src/Freeze/MapDb.cpp | 86 ++++++------- cpp/src/Freeze/MapDb.h | 18 +-- cpp/src/Freeze/SharedDbEnv.cpp | 2 +- cpp/src/Freeze/SharedDbEnv.h | 16 +-- cpp/src/Freeze/TransactionHolder.cpp | 2 +- cpp/src/Freeze/TransactionI.cpp | 20 +-- cpp/src/Freeze/TransactionI.h | 8 +- cpp/src/Freeze/TransactionalEvictorContext.h | 12 +- cpp/src/Freeze/TransactionalEvictorI.h | 16 +-- cpp/src/Freeze/Util.cpp | 22 ++-- cpp/src/FreezeScript/Functions.cpp | 2 +- cpp/src/FreezeScript/Util.cpp | 2 +- cpp/src/FreezeScript/Util.h | 2 +- cpp/src/slice2freezej/Main.cpp | 2 +- cpp/test/Freeze/complex/Parser.cpp | 2 +- cpp/test/Freeze/complex/Parser.h | 4 +- cpp/test/Freeze/evictor/Client.cpp | 116 +++++++++--------- cpp/test/Freeze/evictor/Test.ice | 4 +- cpp/test/Freeze/evictor/TestI.cpp | 36 +++--- cpp/test/Freeze/evictor/TestI.h | 8 +- cpp/test/Freeze/fileLock/Client.cpp | 10 +- cpp/test/Freeze/fileLock/ClientFail.cpp | 6 +- cpp/test/FreezeScript/dbmap/Makefile.mk | 2 +- cpp/test/FreezeScript/dbmap/check.xml | 4 +- cpp/test/FreezeScript/dbmap/init.xml | 4 +- cpp/test/FreezeScript/dbmap/makedb.cpp | 4 +- cpp/test/FreezeScript/evictor/check.xml | 6 +- cpp/test/FreezeScript/evictor/transform.xml | 6 +- java/demo/Freeze/casino/Casino.ice | 6 +- java/demo/Freeze/casino/CasinoStore.ice | 4 +- java/demo/Freeze/casino/README.md | 8 +- java/demo/Freeze/casino/config.server | 6 +- java/demo/Freeze/library/LibraryI.java | 6 +- java/demo/Freeze/library/Scanner.java | 14 +-- java/demo/Freeze/library/Token.java | 6 +- java/demo/Freeze/library/config.collocated | 10 +- java/demo/Freeze/library/config.server | 8 +- java/demo/Freeze/phonebook/ContactI.java | 2 +- java/demo/Freeze/phonebook/Grammar.java | 2 +- java/demo/Freeze/phonebook/Parser.java | 6 +- java/demo/Freeze/phonebook/PhoneBookI.java | 6 +- java/demo/Freeze/phonebook/Scanner.java | 14 +-- java/demo/Freeze/phonebook/Token.java | 6 +- java/demo/Freeze/phonebook/config.collocated | 6 +- java/demo/Freeze/phonebook/config.server | 4 +- java/demo/Freeze/transform/README.md | 14 +-- java/demo/Freeze/transform/transform.xml | 2 +- .../Manual/evictorFilesystem/config.server | 8 +- java/demo/Manual/mapFilesystem/config.server | 4 +- .../main/java/Freeze/FileLockException.java | 2 +- .../java/Freeze/TransactionalEvictorI.java | 2 +- .../main/java/test/Freeze/dbmap/Client.java | 24 ++-- .../main/java/test/Freeze/evictor/Client.java | 4 +- .../main/java/test/Freeze/evictor/Test.ice | 2 +- .../java/test/Freeze/fileLock/Client.java | 2 +- .../java/test/Freeze/fileLock/ClientFail.java | 2 +- .../Freeze/simpleFileLock/ClientFail.java | 4 +- .../src/main/java/test/Util/Application.java | 2 +- man/man1/slice2freeze.1 | 18 +-- man/man1/transformdb.1 | 10 +- slice/Freeze/BackgroundSaveEvictor.ice | 14 +-- slice/Freeze/Connection.ice | 20 +-- slice/Freeze/Evictor.ice | 20 +-- slice/Freeze/EvictorStorage.ice | 4 +- slice/Freeze/Transaction.ice | 10 +- slice/Freeze/TransactionalEvictor.ice | 2 +- 110 files changed, 615 insertions(+), 615 deletions(-) diff --git a/cpp/BuildInstructionsOSX.md b/cpp/BuildInstructionsOSX.md index dd0475a9..b200943e 100644 --- a/cpp/BuildInstructionsOSX.md +++ b/cpp/BuildInstructionsOSX.md @@ -28,7 +28,7 @@ You can install Berkeley DB with [Homebrew][3] as follows: ### Step 1: build IceXML and testcommon in the ice submodule -Edit `freeze/ice/config/Make.rules` to establish your build configuration. +Edit `freeze/ice/config/Make.rules` to establish your build configuration. The comments in the file provide more information. cd freeze/ice/cpp @@ -39,7 +39,7 @@ The comments in the file provide more information. cd freeze/cpp make -j8 -This builds the Freeze library, the FreezeScript utilities, and all Freeze +This builds the Freeze library, the FreezeScript utilities, and all Freeze tests and demos. ## Running the Test Suite @@ -69,7 +69,7 @@ After installation, make sure that the `/bin` directory is in your `PATH`. If you choose to not embed a `runpath` into executables at build time (see your -build settings in `freeze/ice/config/Make.rules`) or did not create a symbolic link +build settings in `freeze/ice/config/Make.rules`) or did not create a symbolic link from the `runpath` directory to the installation directory, you also need to add the library directory to your `DYLD_LIBRARY_PATH`. diff --git a/cpp/BuildInstructionsWindows.md b/cpp/BuildInstructionsWindows.md index 8c54c542..fe60c74f 100644 --- a/cpp/BuildInstructionsWindows.md +++ b/cpp/BuildInstructionsWindows.md @@ -13,8 +13,8 @@ TBD Freeze relies on [Oracle Berkeley DB][2] as its datastore. -The Freeze build system for Windows automatically downloads and installs -[Nuget][3] and Nuget packages for Berkeley DB when you build Freeze for C++. +The Freeze build system for Windows automatically downloads and installs +[Nuget][3] and Nuget packages for Berkeley DB when you build Freeze for C++. These packages are installed in `freeze\cpp\msbuild\packages`. ## Building Freeze for C++ @@ -51,7 +51,7 @@ mode. msbuild msbuild\freeze.proj /p:BuildAllConfigurations=yes This builds all platforms (x64, Win32) and configurations (Debug, Release) -of several Ice C++ components in `freeze\ice\cpp`, the Freeze library, the +of several Ice C++ components in `freeze\ice\cpp`, the Freeze library, the FreezeScript utilities and all the Freeze tests. ## Running the Test Suite diff --git a/cpp/demo/Freeze/backup/README.md b/cpp/demo/Freeze/backup/README.md index 1cda1680..892d9f47 100644 --- a/cpp/demo/Freeze/backup/README.md +++ b/cpp/demo/Freeze/backup/README.md @@ -19,23 +19,23 @@ DB utility names ---------------- The Berkeley DB utilities are usually named db_hotbackup, db_archive, -db_recover, etc. If you use the Berkeley DB 5.3.28 RPMs provided -by ZeroC, the utility names are db53_hotbackup, db53_archive, etc. +db_recover, etc. If you use the Berkeley DB 5.3.28 RPMs provided +by ZeroC, the utility names are db53_hotbackup, db53_archive, etc. Please adjust the instructions below accordingly. DB utilities: 32 vs 64 bit -------------------------- -Berkeley DB log files are architecture-specific: the architecture of +Berkeley DB log files are architecture-specific: the architecture of the DB utilities you use must match the architecture of the program -that creates your DB files. For example, if your client program is a -32-bit application, you need to use 32-bit DB utilities to backup or +that creates your DB files. For example, if your client program is a +32-bit application, you need to use 32-bit DB utilities to backup or restore the DB log files generated by this program. Some Linux distributions provide both 32-bit and 64-bit libraries for -Berkeley DB, but unfortunately only provide 64-bit DB utilities. On +Berkeley DB, but unfortunately only provide 64-bit DB utilities. On such systems, if you build the client program in 32-bit mode, you will -need to build the 32-bit DB utilities from sources to perform hot +need to build the 32-bit DB utilities from sources to perform hot backups and restores as described in this demo. Backup @@ -111,7 +111,7 @@ directory, you can also copy these log files over your restored log files and perform a catastrophic recovery to recover these updates. With the example above: - + $ cp db.old/logs/log.* db/logs $ db_recover -c -h db diff --git a/cpp/demo/Freeze/backup/backup b/cpp/demo/Freeze/backup/backup index 31a6632d..8a78abf2 100755 --- a/cpp/demo/Freeze/backup/backup +++ b/cpp/demo/Freeze/backup/backup @@ -23,22 +23,22 @@ case $1 in echo "====== Checkpoint ======" ${db}_checkpoint -1 -h db - + if [ $1 = "full" ] then if [ -d hotbackup ] then - echo "====== Preserve (move) previous hotbackup directory ======" + echo "====== Preserve (move) previous hotbackup directory ======" if [ -d hotbackup.1 ] then \rm -fr hotbackup.1 fi \mv hotbackup hotbackup.1 fi - + echo "====== Retrieve list of old logs ======" oldLogs=`${db}_archive -h db` - + echo "====== Run ${db}_hotbackup ======" ${db}_hotbackup -b hotbackup -v -D -h db status=$? @@ -51,12 +51,12 @@ case $1 in echo "db/logs/$i deleted" done fi - + if [ $1 = "incremental" ] then if [ -d hotbackup ] then - echo "====== Preserve (copy) previous hotbackup directory ======" + echo "====== Preserve (copy) previous hotbackup directory ======" if [ -d hotbackup.1 ] then \rm -fr hotbackup.1 @@ -68,7 +68,7 @@ case $1 in ${db}_hotbackup -u -b hotbackup -v -D -h db status=$? if [ $status != 0 ]; then exit $status ; fi - fi + fi ;; *) echo "Usage: $0 {full|incremental}" diff --git a/cpp/demo/Freeze/casino/BetResolver.h b/cpp/demo/Freeze/casino/BetResolver.h index c3aad194..79d41204 100644 --- a/cpp/demo/Freeze/casino/BetResolver.h +++ b/cpp/demo/Freeze/casino/BetResolver.h @@ -30,7 +30,7 @@ class BetResolver private: void decrementBetCount(); - + int _betCount; IceUtil::Mutex _mutex; std::vector _timers; diff --git a/cpp/demo/Freeze/casino/Casino.ice b/cpp/demo/Freeze/casino/Casino.ice index c10e9a74..cebdba86 100644 --- a/cpp/demo/Freeze/casino/Casino.ice +++ b/cpp/demo/Freeze/casino/Casino.ice @@ -13,7 +13,7 @@ module Casino // or wins more // interface Player - { + { // // The number of chips held by this player // @@ -78,13 +78,13 @@ module Casino ["cpp:const"] int getEarnings(); // - // Verify that the total number of chips held by all known players and bets; + // Verify that the total number of chips held by all known players and bets; // match getOutstandingChips(); // ["cpp:const", "freeze:read:required"] bool checkAllChips(); // - // Create a new bet with the given amount to join; this bet ends in + // Create a new bet with the given amount to join; this bet ends in // 'lifetime' milliseconds // ["freeze:write"] Bet* createBet(int amount, int lifetime); diff --git a/cpp/demo/Freeze/casino/CasinoStore.ice b/cpp/demo/Freeze/casino/CasinoStore.ice index 60c6e60d..874cf013 100644 --- a/cpp/demo/Freeze/casino/CasinoStore.ice +++ b/cpp/demo/Freeze/casino/CasinoStore.ice @@ -69,8 +69,8 @@ module CasinoStore // The time when the bet completes (ms since the epoch) // long closeTime; - }; - + }; + class PersistentBank implements Casino::Bank, Winner { // diff --git a/cpp/demo/Freeze/casino/README.md b/cpp/demo/Freeze/casino/README.md index c52b70e9..d9ae1043 100644 --- a/cpp/demo/Freeze/casino/README.md +++ b/cpp/demo/Freeze/casino/README.md @@ -18,12 +18,12 @@ Highlights: - The public interface of the server is specified in Casino.ice; CasinoStore.ice is just an implementation detail of the server. -- This demo uses a transactional evictor per servant type; this +- This demo uses a transactional evictor per servant type; this is more efficient than storing different types of servants in the same Freeze transactional evictor. - Transactions often span servants in several evictors; this works - because all the evictors use the same underlying Berkeley DB + because all the evictors use the same underlying Berkeley DB environment. - The application code does not deal at all with database deadlocks; @@ -39,7 +39,7 @@ Highlights: wins a bet and is destroyed at the same time? Will chips get lost? In fact, there is no issue thanks to Berkeley DB locking: when a bet picks a winner, it invokes an operation on this object - (through a proxy) within a transaction. At this point, if the + (through a proxy) within a transaction. At this point, if the object is still alive, it's locked by the transaction, which - prevents another transaction from acquiring a write lock (for + prevents another transaction from acquiring a write lock (for example, to destroy it). diff --git a/cpp/demo/Freeze/casino/config.server b/cpp/demo/Freeze/casino/config.server index a5391de3..d6d89c8c 100644 --- a/cpp/demo/Freeze/casino/config.server +++ b/cpp/demo/Freeze/casino/config.server @@ -25,11 +25,11 @@ Freeze.Warn.Deadlocks=1 # # Freeze Evictor Tracing. # -# 0 = No evictor activity trace (default). +# 0 = No evictor activity trace (default). # 1 = Trace Ice object and facet creation and destruction, facet # streaming time, facet saving time, object eviction (every 50 # objects) and evictor deactivation. -# 2 = Also trace object lookups, and all object evictions. +# 2 = Also trace object lookups, and all object evictions. # 3 = Also trace object retrieval from the database. # #Freeze.Trace.Evictor=1 @@ -46,7 +46,7 @@ Freeze.Evictor.db.player.RollbackOnUserException=1 # # Freeze Transaction Tracing. # -# 0 = No transaction activity trace (default). +# 0 = No transaction activity trace (default). # 1 = Trace transaction IDs and commit and rollback activity. # #Freeze.Trace.Transaction=1 diff --git a/cpp/demo/Freeze/customEvictor/Client.cpp b/cpp/demo/Freeze/customEvictor/Client.cpp index ec304d10..76c507a6 100644 --- a/cpp/demo/Freeze/customEvictor/Client.cpp +++ b/cpp/demo/Freeze/customEvictor/Client.cpp @@ -62,13 +62,13 @@ class ReaderThread : public IceUtil::Thread ItemPrx item = ItemPrx::uncheckedCast(_anItem->ice_identity(identity)); item->getDescription(); } - _requestsPerSecond = + _requestsPerSecond = static_cast(readCount / (IceUtil::Time::now(IceUtil::Time::Monotonic) - startTime).toSecondsDouble()); } catch(const IceUtil::Exception& e) { cerr << "Unexpected exception in ReaderThread: " << e << endl; - } + } } int getRequestsPerSecond() const @@ -105,7 +105,7 @@ class WriterThread : public IceUtil::Thread for(int i = 0; i < writeCount; ++i) { int id = rand() % objectCount; - + ostringstream os; os << "P/N " << id; string nm = os.str(); @@ -116,13 +116,13 @@ class WriterThread : public IceUtil::Thread item->adjustStock(1); } - _requestsPerSecond = + _requestsPerSecond = static_cast(writeCount / (IceUtil::Time::now(IceUtil::Time::Monotonic) - startTime).toSecondsDouble()); } catch(const IceUtil::Exception& e) { cerr << "Unexpected exception in WriterThread: " << e << endl; - } + } } int getRequestsPerSecond() const @@ -176,7 +176,7 @@ WarehouseClient::run(int argc, char*[]) wt->getThreadControl().join(); for(i = 0; i < readerCount; ++i) { - rt[i]->getThreadControl().join(); + rt[i]->getThreadControl().join(); } // diff --git a/cpp/demo/Freeze/customEvictor/CurrentDatabase.h b/cpp/demo/Freeze/customEvictor/CurrentDatabase.h index 69dcf3e6..a04ab2c3 100644 --- a/cpp/demo/Freeze/customEvictor/CurrentDatabase.h +++ b/cpp/demo/Freeze/customEvictor/CurrentDatabase.h @@ -17,12 +17,12 @@ class CurrentDatabase { public: - + CurrentDatabase(const Ice::CommunicatorPtr&, const std::string&, const std::string&); ~CurrentDatabase(); Database& get(); - + private: const Ice::CommunicatorPtr _communicator; diff --git a/cpp/demo/Freeze/customEvictor/Evictor.cpp b/cpp/demo/Freeze/customEvictor/Evictor.cpp index cf4e44b4..ccc2cf27 100644 --- a/cpp/demo/Freeze/customEvictor/Evictor.cpp +++ b/cpp/demo/Freeze/customEvictor/Evictor.cpp @@ -88,7 +88,7 @@ EvictorCache::load(const Ice::Identity& itemId) // cannot acquire the Evictor mutex here, since we also call // IceUtil::Cache with the Evictor mutex locked. // -void +void EvictorCache::pinned(const EvictorEntryPtr& entry, EvictorCache::Position cp) { entry->stale = false; @@ -115,13 +115,13 @@ Evictor::Evictor(CurrentDatabase& currentDb, int size) : { } -Ice::ObjectPtr +Ice::ObjectPtr Evictor::locate(const Ice::Current& current, Ice::LocalObjectPtr& cookie) { cookie = 0; // - // Lookup the cookie (EvictorEntry) in the cache; this will call load() + // Lookup the cookie (EvictorEntry) in the cache; this will call load() // if the entry is not yet in there. // // If we get an entry that was just evicted (stale == true), we try again. @@ -178,8 +178,8 @@ Evictor::locate(const Ice::Current& current, Ice::LocalObjectPtr& cookie) } } -void -Evictor::finished(const Ice::Current& /*current*/, const Ice::ObjectPtr& /*servant*/, +void +Evictor::finished(const Ice::Current& /*current*/, const Ice::ObjectPtr& /*servant*/, const Ice::LocalObjectPtr& cookie) { if(cookie != 0) @@ -193,10 +193,10 @@ Evictor::finished(const Ice::Current& /*current*/, const Ice::ObjectPtr& /*serva assert(entry->useCount >= 0); evict(); - } + } } -void +void Evictor::deactivate(const string& /*category*/) { Mutex::Lock lock(_mutex); diff --git a/cpp/demo/Freeze/customEvictor/ItemI.cpp b/cpp/demo/Freeze/customEvictor/ItemI.cpp index c66ac2e1..528dbbd5 100644 --- a/cpp/demo/Freeze/customEvictor/ItemI.cpp +++ b/cpp/demo/Freeze/customEvictor/ItemI.cpp @@ -14,46 +14,46 @@ ItemI::ItemI(CurrentDatabase& currentDb, const ItemInfo& info) : _currentDb(currentDb), _cachedInfo(info) { -} +} -string +string ItemI::getDescription(const Ice::Current&) { Mutex::Lock lock(_mutex); return _cachedInfo.description; -} +} -void +void ItemI::setDescription(const string& newDescription, const Ice::Current& current) { Mutex::Lock lock(_mutex); _cachedInfo.description = newDescription; save(current); -} +} -float +float ItemI::getUnitPrice(const Ice::Current&) { Mutex::Lock lock(_mutex); return _cachedInfo.unitPrice; -} +} -void +void ItemI::setUnitPrice(float newUnitPrice, const Ice::Current& current) { Mutex::Lock lock(_mutex); _cachedInfo.unitPrice = newUnitPrice; save(current); -} +} -int +int ItemI::quantityInStock(const Ice::Current&) { Mutex::Lock lock(_mutex); return _cachedInfo.quantityInStock; -} +} -void +void ItemI::adjustStock(int value, const Ice::Current& current) { Mutex::Lock lock(_mutex); @@ -64,7 +64,7 @@ ItemI::adjustStock(int value, const Ice::Current& current) } _cachedInfo.quantityInStock = newQuantity; save(current); -} +} void ItemI::save(const Ice::Current& current) diff --git a/cpp/demo/Freeze/customEvictor/ItemI.h b/cpp/demo/Freeze/customEvictor/ItemI.h index da9436a8..3e5e66fe 100644 --- a/cpp/demo/Freeze/customEvictor/ItemI.h +++ b/cpp/demo/Freeze/customEvictor/ItemI.h @@ -16,7 +16,7 @@ class ItemI : public Warehouse::Item { public: - ItemI(CurrentDatabase&, const Warehouse::ItemInfo&); + ItemI(CurrentDatabase&, const Warehouse::ItemInfo&); virtual std::string getDescription(const Ice::Current&); virtual void setDescription(const std::string&,const Ice::Current&); @@ -28,9 +28,9 @@ class ItemI : public Warehouse::Item virtual void adjustStock(int, const Ice::Current&); private: - + void save(const Ice::Current&); - + CurrentDatabase& _currentDb; Warehouse::ItemInfo _cachedInfo; IceUtil::Mutex _mutex; diff --git a/cpp/demo/Freeze/customEvictor/Makefile.mk b/cpp/demo/Freeze/customEvictor/Makefile.mk index b8f1243b..ee8396e1 100644 --- a/cpp/demo/Freeze/customEvictor/Makefile.mk +++ b/cpp/demo/Freeze/customEvictor/Makefile.mk @@ -17,7 +17,7 @@ $(test)_server_sources = Item.ice \ $(test)_server_slice2freeze := Database $(test)_server_Database := --dict Database,string,Warehouse::ItemInfo -$(test)_server_Database_slice := $(test)/ItemInfo.ice +$(test)_server_Database_slice := $(test)/ItemInfo.ice demos += $(test) diff --git a/cpp/demo/Freeze/customEvictor/Server.cpp b/cpp/demo/Freeze/customEvictor/Server.cpp index 32c30fbe..d93da19b 100644 --- a/cpp/demo/Freeze/customEvictor/Server.cpp +++ b/cpp/demo/Freeze/customEvictor/Server.cpp @@ -43,7 +43,7 @@ WarehouseServer::run(int argc, char* argv[]) } else { - cout << "Using Evictor implemented with IceUtil::Cache" << endl; + cout << "Using Evictor implemented with IceUtil::Cache" << endl; } Ice::ObjectAdapterPtr adapter = communicator()->createObjectAdapter("Warehouse"); diff --git a/cpp/demo/Freeze/customEvictor/SimpleEvictor.cpp b/cpp/demo/Freeze/customEvictor/SimpleEvictor.cpp index f7a3f44c..25ca50ac 100644 --- a/cpp/demo/Freeze/customEvictor/SimpleEvictor.cpp +++ b/cpp/demo/Freeze/customEvictor/SimpleEvictor.cpp @@ -42,8 +42,8 @@ SimpleEvictor::SimpleEvictor(CurrentDatabase& currentDb, int size) : _currentDb(currentDb) { } - -Ice::ObjectPtr + +Ice::ObjectPtr SimpleEvictor::add(const Ice::Current& current, Ice::LocalObjectPtr& cookie) { cookie = 0; @@ -56,7 +56,7 @@ SimpleEvictor::add(const Ice::Current& current, Ice::LocalObjectPtr& cookie) cout << cacheMisses << " cache misses" << endl; } } - + // // You can simulate more expensive cache-misses by adding a sleep here: // @@ -77,7 +77,7 @@ SimpleEvictor::add(const Ice::Current& current, Ice::LocalObjectPtr& cookie) } } -void +void SimpleEvictor::evict(const Ice::ObjectPtr&, const Ice::LocalObjectPtr&) { // diff --git a/cpp/demo/Freeze/customEvictor/SimpleEvictor.h b/cpp/demo/Freeze/customEvictor/SimpleEvictor.h index bf8bfbba..e7379bc3 100644 --- a/cpp/demo/Freeze/customEvictor/SimpleEvictor.h +++ b/cpp/demo/Freeze/customEvictor/SimpleEvictor.h @@ -18,7 +18,7 @@ class SimpleEvictor : public EvictorBase SimpleEvictor(CurrentDatabase&, int); protected: - + virtual Ice::ObjectPtr add(const Ice::Current&, Ice::LocalObjectPtr&); virtual void evict(const Ice::ObjectPtr&, const Ice::LocalObjectPtr&); diff --git a/cpp/demo/Freeze/library/config.collocated b/cpp/demo/Freeze/library/config.collocated index acaea776..b7b3a9b0 100644 --- a/cpp/demo/Freeze/library/config.collocated +++ b/cpp/demo/Freeze/library/config.collocated @@ -21,14 +21,14 @@ Library.Proxy=library:default -h localhost -p 10000 # Don't warn about unknown properties. If this is not set we'll get a # warning about "Library.Proxy" since the Ice run time thinks this is # an OA property due to the Object Adapter "Library". -# +# Ice.Warn.UnknownProperties=0 # # Freeze Map Tracing. # -# 0 = No map activity trace (default). -# 1 = Trace database open and close. +# 0 = No map activity trace (default). +# 1 = Trace database open and close. # 2 = Also trace iterator and transaction operations, and reference # counting of the underlying database. # @@ -37,11 +37,11 @@ Freeze.Trace.Map=1 # # Freeze Evictor Tracing. # -# 0 = No evictor activity trace (default). +# 0 = No evictor activity trace (default). # 1 = Trace Ice object and facet creation and destruction, facet # streaming time, facet saving time, object eviction (every 50 # objects) and evictor deactivation. -# 2 = Also trace object lookups, and all object evictions. +# 2 = Also trace object lookups, and all object evictions. # 3 = Also trace object retrieval from the database. # Freeze.Trace.Evictor=2 diff --git a/cpp/demo/Freeze/library/config.server b/cpp/demo/Freeze/library/config.server index 19b4ebe4..b61af751 100644 --- a/cpp/demo/Freeze/library/config.server +++ b/cpp/demo/Freeze/library/config.server @@ -14,8 +14,8 @@ EvictorSize=3 # # Freeze Map Tracing. # -# 0 = No map activity trace (default). -# 1 = Trace database open and close. +# 0 = No map activity trace (default). +# 1 = Trace database open and close. # 2 = Also trace iterator and transaction operations, and reference # counting of the underlying database. # @@ -24,11 +24,11 @@ Freeze.Trace.Map=1 # # Freeze Evictor Tracing. # -# 0 = No evictor activity trace (default). +# 0 = No evictor activity trace (default). # 1 = Trace Ice object and facet creation and destruction, facet # streaming time, facet saving time, object eviction (every 50 # objects) and evictor deactivation. -# 2 = Also trace object lookups, and all object evictions. +# 2 = Also trace object lookups, and all object evictions. # 3 = Also trace object retrieval from the database. # Freeze.Trace.Evictor=2 diff --git a/cpp/demo/Freeze/phonebook/config.collocated b/cpp/demo/Freeze/phonebook/config.collocated index 9be79c92..4247df22 100644 --- a/cpp/demo/Freeze/phonebook/config.collocated +++ b/cpp/demo/Freeze/phonebook/config.collocated @@ -21,7 +21,7 @@ PhoneBook.Proxy=phonebook:default -h localhost -p 10000 # Don't warn about unknown properties. If this is not set we'll get a # warning about "PhoneBook.Proxy" since the Ice run time thinks this is # an OA property due to the Object Adapter "PhoneBook". -# +# Ice.Warn.UnknownProperties=0 # @@ -33,11 +33,11 @@ Freeze.Evictor.db.contacts.SavePeriod=10000 # # Freeze Evictor Tracing. # -# 0 = No evictor activity trace (default). +# 0 = No evictor activity trace (default). # 1 = Trace Ice object and facet creation and destruction, facet # streaming time, facet saving time, object eviction (every 50 # objects) and evictor deactivation. -# 2 = Also trace object lookups, and all object evictions. +# 2 = Also trace object lookups, and all object evictions. # 3 = Also trace object retrieval from the database. # Freeze.Trace.Evictor=2 diff --git a/cpp/demo/Freeze/phonebook/config.server b/cpp/demo/Freeze/phonebook/config.server index 63d3dac7..7e0fb519 100644 --- a/cpp/demo/Freeze/phonebook/config.server +++ b/cpp/demo/Freeze/phonebook/config.server @@ -20,11 +20,11 @@ Freeze.Evictor.db.contacts.SavePeriod=10000 # # Freeze Evictor Tracing. # -# 0 = No evictor activity trace (default). +# 0 = No evictor activity trace (default). # 1 = Trace Ice object and facet creation and destruction, facet # streaming time, facet saving time, object eviction (every 50 # objects) and evictor deactivation. -# 2 = Also trace object lookups, and all object evictions. +# 2 = Also trace object lookups, and all object evictions. # 3 = Also trace object retrieval from the database. # Freeze.Trace.Evictor=2 diff --git a/cpp/demo/Freeze/transform/create.cpp b/cpp/demo/Freeze/transform/create.cpp index f6011a6a..73f0d776 100644 --- a/cpp/demo/Freeze/transform/create.cpp +++ b/cpp/demo/Freeze/transform/create.cpp @@ -15,7 +15,7 @@ using namespace Freeze; class Create : public Ice::Application { public: - + virtual int run(int, char*[]); }; @@ -29,19 +29,19 @@ int Create::run(int, char*[]) { const string names[] = { "don", "ed", "frank", "gary", "arnold", "bob", "carlos" }; - const string phoneNumbers[] = { "(777)777-7777", "(666)666-6666", "(555)555-5555 x123", + const string phoneNumbers[] = { "(777)777-7777", "(666)666-6666", "(555)555-5555 x123", "(444)444-4444", "(333)333-3333 x1234", "(222)222-2222", "(111)111-1111" }; const size_t size = 7; ConnectionPtr connection = createConnection(communicator(), "db"); Contacts contacts(connection, "contacts"); - - + + // // Create a bunch of contacts within one transaction, and commit it // - + TransactionHolder txh(connection); for(size_t i = 0; i < size; ++i) { @@ -50,10 +50,10 @@ Create::run(int, char*[]) contacts.put(Contacts::value_type(names[i], data)); } - + txh.commit(); - + cout << size << " contacts were successfully created or updated" << endl; - + return 0; } diff --git a/cpp/demo/Freeze/transform/read.cpp b/cpp/demo/Freeze/transform/read.cpp index cf29eaf9..0fd4ceec 100644 --- a/cpp/demo/Freeze/transform/read.cpp +++ b/cpp/demo/Freeze/transform/read.cpp @@ -15,7 +15,7 @@ using namespace Freeze; class Read : public Ice::Application { public: - + virtual int run(int, char*[]); }; @@ -30,7 +30,7 @@ Read::run(int, char*[]) { ConnectionPtr connection = createConnection(communicator(), "db"); const Contacts contacts(connection, "contacts", false); - + Contacts::const_iterator p; cout << "All contacts (default order)" << endl; @@ -44,6 +44,6 @@ Read::run(int, char*[]) { cout << p->first << ":\t\t" << p->second.phoneNumber << endl; } - + return 0; } diff --git a/cpp/demo/Freeze/transform/readnew.cpp b/cpp/demo/Freeze/transform/readnew.cpp index 1cc6616f..327dc1da 100644 --- a/cpp/demo/Freeze/transform/readnew.cpp +++ b/cpp/demo/Freeze/transform/readnew.cpp @@ -15,7 +15,7 @@ using namespace Freeze; class ReadNew : public Ice::Application { public: - + virtual int run(int, char*[]); }; @@ -31,7 +31,7 @@ ReadNew::run(int, char*[]) ConnectionPtr connection = createConnection(communicator(), "dbnew"); bool createDb = true; const NewContacts contacts(connection, "contacts", createDb); - + NewContacts::const_iterator p; cout << "All contacts (default order)" << endl; @@ -40,13 +40,13 @@ ReadNew::run(int, char*[]) cout << p->first << ":\t\t" << p->second.phoneNumber << " " << p->second.emailAddress << endl; } - + cout << endl << "All contacts (ordered by phone number)" << endl; for(p = contacts.beginForPhoneNumber(); p != contacts.endForPhoneNumber(); ++p) { cout << p->first << ":\t\t" << p->second.phoneNumber << " " << p->second.emailAddress << endl; } - + return 0; } diff --git a/cpp/demo/Freeze/transform/recreate.cpp b/cpp/demo/Freeze/transform/recreate.cpp index 783d2ebc..1c545164 100644 --- a/cpp/demo/Freeze/transform/recreate.cpp +++ b/cpp/demo/Freeze/transform/recreate.cpp @@ -15,7 +15,7 @@ using namespace Freeze; class Recreate : public Ice::Application { public: - + virtual int run(int, char*[]); }; @@ -30,7 +30,7 @@ Recreate::run(int, char*[]) { ConnectionPtr connection = createConnection(communicator(), "dbnew"); NewContacts::recreate(connection, "contacts"); - + cout << "Recreated contacts database successfully!" << endl; return 0; } diff --git a/cpp/demo/Freeze/transform/transform.xml b/cpp/demo/Freeze/transform/transform.xml index 1f6e8f1b..6d0238be 100644 --- a/cpp/demo/Freeze/transform/transform.xml +++ b/cpp/demo/Freeze/transform/transform.xml @@ -5,10 +5,10 @@ - + - + diff --git a/cpp/demo/Manual/evictorFilesystem/Parser.h b/cpp/demo/Manual/evictorFilesystem/Parser.h index 25baf0d9..bbfbf82f 100644 --- a/cpp/demo/Manual/evictorFilesystem/Parser.h +++ b/cpp/demo/Manual/evictorFilesystem/Parser.h @@ -58,10 +58,10 @@ class Parser : public IceUtil::SimpleShared void destroy(const ::std::list< ::std::string>&); // - // With older flex version <= 2.5.35 YY_INPUT second + // With older flex version <= 2.5.35 YY_INPUT second // paramenter is of type int&, in newer versions it // changes to size_t& - // + // void getInput(char*, int&, size_t); void getInput(char*, size_t&, size_t); void continueLine(); diff --git a/cpp/demo/Manual/evictorFilesystem/config.server b/cpp/demo/Manual/evictorFilesystem/config.server index 69e536ab..52c11a2d 100644 --- a/cpp/demo/Manual/evictorFilesystem/config.server +++ b/cpp/demo/Manual/evictorFilesystem/config.server @@ -6,8 +6,8 @@ EvictorFilesystem.Endpoints=default -h localhost -p 10000 # # Freeze Map Tracing. # -# 0 = No map activity trace (default). -# 1 = Trace database open and close. +# 0 = No map activity trace (default). +# 1 = Trace database open and close. # 2 = Also trace iterator and transaction operations, and reference # counting of the underlying database. # @@ -16,11 +16,11 @@ Freeze.Trace.Map=1 # # Freeze Evictor Tracing. # -# 0 = No evictor activity trace (default). +# 0 = No evictor activity trace (default). # 1 = Trace Ice object and facet creation and destruction, facet # streaming time, facet saving time, object eviction (every 50 # objects) and evictor deactivation. -# 2 = Also trace object lookups, and all object evictions. +# 2 = Also trace object lookups, and all object evictions. # 3 = Also trace object retrieval from the database. # Freeze.Trace.Evictor=2 diff --git a/cpp/demo/Manual/mapFilesystem/Makefile.mk b/cpp/demo/Manual/mapFilesystem/Makefile.mk index 6e375e6a..0b01eeba 100644 --- a/cpp/demo/Manual/mapFilesystem/Makefile.mk +++ b/cpp/demo/Manual/mapFilesystem/Makefile.mk @@ -17,10 +17,10 @@ $(test)_server_sources = Filesystem.ice \ $(test)_server_slice2freeze := IdentityFileEntryMap IdentityDirectoryEntryMap -$(test)_server_IdentityFileEntryMap := --dict FilesystemDB::IdentityFileEntryMap,Ice::Identity,FilesystemDB::FileEntry +$(test)_server_IdentityFileEntryMap := --dict FilesystemDB::IdentityFileEntryMap,Ice::Identity,FilesystemDB::FileEntry $(test)_server_IdentityFileEntryMap_slice := $(test)/FilesystemDB.ice $(ice_slicedir)/Ice/Identity.ice -$(test)_server_IdentityDirectoryEntryMap := --dict FilesystemDB::IdentityDirectoryEntryMap,Ice::Identity,FilesystemDB::DirectoryEntry +$(test)_server_IdentityDirectoryEntryMap := --dict FilesystemDB::IdentityDirectoryEntryMap,Ice::Identity,FilesystemDB::DirectoryEntry $(test)_server_IdentityDirectoryEntryMap_slice := $(test)/FilesystemDB.ice $(ice_slicedir)/Ice/Identity.ice demos += $(test) diff --git a/cpp/demo/Manual/mapFilesystem/Parser.h b/cpp/demo/Manual/mapFilesystem/Parser.h index 324be22f..efdf662a 100644 --- a/cpp/demo/Manual/mapFilesystem/Parser.h +++ b/cpp/demo/Manual/mapFilesystem/Parser.h @@ -57,10 +57,10 @@ class Parser : public IceUtil::SimpleShared void destroy(const ::std::list< ::std::string>&); // - // With older flex version <= 2.5.35 YY_INPUT second + // With older flex version <= 2.5.35 YY_INPUT second // paramenter is of type int&, in newer versions it // changes to size_t& - // + // void getInput(char*, int&, size_t); void getInput(char*, size_t&, size_t); void continueLine(); diff --git a/cpp/demo/Manual/mapFilesystem/config.server b/cpp/demo/Manual/mapFilesystem/config.server index c8694039..f73867be 100644 --- a/cpp/demo/Manual/mapFilesystem/config.server +++ b/cpp/demo/Manual/mapFilesystem/config.server @@ -6,8 +6,8 @@ MapFilesystem.Endpoints=default -h localhost -p 10000 # # Freeze Map Tracing. # -# 0 = No map activity trace (default). -# 1 = Trace database open and close. +# 0 = No map activity trace (default). +# 1 = Trace database open and close. # 2 = Also trace iterator and transaction operations, and reference # counting of the underlying database. # diff --git a/cpp/include/Freeze/AbstractMutex.h b/cpp/include/Freeze/AbstractMutex.h index c650a720..e38a3299 100644 --- a/cpp/include/Freeze/AbstractMutex.h +++ b/cpp/include/Freeze/AbstractMutex.h @@ -19,7 +19,7 @@ namespace IceUtil class FREEZE_API AbstractMutex { public: - + typedef LockT Lock; typedef TryLockT TryLock; diff --git a/cpp/include/Freeze/Cache.h b/cpp/include/Freeze/Cache.h index 8aafef84..15bd83ca 100644 --- a/cpp/include/Freeze/Cache.h +++ b/cpp/include/Freeze/Cache.h @@ -23,7 +23,7 @@ template class Cache { public: - + // // Latch and CacheValue are implementation details; // application code should not use them. @@ -34,7 +34,7 @@ class Cache Latch() : IceUtilInternal::CountDownLatch(1), useCount(0) - { + { } int useCount; }; @@ -46,7 +46,7 @@ class Cache latch(0) { } - + IceUtil::Handle obj; Latch* latch; }; @@ -56,12 +56,12 @@ class Cache IceUtil::Handle getIfPinned(const Key&, bool = false) const; void unpin(Position); - + void clear(); size_t size() const; bool pin(const Key&, const IceUtil::Handle&); - + IceUtil::Handle pin(const Key&); IceUtil::Handle putIfAbsent(const Key&, const IceUtil::Handle&); @@ -72,7 +72,7 @@ class Cache virtual void pinned(const IceUtil::Handle&, Position) { } - + virtual ~Cache() { } @@ -82,13 +82,13 @@ class Cache IceUtil::Handle pinImpl(const Key&, const IceUtil::Handle&); typedef std::map CacheMap; - + IceUtil::Mutex _mutex; CacheMap _map; }; -template IceUtil::Handle +template IceUtil::Handle Cache::getIfPinned(const Key& key, bool wait) const { IceUtil::Mutex::Lock sync(_mutex); @@ -103,7 +103,7 @@ Cache::getIfPinned(const Key& key, bool wait) const { return result; } - + // // The object is being loaded: we wait // @@ -112,7 +112,7 @@ Cache::getIfPinned(const Key& key, bool wait) const { const_cast(p->second).latch = new Latch; } - + Latch* latch = p->second.latch; ++latch->useCount; sync.release(); @@ -144,7 +144,7 @@ Cache::unpin(typename Cache::Position p) _map.erase(p); } -template void +template void Cache::clear() { // @@ -154,14 +154,14 @@ Cache::clear() _map.clear(); } -template size_t +template size_t Cache::size() const { IceUtil::Mutex::Lock sync(_mutex); return _map.size(); } - -template bool + +template bool Cache::pin(const Key& key, const IceUtil::Handle& obj) { IceUtil::Mutex::Lock sync(_mutex); @@ -170,7 +170,7 @@ Cache::pin(const Key& key, const IceUtil::Handle& obj) _map.insert(CacheMap::value_type(key, CacheValue(obj))); #else _map.insert(typename CacheMap::value_type(key, CacheValue(obj))); -#endif +#endif if(ir.second) { @@ -179,19 +179,19 @@ Cache::pin(const Key& key, const IceUtil::Handle& obj) return ir.second; } -template IceUtil::Handle +template IceUtil::Handle Cache::pin(const Key& key) { return pinImpl(key, 0); } -template IceUtil::Handle +template IceUtil::Handle Cache::putIfAbsent(const Key& key, const IceUtil::Handle& obj) { return pinImpl(key, obj); } -template IceUtil::Handle +template IceUtil::Handle Cache::pinImpl(const Key& key, const IceUtil::Handle& newObj) { Latch* latch = 0; @@ -201,7 +201,7 @@ Cache::pinImpl(const Key& key, const IceUtil::Handle& newObj) { { IceUtil::Mutex::Lock sync(_mutex); - + // // Clean up latch from previous loop // @@ -213,13 +213,13 @@ Cache::pinImpl(const Key& key, const IceUtil::Handle& newObj) } latch = 0; } - + std::pair ir = #if defined(_MSC_VER) _map.insert(CacheMap::value_type(key, CacheValue(0))); #else _map.insert(typename CacheMap::value_type(key, CacheValue(0))); -#endif +#endif if(ir.second == false) { @@ -234,37 +234,37 @@ Cache::pinImpl(const Key& key, const IceUtil::Handle& newObj) // if(val.latch == 0) { - // - // The first queued thread creates the latch - // - val.latch = new Latch; + // + // The first queued thread creates the latch + // + val.latch = new Latch; } latch = val.latch; latch->useCount++; } - - p = ir.first; + + p = ir.first; } - - if(latch != 0) + + if(latch != 0) { // // Note: only the threads owning a "useCount" wait; upon wake-up, // they loop back, release this useCount and possibly delete the latch // - + latch->await(); - // - // p could be stale now, e.g. some other thread pinned and unpinned the - // object while we were waiting. - // So start over. + // + // p could be stale now, e.g. some other thread pinned and unpinned the + // object while we were waiting. + // So start over. } } while(latch != 0); - + // - // Load + // Load // IceUtil::Handle obj; try @@ -277,7 +277,7 @@ Cache::pinImpl(const Key& key, const IceUtil::Handle& newObj) latch = p->second.latch; p->second.latch = 0; _map.erase(p); - if(latch != 0) + if(latch != 0) { // // It is necessary to call countDown() within the sync @@ -292,31 +292,31 @@ Cache::pinImpl(const Key& key, const IceUtil::Handle& newObj) } IceUtil::Mutex::Lock sync(_mutex); - + // // p is still valid here -- nobody knows about it. See also unpin(). // latch = p->second.latch; p->second.latch = 0; - + try { - if(obj != 0) - { + if(obj != 0) + { p->second.obj = obj; pinned(obj, p); - } - else - { + } + else + { if(newObj == 0) { // // pin() did not find the object // - - // - // The waiting threads will have to call load() to see by themselves. - // + + // + // The waiting threads will have to call load() to see by themselves. + // _map.erase(p); } else @@ -331,8 +331,8 @@ Cache::pinImpl(const Key& key, const IceUtil::Handle& newObj) } catch(...) { - if(latch != 0) - { + if(latch != 0) + { // // Must be called within sync; see ->countDown() note above. // @@ -341,8 +341,8 @@ Cache::pinImpl(const Key& key, const IceUtil::Handle& newObj) } throw; } - - if(latch != 0) + + if(latch != 0) { // // Must be called within sync; see ->countDown() note above. diff --git a/cpp/include/Freeze/Index.h b/cpp/include/Freeze/Index.h index 4a818223..de203e10 100644 --- a/cpp/include/Freeze/Index.h +++ b/cpp/include/Freeze/Index.h @@ -20,24 +20,24 @@ class ObjectStoreBase; class FREEZE_API Index : public IceUtil::Shared { public: - + virtual ~Index(); const std::string& name() const; const std::string& facet() const; protected: - + Index(const std::string&, const std::string&); - + virtual bool marshalKey(const Ice::ObjectPtr&, Freeze::Key&) const = 0; - + std::vector untypedFindFirst(const Freeze::Key&, Ice::Int) const; - + std::vector untypedFind(const Freeze::Key&) const; - + Ice::Int untypedCount(const Freeze::Key&) const; - + Ice::CommunicatorPtr _communicator; Ice::EncodingVersion _encoding; @@ -45,7 +45,7 @@ class FREEZE_API Index : public IceUtil::Shared friend class IndexI; friend class ObjectStoreBase; - + std::string _name; std::string _facet; IndexI* _impl; diff --git a/cpp/include/Freeze/Initialize.h b/cpp/include/Freeze/Initialize.h index 51ac92d4..77b5a478 100644 --- a/cpp/include/Freeze/Initialize.h +++ b/cpp/include/Freeze/Initialize.h @@ -35,9 +35,9 @@ namespace Freeze typedef std::map FacetTypeMap; -FREEZE_API Freeze::BackgroundSaveEvictorPtr +FREEZE_API Freeze::BackgroundSaveEvictorPtr createBackgroundSaveEvictor(const Ice::ObjectAdapterPtr& adapter, - const std::string& envName, + const std::string& envName, const std::string& filename, const ServantInitializerPtr& initializer = 0, const std::vector& indices = std::vector(), @@ -46,25 +46,25 @@ createBackgroundSaveEvictor(const Ice::ObjectAdapterPtr& adapter, FREEZE_API BackgroundSaveEvictorPtr createBackgroundSaveEvictor(const Ice::ObjectAdapterPtr& adapter, const std::string& envName, - DbEnv& dbEnv, + DbEnv& dbEnv, const std::string& filename, const ServantInitializerPtr& initializer = 0, const std::vector& indices = std::vector(), bool createDb = true); -FREEZE_API TransactionalEvictorPtr +FREEZE_API TransactionalEvictorPtr createTransactionalEvictor(const Ice::ObjectAdapterPtr& adapter, - const std::string& envName, + const std::string& envName, const std::string& filename, const FacetTypeMap& facetTypes = FacetTypeMap(), const ServantInitializerPtr& initializer = 0, const std::vector& indices = std::vector(), bool createDb = true); -FREEZE_API TransactionalEvictorPtr +FREEZE_API TransactionalEvictorPtr createTransactionalEvictor(const Ice::ObjectAdapterPtr& adapter, const std::string& envName, - DbEnv& dbEnv, + DbEnv& dbEnv, const std::string& filename, const FacetTypeMap& facetTypes = FacetTypeMap(), const ServantInitializerPtr& initializer = 0, @@ -78,7 +78,7 @@ createTransactionalEvictor(const Ice::ObjectAdapterPtr& adapter, class FREEZE_API TransactionalEvictorDeadlockException : public Ice::SystemException { public: - + TransactionalEvictorDeadlockException(const char*, int, const TransactionPtr& = 0); virtual ~TransactionalEvictorDeadlockException() throw(); @@ -95,7 +95,7 @@ FREEZE_API ConnectionPtr createConnection(const Ice::CommunicatorPtr& communicat const std::string& envName); FREEZE_API ConnectionPtr createConnection(const Ice::CommunicatorPtr& communicator, - const std::string& envName, + const std::string& envName, DbEnv& dbEnv); FREEZE_API const std::string& catalogName(); diff --git a/cpp/include/Freeze/TransactionHolder.h b/cpp/include/Freeze/TransactionHolder.h index 26cc795d..52cc1305 100644 --- a/cpp/include/Freeze/TransactionHolder.h +++ b/cpp/include/Freeze/TransactionHolder.h @@ -16,9 +16,9 @@ namespace Freeze class FREEZE_API TransactionHolder { public: - + TransactionHolder(const ConnectionPtr&); - + ~TransactionHolder(); void @@ -28,13 +28,13 @@ class FREEZE_API TransactionHolder rollback(); private: - + // // Not implemented // TransactionHolder(const TransactionHolder&); - TransactionHolder& + TransactionHolder& operator=(const TransactionHolder&); TransactionPtr _transaction; diff --git a/cpp/msbuild/freeze.nuget.targets b/cpp/msbuild/freeze.nuget.targets index 9e940803..ec50be3b 100644 --- a/cpp/msbuild/freeze.nuget.targets +++ b/cpp/msbuild/freeze.nuget.targets @@ -21,13 +21,13 @@ - + - diff --git a/cpp/src/Freeze/BackgroundSaveEvictorI.h b/cpp/src/Freeze/BackgroundSaveEvictorI.h index a59f2e4b..95d64d64 100644 --- a/cpp/src/Freeze/BackgroundSaveEvictorI.h +++ b/cpp/src/Freeze/BackgroundSaveEvictorI.h @@ -15,16 +15,16 @@ namespace Freeze #if defined(_MSC_VER) && (_MSC_VER <= 1200) || defined(__IBMCPP__) - enum - { + enum + { clean = 0, created = 1, modified = 2, destroyed = 3, dead = 4 }; - -#else + +#else // // Clean object; can become modified or destroyed // @@ -85,24 +85,24 @@ struct BackgroundSaveEvictorElement : public Ice::LocalObject int usageCount; int keepCount; bool stale; - + // // Protected by mutex - // + // IceUtil::Mutex mutex; ObjectRecord rec; Ice::Byte status; }; -class BackgroundSaveEvictorI : public BackgroundSaveEvictor, public EvictorI, +class BackgroundSaveEvictorI : public BackgroundSaveEvictor, public EvictorI, public IceUtil::Thread { public: - BackgroundSaveEvictorI(const Ice::ObjectAdapterPtr&, const std::string&, DbEnv*, const std::string&, + BackgroundSaveEvictorI(const Ice::ObjectAdapterPtr&, const std::string&, DbEnv*, const std::string&, const ServantInitializerPtr&, const std::vector&, bool); - + virtual Ice::ObjectPrx addFacet(const Ice::ObjectPtr&, const Ice::Identity&, const std::string&); virtual Ice::ObjectPtr removeFacet(const Ice::Identity&, const std::string&); @@ -118,7 +118,7 @@ class BackgroundSaveEvictorI : public BackgroundSaveEvictor, public EvictorI StreamedObjectPtr; protected: - + virtual bool hasAnotherFacet(const Ice::Identity&, const std::string&); - + virtual Ice::ObjectPtr locateImpl(const Ice::Current&, Ice::LocalObjectPtr&); - + virtual void evict(); private: @@ -169,7 +169,7 @@ class BackgroundSaveEvictorI : public BackgroundSaveEvictor, public EvictorI ConnectionIPtr; inline void @@ -128,7 +128,7 @@ ConnectionI::dbEnv() const return _dbEnv; } -inline const std::string& +inline const std::string& ConnectionI::envName() const { return _envName; diff --git a/cpp/src/Freeze/EvictorIteratorI.cpp b/cpp/src/Freeze/EvictorIteratorI.cpp index 32312408..c4a7aa4f 100644 --- a/cpp/src/Freeze/EvictorIteratorI.cpp +++ b/cpp/src/Freeze/EvictorIteratorI.cpp @@ -29,7 +29,7 @@ Freeze::EvictorIteratorI::EvictorIteratorI(ObjectStoreBase* store, const Transac bool Freeze::EvictorIteratorI::hasNext() { - if(_batchIterator != _batch.end()) + if(_batchIterator != _batch.end()) { return true; } @@ -64,14 +64,14 @@ Freeze::EvictorIteratorI::nextBatch() return _batch.end(); } - DeactivateController::Guard + DeactivateController::Guard deactivateGuard(_store->evictor()->deactivateController()); - + Key firstKey = _key; const CommunicatorPtr& communicator = _store->communicator(); const EncodingVersion& encoding = _store->encoding(); - + DbTxn* txn = _tx == 0 ? 0: _tx->dbTxn(); try @@ -79,19 +79,19 @@ Freeze::EvictorIteratorI::nextBatch() for(;;) { _batch.clear(); - + Dbt dbKey; initializeOutDbt(_key, dbKey); Dbt dbValue; dbValue.set_flags(DB_DBT_USERMEM | DB_DBT_PARTIAL); - + Dbc* dbc = 0; try { // // Move to the first record - // + // u_int32_t flags = DB_NEXT; if(_initialized) @@ -107,7 +107,7 @@ Freeze::EvictorIteratorI::nextBatch() // dbKey.set_size(static_cast(firstKey.size())); } - + _store->db()->cursor(txn, &dbc, 0); bool done = false; @@ -130,7 +130,7 @@ Freeze::EvictorIteratorI::nextBatch() _initialized = true; flags = DB_NEXT; - + Ice::Identity ident; ObjectStoreBase::unmarshal(ident, _key, communicator, encoding); if(_batch.size() < _batchSize) @@ -181,7 +181,7 @@ Freeze::EvictorIteratorI::nextBatch() // Else, ignored } } - + if(_tx == 0) { _key = firstKey; @@ -223,7 +223,7 @@ Freeze::EvictorIteratorI::nextBatch() { handleDbException(dx, __FILE__, __LINE__); } - + if(_batch.size() == 0) { return _batch.end(); diff --git a/cpp/src/Freeze/Index.cpp b/cpp/src/Freeze/Index.cpp index 2510d9e7..f968a379 100644 --- a/cpp/src/Freeze/Index.cpp +++ b/cpp/src/Freeze/Index.cpp @@ -34,19 +34,19 @@ Freeze::Index::facet() const { return _facet; } - + vector Freeze::Index::untypedFindFirst(const Key& bytes, Int firstN) const { return _impl->untypedFindFirst(bytes, firstN); -} +} vector Freeze::Index::untypedFind(const Key& bytes) const { return _impl->untypedFind(bytes); } - + Int Freeze::Index::untypedCount(const Key& bytes) const { diff --git a/cpp/src/Freeze/IndexI.cpp b/cpp/src/Freeze/IndexI.cpp index 3cc0e175..42e01861 100644 --- a/cpp/src/Freeze/IndexI.cpp +++ b/cpp/src/Freeze/IndexI.cpp @@ -16,7 +16,7 @@ using namespace Ice; using namespace std; -static int +static int callback(Db* secondary, const Dbt* key, const Dbt* value, Dbt* result) { void* indexObj = secondary->get_app_private(); @@ -31,11 +31,11 @@ Freeze::IndexI::IndexI(Index& index) : _store(0) { } - + vector Freeze::IndexI::untypedFindFirst(const Key& bytes, Int firstN) const { - DeactivateController::Guard + DeactivateController::Guard deactivateGuard(_store->evictor()->deactivateController()); Dbt dbKey; @@ -56,7 +56,7 @@ Freeze::IndexI::untypedFindFirst(const Key& bytes, Int firstN) const dbKey.set_flags(DB_DBT_USERMEM); dbKey.set_ulen(static_cast(bytes.size())); #endif - + Key pkey(1024); Dbt pdbKey; initializeOutDbt(pkey, pdbKey); @@ -83,12 +83,12 @@ Freeze::IndexI::untypedFindFirst(const Key& bytes, Int firstN) const { // // Move to the first record - // + // _db->cursor(tx, &dbc, 0); u_int32_t flags = DB_SET; bool found; - + do { for(;;) @@ -105,7 +105,7 @@ Freeze::IndexI::untypedFindFirst(const Key& bytes, Int firstN) const if(found) { pkey.resize(pdbKey.get_size()); - + Ice::Identity ident; ObjectStoreBase::unmarshal(ident, pkey, communicator, encoding); identities.push_back(ident); @@ -122,7 +122,7 @@ Freeze::IndexI::untypedFindFirst(const Key& bytes, Int firstN) const handleDbException(dx, pkey, pdbKey, __FILE__, __LINE__); } } - } + } while((firstN <= 0 || identities.size() < static_cast(firstN)) && found); Dbc* toClose = dbc; @@ -151,7 +151,7 @@ Freeze::IndexI::untypedFindFirst(const Key& bytes, Int firstN) const if(_store->evictor()->deadlockWarning()) { Warning out(_store->communicator()->getLogger()); - out << "Deadlock in Freeze::IndexI::untypedFindFirst while searching \"" + out << "Deadlock in Freeze::IndexI::untypedFindFirst while searching \"" << _store->evictor()->filename() + "/" + _dbName << "\"; retrying ..."; } @@ -190,10 +190,10 @@ Freeze::IndexI::untypedFindFirst(const Key& bytes, Int firstN) const { handleDbException(dx, __FILE__, __LINE__); } - + return identities; } - + vector Freeze::IndexI::untypedFind(const Key& bytes) const { @@ -203,7 +203,7 @@ Freeze::IndexI::untypedFind(const Key& bytes) const Int Freeze::IndexI::untypedCount(const Key& bytes) const { - DeactivateController::Guard + DeactivateController::Guard deactivateGuard(_store->evictor()->deactivateController()); Dbt dbKey; @@ -224,7 +224,7 @@ Freeze::IndexI::untypedCount(const Key& bytes) const dbKey.set_flags(DB_DBT_USERMEM); dbKey.set_ulen(static_cast(bytes.size())); #endif - + Dbt dbValue; dbValue.set_flags(DB_DBT_USERMEM | DB_DBT_PARTIAL); @@ -232,28 +232,28 @@ Freeze::IndexI::untypedCount(const Key& bytes) const DbTxn* tx = transaction == 0 ? 0 : transaction->dbTxn(); Int result = 0; - + try { for(;;) { Dbc* dbc = 0; - + try { // // Move to the first record - // + // _db->cursor(tx, &dbc, 0); bool found = (dbc->get(&dbKey, &dbValue, DB_SET) == 0); - + if(found) { db_recno_t count = 0; dbc->count(&count, 0); result = static_cast(count); } - + Dbc* toClose = dbc; dbc = 0; toClose->close(); @@ -280,7 +280,7 @@ Freeze::IndexI::untypedCount(const Key& bytes) const if(_store->evictor()->deadlockWarning()) { Warning out(_store->communicator()->getLogger()); - out << "Deadlock in Freeze::IndexI::untypedCount while searching \"" + out << "Deadlock in Freeze::IndexI::untypedCount while searching \"" << _store->evictor()->filename() + "/" + _dbName << "\"; retrying ..."; } @@ -289,7 +289,7 @@ Freeze::IndexI::untypedCount(const Key& bytes) const throw; } // Else retry - + } catch(...) { @@ -322,19 +322,19 @@ Freeze::IndexI::untypedCount(const Key& bytes) const ex.message = dx.what(); throw ex; } - + return result; } void -Freeze::IndexI::associate(ObjectStoreBase* store, DbTxn* txn, +Freeze::IndexI::associate(ObjectStoreBase* store, DbTxn* txn, bool createDb, bool populateIndex) { assert(txn != 0); _store = store; _index._communicator = store->communicator(); _index._encoding = store->encoding(); - + _db.reset(new Db(store->evictor()->dbEnv()->getEnv(), 0)); _db->set_flags(DB_DUP | DB_DUPSORT); _db->set_app_private(this); @@ -354,7 +354,7 @@ Freeze::IndexI::associate(ObjectStoreBase* store, DbTxn* txn, } _db->set_bt_minkey(btreeMinKey); } - + bool checksum = properties->getPropertyAsInt(propPrefix + "Checksum") > 0; if(checksum) { @@ -364,7 +364,7 @@ Freeze::IndexI::associate(ObjectStoreBase* store, DbTxn* txn, _db->set_flags(DB_CHKSUM); } - + // // pagesize can't change // @@ -377,13 +377,13 @@ Freeze::IndexI::associate(ObjectStoreBase* store, DbTxn* txn, // // - // Berkeley DB expects file paths to be UTF8 encoded. We keep + // Berkeley DB expects file paths to be UTF8 encoded. We keep // _dbName as a native string here, while it might have // been better to convert it to UTF-8, changing this isn't // possible without potentially breaking backward compatibility // with deployed databases. // - _db->open(txn, + _db->open(txn, nativeToUTF8(store->evictor()->filename(), getProcessStringConverter()).c_str(), _dbName.c_str(), DB_BTREE, flags, FREEZE_DB_MODE); @@ -396,7 +396,7 @@ Freeze::IndexI::associate(ObjectStoreBase* store, DbTxn* txn, } int -Freeze::IndexI::secondaryKeyCreate(Db* /*secondary*/, const Dbt* /*dbKey*/, +Freeze::IndexI::secondaryKeyCreate(Db* /*secondary*/, const Dbt* /*dbKey*/, const Dbt* dbValue, Dbt* result) { const Ice::CommunicatorPtr& communicator = _store->communicator(); @@ -439,6 +439,6 @@ Freeze::IndexI::close() { throw DatabaseException(__FILE__, __LINE__, dx.what()); } - _db.reset(0); + _db.reset(0); } } diff --git a/cpp/src/Freeze/IndexI.h b/cpp/src/Freeze/IndexI.h index c7de56b3..7d424cec 100644 --- a/cpp/src/Freeze/IndexI.h +++ b/cpp/src/Freeze/IndexI.h @@ -19,15 +19,15 @@ class ObjectStoreBase; class IndexI { public: - + IndexI(Index&); std::vector untypedFindFirst(const Key&, Ice::Int) const; - + std::vector untypedFind(const Key&) const; - + Ice::Int untypedCount(const Key&) const; - + void associate(ObjectStoreBase*, DbTxn*, bool, bool); @@ -36,7 +36,7 @@ class IndexI void close(); - + private: Index& _index; diff --git a/cpp/src/Freeze/MapDb.cpp b/cpp/src/Freeze/MapDb.cpp index 0a40eb98..554c076d 100644 --- a/cpp/src/Freeze/MapDb.cpp +++ b/cpp/src/Freeze/MapDb.cpp @@ -26,7 +26,7 @@ const string _catalogIndexListName = "__catalogIndexList"; } -extern "C" +extern "C" { #if (DB_VERSION_MAJOR <= 5) static int customCompare(DB* db, const DBT* dbt1, const DBT* dbt2) @@ -39,7 +39,7 @@ extern "C" Key k1(first, first + dbt1->size); first = static_cast(dbt2->data); Key k2(first, first + dbt2->size); - + return me->getKeyCompare()->compare(k1, k2); } } @@ -79,8 +79,8 @@ Freeze::MapDb::~MapDb() } } } - -Freeze::MapDb::MapDb(const ConnectionIPtr& connection, + +Freeze::MapDb::MapDb(const ConnectionIPtr& connection, const string& dbName, const string& key, const string& value, @@ -101,7 +101,7 @@ Freeze::MapDb::MapDb(const ConnectionIPtr& connection, } Catalog catalog(connection, _catalogName); - + TransactionPtr tx = connection->currentTransaction(); bool ownTx = (tx == 0); @@ -116,14 +116,14 @@ Freeze::MapDb::MapDb(const ConnectionIPtr& connection, } Catalog::iterator ci = catalog.find(_dbName); - + if(ci != catalog.end()) { if(ci->second.evictor) { throw DatabaseException(__FILE__, __LINE__, _dbName + " is an evictor database"); } - + _key = ci->second.key; _value = ci->second.value; checkTypes(key, value); @@ -133,16 +133,16 @@ Freeze::MapDb::MapDb(const ConnectionIPtr& connection, _key = key; _value = value; } - + set_app_private(this); if(_keyCompare->compareEnabled()) { set_bt_compare(&customCompare); } - + PropertiesPtr properties = _communicator->getProperties(); string propPrefix = "Freeze.Map." + _dbName + "."; - + int btreeMinKey = properties->getPropertyAsInt(propPrefix + "BtreeMinKey"); if(btreeMinKey > 2) { @@ -153,7 +153,7 @@ Freeze::MapDb::MapDb(const ConnectionIPtr& connection, } set_bt_minkey(btreeMinKey); } - + bool checksum = properties->getPropertyAsInt(propPrefix + "Checksum") > 0; if(checksum) { @@ -162,10 +162,10 @@ Freeze::MapDb::MapDb(const ConnectionIPtr& connection, Trace out(_communicator->getLogger(), "Freeze.Map"); out << "Turning checksum on for \"" << _dbName << "\""; } - + set_flags(DB_CHKSUM); } - + int pageSize = properties->getPropertyAsInt(propPrefix + "PageSize"); if(pageSize > 0) { @@ -176,10 +176,10 @@ Freeze::MapDb::MapDb(const ConnectionIPtr& connection, } set_pagesize(pageSize); } - + DbTxn* txn = getTxn(tx); - + u_int32_t flags = DB_THREAD; if(createDb) { @@ -191,12 +191,12 @@ Freeze::MapDb::MapDb(const ConnectionIPtr& connection, // open(txn, nativeToUTF8(_dbName, getProcessStringConverter()).c_str(), 0, DB_BTREE, flags, FREEZE_DB_MODE); - + StringSeq oldIndices; StringSeq newIndices; size_t oldSize = 0; CatalogIndexList catalogIndexList(connection, _catalogIndexListName); - + if(createDb) { CatalogIndexList::iterator cil = catalogIndexList.find(_dbName); @@ -205,17 +205,17 @@ Freeze::MapDb::MapDb(const ConnectionIPtr& connection, oldIndices = cil->second; oldSize = oldIndices.size(); } - } - + } + for(vector::const_iterator p = indices.begin(); p != indices.end(); ++p) { - const MapIndexBasePtr& indexBase = *p; + const MapIndexBasePtr& indexBase = *p; assert(indexBase->_impl == 0); assert(indexBase->_communicator == 0); indexBase->_communicator = connection->communicator(); indexBase->_encoding = connection->encoding(); - + IceInternal::UniquePtr indexI; try @@ -233,24 +233,24 @@ Freeze::MapDb::MapDb(const ConnectionIPtr& connection, throw DatabaseException(__FILE__, __LINE__, message); } - + #ifdef NDEBUG _indices.insert(IndexMap::value_type(indexBase->name(), indexI.get())); #else - bool inserted = + bool inserted = _indices.insert(IndexMap::value_type(indexBase->name(), indexI.get())).second; assert(inserted); #endif - + indexBase->_impl = indexI.release(); - + if(createDb) { newIndices.push_back(indexBase->name()); oldIndices.erase(std::remove(oldIndices.begin(), oldIndices.end(), indexBase->name()), oldIndices.end()); } } - + if(ci == catalog.end()) { CatalogData catalogData; @@ -259,7 +259,7 @@ Freeze::MapDb::MapDb(const ConnectionIPtr& connection, catalogData.value = value; catalog.put(Catalog::value_type(_dbName, catalogData)); } - + if(createDb) { // @@ -270,13 +270,13 @@ Freeze::MapDb::MapDb(const ConnectionIPtr& connection, for(StringSeq::const_iterator q = oldIndices.begin(); q != oldIndices.end(); ++q) { const string& index = *q; - + if(_trace >= 1) { Trace out(_communicator->getLogger(), "Freeze.Map"); out << "removing old index \"" << index << "\" on Db \"" << _dbName << "\""; } - + try { connection->removeMapIndex(_dbName, *q); @@ -285,7 +285,7 @@ Freeze::MapDb::MapDb(const ConnectionIPtr& connection, catch(const IndexNotFoundException&) { // Ignored - + if(_trace >= 1) { Trace out(_communicator->getLogger(), "Freeze.Map"); @@ -293,7 +293,7 @@ Freeze::MapDb::MapDb(const ConnectionIPtr& connection, } } } - + if(indexRemoved || oldSize != newIndices.size()) { if(newIndices.size() == 0) @@ -304,7 +304,7 @@ Freeze::MapDb::MapDb(const ConnectionIPtr& connection, Trace out(_communicator->getLogger(), "Freeze.Map"); out << "Removed catalogIndexList entry for Db \"" << _dbName << "\""; } - + } else { @@ -331,7 +331,7 @@ Freeze::MapDb::MapDb(const ConnectionIPtr& connection, if(connection->deadlockWarning()) { Warning out(connection->communicator()->getLogger()); - out << "Deadlock in Freeze::MapDb::MapDb on Map \"" + out << "Deadlock in Freeze::MapDb::MapDb on Map \"" << _dbName << "\"; retrying ..."; } @@ -356,7 +356,7 @@ Freeze::MapDb::MapDb(const ConnectionIPtr& connection, { } } - + string message = "Error while opening Db \"" + _dbName + "\": " + dx.what(); @@ -365,7 +365,7 @@ Freeze::MapDb::MapDb(const ConnectionIPtr& connection, catch(...) { if(ownTx && tx != 0) - { + { try { tx->rollback(); @@ -379,11 +379,11 @@ Freeze::MapDb::MapDb(const ConnectionIPtr& connection, } } -Freeze::MapDb::MapDb(const Ice::CommunicatorPtr& communicator, +Freeze::MapDb::MapDb(const Ice::CommunicatorPtr& communicator, const Ice::EncodingVersion& encoding, - const string& dbName, - const string& keyTypeId, - const string& valueTypeId, + const string& dbName, + const string& keyTypeId, + const string& valueTypeId, DbEnv* env) : Db(env, 0), _communicator(communicator), @@ -403,7 +403,7 @@ Freeze::MapDb::MapDb(const Ice::CommunicatorPtr& communicator, { PropertiesPtr properties = _communicator->getProperties(); string propPrefix = "Freeze.Map." + _dbName + "."; - + int btreeMinKey = properties->getPropertyAsInt(propPrefix + "BtreeMinKey"); if(btreeMinKey > 2) { @@ -414,7 +414,7 @@ Freeze::MapDb::MapDb(const Ice::CommunicatorPtr& communicator, } set_bt_minkey(btreeMinKey); } - + bool checksum = properties->getPropertyAsInt(propPrefix + "Checksum") > 0; if(checksum) { @@ -426,7 +426,7 @@ Freeze::MapDb::MapDb(const Ice::CommunicatorPtr& communicator, set_flags(DB_CHKSUM); } - + int pageSize = properties->getPropertyAsInt(propPrefix + "PageSize"); if(pageSize > 0) { @@ -458,7 +458,7 @@ Freeze::MapDb::connectIndices(const vector& indices) const for(vector::const_iterator p = indices.begin(); p != indices.end(); ++p) { - const MapIndexBasePtr& indexBase = *p; + const MapIndexBasePtr& indexBase = *p; assert(indexBase->_impl == 0); IndexMap::const_iterator q = _indices.find(indexBase->name()); diff --git a/cpp/src/Freeze/MapDb.h b/cpp/src/Freeze/MapDb.h index b5223f13..b0038589 100644 --- a/cpp/src/Freeze/MapDb.h +++ b/cpp/src/Freeze/MapDb.h @@ -22,25 +22,25 @@ class MapDb; class MapIndexI { public: - + MapIndexI(const ConnectionIPtr&, MapDb&, DbTxn*, bool, const MapIndexBasePtr&); ~MapIndexI(); - + IteratorHelper* begin(bool, const MapHelperI&) const; IteratorHelper* untypedFind(const Key&, bool, const MapHelperI&, bool) const; IteratorHelper* untypedLowerBound(const Key&, bool, const MapHelperI&) const; IteratorHelper* untypedUpperBound(const Key&, bool, const MapHelperI&) const; int untypedCount(const Key&, const ConnectionIPtr&) const; - + int secondaryKeyCreate(Db*, const Dbt*, const Dbt*, Dbt*); const std::string& name() const { return _index->name(); } - + Db* db() const { return _db.get(); @@ -67,17 +67,17 @@ class MapIndexI class MapDb : public ::Db { public: - + MapDb(const ConnectionIPtr&, const std::string&, const std::string&, const std::string&, const KeyCompareBasePtr&, const std::vector&, bool); - + // // The constructor for catalogs // - MapDb(const Ice::CommunicatorPtr&, const Ice::EncodingVersion&, const std::string&, const std::string&, + MapDb(const Ice::CommunicatorPtr&, const Ice::EncodingVersion&, const std::string&, const std::string&, const std::string&, DbEnv*); - + ~MapDb(); void connectIndices(const std::vector&) const; @@ -104,7 +104,7 @@ class MapDb : public ::Db IndexMap _indices; }; -inline const std::string& +inline const std::string& MapDb::dbName() const { return _dbName; diff --git a/cpp/src/Freeze/SharedDbEnv.cpp b/cpp/src/Freeze/SharedDbEnv.cpp index b684db79..385d0e18 100644 --- a/cpp/src/Freeze/SharedDbEnv.cpp +++ b/cpp/src/Freeze/SharedDbEnv.cpp @@ -272,7 +272,7 @@ Freeze::SharedDbEnv::removeSharedMapDb(const string& dbName) } -void +void Freeze::SharedDbEnv::__incRef() { IceUtilInternal::MutexPtrLock lock(refCountMutex); diff --git a/cpp/src/Freeze/SharedDbEnv.h b/cpp/src/Freeze/SharedDbEnv.h index a134253d..3a487398 100644 --- a/cpp/src/Freeze/SharedDbEnv.h +++ b/cpp/src/Freeze/SharedDbEnv.h @@ -37,7 +37,7 @@ typedef IceUtil::Handle TransactionalEvictorContext class SharedDbEnv { public: - + static SharedDbEnvPtr get(const Ice::CommunicatorPtr&, const std::string&, DbEnv* = 0); ~SharedDbEnv(); @@ -53,10 +53,10 @@ class SharedDbEnv // void removeSharedMapDb(const std::string&); - + void __incRef(); void __decRef(); - + // // EvictorContext factory/manager // @@ -73,7 +73,7 @@ class SharedDbEnv private: SharedDbEnv(const std::string&, const Ice::CommunicatorPtr&, DbEnv* env); - + void cleanup(); DbEnv* _env; @@ -102,22 +102,22 @@ class SharedDbEnv inline DbEnv* SharedDbEnv::getEnv() const { - return _env; + return _env; } -inline const std::string& +inline const std::string& SharedDbEnv::getEnvName() const { return _envName; } -inline const Ice::CommunicatorPtr& +inline const Ice::CommunicatorPtr& SharedDbEnv::getCommunicator() const { return _communicator; } -inline const Ice::EncodingVersion& +inline const Ice::EncodingVersion& SharedDbEnv::getEncoding() const { return _encoding; diff --git a/cpp/src/Freeze/TransactionHolder.cpp b/cpp/src/Freeze/TransactionHolder.cpp index 924fcdb9..2ffbb1ca 100644 --- a/cpp/src/Freeze/TransactionHolder.cpp +++ b/cpp/src/Freeze/TransactionHolder.cpp @@ -8,7 +8,7 @@ using namespace Freeze; -Freeze::TransactionHolder::TransactionHolder(const ConnectionPtr& connection) +Freeze::TransactionHolder::TransactionHolder(const ConnectionPtr& connection) : _transaction(0) { if(connection->currentTransaction() == 0) diff --git a/cpp/src/Freeze/TransactionI.cpp b/cpp/src/Freeze/TransactionI.cpp index c5f982af..aa46ed94 100644 --- a/cpp/src/Freeze/TransactionI.cpp +++ b/cpp/src/Freeze/TransactionI.cpp @@ -26,9 +26,9 @@ Freeze::TransactionI::commit() { throw DatabaseException(__FILE__, __LINE__, "inactive transaction"); } - + long txnId = 0; - + try { _connection->closeAllIterators(); @@ -106,7 +106,7 @@ Freeze::TransactionI::rollbackInternal(bool warning) try { _connection->closeAllIterators(); - + if(_txTrace >= 1 || (warning && _warnRollback)) { txnId = (_txn->id() & 0x7FFFFFFF) + 0x80000000L; @@ -117,9 +117,9 @@ Freeze::TransactionI::rollbackInternal(bool warning) << " due to destruction.\nApplication code should explicitly call rollback or commit."; } } - + _txn->abort(); - + if(_txTrace >= 1) { Trace out(_communicator->getLogger(), "Freeze.Transaction"); @@ -133,7 +133,7 @@ Freeze::TransactionI::rollbackInternal(bool warning) Trace out(_communicator->getLogger(), "Freeze.Transaction"); out << "failed to rollback transaction " << hex << txnId << dec << ": " << dx.what(); } - + DeadlockException deadlockException(__FILE__, __LINE__, dx.what(), this); postCompletion(false, true); @@ -148,7 +148,7 @@ Freeze::TransactionI::rollbackInternal(bool warning) Trace out(_communicator->getLogger(), "Freeze.Transaction"); out << "failed to rollback transaction " << hex << txnId << dec << ": " << dx.what(); } - + postCompletion(false, false); // After postCompletion is called the transaction may be // dead. Beware! @@ -202,7 +202,7 @@ Freeze::TransactionI::setPostCompletionCallback(const Freeze::PostCompletionCall { _postCompletionCallback = cb; } - + // // The constructor takes a ConnectionI* instead of a ConnectionIPtr // because we have to ensure there is no call to __decRef while the @@ -243,7 +243,7 @@ Freeze::TransactionI::TransactionI(ConnectionI* connection) : } } - + Freeze::TransactionI::~TransactionI() { assert(_txn == 0); @@ -269,7 +269,7 @@ Freeze::TransactionI::postCompletion(bool committed, bool deadlock) { PostCompletionCallbackPtr cb = _postCompletionCallback; _postCompletionCallback = 0; - + cb->postCompletion(committed, deadlock, _connection->dbEnv()); } diff --git a/cpp/src/Freeze/TransactionI.h b/cpp/src/Freeze/TransactionI.h index 3ccb3426..4fe24101 100644 --- a/cpp/src/Freeze/TransactionI.h +++ b/cpp/src/Freeze/TransactionI.h @@ -41,7 +41,7 @@ class TransactionI : public Transaction virtual ConnectionPtr getConnection() const; - + // // Custom refcounting implementation // @@ -54,7 +54,7 @@ class TransactionI : public Transaction TransactionI(ConnectionI*); ~TransactionI(); - + DbTxn* dbTxn() const { @@ -64,9 +64,9 @@ class TransactionI : public Transaction private: friend class ConnectionI; - + int getRefNoSync() const; - + void postCompletion(bool, bool); const Ice::CommunicatorPtr _communicator; diff --git a/cpp/src/Freeze/TransactionalEvictorContext.h b/cpp/src/Freeze/TransactionalEvictorContext.h index c873b4ff..f3ed39a1 100644 --- a/cpp/src/Freeze/TransactionalEvictorContext.h +++ b/cpp/src/Freeze/TransactionalEvictorContext.h @@ -29,7 +29,7 @@ class TransactionalEvictorContext : public Ice::DispatchInterceptorAsyncCallback class ServantHolder { public: - + ServantHolder(); ~ServantHolder() ICE_NOEXCEPT_FALSE; @@ -80,7 +80,7 @@ class TransactionalEvictorContext : public Ice::DispatchInterceptorAsyncCallback public: ToInvalidate(const Ice::Identity&, ObjectStore*); - + static void invalidate(ToInvalidate*); static void destroy(ToInvalidate*); @@ -119,9 +119,9 @@ class TransactionalEvictorContext : public Ice::DispatchInterceptorAsyncCallback { return _tx; } - + private: - + friend class ServantHolder; ServantHolder::Body* findServantHolderBody(const Ice::Identity&, ObjectStore*) const; @@ -133,7 +133,7 @@ class TransactionalEvictorContext : public Ice::DispatchInterceptorAsyncCallback // typedef std::deque Stack; Stack _stack; - + // // List of objects to invalidate from the caches upon commit // @@ -144,7 +144,7 @@ class TransactionalEvictorContext : public Ice::DispatchInterceptorAsyncCallback IceInternal::UniquePtr _deadlockException; IceInternal::UniquePtr _nestedCallDeadlockException; - + // // Protected by this // diff --git a/cpp/src/Freeze/TransactionalEvictorI.h b/cpp/src/Freeze/TransactionalEvictorI.h index b05c2d1d..a71aec2e 100644 --- a/cpp/src/Freeze/TransactionalEvictorI.h +++ b/cpp/src/Freeze/TransactionalEvictorI.h @@ -38,8 +38,8 @@ class TransactionalEvictorElement : public Ice::LocalObject return _stale; } -private: - +private: + friend class TransactionalEvictorI; const Ice::ObjectPtr _servant; @@ -67,9 +67,9 @@ class TransactionalEvictorI : public TransactionalEvictor, public EvictorI&, bool); - + virtual ~TransactionalEvictorI(); virtual TransactionPtr getCurrentTransaction() const; @@ -81,7 +81,7 @@ class TransactionalEvictorI : public TransactionalEvictor, public EvictorI*); protected: - + virtual bool hasAnotherFacet(const Ice::Identity&, const std::string&); - + virtual Ice::ObjectPtr locateImpl(const Ice::Current&, Ice::LocalObjectPtr&); - + virtual void evict(); private: diff --git a/cpp/src/Freeze/Util.cpp b/cpp/src/Freeze/Util.cpp index c1323134..1816b8fa 100644 --- a/cpp/src/Freeze/Util.cpp +++ b/cpp/src/Freeze/Util.cpp @@ -12,15 +12,15 @@ using namespace Ice; using namespace std; void -Freeze::handleDbException(const DbException& dx, +Freeze::handleDbException(const DbException& dx, const char* file, int line) { throw DatabaseException(file, line, dx.what()); } void -Freeze::handleDbException(const DbException& dx, - Key& key, Dbt& dbKey, +Freeze::handleDbException(const DbException& dx, + Key& key, Dbt& dbKey, const char* file, int line) { bool bufferSmallException = @@ -28,8 +28,8 @@ Freeze::handleDbException(const DbException& dx, (dx.get_errno() == ENOMEM); #else (dx.get_errno() == DB_BUFFER_SMALL || dx.get_errno() == ENOMEM); -#endif - +#endif + if(bufferSmallException && (dbKey.get_size() > dbKey.get_ulen())) { // @@ -48,8 +48,8 @@ Freeze::handleDbException(const DbException& dx, } void -Freeze::handleDbException(const DbException& dx, - Key& key, Dbt& dbKey, +Freeze::handleDbException(const DbException& dx, + Key& key, Dbt& dbKey, Value& value, Dbt& dbValue, const char* file, int line) { @@ -58,9 +58,9 @@ Freeze::handleDbException(const DbException& dx, (dx.get_errno() == ENOMEM); #else (dx.get_errno() == DB_BUFFER_SMALL || dx.get_errno() == ENOMEM); -#endif +#endif - bool resized = false; + bool resized = false; if(bufferSmallException) { if(dbKey.get_size() > dbKey.get_ulen()) @@ -71,7 +71,7 @@ Freeze::handleDbException(const DbException& dx, dbKey.set_size(static_cast(oldKeySize)); resized = true; } - + if(dbValue.get_size() > dbValue.get_ulen()) { value.resize(dbValue.get_size()); @@ -79,7 +79,7 @@ Freeze::handleDbException(const DbException& dx, resized = true; } } - + if(!resized) { handleDbException(dx, file, line); diff --git a/cpp/src/FreezeScript/Functions.cpp b/cpp/src/FreezeScript/Functions.cpp index 9f0b878e..73ebff7c 100644 --- a/cpp/src/FreezeScript/Functions.cpp +++ b/cpp/src/FreezeScript/Functions.cpp @@ -13,7 +13,7 @@ using namespace std; bool FreezeScript::invokeGlobalFunction(const Ice::CommunicatorPtr& communicator, const string& name, const DataList& args, - DataPtr& result, const DataFactoryPtr& factory, + DataPtr& result, const DataFactoryPtr& factory, const ErrorReporterPtr& errorReporter) { // diff --git a/cpp/src/FreezeScript/Util.cpp b/cpp/src/FreezeScript/Util.cpp index a5fe9ae6..c7a02550 100644 --- a/cpp/src/FreezeScript/Util.cpp +++ b/cpp/src/FreezeScript/Util.cpp @@ -187,7 +187,7 @@ FreezeScript::parseSlice(const string& n, const Slice::UnitPtr& u, const vector< if(!icecpp->close()) { - return false; + return false; } if(status != EXIT_SUCCESS) diff --git a/cpp/src/FreezeScript/Util.h b/cpp/src/FreezeScript/Util.h index 9e908bce..03755119 100644 --- a/cpp/src/FreezeScript/Util.h +++ b/cpp/src/FreezeScript/Util.h @@ -52,7 +52,7 @@ std::string typeName(const Slice::TypePtr&); std::string typeToString(const Slice::TypePtr&); bool ignoreType(const std::string&); void createEvictorSliceTypes(const Slice::UnitPtr&); -bool parseSlice(const std::string&, const Slice::UnitPtr&, const std::vector&, +bool parseSlice(const std::string&, const Slice::UnitPtr&, const std::vector&, const std::vector&, bool, const std::string&); typedef std::map CatalogDataMap; diff --git a/cpp/src/slice2freezej/Main.cpp b/cpp/src/slice2freezej/Main.cpp index 21064071..18a5db56 100644 --- a/cpp/src/slice2freezej/Main.cpp +++ b/cpp/src/slice2freezej/Main.cpp @@ -1782,7 +1782,7 @@ compile(int argc, char* argv[]) string dependFile = opts.optArg("depend-file"); bool debug = opts.isSet("debug"); - + bool ice = opts.isSet("ice"); bool underscore = opts.isSet("underscore"); diff --git a/cpp/test/Freeze/complex/Parser.cpp b/cpp/test/Freeze/complex/Parser.cpp index 5287bd92..f0c38735 100644 --- a/cpp/test/Freeze/complex/Parser.cpp +++ b/cpp/test/Freeze/complex/Parser.cpp @@ -62,7 +62,7 @@ Parser::error(const std::string& s) } // -// With older flex version <= 2.5.35 YY_INPUT second +// With older flex version <= 2.5.35 YY_INPUT second // paramenter is of type int&, in newer versions it // changes to size_t& // diff --git a/cpp/test/Freeze/complex/Parser.h b/cpp/test/Freeze/complex/Parser.h index d3a8ee72..bbc1cf25 100644 --- a/cpp/test/Freeze/complex/Parser.h +++ b/cpp/test/Freeze/complex/Parser.h @@ -63,10 +63,10 @@ class Parser void error(const std::string&); // - // With older flex version <= 2.5.35 YY_INPUT second + // With older flex version <= 2.5.35 YY_INPUT second // paramenter is of type int&, in newer versions it // changes to size_t& - // + // void getInput(char*, int&, size_t); void getInput(char*, size_t&, size_t); void setResult(const Complex::NodePtr&); diff --git a/cpp/test/Freeze/evictor/Client.cpp b/cpp/test/Freeze/evictor/Client.cpp index 92ac03dd..e6630769 100644 --- a/cpp/test/Freeze/evictor/Client.cpp +++ b/cpp/test/Freeze/evictor/Client.cpp @@ -21,7 +21,7 @@ class ReadThread : public Thread _servants(servants) { } - + virtual void run() { @@ -41,7 +41,7 @@ class ReadThread : public Thread { test(false); } - + for(int i = 1; i < static_cast(_servants.size()); ++i) { test(_servants[i]->getValue() == i); @@ -64,7 +64,7 @@ class ReadForeverThread : public Thread, public IceUtil::MonitorgetServant(id); servant->destroy(); - + // // Twice // @@ -296,7 +296,7 @@ class CreateDestroyThread : public Thread else { Test::ServantPrx servant = _evictor->createServant(id, i); - + // // Twice // @@ -358,7 +358,7 @@ class TransferThread : public Thread _accounts(accounts) { } - + void run() { @@ -372,22 +372,22 @@ class TransferThread : public Thread // if(IceUtil::Time::now() - now > IceUtil::Time::seconds(60)) { - cerr << "warning: exiting transfer thread after one minute and " << i << " iterations" << endl; + cerr << "warning: exiting transfer thread after one minute and " << i << " iterations" << endl; break; } // - // Transfer 100 at random between two distinct accounts + // Transfer 100 at random between two distinct accounts // Test::AccountPrx from = _accounts[IceUtilInternal::random(static_cast(_accounts.size()))]; - + Test::AccountPrx to; do { to = _accounts[IceUtilInternal::random(static_cast(_accounts.size()))]; } while(from == to); - + try { @@ -438,7 +438,7 @@ class TransferThread : public Thread // test(false); } - + /* if(i % 100 == 0) { @@ -452,7 +452,7 @@ class TransferThread : public Thread Test::AccountPrxSeq _accounts; }; - + int @@ -471,16 +471,16 @@ run(int, char**, const Ice::CommunicatorPtr& communicator, bool transactional, b { cout << "testing background-save Freeze Evictor... " << flush; } - + const Ice::Int size = 5; Ice::Int i; - + Test::RemoteEvictorPrx evictor = factory->createEvictor("Test", transactional); - + evictor->setSize(size); - + // - // Create some servants + // Create some servants // vector servants; for(i = 0; i < size; i++) @@ -490,7 +490,7 @@ run(int, char**, const Ice::CommunicatorPtr& communicator, bool transactional, b string id = ostr.str(); servants.push_back(evictor->createServant(id, i)); servants[i]->ice_ping(); - + Test::FacetPrx facet1 = Test::FacetPrx::uncheckedCast(servants[i], "facet1"); try { @@ -512,7 +512,7 @@ run(int, char**, const Ice::CommunicatorPtr& communicator, bool transactional, b test(facet2); facet2->setValue(100 * i); } - + // // Evict and verify values. // @@ -529,7 +529,7 @@ run(int, char**, const Ice::CommunicatorPtr& communicator, bool transactional, b test(facet2); test(facet2->getData() == "moreData"); } - + // // Mutate servants. // @@ -543,7 +543,7 @@ run(int, char**, const Ice::CommunicatorPtr& communicator, bool transactional, b test(facet2); facet2->setValue(100 * i + 100); } - + // // Evict and verify values. // @@ -562,7 +562,7 @@ run(int, char**, const Ice::CommunicatorPtr& communicator, bool transactional, b if(!transactional) { - // + // // Test saving while busy // for(i = 0; i < size; i++) @@ -571,7 +571,7 @@ run(int, char**, const Ice::CommunicatorPtr& communicator, bool transactional, b // Start a mutating operation so that the object is not idle. // servants[i]->begin_setValueAsync(i + 300); - + test(servants[i]->getValue() == i + 100); // // This operation modifies the object state but is not saved @@ -579,7 +579,7 @@ run(int, char**, const Ice::CommunicatorPtr& communicator, bool transactional, b // servants[i]->setValue(i + 200); test(servants[i]->getValue() == i + 200); - + // // Force the response to setValueAsync // @@ -590,7 +590,7 @@ run(int, char**, const Ice::CommunicatorPtr& communicator, bool transactional, b // // Add duplicate facet and catch corresponding exception - // + // for(i = 0; i < size; i++) { try @@ -602,10 +602,10 @@ run(int, char**, const Ice::CommunicatorPtr& communicator, bool transactional, b { } } - + // // Remove a facet that does not exist - // + // try { servants[0]->removeFacet("facet3"); @@ -617,7 +617,7 @@ run(int, char**, const Ice::CommunicatorPtr& communicator, bool transactional, b // // Call an operation that does not exist on the servant - // + // try { Test::AccountPrx::uncheckedCast(servants[0])->getBalance(); @@ -626,7 +626,7 @@ run(int, char**, const Ice::CommunicatorPtr& communicator, bool transactional, b catch(const Ice::OperationNotExistException&) { } - + // // Remove all facets // @@ -676,10 +676,10 @@ run(int, char**, const Ice::CommunicatorPtr& communicator, bool transactional, b // Expected } } - + // // Recreate servants, set transient value - // + // servants.clear(); for(i = 0; i < size; i++) { @@ -689,14 +689,14 @@ run(int, char**, const Ice::CommunicatorPtr& communicator, bool transactional, b servants.push_back(evictor->createServant(id, i)); servants[i]->setTransientValue(i); } - + // // Evict all // evictor->saveNow(); evictor->setSize(0); evictor->setSize(size); - + // // Check the transient value // @@ -707,7 +707,7 @@ run(int, char**, const Ice::CommunicatorPtr& communicator, bool transactional, b if(!transactional) { - + // // Now with keep // @@ -720,8 +720,8 @@ run(int, char**, const Ice::CommunicatorPtr& communicator, bool transactional, b evictor->saveNow(); evictor->setSize(0); evictor->setSize(size); - - + + // // Check the transient value // @@ -782,7 +782,7 @@ run(int, char**, const Ice::CommunicatorPtr& communicator, bool transactional, b { int totalBalance = servants[0]->getTotalBalance(); test(totalBalance == 0); - + Test::AccountPrxSeq accounts = servants[0]->getAccounts(); test(accounts.size() > 0); @@ -790,7 +790,7 @@ run(int, char**, const Ice::CommunicatorPtr& communicator, bool transactional, b test(totalBalance > 0); const int threadCount = static_cast(accounts.size()); - + vector threads(threadCount); for(i = 0; i < threadCount; i++) { @@ -802,19 +802,19 @@ run(int, char**, const Ice::CommunicatorPtr& communicator, bool transactional, b { threads[i]->getThreadControl().join(); } - + // // Check that the total balance did not change! // test(totalBalance == servants[0]->getTotalBalance()); } - + // // Deactivate and recreate evictor, to ensure that servants // are restored properly after database close and reopen. // evictor->deactivate(); - + evictor = factory->createEvictor("Test", transactional); evictor->setSize(size); @@ -837,20 +837,20 @@ run(int, char**, const Ice::CommunicatorPtr& communicator, bool transactional, b { const int threadCount = size * 2; - + ThreadPtr threads[threadCount]; for(i = 0; i < threadCount; i++) { threads[i] = new ReadThread(servants); threads[i]->start(); } - + for(i = 0; i < threadCount; i++) { threads[i]->getThreadControl().join(); } } - + // // Clean up. // @@ -863,14 +863,14 @@ run(int, char**, const Ice::CommunicatorPtr& communicator, bool transactional, b // { const int threadCount = size;; - + ThreadPtr threads[threadCount]; for(i = 0; i < threadCount; i++) { threads[i] = new CreateDestroyThread(evictor, i, size); threads[i]->start(); } - + for(i = 0; i < threadCount; i++) { threads[i]->getThreadControl().join(); @@ -878,8 +878,8 @@ run(int, char**, const Ice::CommunicatorPtr& communicator, bool transactional, b // // Verify all destroyed - // - for(i = 0; i < size; i++) + // + for(i = 0; i < size; i++) { try { @@ -895,7 +895,7 @@ run(int, char**, const Ice::CommunicatorPtr& communicator, bool transactional, b // // Recreate servants. - // + // servants.clear(); for(i = 0; i < size; i++) { @@ -911,7 +911,7 @@ run(int, char**, const Ice::CommunicatorPtr& communicator, bool transactional, b // { const int threadCount = size; - + ReadForeverThreadPtr threads[threadCount]; for(i = 0; i < threadCount; i++) { @@ -947,7 +947,7 @@ run(int, char**, const Ice::CommunicatorPtr& communicator, bool transactional, b // { const int threadCount = size; - + AddForeverThreadPtr threads[threadCount]; for(i = 0; i < threadCount; i++) { @@ -965,14 +965,14 @@ run(int, char**, const Ice::CommunicatorPtr& communicator, bool transactional, b { threads[i]->setState(AddForeverThread::StateDeactivated); } - + for(i = 0; i < threadCount; i++) { threads[i]->getThreadControl().join(); } } - - + + // // Clean up. // @@ -986,7 +986,7 @@ run(int, char**, const Ice::CommunicatorPtr& communicator, bool transactional, b { factory->shutdown(); } - + return EXIT_SUCCESS; } diff --git a/cpp/test/Freeze/evictor/Test.ice b/cpp/test/Freeze/evictor/Test.ice index 57cc7c44..9f842114 100644 --- a/cpp/test/Freeze/evictor/Test.ice +++ b/cpp/test/Freeze/evictor/Test.ice @@ -41,7 +41,7 @@ exception InsufficientFundsException ["freeze:write", "amd"] void transfer2(int amount, Account* toAccount) throws InsufficientFundsException; ["freeze:write", "amd"] void transfer3(int amount, Account* toAccount) throws InsufficientFundsException; - + // // "Internal" operation @@ -94,7 +94,7 @@ interface RemoteEvictor { idempotent void setSize(int size); - Servant* createServant(string id, int value) + Servant* createServant(string id, int value) throws AlreadyRegisteredException, EvictorDeactivatedException; idempotent Servant* getServant(string id); diff --git a/cpp/test/Freeze/evictor/TestI.cpp b/cpp/test/Freeze/evictor/TestI.cpp index e5eb78a4..71f6a64b 100644 --- a/cpp/test/Freeze/evictor/TestI.cpp +++ b/cpp/test/Freeze/evictor/TestI.cpp @@ -19,10 +19,10 @@ Test::AccountI::getBalance(const Current&) { return balance; } - -void + +void Test::AccountI::deposit(int amount, const Current&) -{ +{ // // No need to synchronize since everything occurs within its own transaction // @@ -34,7 +34,7 @@ Test::AccountI::deposit(int amount, const Current&) balance = newBalance; } -void +void Test::AccountI::transfer(int amount, const Test::AccountPrx& toAccount, const Current& current) { test(_evictor->getCurrentTransaction() != 0); @@ -43,7 +43,7 @@ Test::AccountI::transfer(int amount, const Test::AccountPrx& toAccount, const Cu deposit(-amount, current); // direct call } -void +void Test::AccountI::transfer2_async(const AMD_Account_transfer2Ptr& cb, int amount, const Test::AccountPrx& toAccount, const Current& current) { // @@ -61,14 +61,14 @@ Test::AccountI::transfer2_async(const AMD_Account_transfer2Ptr& cb, int amount, cb->ice_exception(ex); return; } - + cb->ice_response(); } class ResponseThread : public IceUtil::Thread, private IceUtil::Monitor { public: - + ResponseThread(const Test::AMD_Account_transfer3Ptr& cb) : _cb(cb), _response(false), @@ -127,7 +127,7 @@ class ResponseThread : public IceUtil::Thread, private IceUtil::Monitorice_exception(Ice::TimeoutException(__FILE__, __LINE__)); } } - + private: Test::AMD_Account_transfer3Ptr _cb; bool _response; @@ -140,7 +140,7 @@ typedef IceUtil::Handle ResponseThreadPtr; -void +void Test::AccountI::transfer3_async(const AMD_Account_transfer3Ptr& cb, int amount, const Test::AccountPrx& toAccount, const Current& current) { // @@ -149,7 +149,7 @@ Test::AccountI::transfer3_async(const AMD_Account_transfer3Ptr& cb, int amount, ResponseThreadPtr thread = new ResponseThread(cb); IceUtil::ThreadControl tc = thread->start(33000); - + test(_evictor->getCurrentTransaction() != 0); try @@ -166,7 +166,7 @@ Test::AccountI::transfer3_async(const AMD_Account_transfer3Ptr& cb, int amount, // when the dispatch commits before it gets any response! // _evictor->getCurrentTransaction()->rollback(); - + thread->exception(e); return; @@ -195,7 +195,7 @@ Test::AccountI::AccountI() : { } -void +void Test::AccountI::init(const Freeze::TransactionalEvictorPtr& evictor) { test(_evictor == 0); @@ -212,7 +212,7 @@ class DelayedResponse : public Thread _val(val) { } - + virtual void run() { @@ -491,7 +491,7 @@ class Initializer : public Freeze::ServantInitializer _remoteEvictor = remoteEvictor; _evictor = evictor; } - + virtual void initialize(const ObjectAdapterPtr&, const Identity&, const string&, const ObjectPtr& servant) { @@ -521,9 +521,9 @@ Test::RemoteEvictorI::RemoteEvictorI(const CommunicatorPtr& communicator, const _category(category) { _evictorAdapter = communicator->createObjectAdapterWithEndpoints(Ice::generateUUID(), "default"); - + Initializer* initializer = new Initializer; - + if(transactional) { _evictor = Freeze::createTransactionalEvictor(_evictorAdapter, envName, category, Freeze::FacetTypeMap(), initializer); @@ -626,8 +626,8 @@ Test::RemoteEvictorFactoryI::RemoteEvictorFactoryI(const std::string& envName) : ::Test::RemoteEvictorPrx Test::RemoteEvictorFactoryI::createEvictor(const string& name, bool transactional, const Current& current) { - RemoteEvictorIPtr remoteEvictor = - new RemoteEvictorI(current.adapter->getCommunicator(), _envName, name, transactional); + RemoteEvictorIPtr remoteEvictor = + new RemoteEvictorI(current.adapter->getCommunicator(), _envName, name, transactional); return RemoteEvictorPrx::uncheckedCast( current.adapter->add(remoteEvictor, Ice::stringToIdentity(name))); } diff --git a/cpp/test/Freeze/evictor/TestI.h b/cpp/test/Freeze/evictor/TestI.h index 6411b230..95b463e7 100644 --- a/cpp/test/Freeze/evictor/TestI.h +++ b/cpp/test/Freeze/evictor/TestI.h @@ -25,7 +25,7 @@ class AccountI : public Account public: virtual int getBalance(const Ice::Current&); - + virtual void deposit(int, const Ice::Current&); virtual void transfer(int, const Test::AccountPrx&, const Ice::Current&); @@ -58,10 +58,10 @@ class ServantI : public virtual Servant, public IceUtil::AbstractMutexIdestroy(); diff --git a/cpp/test/Freeze/fileLock/ClientFail.cpp b/cpp/test/Freeze/fileLock/ClientFail.cpp index f4262359..37dea173 100644 --- a/cpp/test/Freeze/fileLock/ClientFail.cpp +++ b/cpp/test/Freeze/fileLock/ClientFail.cpp @@ -17,7 +17,7 @@ main(int argc, char* argv[]) { int status = EXIT_SUCCESS; Ice::CommunicatorPtr communicator; - + string envName = "db"; communicator = Ice::initialize(argc, argv); @@ -26,7 +26,7 @@ main(int argc, char* argv[]) envName = argv[1]; envName += "/db"; } - + { Freeze::ConnectionPtr connection; try @@ -49,7 +49,7 @@ main(int argc, char* argv[]) test(false); } } - + try { communicator->destroy(); diff --git a/cpp/test/FreezeScript/dbmap/Makefile.mk b/cpp/test/FreezeScript/dbmap/Makefile.mk index 442d1051..62d7e0c8 100644 --- a/cpp/test/FreezeScript/dbmap/Makefile.mk +++ b/cpp/test/FreezeScript/dbmap/Makefile.mk @@ -11,7 +11,7 @@ $(test)_makedb_sources := TestOld.ice \ $(test)_makedb_slice2freeze := IntSMap -$(test)_makedb_IntSMap := --dict IntSMap,int,::Test::S +$(test)_makedb_IntSMap := --dict IntSMap,int,::Test::S $(test)_makedb_IntSMap_slice := $(test)/TestOld.ice tests += $(test) diff --git a/cpp/test/FreezeScript/dbmap/check.xml b/cpp/test/FreezeScript/dbmap/check.xml index 3205258f..23403fa7 100644 --- a/cpp/test/FreezeScript/dbmap/check.xml +++ b/cpp/test/FreezeScript/dbmap/check.xml @@ -3,10 +3,10 @@ - + - + diff --git a/cpp/test/FreezeScript/dbmap/init.xml b/cpp/test/FreezeScript/dbmap/init.xml index 994d75b0..0d039d4c 100644 --- a/cpp/test/FreezeScript/dbmap/init.xml +++ b/cpp/test/FreezeScript/dbmap/init.xml @@ -3,10 +3,10 @@ - + - + diff --git a/cpp/test/FreezeScript/dbmap/makedb.cpp b/cpp/test/FreezeScript/dbmap/makedb.cpp index 6bcc8a44..895cfbe7 100644 --- a/cpp/test/FreezeScript/dbmap/makedb.cpp +++ b/cpp/test/FreezeScript/dbmap/makedb.cpp @@ -29,7 +29,7 @@ main(int argc, char* argv[]) { int status; Ice::CommunicatorPtr communicator; - + string envName = "db"; try @@ -41,7 +41,7 @@ main(int argc, char* argv[]) envName += "/"; envName += "db"; } - + status = run(communicator, envName, "default.db"); } catch(const Ice::Exception& ex) diff --git a/cpp/test/FreezeScript/evictor/check.xml b/cpp/test/FreezeScript/evictor/check.xml index 28800ff1..0a3ef26e 100644 --- a/cpp/test/FreezeScript/evictor/check.xml +++ b/cpp/test/FreezeScript/evictor/check.xml @@ -16,10 +16,10 @@ - + - + @@ -32,7 +32,7 @@ - + diff --git a/cpp/test/FreezeScript/evictor/transform.xml b/cpp/test/FreezeScript/evictor/transform.xml index b6cb74d1..1d98cb42 100644 --- a/cpp/test/FreezeScript/evictor/transform.xml +++ b/cpp/test/FreezeScript/evictor/transform.xml @@ -10,17 +10,17 @@ --> - + - + - + diff --git a/java/demo/Freeze/casino/Casino.ice b/java/demo/Freeze/casino/Casino.ice index 5ab3e023..5453e45b 100644 --- a/java/demo/Freeze/casino/Casino.ice +++ b/java/demo/Freeze/casino/Casino.ice @@ -13,7 +13,7 @@ module Casino // or wins more // interface Player - { + { // // The number of chips held by this player // @@ -78,13 +78,13 @@ module Casino int getEarnings(); // - // Verify that the total number of chips held by all known players and bets; + // Verify that the total number of chips held by all known players and bets; // match getOutstandingChips(); // ["freeze:read:required"] bool checkAllChips(); // - // Create a new bet with the given amount to join; this bet ends in + // Create a new bet with the given amount to join; this bet ends in // 'lifetime' milliseconds // ["freeze:write"] Bet* createBet(int amount, int lifetime); diff --git a/java/demo/Freeze/casino/CasinoStore.ice b/java/demo/Freeze/casino/CasinoStore.ice index c6a827cf..f129ba22 100644 --- a/java/demo/Freeze/casino/CasinoStore.ice +++ b/java/demo/Freeze/casino/CasinoStore.ice @@ -70,8 +70,8 @@ module CasinoStore // The time when the bet completes (ms since the epoch) // long closeTime; - }; - + }; + class PersistentBank implements Casino::Bank, Winner { // diff --git a/java/demo/Freeze/casino/README.md b/java/demo/Freeze/casino/README.md index 386a6329..f2af68c2 100644 --- a/java/demo/Freeze/casino/README.md +++ b/java/demo/Freeze/casino/README.md @@ -18,12 +18,12 @@ Highlights: - The public interface of the server is specified in Casino.ice; CasinoStore.ice is just an implementation detail of the server. -- This demo uses a transactional evictor per servant type; this +- This demo uses a transactional evictor per servant type; this is more efficient than storing different types of servants in the same Freeze transactional evictor. - Transactions often span servants in several evictors; this works - because all the evictors use the same underlying Berkeley DB + because all the evictors use the same underlying Berkeley DB environment. - The application code does not deal at all with database deadlocks; @@ -39,7 +39,7 @@ Highlights: wins a bet and is destroyed at the same time? Will chips get lost? In fact, there is no issue thanks to Berkeley DB locking: when a bet picks a winner, it invokes an operation on this object - (through a proxy) within a transaction. At this point, if the + (through a proxy) within a transaction. At this point, if the object is still alive, it's locked by the transaction, which - prevents another transaction from acquiring a write lock (for + prevents another transaction from acquiring a write lock (for example, to destroy it). diff --git a/java/demo/Freeze/casino/config.server b/java/demo/Freeze/casino/config.server index a5391de3..d6d89c8c 100644 --- a/java/demo/Freeze/casino/config.server +++ b/java/demo/Freeze/casino/config.server @@ -25,11 +25,11 @@ Freeze.Warn.Deadlocks=1 # # Freeze Evictor Tracing. # -# 0 = No evictor activity trace (default). +# 0 = No evictor activity trace (default). # 1 = Trace Ice object and facet creation and destruction, facet # streaming time, facet saving time, object eviction (every 50 # objects) and evictor deactivation. -# 2 = Also trace object lookups, and all object evictions. +# 2 = Also trace object lookups, and all object evictions. # 3 = Also trace object retrieval from the database. # #Freeze.Trace.Evictor=1 @@ -46,7 +46,7 @@ Freeze.Evictor.db.player.RollbackOnUserException=1 # # Freeze Transaction Tracing. # -# 0 = No transaction activity trace (default). +# 0 = No transaction activity trace (default). # 1 = Trace transaction IDs and commit and rollback activity. # #Freeze.Trace.Transaction=1 diff --git a/java/demo/Freeze/library/LibraryI.java b/java/demo/Freeze/library/LibraryI.java index ce3c200e..ebec9dd5 100644 --- a/java/demo/Freeze/library/LibraryI.java +++ b/java/demo/Freeze/library/LibraryI.java @@ -64,7 +64,7 @@ class LibraryI extends _LibraryDisp newIsbnSeq[length] = description.isbn; _authors.fastPut(description.authors, newIsbnSeq); - + return book; } catch(Freeze.DatabaseException ex) @@ -161,7 +161,7 @@ class LibraryI extends _LibraryDisp String[] isbnSeq = _authors.get(description.authors); assert isbnSeq != null; - + int i; for(i = 0; i < isbnSeq.length; ++i) { @@ -193,7 +193,7 @@ class LibraryI extends _LibraryDisp { System.arraycopy(isbnSeq, i+1, newIsbnSeq, i, isbnSeq.length - i - 1); } - + _authors.fastPut(description.authors, newIsbnSeq); } diff --git a/java/demo/Freeze/library/Scanner.java b/java/demo/Freeze/library/Scanner.java index 09ab0220..8bad13dd 100644 --- a/java/demo/Freeze/library/Scanner.java +++ b/java/demo/Freeze/library/Scanner.java @@ -10,7 +10,7 @@ class Scanner { _parser = p; } - + Token nextToken() { @@ -204,31 +204,31 @@ else if(c == '\\') buf.append(next); break; } - + case 'n': { buf.append('\n'); break; } - + case 'r': { buf.append('\r'); break; } - + case 't': { buf.append('\t'); break; } - + case 'f': { buf.append('\f'); break; } - + default: { buf.append(c); @@ -272,7 +272,7 @@ else if(c == '\\') { } } - + return buf.toString(); } diff --git a/java/demo/Freeze/library/Token.java b/java/demo/Freeze/library/Token.java index b01c9b37..9c62200d 100644 --- a/java/demo/Freeze/library/Token.java +++ b/java/demo/Freeze/library/Token.java @@ -20,16 +20,16 @@ class Token public static final int TOK_SHUTDOWN = 11; public static final int TOK_STRING = 12; public static final int TOK_SEMI = 13; - + int type; String value; - + Token(int t) { type = t; value = null; } - + Token(int t, String v) { type = t; diff --git a/java/demo/Freeze/library/config.collocated b/java/demo/Freeze/library/config.collocated index acaea776..b7b3a9b0 100644 --- a/java/demo/Freeze/library/config.collocated +++ b/java/demo/Freeze/library/config.collocated @@ -21,14 +21,14 @@ Library.Proxy=library:default -h localhost -p 10000 # Don't warn about unknown properties. If this is not set we'll get a # warning about "Library.Proxy" since the Ice run time thinks this is # an OA property due to the Object Adapter "Library". -# +# Ice.Warn.UnknownProperties=0 # # Freeze Map Tracing. # -# 0 = No map activity trace (default). -# 1 = Trace database open and close. +# 0 = No map activity trace (default). +# 1 = Trace database open and close. # 2 = Also trace iterator and transaction operations, and reference # counting of the underlying database. # @@ -37,11 +37,11 @@ Freeze.Trace.Map=1 # # Freeze Evictor Tracing. # -# 0 = No evictor activity trace (default). +# 0 = No evictor activity trace (default). # 1 = Trace Ice object and facet creation and destruction, facet # streaming time, facet saving time, object eviction (every 50 # objects) and evictor deactivation. -# 2 = Also trace object lookups, and all object evictions. +# 2 = Also trace object lookups, and all object evictions. # 3 = Also trace object retrieval from the database. # Freeze.Trace.Evictor=2 diff --git a/java/demo/Freeze/library/config.server b/java/demo/Freeze/library/config.server index 19b4ebe4..b61af751 100644 --- a/java/demo/Freeze/library/config.server +++ b/java/demo/Freeze/library/config.server @@ -14,8 +14,8 @@ EvictorSize=3 # # Freeze Map Tracing. # -# 0 = No map activity trace (default). -# 1 = Trace database open and close. +# 0 = No map activity trace (default). +# 1 = Trace database open and close. # 2 = Also trace iterator and transaction operations, and reference # counting of the underlying database. # @@ -24,11 +24,11 @@ Freeze.Trace.Map=1 # # Freeze Evictor Tracing. # -# 0 = No evictor activity trace (default). +# 0 = No evictor activity trace (default). # 1 = Trace Ice object and facet creation and destruction, facet # streaming time, facet saving time, object eviction (every 50 # objects) and evictor deactivation. -# 2 = Also trace object lookups, and all object evictions. +# 2 = Also trace object lookups, and all object evictions. # 3 = Also trace object retrieval from the database. # Freeze.Trace.Evictor=2 diff --git a/java/demo/Freeze/phonebook/ContactI.java b/java/demo/Freeze/phonebook/ContactI.java index 4a704c60..60f61227 100644 --- a/java/demo/Freeze/phonebook/ContactI.java +++ b/java/demo/Freeze/phonebook/ContactI.java @@ -87,5 +87,5 @@ class ContactI extends Contact } private ContactFactory _factory; - + } diff --git a/java/demo/Freeze/phonebook/Grammar.java b/java/demo/Freeze/phonebook/Grammar.java index fa2478c1..06266e73 100644 --- a/java/demo/Freeze/phonebook/Grammar.java +++ b/java/demo/Freeze/phonebook/Grammar.java @@ -11,7 +11,7 @@ class Grammar _parser = p; _scanner = new Scanner(_parser); } - + void parse() { diff --git a/java/demo/Freeze/phonebook/Parser.java b/java/demo/Freeze/phonebook/Parser.java index 3eca4454..e5926919 100644 --- a/java/demo/Freeze/phonebook/Parser.java +++ b/java/demo/Freeze/phonebook/Parser.java @@ -40,7 +40,7 @@ class Parser error("`add' requires at least one argument (type `help' for more info)"); return; } - + try { for(String name : args) @@ -68,7 +68,7 @@ class Parser error("`find' requires exactly one argument (type `help' for more info)"); return; } - + try { String name = args.get(0); @@ -96,7 +96,7 @@ class Parser } printCurrent(); } - + void printCurrent() { diff --git a/java/demo/Freeze/phonebook/PhoneBookI.java b/java/demo/Freeze/phonebook/PhoneBookI.java index e345fc5e..12126892 100644 --- a/java/demo/Freeze/phonebook/PhoneBookI.java +++ b/java/demo/Freeze/phonebook/PhoneBookI.java @@ -24,7 +24,7 @@ class PhoneBookI extends _PhoneBookDisp // Create a new Contact Servant. // ContactI contact = new ContactI(_contactFactory); - + // // Create a new Ice Object in the evictor, using the new // identity and the new Servant. @@ -77,14 +77,14 @@ class PhoneBookI extends _PhoneBookDisp current.adapter.getCommunicator().shutdown(); } - PhoneBookI(Freeze.Evictor evictor, ContactFactory contactFactory, + PhoneBookI(Freeze.Evictor evictor, ContactFactory contactFactory, NameIndex index) { _evictor = evictor; _contactFactory = contactFactory; _index = index; } - + private Freeze.Evictor _evictor; private ContactFactory _contactFactory; private NameIndex _index; diff --git a/java/demo/Freeze/phonebook/Scanner.java b/java/demo/Freeze/phonebook/Scanner.java index 1f5fcf50..0bbba917 100644 --- a/java/demo/Freeze/phonebook/Scanner.java +++ b/java/demo/Freeze/phonebook/Scanner.java @@ -10,7 +10,7 @@ class Scanner { _parser = p; } - + Token nextToken() { @@ -204,31 +204,31 @@ else if(c == '\\') buf.append(next); break; } - + case 'n': { buf.append('\n'); break; } - + case 'r': { buf.append('\r'); break; } - + case 't': { buf.append('\t'); break; } - + case 'f': { buf.append('\f'); break; } - + default: { buf.append(c); @@ -272,7 +272,7 @@ else if(c == '\\') { } } - + return buf.toString(); } diff --git a/java/demo/Freeze/phonebook/Token.java b/java/demo/Freeze/phonebook/Token.java index 1a0ba6af..1dd4f7ea 100644 --- a/java/demo/Freeze/phonebook/Token.java +++ b/java/demo/Freeze/phonebook/Token.java @@ -20,16 +20,16 @@ class Token public static final int TOK_SHUTDOWN = 11; public static final int TOK_STRING = 12; public static final int TOK_SEMI = 13; - + int type; String value; - + Token(int t) { type = t; value = null; } - + Token(int t, String v) { type = t; diff --git a/java/demo/Freeze/phonebook/config.collocated b/java/demo/Freeze/phonebook/config.collocated index 9be79c92..4247df22 100644 --- a/java/demo/Freeze/phonebook/config.collocated +++ b/java/demo/Freeze/phonebook/config.collocated @@ -21,7 +21,7 @@ PhoneBook.Proxy=phonebook:default -h localhost -p 10000 # Don't warn about unknown properties. If this is not set we'll get a # warning about "PhoneBook.Proxy" since the Ice run time thinks this is # an OA property due to the Object Adapter "PhoneBook". -# +# Ice.Warn.UnknownProperties=0 # @@ -33,11 +33,11 @@ Freeze.Evictor.db.contacts.SavePeriod=10000 # # Freeze Evictor Tracing. # -# 0 = No evictor activity trace (default). +# 0 = No evictor activity trace (default). # 1 = Trace Ice object and facet creation and destruction, facet # streaming time, facet saving time, object eviction (every 50 # objects) and evictor deactivation. -# 2 = Also trace object lookups, and all object evictions. +# 2 = Also trace object lookups, and all object evictions. # 3 = Also trace object retrieval from the database. # Freeze.Trace.Evictor=2 diff --git a/java/demo/Freeze/phonebook/config.server b/java/demo/Freeze/phonebook/config.server index 45e5b9a0..e122f775 100644 --- a/java/demo/Freeze/phonebook/config.server +++ b/java/demo/Freeze/phonebook/config.server @@ -20,11 +20,11 @@ Freeze.Evictor.db.contacts.SavePeriod=10000 # # Freeze Evictor Tracing. # -# 0 = No evictor activity trace (default). +# 0 = No evictor activity trace (default). # 1 = Trace Ice object and facet creation and destruction, facet # streaming time, facet saving time, object eviction (every 50 # objects) and evictor deactivation. -# 2 = Also trace object lookups, and all object evictions. +# 2 = Also trace object lookups, and all object evictions. # 3 = Also trace object retrieval from the database. # Freeze.Trace.Evictor=2 diff --git a/java/demo/Freeze/transform/README.md b/java/demo/Freeze/transform/README.md index 2cdce4e3..793eb677 100644 --- a/java/demo/Freeze/transform/README.md +++ b/java/demo/Freeze/transform/README.md @@ -29,33 +29,33 @@ $ transformdb --old ContactData.ice --new NewContactData.ice db dbnew With a sorted map, the situation is more complicated. transformdb is unaware of the sort order, and as a result transforms the map into -an unsorted map -- or more precisely, a new map sorted using Berkeley -DB's default sort order (comparison of binary strings that correspond +an unsorted map -- or more precisely, a new map sorted using Berkeley +DB's default sort order (comparison of binary strings that correspond to data encoded using the Ice encoding). -The solution, illustrated in this demo, is to recreate the map +The solution, illustrated in this demo, is to recreate the map after the successful transformdb transformation. This demo provides four programs: - Create - Creates or updates the contacts map in the 'db' directory (uses + Creates or updates the contacts map in the 'db' directory (uses the old version of ContactData) - Read - Reads and displays the contents of the contacts map in the 'db' + Reads and displays the contents of the contacts map in the 'db' directory (uses the old version of ContactData) - ReadNew Reads and displays the contents of the contacts map in the 'dbnew' directory (uses the new version of ContactData) - + - Recreate - Recreate the contacts map in the 'dbnew' directory (uses the new + Recreate the contacts map in the 'dbnew' directory (uses the new version of ContactData) diff --git a/java/demo/Freeze/transform/transform.xml b/java/demo/Freeze/transform/transform.xml index 6f36871d..431c4121 100644 --- a/java/demo/Freeze/transform/transform.xml +++ b/java/demo/Freeze/transform/transform.xml @@ -9,5 +9,5 @@ value="oldkey + '@gmail.com'"/> - + diff --git a/java/demo/Manual/evictorFilesystem/config.server b/java/demo/Manual/evictorFilesystem/config.server index 69e536ab..52c11a2d 100644 --- a/java/demo/Manual/evictorFilesystem/config.server +++ b/java/demo/Manual/evictorFilesystem/config.server @@ -6,8 +6,8 @@ EvictorFilesystem.Endpoints=default -h localhost -p 10000 # # Freeze Map Tracing. # -# 0 = No map activity trace (default). -# 1 = Trace database open and close. +# 0 = No map activity trace (default). +# 1 = Trace database open and close. # 2 = Also trace iterator and transaction operations, and reference # counting of the underlying database. # @@ -16,11 +16,11 @@ Freeze.Trace.Map=1 # # Freeze Evictor Tracing. # -# 0 = No evictor activity trace (default). +# 0 = No evictor activity trace (default). # 1 = Trace Ice object and facet creation and destruction, facet # streaming time, facet saving time, object eviction (every 50 # objects) and evictor deactivation. -# 2 = Also trace object lookups, and all object evictions. +# 2 = Also trace object lookups, and all object evictions. # 3 = Also trace object retrieval from the database. # Freeze.Trace.Evictor=2 diff --git a/java/demo/Manual/mapFilesystem/config.server b/java/demo/Manual/mapFilesystem/config.server index c8694039..f73867be 100644 --- a/java/demo/Manual/mapFilesystem/config.server +++ b/java/demo/Manual/mapFilesystem/config.server @@ -6,8 +6,8 @@ MapFilesystem.Endpoints=default -h localhost -p 10000 # # Freeze Map Tracing. # -# 0 = No map activity trace (default). -# 1 = Trace database open and close. +# 0 = No map activity trace (default). +# 1 = Trace database open and close. # 2 = Also trace iterator and transaction operations, and reference # counting of the underlying database. # diff --git a/java/src/Freeze/src/main/java/Freeze/FileLockException.java b/java/src/Freeze/src/main/java/Freeze/FileLockException.java index 5ee1f993..7ce00447 100644 --- a/java/src/Freeze/src/main/java/Freeze/FileLockException.java +++ b/java/src/Freeze/src/main/java/Freeze/FileLockException.java @@ -40,7 +40,7 @@ public FileLockException clone() { assert false; } - return c; + return c; } public String diff --git a/java/src/Freeze/src/main/java/Freeze/TransactionalEvictorI.java b/java/src/Freeze/src/main/java/Freeze/TransactionalEvictorI.java index 6958f1fc..f709ee78 100644 --- a/java/src/Freeze/src/main/java/Freeze/TransactionalEvictorI.java +++ b/java/src/Freeze/src/main/java/Freeze/TransactionalEvictorI.java @@ -483,7 +483,7 @@ class TransactionalEvictorI extends EvictorI implements TransactionalEvictor try { boolean dispatchSync = sh.servant().ice_dispatch(request, ctx); - + if(!dispatchSync) { // diff --git a/java/test/src/main/java/test/Freeze/dbmap/Client.java b/java/test/src/main/java/test/Freeze/dbmap/Client.java index 9760eaf0..93f319b0 100644 --- a/java/test/src/main/java/test/Freeze/dbmap/Client.java +++ b/java/test/src/main/java/test/Freeze/dbmap/Client.java @@ -295,7 +295,7 @@ static class WriteThread extends Thread test(count == 1); // Opened by keys.remove() Transaction tx = connection.beginTransaction(); - + test(keys.size() == alphabet.length()); test(keys.remove((byte)'a') == true); @@ -1108,7 +1108,7 @@ else if(s1 == null) // fastRemove // sub = sm.headMap(first, true); - + Ice.Identity id = sub.get(first); test(sub.fastRemove(first) == true); test(sub.fastRemove(first) == false); @@ -1130,24 +1130,24 @@ else if(s1 == null) NavigableMap>> isub = null; isub = sm.mapForCategory(); - + { Transaction tx = connection.beginTransaction(); - + Ice.Identity id = sm.get(sm.firstKey()); int sz = isub.get(id.category).size(); test(sz > 0); - - test(sm.fastRemove(sm.firstKey()) == true); - - + + test(sm.fastRemove(sm.firstKey()) == true); + + if(sz == 1) { test(isub.get(id.category) == null); } else - { + { // System.out.println("Check size within tx"); test(isub.get(id.category).size() == sz -1); } @@ -1424,10 +1424,10 @@ else if(s1 == null) { NavigableMap dmap = sm.descendingMap(); - + testSortedMap(dmap, false); testSortedMap(dmap.descendingMap(), true); // Ascending submap. - + } int finc, tinc; // Inclusive flags @@ -2154,7 +2154,7 @@ public int run(String[] args) return run(args, communicator(), envName, "binary"); } - + public static void main(String[] args) { Client c = new Client(); diff --git a/java/test/src/main/java/test/Freeze/evictor/Client.java b/java/test/src/main/java/test/Freeze/evictor/Client.java index a30f144c..76831a71 100644 --- a/java/test/src/main/java/test/Freeze/evictor/Client.java +++ b/java/test/src/main/java/test/Freeze/evictor/Client.java @@ -420,7 +420,7 @@ static class TransferThread extends Thread test(base != null); // // Use an invocation tiemout to avoid createEvictor call to hang in case the server - // fails to load DB classes. The timeout shouldn't be too low since the operation + // fails to load DB classes. The timeout shouldn't be too low since the operation // can take some time to complete on slow machines // RemoteEvictorFactoryPrx factory = RemoteEvictorFactoryPrxHelper.checkedCast(base.ice_invocationTimeout(60000)); @@ -589,7 +589,7 @@ static class TransferThread extends Thread // // Call an operation that does not exist on the servant - // + // try { AccountPrxHelper.uncheckedCast(servants[0]).getBalance(); diff --git a/java/test/src/main/java/test/Freeze/evictor/Test.ice b/java/test/src/main/java/test/Freeze/evictor/Test.ice index 694bbecb..93136e43 100644 --- a/java/test/src/main/java/test/Freeze/evictor/Test.ice +++ b/java/test/src/main/java/test/Freeze/evictor/Test.ice @@ -93,7 +93,7 @@ interface RemoteEvictor { idempotent void setSize(int size); - Servant* createServant(string id, int value) + Servant* createServant(string id, int value) throws AlreadyRegisteredException, EvictorDeactivatedException; idempotent Servant* getServant(string id); diff --git a/java/test/src/main/java/test/Freeze/fileLock/Client.java b/java/test/src/main/java/test/Freeze/fileLock/Client.java index 3721821d..1e648614 100644 --- a/java/test/src/main/java/test/Freeze/fileLock/Client.java +++ b/java/test/src/main/java/test/Freeze/fileLock/Client.java @@ -55,7 +55,7 @@ public int run(String[] args) System.out.println("File lock released."); return 0; } - + public static void main(String[] args) { Client c = new Client(); diff --git a/java/test/src/main/java/test/Freeze/fileLock/ClientFail.java b/java/test/src/main/java/test/Freeze/fileLock/ClientFail.java index 3458eeb4..4bd4f7a4 100644 --- a/java/test/src/main/java/test/Freeze/fileLock/ClientFail.java +++ b/java/test/src/main/java/test/Freeze/fileLock/ClientFail.java @@ -49,7 +49,7 @@ public int run(String[] args) } return 0; } - + public static void main(String[] args) { ClientFail c = new ClientFail(); diff --git a/java/test/src/main/java/test/Freeze/simpleFileLock/ClientFail.java b/java/test/src/main/java/test/Freeze/simpleFileLock/ClientFail.java index ecf87ed9..f7750bd0 100644 --- a/java/test/src/main/java/test/Freeze/simpleFileLock/ClientFail.java +++ b/java/test/src/main/java/test/Freeze/simpleFileLock/ClientFail.java @@ -27,7 +27,7 @@ public class ClientFail public static void main(String[] argvs) { - + try { new Freeze.FileLock("file.lock"); @@ -37,7 +37,7 @@ public class ClientFail { System.out.println("File lock not acquired."); // - // Try to read the pid of the lock owner from the lock file, in Windows + // Try to read the pid of the lock owner from the lock file, in Windows // we don't write pid to lock files. // if(!System.getProperty("os.name").startsWith("Windows")) diff --git a/java/test/src/main/java/test/Util/Application.java b/java/test/src/main/java/test/Util/Application.java index 072406f3..ba762b29 100644 --- a/java/test/src/main/java/test/Util/Application.java +++ b/java/test/src/main/java/test/Util/Application.java @@ -12,7 +12,7 @@ public abstract class Application { public final int WAIT = 2; - + public interface ServerReadyListener { diff --git a/man/man1/slice2freeze.1 b/man/man1/slice2freeze.1 index 567c585b..ae130b09 100644 --- a/man/man1/slice2freeze.1 +++ b/man/man1/slice2freeze.1 @@ -13,7 +13,7 @@ slice2freeze [options] [files] slice2freeze generates Freeze map and index classes in C++. The macro __SLICE2FREEZE__ is defined during this compilation. -Full documentation for slice2freeze is available online at: +Full documentation for slice2freeze is available online at: .br https://doc.zeroc.com/display/Freeze37/slice2freeze+Command-Line+Options @@ -35,7 +35,7 @@ Defines the preprocessor symbol NAME. .TP .BR \-DNAME=DEF\fR -.br +.br Defines the preprocessor symbol NAME with the value DEF. .TP @@ -105,7 +105,7 @@ cpp to EXT. .BR \-\-add-header " " HDR[,GUARD] .br This option adds an include directive for the specified header at the -beginning of the generated source file (preceding any other include +beginning of the generated source file (preceding any other include directives). If GUARD is specified, the include directive is protected by the specified guard. @@ -118,10 +118,10 @@ header file with the directory DIR. .TP .BR \-\-dict " " NAME,KEY,VALUE[,sort[,COMPARE]]\fR .br -Generate a Freeze map class named NAME using KEY as key and VALUE as value. -This option may be specified multiple times to generate several Freeze maps. -NAME may be a scoped C++ name, such as Demo::Struct1ObjectMap. KEY and VALUE -represent Slice types and therefore must use Slice syntax, such as bool or +Generate a Freeze map class named NAME using KEY as key and VALUE as value. +This option may be specified multiple times to generate several Freeze maps. +NAME may be a scoped C++ name, such as Demo::Struct1ObjectMap. KEY and VALUE +represent Slice types and therefore must use Slice syntax, such as bool or Ice::Identity. By default, keys are sorted using their binary Ice-encoded representation. Include sort to sort with the COMPARE functor class. If COMPARE is not specified, the default value is std::less. @@ -129,7 +129,7 @@ COMPARE is not specified, the default value is std::less. .TP .BR \-\-dict\-index " " MAP[,MEMBER] " " [,case\-sensitive|case\-insensitive][,sort[,COMPARE]]\fR .br -Add an index to the Freeze map named MAP. If MEMBER is specified, the map +Add an index to the Freeze map named MAP. If MEMBER is specified, the map value type must be a structure or a class, and MEMBER must be a member of this structure or class. @@ -140,7 +140,7 @@ Generate an index class for a Freeze evictor. CLASS is the name of the class to be generated. TYPE denotes the type of class to be indexed (objects of different classes are not included in this index). MEMBER is the name of the data member in TYPE to index. When MEMBER has type string, it is possible to -specify whether the index is case-sensitive or not. The default is +specify whether the index is case-sensitive or not. The default is case-sensitive. .TP diff --git a/man/man1/transformdb.1 b/man/man1/transformdb.1 index 015a6807..428880b7 100644 --- a/man/man1/transformdb.1 +++ b/man/man1/transformdb.1 @@ -32,12 +32,12 @@ environment NEWDBENV. The FreezeScript tool transformdb migrates a database created by a Freeze map or evictor. It accomplishes this by comparing the "old" Slice definitions -(i.e., the ones that describe the current contents of the database) with the -"new" Slice definitions, and making whatever modifications are necessary to +(i.e., the ones that describe the current contents of the database) with the +"new" Slice definitions, and making whatever modifications are necessary to ensure that the transformed database is compatible with the new definitions. The macro __TRANSFORMDB__ is defined during the Slice file compilation. -Full documentation for transformdb is available online at: +Full documentation for transformdb is available online at: .br https://doc.zeroc.com/display/Freeze37/Using+transformdb @@ -59,7 +59,7 @@ Defines the preprocessor symbol NAME. .TP .BR \-DNAME=DEF\fR -.br +.br Defines the preprocessor symbol NAME with the value DEF. .TP @@ -93,7 +93,7 @@ Print debug information showing the operation of the Slice parser. .BR \-\-new " " SLICE\fR .br Loads the old or new Slice definitions contained in the file SLICE. These -options may be specified multiple times if several files must be loaded. +options may be specified multiple times if several files must be loaded. However, it is the user's responsibility to ensure that duplicate definitions do not occur (which is possible when two files are loaded that share a common include file). One strategy for avoiding duplicate definitions is to load a diff --git a/slice/Freeze/BackgroundSaveEvictor.ice b/slice/Freeze/BackgroundSaveEvictor.ice index 1de1427e..4c121144 100644 --- a/slice/Freeze/BackgroundSaveEvictor.ice +++ b/slice/Freeze/BackgroundSaveEvictor.ice @@ -14,8 +14,8 @@ module Freeze { /** - * - * A background-save evictor is an evictor that saves updates + * + * A background-save evictor is an evictor that saves updates * asynchronously in a background thread. * **/ @@ -30,7 +30,7 @@ local interface BackgroundSaveEvictor extends Evictor * * @param id The identity of the Ice object. * - * @throws Ice.NotRegisteredException Raised if this identity was not + * @throws Ice.NotRegisteredException Raised if this identity was not * registered with the evictor. * * @throws DatabaseException Raised if a database failure occurred. @@ -44,7 +44,7 @@ local interface BackgroundSaveEvictor extends Evictor /** * - * Like {@link #keep}, but with a facet. Calling keep(id) + * Like {@link #keep}, but with a facet. Calling keep(id) * is equivalent to calling {@link #keepFacet} with an empty facet. * * @param id The identity of the Ice object. @@ -52,7 +52,7 @@ local interface BackgroundSaveEvictor extends Evictor * @param facet The facet. An empty facet means the default * facet. * - * @throws Ice.NotRegisteredException Raised if this identity was not + * @throws Ice.NotRegisteredException Raised if this identity was not * registered with the evictor. * * @throws DatabaseException Raised if a database failure occurred. @@ -68,7 +68,7 @@ local interface BackgroundSaveEvictor extends Evictor /** * * Release a lock acquired by {@link #keep}. Once all the locks on an - * object have been released, the object is again subject to the + * object have been released, the object is again subject to the * normal eviction strategy. * * @param id The identity of the Ice object. @@ -84,7 +84,7 @@ local interface BackgroundSaveEvictor extends Evictor /** * - * Like {@link #release}, but with a facet. Calling release(id) + * Like {@link #release}, but with a facet. Calling release(id) * is equivalent to calling {@link #releaseFacet} with an empty facet. * * @param id The identity of the Ice object. diff --git a/slice/Freeze/Connection.ice b/slice/Freeze/Connection.ice index 442bf174..f9d5f698 100644 --- a/slice/Freeze/Connection.ice +++ b/slice/Freeze/Connection.ice @@ -28,9 +28,9 @@ local exception TransactionAlreadyInProgressException /** - * + * * A connection to a database (database environment with Berkeley - * DB). If you want to use a connection concurrently + * DB). If you want to use a connection concurrently * in multiple threads, you need to serialize access to this * connection. * @@ -40,20 +40,20 @@ local interface Connection /** * * Create a new transaction. Only one transaction at a time can - * be associated with a connection. + * be associated with a connection. * * @return The new transaction. * - * @throws TransactionAlreadyInProgressException Raised if a + * @throws TransactionAlreadyInProgressException Raised if a * transaction is already associated with this connection. * **/ Transaction beginTransaction(); - - + + /** * - * Returns the transaction associated with this connection. + * Returns the transaction associated with this connection. * * @return The current transaction if there is one, null otherwise. * @@ -70,7 +70,7 @@ local interface Connection **/ void removeMapIndex(string mapName, string indexName); - + /** * * Closes this connection. If there is an associated transaction, @@ -79,7 +79,7 @@ local interface Connection **/ void close(); - + /** * * Returns the communicator associated with this connection. @@ -102,7 +102,7 @@ local interface Connection **/ ["cpp:const"] string getName(); -}; +}; }; diff --git a/slice/Freeze/Evictor.ice b/slice/Freeze/Evictor.ice index 5a957a37..2c4aa896 100644 --- a/slice/Freeze/Evictor.ice +++ b/slice/Freeze/Evictor.ice @@ -126,7 +126,7 @@ local exception EvictorDeactivatedException **/ local interface Evictor extends Ice::ServantLocator { - + /** * * Set the size of the evictor's servant queue. This is the @@ -167,12 +167,12 @@ local interface Evictor extends Ice::ServantLocator /** * - * Add a servant to this evictor. The state of the servant passed to + * Add a servant to this evictor. The state of the servant passed to * this operation will be saved in the evictor's persistent store. * * @param servant The servant to add. * - * @param id The identity of the Ice object that is implemented by + * @param id The identity of the Ice object that is implemented by * the servant. * * @return A proxy that matches the given identity and this evictor's @@ -201,7 +201,7 @@ local interface Evictor extends Ice::ServantLocator * * @param servant The servant to add. * - * @param id The identity of the Ice object that is implemented by + * @param id The identity of the Ice object that is implemented by * the servant. * * @param facet The facet. An empty facet means the default @@ -226,7 +226,7 @@ local interface Evictor extends Ice::ServantLocator Object* addFacet(Object servant, Ice::Identity id, string facet); // - // Note: no UUID operation as we don't know the category or + // Note: no UUID operation as we don't know the category or // categories this evictor was registered with. // @@ -238,7 +238,7 @@ local interface Evictor extends Ice::ServantLocator * * @return The removed servant. * - * @throws Ice.NotRegisteredException Raised if this identity was not + * @throws Ice.NotRegisteredException Raised if this identity was not * registered with the evictor. * * @throws DatabaseException Raised if a database failure occurred. @@ -254,7 +254,7 @@ local interface Evictor extends Ice::ServantLocator /** * - * Like {@link #remove}, but with a facet. Calling remove(id) + * Like {@link #remove}, but with a facet. Calling remove(id) * is equivalent to calling {@link #removeFacet} with an empty facet. * * @param id The identity of the Ice object. @@ -264,7 +264,7 @@ local interface Evictor extends Ice::ServantLocator * * @return The removed servant. * - * @throws Ice.NotRegisteredException Raised if this identity was not + * @throws Ice.NotRegisteredException Raised if this identity was not * registered with the evictor. * * @throws DatabaseException Raised if a database failure occurred. @@ -296,7 +296,7 @@ local interface Evictor extends Ice::ServantLocator bool hasObject(Ice::Identity id); /** - * + * * Like {@link #hasObject}, but with a facet. Calling hasObject(id) * is equivalent to calling {@link #hasFacet} with an empty * facet. @@ -310,7 +310,7 @@ local interface Evictor extends Ice::ServantLocator * been deactivated. * **/ - bool hasFacet(Ice::Identity id, string facet); + bool hasFacet(Ice::Identity id, string facet); /** * diff --git a/slice/Freeze/EvictorStorage.ice b/slice/Freeze/EvictorStorage.ice index 657281a1..bd5aab4b 100644 --- a/slice/Freeze/EvictorStorage.ice +++ b/slice/Freeze/EvictorStorage.ice @@ -44,7 +44,7 @@ struct Statistics /** * - * ObjectRecord is the value-type for the persistent maps maintained by evictors + * ObjectRecord is the value-type for the persistent maps maintained by evictors * when using Ice encoding version is 1.0. * **/ @@ -59,7 +59,7 @@ struct ObjectRecord /** * - * The statistics for the object. + * The statistics for the object. * **/ Statistics stats; diff --git a/slice/Freeze/Transaction.ice b/slice/Freeze/Transaction.ice index e94ce694..e1596bf1 100644 --- a/slice/Freeze/Transaction.ice +++ b/slice/Freeze/Transaction.ice @@ -15,8 +15,8 @@ local interface Connection; /** - * - * A transaction. If you want to use a transaction concurrently + * + * A transaction. If you want to use a transaction concurrently * in multiple threads, you need to serialize access to this * transaction. * @@ -25,7 +25,7 @@ local interface Transaction { /** * - * Commit this transaction. + * Commit this transaction. * * @throws DatabaseException Raised if a database failure occurred. * @@ -34,7 +34,7 @@ local interface Transaction /** * - * Roll back this transaction. + * Roll back this transaction. * * @throws DatabaseException Raised if a database failure occurred. * @@ -47,7 +47,7 @@ local interface Transaction * **/ ["cpp:const"] Connection getConnection(); -}; +}; }; diff --git a/slice/Freeze/TransactionalEvictor.ice b/slice/Freeze/TransactionalEvictor.ice index 99606b07..881e1263 100644 --- a/slice/Freeze/TransactionalEvictor.ice +++ b/slice/Freeze/TransactionalEvictor.ice @@ -16,7 +16,7 @@ module Freeze local interface Transaction; /** - * + * * A transactional evictor is an evictor that performs every single read-write * operation within its own transaction. *