Skip to content

Commit

Permalink
Reapply "Removed Freeze DbEnvs from IceGrid and IceGridGUI (#1587)"
Browse files Browse the repository at this point in the history
This reverts commit d451c07.
  • Loading branch information
externl committed Dec 12, 2023
1 parent d451c07 commit 6134ac6
Show file tree
Hide file tree
Showing 36 changed files with 46 additions and 1,250 deletions.
29 changes: 0 additions & 29 deletions config/PropertyNames.xml
Original file line number Diff line number Diff line change
Expand Up @@ -660,33 +660,4 @@ generated from the section label.
<property name="[any].AdminPermissionsVerifier" />
</section>

<section name="Freeze">
<property name="DbEnv.[any].CheckpointPeriod" />
<property name="DbEnv.[any].DbHome" />
<property name="DbEnv.[any].DbPrivate" />
<property name="DbEnv.[any].DbRecoverFatal" />
<property name="DbEnv.[any].EncodingVersion" />
<property name="DbEnv.[any].LockFile" />
<property name="DbEnv.[any].OldLogsAutoDelete" />
<property name="DbEnv.[any].PeriodicCheckpointMinSize" />
<property name="Evictor.[any].BtreeMinKey" />
<property name="Evictor.[any].Checksum" />
<property name="Evictor.[any].MaxTxSize" />
<property name="Evictor.[any].PageSize" />
<property name="Evictor.[any].PopulateEmptyIndices" />
<property name="Evictor.[any].RollbackOnUserException" />
<property name="Evictor.[any].SavePeriod" />
<property name="Evictor.[any].SaveSizeTrigger" />
<property name="Evictor.[any].StreamTimeout" />
<property name="Map.[any].BtreeMinKey" />
<property name="Map.[any].Checksum" />
<property name="Map.[any].PageSize" />
<property name="Trace.DbEnv" />
<property name="Trace.Evictor" />
<property name="Trace.Map" />
<property name="Trace.Transaction" />
<property name="Warn.Deadlocks" />
<property name="Warn.Rollback" />
</section>

</properties>
38 changes: 1 addition & 37 deletions cpp/src/Ice/PropertyNames.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//
// Copyright (c) ZeroC, Inc. All rights reserved.
//
// Generated by makeprops.py from file ./config/PropertyNames.xml, Mon Dec 11 11:59:14 2023
// Generated by makeprops.py from file ./config/PropertyNames.xml, Mon Dec 11 15:47:11 2023

// IMPORTANT: Do not edit this file -- any edits made here will be lost!

Expand Down Expand Up @@ -1350,40 +1350,6 @@ const IceInternal::PropertyArray
IceInternal::PropertyNames::Glacier2CryptPermissionsVerifierProps(Glacier2CryptPermissionsVerifierPropsData,
sizeof(Glacier2CryptPermissionsVerifierPropsData)/sizeof(Glacier2CryptPermissionsVerifierPropsData[0]));

const IceInternal::Property FreezePropsData[] =
{
IceInternal::Property("Freeze.DbEnv.*.CheckpointPeriod", false, 0),
IceInternal::Property("Freeze.DbEnv.*.DbHome", false, 0),
IceInternal::Property("Freeze.DbEnv.*.DbPrivate", false, 0),
IceInternal::Property("Freeze.DbEnv.*.DbRecoverFatal", false, 0),
IceInternal::Property("Freeze.DbEnv.*.EncodingVersion", false, 0),
IceInternal::Property("Freeze.DbEnv.*.LockFile", false, 0),
IceInternal::Property("Freeze.DbEnv.*.OldLogsAutoDelete", false, 0),
IceInternal::Property("Freeze.DbEnv.*.PeriodicCheckpointMinSize", false, 0),
IceInternal::Property("Freeze.Evictor.*.BtreeMinKey", false, 0),
IceInternal::Property("Freeze.Evictor.*.Checksum", false, 0),
IceInternal::Property("Freeze.Evictor.*.MaxTxSize", false, 0),
IceInternal::Property("Freeze.Evictor.*.PageSize", false, 0),
IceInternal::Property("Freeze.Evictor.*.PopulateEmptyIndices", false, 0),
IceInternal::Property("Freeze.Evictor.*.RollbackOnUserException", false, 0),
IceInternal::Property("Freeze.Evictor.*.SavePeriod", false, 0),
IceInternal::Property("Freeze.Evictor.*.SaveSizeTrigger", false, 0),
IceInternal::Property("Freeze.Evictor.*.StreamTimeout", false, 0),
IceInternal::Property("Freeze.Map.*.BtreeMinKey", false, 0),
IceInternal::Property("Freeze.Map.*.Checksum", false, 0),
IceInternal::Property("Freeze.Map.*.PageSize", false, 0),
IceInternal::Property("Freeze.Trace.DbEnv", false, 0),
IceInternal::Property("Freeze.Trace.Evictor", false, 0),
IceInternal::Property("Freeze.Trace.Map", false, 0),
IceInternal::Property("Freeze.Trace.Transaction", false, 0),
IceInternal::Property("Freeze.Warn.Deadlocks", false, 0),
IceInternal::Property("Freeze.Warn.Rollback", false, 0),
};

const IceInternal::PropertyArray
IceInternal::PropertyNames::FreezeProps(FreezePropsData,
sizeof(FreezePropsData)/sizeof(FreezePropsData[0]));

const IceInternal::PropertyArray IceInternal::PropertyNames::validProps[] =
{
IceProps,
Expand All @@ -1402,7 +1368,6 @@ const IceInternal::PropertyArray IceInternal::PropertyNames::validProps[] =
IceBTProps,
Glacier2Props,
Glacier2CryptPermissionsVerifierProps,
FreezeProps,
IceInternal::PropertyArray(0,0)
};

Expand All @@ -1424,6 +1389,5 @@ const char* IceInternal::PropertyNames::clPropNames[] =
"IceBT",
"Glacier2",
"Glacier2CryptPermissionsVerifier",
"Freeze",
0
};
3 changes: 1 addition & 2 deletions cpp/src/Ice/PropertyNames.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//
// Copyright (c) ZeroC, Inc. All rights reserved.
//
// Generated by makeprops.py from file ./config/PropertyNames.xml, Mon Dec 11 11:59:14 2023
// Generated by makeprops.py from file ./config/PropertyNames.xml, Mon Dec 11 15:47:11 2023

// IMPORTANT: Do not edit this file -- any edits made here will be lost!

Expand Down Expand Up @@ -67,7 +67,6 @@ class PropertyNames
static const PropertyArray IceBTProps;
static const PropertyArray Glacier2Props;
static const PropertyArray Glacier2CryptPermissionsVerifierProps;
static const PropertyArray FreezeProps;

static const PropertyArray validProps[];
static const char * clPropNames[];
Expand Down
64 changes: 0 additions & 64 deletions cpp/src/IceGrid/DescriptorBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -713,64 +713,6 @@ CommunicatorDescriptorBuilder::addAllocatable(const XmlAttributesHelper& attrs)
_descriptor->adapters.back().allocatables.push_back(object);
}

void
CommunicatorDescriptorBuilder::addDbEnv(const XmlAttributesHelper& attrs)
{
DbEnvDescriptor desc;
desc.name = attrs("name");

DbEnvDescriptorSeq::iterator p;
for(p = _descriptor->dbEnvs.begin(); p != _descriptor->dbEnvs.end(); ++p)
{
//
// We are re-opening the dbenv element to define more properties.
//
if(p->name == desc.name)
{
break;
}
}

if(p != _descriptor->dbEnvs.end())
{
//
// Remove the previously defined dbenv, we'll add it back again when
// the dbenv element end tag is reached.
//
desc = *p;
_descriptor->dbEnvs.erase(p);
}

if(desc.dbHome.empty())
{
desc.dbHome = attrs("home", "");
}

_descriptor->dbEnvs.push_back(desc);
}

void
CommunicatorDescriptorBuilder::addDbEnvProperty(const XmlAttributesHelper& attrs)
{
if(!_descriptor->dbEnvs.back().dbHome.empty())
{
throw invalid_argument("can't add property to the database environment:\n"
"properties are only allowed if the database\n"
"environment home directory is managed by the node");
}

PropertyDescriptor prop;
prop.name = attrs("name");
prop.value = attrs("value", "");
_descriptor->dbEnvs.back().properties.push_back(prop);
}

void
CommunicatorDescriptorBuilder::setDbEnvDescription(const string& value)
{
_descriptor->dbEnvs.back().description = value;
}

void
CommunicatorDescriptorBuilder::addLog(const XmlAttributesHelper& attrs)
{
Expand Down Expand Up @@ -923,12 +865,6 @@ IceBoxDescriptorBuilder::addAdapter(const XmlAttributesHelper& /*attrs*/)
throw invalid_argument("<adapter> element can't be a child of an <icebox> element");
}

void
IceBoxDescriptorBuilder::addDbEnv(const XmlAttributesHelper& /*attrs*/)
{
throw invalid_argument("<dbenv> element can't be a child of an <icebox> element");
}

void
IceBoxDescriptorBuilder::addServiceInstance(const ServiceInstanceDescriptor& desc)
{
Expand Down
4 changes: 0 additions & 4 deletions cpp/src/IceGrid/DescriptorBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -217,9 +217,6 @@ class CommunicatorDescriptorBuilder : public DescriptorBuilder
virtual void setAdapterDescription(const std::string&);
virtual void addObject(const XmlAttributesHelper&);
virtual void addAllocatable(const XmlAttributesHelper&);
virtual void addDbEnv(const XmlAttributesHelper&);
virtual void addDbEnvProperty(const XmlAttributesHelper&);
virtual void setDbEnvDescription(const std::string&);
virtual void addLog(const XmlAttributesHelper&);

virtual PropertySetDescriptorBuilder* createPropertySet() const;
Expand Down Expand Up @@ -289,7 +286,6 @@ class IceBoxDescriptorBuilder : public ServerDescriptorBuilder
virtual ServiceInstanceDescriptorBuilder* createServiceInstance(const XmlAttributesHelper&);

virtual void addAdapter(const XmlAttributesHelper&);
virtual void addDbEnv(const XmlAttributesHelper&);
virtual void addServiceInstance(const ServiceInstanceDescriptor&);
virtual void addService(const ServiceDescriptorPtr&);

Expand Down
51 changes: 0 additions & 51 deletions cpp/src/IceGrid/DescriptorHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1091,12 +1091,6 @@ CommunicatorHelper::operator==(const CommunicatorHelper& helper) const
}
}

if(set<DbEnvDescriptor>(_desc->dbEnvs.begin(), _desc->dbEnvs.end()) !=
set<DbEnvDescriptor>(helper._desc->dbEnvs.begin(), helper._desc->dbEnvs.end()))
{
return false;
}

if(_desc->logs != helper._desc->logs)
{
return false;
Expand Down Expand Up @@ -1211,16 +1205,6 @@ CommunicatorHelper::instantiateImpl(const CommunicatorDescriptorPtr& instance, c
}
}

for(DbEnvDescriptorSeq::const_iterator s = _desc->dbEnvs.begin(); s != _desc->dbEnvs.end(); ++s)
{
DbEnvDescriptor dbEnv;
dbEnv.name = resolve(s->name, "database environment name", false);
dbEnv.description = resolve(s->description, "database environment description");
dbEnv.dbHome = resolve(s->dbHome, "database environment home directory");
dbEnv.properties = resolve(s->properties, "database environment property");
instance->dbEnvs.push_back(dbEnv);
}

for(Ice::StringSeq::const_iterator l = _desc->logs.begin(); l != _desc->logs.end(); ++l)
{
instance->logs.push_back(resolve(*l, "log path", false));
Expand All @@ -1238,12 +1222,6 @@ CommunicatorHelper::print(const Ice::CommunicatorPtr& communicator, Output& out)
out << eb;
}
set<string> hiddenProperties;
{
for(DbEnvDescriptorSeq::const_iterator p = _desc->dbEnvs.begin(); p != _desc->dbEnvs.end(); ++p)
{
printDbEnv(out, *p);
}
}
{
for(AdapterDescriptorSeq::const_iterator p = _desc->adapters.begin(); p != _desc->adapters.end(); ++p)
{
Expand Down Expand Up @@ -1279,35 +1257,6 @@ CommunicatorHelper::print(const Ice::CommunicatorPtr& communicator, Output& out)
}
}

void
CommunicatorHelper::printDbEnv(Output& out, const DbEnvDescriptor& dbEnv) const
{
out << nl << "database environment `" << dbEnv.name << "'";
if(!dbEnv.dbHome.empty() || !dbEnv.properties.empty() || !dbEnv.description.empty())
{
out << sb;
if(!dbEnv.dbHome.empty())
{
out << nl << "home = `" << dbEnv.dbHome << "'";
}
if(!dbEnv.description.empty())
{
out << nl << "description = `" << dbEnv.description << "'";
}
if(!dbEnv.properties.empty())
{
out << nl << "properties";
out << sb;
for(PropertyDescriptorSeq::const_iterator p = dbEnv.properties.begin(); p != dbEnv.properties.end(); ++p)
{
out << nl << p->name << " = `" << p->value << "'";
}
out << eb;
}
out << eb;
}
}

void
CommunicatorHelper::printObjectAdapter(const Ice::CommunicatorPtr& communicator,
Output& out,
Expand Down
1 change: 0 additions & 1 deletion cpp/src/IceGrid/DescriptorHelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ class CommunicatorHelper

protected:

void printDbEnv(IceUtilInternal::Output&, const DbEnvDescriptor&) const;
void printObjectAdapter(const Ice::CommunicatorPtr&, IceUtilInternal::Output&, const AdapterDescriptor&) const;
void printPropertySet(IceUtilInternal::Output&, const PropertySetDescriptor&) const;
virtual std::string getProperty(const std::string&) const;
Expand Down
30 changes: 1 addition & 29 deletions cpp/src/IceGrid/DescriptorParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ class DescriptorHandler : public IceXML::Handler
bool _isTopLevel;
bool _inAdapter;
bool _inReplicaGroup;
bool _inDbEnv;
bool _inDistrib;
};

Expand All @@ -82,8 +81,7 @@ DescriptorHandler::DescriptorHandler(const string& filename, const Ice::Communic
_currentCommunicator(0),
_isTopLevel(true),
_inAdapter(false),
_inReplicaGroup(false),
_inDbEnv(false)
_inReplicaGroup(false)
{
}

Expand Down Expand Up @@ -425,15 +423,6 @@ DescriptorHandler::startElement(const string& name, const IceXML::Attributes& at
}
_inDistrib = true;
}
else if(name == "dbenv")
{
if(!_currentCommunicator)
{
error("the <dbenv> element can only be a child of a <server> or <service> element");
}
_currentCommunicator->addDbEnv(attributes);
_inDbEnv = true;
}
else if(name == "log")
{
if(!_currentCommunicator)
Expand All @@ -442,14 +431,6 @@ DescriptorHandler::startElement(const string& name, const IceXML::Attributes& at
}
_currentCommunicator->addLog(attributes);
}
else if(name == "dbproperty")
{
if(!_inDbEnv)
{
error("the <dbproperty> element can only be a child of a <dbenv> element");
}
_currentCommunicator->addDbEnvProperty(attributes);
}
else if(name == "description" || name == "option" || name == "env" || name == "directory")
{
//
Expand Down Expand Up @@ -610,11 +591,6 @@ DescriptorHandler::endElement(const string& name, int line, int column)
{
_currentApplication->setReplicaGroupDescription(elementValue());
}
else if(_inDbEnv)
{
assert(_currentCommunicator);
_currentCommunicator->setDbEnvDescription(elementValue());
}
else if(_currentCommunicator)
{
_currentCommunicator->setDescription(elementValue());
Expand Down Expand Up @@ -672,10 +648,6 @@ DescriptorHandler::endElement(const string& name, int line, int column)
_currentApplication->finishReplicaGroup();
_inReplicaGroup = false;
}
else if(name == "dbenv")
{
_inDbEnv = false;
}
else if(name == "distrib")
{
_inDistrib = false;
Expand Down
4 changes: 3 additions & 1 deletion cpp/src/IceGrid/Internal.ice
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ local exception SynchronizationException
{
}

// This class is no longer used. We keep it only for interop with IceGrid 3.7.
//
class InternalDbEnvDescriptor
{
/** The name of the database environment. */
Expand Down Expand Up @@ -109,7 +111,7 @@ class InternalServerDescriptor
/** The indirect object adapters. */
InternalAdapterDescriptorSeq adapters;

/** The database environments. */
// Not used, always empty. Kept only for interop with IceGrid 3.7.
InternalDbEnvDescriptorSeq dbEnvs;

/** The configuration files of the server. */
Expand Down
Loading

0 comments on commit 6134ac6

Please sign in to comment.