diff options
author | Dwayne Boone <dwayne@zeroc.com> | 2014-09-18 15:21:47 -0230 |
---|---|---|
committer | Dwayne Boone <dwayne@zeroc.com> | 2014-09-18 15:21:47 -0230 |
commit | 7f90f0b6d10d75e0bcb5d9b32ad18d2dfa6a9355 (patch) | |
tree | d1672e43bdc70a5aab2eaf043470560498eef90f /cpp/src/Freeze/EvictorI.cpp | |
parent | ICE-5661 add proxy->begin_ice_getConnection (diff) | |
download | ice-7f90f0b6d10d75e0bcb5d9b32ad18d2dfa6a9355.tar.bz2 ice-7f90f0b6d10d75e0bcb5d9b32ad18d2dfa6a9355.tar.xz ice-7f90f0b6d10d75e0bcb5d9b32ad18d2dfa6a9355.zip |
ICE-5677 consistent checking of boolean properties
Diffstat (limited to 'cpp/src/Freeze/EvictorI.cpp')
-rw-r--r-- | cpp/src/Freeze/EvictorI.cpp | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/cpp/src/Freeze/EvictorI.cpp b/cpp/src/Freeze/EvictorI.cpp index c9c4be90440..7bd912767e1 100644 --- a/cpp/src/Freeze/EvictorI.cpp +++ b/cpp/src/Freeze/EvictorI.cpp @@ -85,7 +85,7 @@ Freeze::DeactivateController::deactivate() { return false; } - + if(_deactivating) { // @@ -140,9 +140,9 @@ Freeze::DeactivateController::deactivationComplete() // EvictorIBase // -Freeze::EvictorIBase::EvictorIBase(const ObjectAdapterPtr& adapter, - const string& envName, - DbEnv* dbEnv, +Freeze::EvictorIBase::EvictorIBase(const ObjectAdapterPtr& adapter, + const string& envName, + DbEnv* dbEnv, const string& filename, const FacetTypeMap& facetTypes, const ServantInitializerPtr& initializer, @@ -164,7 +164,7 @@ Freeze::EvictorIBase::EvictorIBase(const ObjectAdapterPtr& adapter, _trace = _communicator->getProperties()->getPropertyAsInt("Freeze.Trace.Evictor"); _txTrace = _communicator->getProperties()->getPropertyAsInt("Freeze.Trace.Transaction"); - _deadlockWarning = (_communicator->getProperties()->getPropertyAsInt("Freeze.Warn.Deadlocks") != 0); + _deadlockWarning = (_communicator->getProperties()->getPropertyAsInt("Freeze.Warn.Deadlocks") > 0); } @@ -233,10 +233,10 @@ Freeze::EvictorIBase::locate(const Current& current, LocalObjectPtr& cookie) if(_trace >= 3) { Trace out(_communicator->getLogger(), "Freeze.Evictor"); - out << "ice_ping found \"" << _communicator->identityToString(current.id) + out << "ice_ping found \"" << _communicator->identityToString(current.id) << "\" with facet \"" << current.facet + "\""; } - + cookie = 0; return _pingObject; } @@ -245,7 +245,7 @@ Freeze::EvictorIBase::locate(const Current& current, LocalObjectPtr& cookie) if(_trace >= 3) { Trace out(_communicator->getLogger(), "Freeze.Evictor"); - out << "ice_ping raises FacetNotExistException for \"" << _communicator->identityToString(current.id) + out << "ice_ping raises FacetNotExistException for \"" << _communicator->identityToString(current.id) << "\" with facet \"" << current.facet + "\""; } throw FacetNotExistException(__FILE__, __LINE__); @@ -255,15 +255,15 @@ Freeze::EvictorIBase::locate(const Current& current, LocalObjectPtr& cookie) if(_trace >= 3) { Trace out(_communicator->getLogger(), "Freeze.Evictor"); - out << "ice_ping will raise ObjectNotExistException for \"" + out << "ice_ping will raise ObjectNotExistException for \"" << _communicator->identityToString(current.id) << "\" with facet \"" << current.facet + "\""; } return 0; } } - + ObjectPtr result = locateImpl(current, cookie); - + if(result == 0) { if(hasAnotherFacet(current.id, current.facet)) @@ -275,7 +275,7 @@ Freeze::EvictorIBase::locate(const Current& current, LocalObjectPtr& cookie) } -void +void Freeze::EvictorIBase::initialize(const Identity& ident, const string& facet, const ObjectPtr& servant) { if(_initializer != 0) @@ -284,7 +284,7 @@ Freeze::EvictorIBase::initialize(const Identity& ident, const string& facet, con } } -void +void Freeze::EvictorIBase::updateStats(Statistics& stats, IceUtil::Int64 time) { IceUtil::Int64 diff = time - (stats.creationTime + stats.lastSaveTime); @@ -311,7 +311,7 @@ vector<string> Freeze::EvictorIBase::allDbs() const { vector<string> result; - + try { Db db(_dbEnv->getEnv(), 0); @@ -319,18 +319,18 @@ Freeze::EvictorIBase::allDbs() const // // Berkeley DB expects file paths to be UTF8 encoded. // - db.open(0, nativeToUTF8(_filename, IceUtil::getProcessStringConverter()).c_str(), 0, DB_UNKNOWN, + db.open(0, nativeToUTF8(_filename, IceUtil::getProcessStringConverter()).c_str(), 0, DB_UNKNOWN, DB_RDONLY, 0); Dbc* dbc = 0; db.cursor(0, &dbc, 0); - + Dbt dbKey; dbKey.set_flags(DB_DBT_MALLOC); - + Dbt dbValue; dbValue.set_flags(DB_DBT_USERMEM | DB_DBT_PARTIAL); - + bool more = true; while(more) { @@ -338,7 +338,7 @@ Freeze::EvictorIBase::allDbs() const if(more) { string dbName(static_cast<char*>(dbKey.get_data()), dbKey.get_size()); - + if(dbName.find(indexPrefix) != 0) { result.push_back(dbName); @@ -346,7 +346,7 @@ Freeze::EvictorIBase::allDbs() const free(dbKey.get_data()); } } - + dbc->close(); db.close(0); } @@ -359,7 +359,7 @@ Freeze::EvictorIBase::allDbs() const throw ex; } } - + return result; } |