summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOssama Othman <ossama-othman@users.noreply.github.com>2002-07-22 18:28:25 +0000
committerOssama Othman <ossama-othman@users.noreply.github.com>2002-07-22 18:28:25 +0000
commit18c3103685e6cd84b6ea2b29bb7817e568b42c91 (patch)
tree668d5de452096c37275be5a30487229d5b7777d9
parentb019d49eeb722420a5e67bed0f77950f669b8fc4 (diff)
downloadATCD-18c3103685e6cd84b6ea2b29bb7817e568b42c91.tar.gz
ChangeLogTag:Mon Jul 22 14:22:49 2002 Ossama Othman <ossama@uci.edu>
-rw-r--r--TAO/ChangeLog16
-rw-r--r--TAO/orbsvcs/orbsvcs/CosLoadBalancing.dsp100
-rw-r--r--TAO/orbsvcs/orbsvcs/CosLoadBalancing.idl108
-rw-r--r--TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LoadManager.cpp9
4 files changed, 183 insertions, 50 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog
index d483d53cda5..e02d2e831c8 100644
--- a/TAO/ChangeLog
+++ b/TAO/ChangeLog
@@ -1,3 +1,19 @@
+Mon Jul 22 14:22:49 2002 Ossama Othman <ossama@uci.edu>
+
+ * orbsvcs/orbsvcs/CosLoadBalancing.idl:
+
+ Refined the CosLoadBalancing IDL. Neglected to commit these
+ changes in an earlier commit.
+
+ * orbsvcs/orbsvcs/CosLoadBalancing.dsp:
+
+ Added new CosLoadBalancing source files to the source list(s).
+
+ * orbsvcs/orbsvcs/LoadBalancing/LB_LoadManager.cpp
+ (built_in_strategy):
+
+ Removed extraneous "ACE_INLINE" declaration.
+
Mon Jul 22 13:49:28 2002 Carlos O'Ryan <coryan@atdesk.com>
* tao/Utils/RIR_Narrow.h:
diff --git a/TAO/orbsvcs/orbsvcs/CosLoadBalancing.dsp b/TAO/orbsvcs/orbsvcs/CosLoadBalancing.dsp
index 5c4ae49b3b4..957eb4161e3 100644
--- a/TAO/orbsvcs/orbsvcs/CosLoadBalancing.dsp
+++ b/TAO/orbsvcs/orbsvcs/CosLoadBalancing.dsp
@@ -56,7 +56,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-# ADD LINK32 ace.lib TAO.lib TAO_PortableServer.lib TAO_CosNaming.lib TAO_PortableGroup.lib /nologo /dll /machine:I386 /out:"..\..\..\bin\TAO_CosLoadBalancing.dll" /libpath:"..\..\tao\PortableServer" /libpath:"..\..\tao" /libpath:"..\..\..\ace"
+# ADD LINK32 ace.lib TAO.lib TAO_PortableServer.lib TAO_CosNaming.lib TAO_PortableGroup.lib TAO_Messaging.lib /nologo /dll /machine:I386 /out:"..\..\..\bin\TAO_CosLoadBalancing.dll" /libpath:"..\..\tao\PortableServer" /libpath:"..\..\tao\Messaging" /libpath:"..\..\tao" /libpath:"..\..\..\ace"
!ELSEIF "$(CFG)" == "CosLoadBalancing - Win32 Debug"
@@ -83,7 +83,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 TAOd.lib aced.lib TAO_PortableServerd.lib TAO_CosNamingd.lib TAO_PortableGroupd.lib /nologo /dll /debug /machine:I386 /out:"..\..\..\bin\TAO_CosLoadBalancingd.dll" /pdbtype:sept /libpath:"..\..\tao\PortableServer" /libpath:"..\..\tao" /libpath:"..\..\..\ace"
+# ADD LINK32 TAOd.lib aced.lib TAO_PortableServerd.lib TAO_CosNamingd.lib TAO_PortableGroupd.lib TAO_Messagingd.lib /nologo /dll /debug /machine:I386 /out:"..\..\..\bin\TAO_CosLoadBalancingd.dll" /pdbtype:sept /libpath:"..\..\tao\PortableServer" /libpath:"..\..\tao\Messaging" /libpath:"..\..\tao" /libpath:"..\..\..\ace"
# SUBTRACT LINK32 /profile
!ELSEIF "$(CFG)" == "CosLoadBalancing - Win32 MFC Debug"
@@ -112,7 +112,7 @@ BSC32=bscmake.exe
LINK32=link.exe
# ADD BASE LINK32 TAOd.lib aced.lib /nologo /dll /debug /machine:I386 /out:"..\..\..\bin\TAO_CosLoadBalancingd.dll" /pdbtype:sept /libpath:"..\..\tao" /libpath:"..\..\..\ace"
# SUBTRACT BASE LINK32 /profile
-# ADD LINK32 TAOd.lib aced.lib TAO_PortableServermfcd.lib TAO_CosNamingmfcd.lib /nologo /dll /debug /machine:I386 /out:"..\..\..\bin\TAO_CosLoadBalancingmfcd.dll" /pdbtype:sept /libpath:"..\..\tao\PortableServer" /libpath:"..\..\tao" /libpath:"..\..\..\ace"
+# ADD LINK32 TAOd.lib aced.lib TAO_PortableServermfcd.lib TAO_CosNamingmfcd.lib /nologo /dll /debug /machine:I386 /out:"..\..\..\bin\TAO_CosLoadBalancingmfcd.dll" /pdbtype:sept /libpath:"..\..\tao\PortableServer" /libpath:"..\..\tao\Messaging" /libpath:"..\..\tao" /libpath:"..\..\..\ace"
# SUBTRACT LINK32 /profile
!ELSEIF "$(CFG)" == "CosLoadBalancing - Win32 MFC Release"
@@ -140,7 +140,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 ace.lib TAO.lib /nologo /dll /machine:I386 /out:"..\..\..\bin\TAO_CosLoadBalancing.dll" /libpath:"..\..\tao" /libpath:"..\..\..\ace"
-# ADD LINK32 ace.lib TAO.lib TAO_PortableServermfc.lib TAO_CosNamingmfc.lib /nologo /dll /machine:I386 /out:"..\..\..\bin\TAO_CosLoadBalancingmfc.dll" /libpath:"..\..\tao\PortableServer" /libpath:"..\..\tao" /libpath:"..\..\..\ace"
+# ADD LINK32 ace.lib TAO.lib TAO_PortableServermfc.lib TAO_CosNamingmfc.lib /nologo /dll /machine:I386 /out:"..\..\..\bin\TAO_CosLoadBalancingmfc.dll" /libpath:"..\..\tao\PortableServer" /libpath:"..\..\tao\Messaging" /libpath:"..\..\tao" /libpath:"..\..\..\ace"
!ENDIF
@@ -163,10 +163,42 @@ SOURCE=.\CosLoadBalancingS.cpp
# End Source File
# Begin Source File
+SOURCE=.\LoadBalancing\LB_CPU_Monitor.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\LoadBalancing\LB_LeastLoaded.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\LoadBalancing\LB_LoadAlert.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\LoadBalancing\LB_LoadAlert_Handler.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\LoadBalancing\LB_LoadAlertInfo.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\LoadBalancing\LB_LoadAlertMap.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\LoadBalancing\LB_LoadListMap.cpp
+# End Source File
+# Begin Source File
+
SOURCE=.\LoadBalancing\LB_LoadManager.cpp
# End Source File
# Begin Source File
+SOURCE=.\LoadBalancing\LB_LoadMap.cpp
+# End Source File
+# Begin Source File
+
SOURCE=.\LoadBalancing\LB_MemberLocator.cpp
# End Source File
# Begin Source File
@@ -175,12 +207,24 @@ SOURCE=.\LoadBalancing\LB_MonitorMap.cpp
# End Source File
# Begin Source File
+SOURCE=.\LoadBalancing\LB_ORBInitializer.cpp
+# End Source File
+# Begin Source File
+
SOURCE=.\LoadBalancing\LB_Pull_Handler.cpp
# End Source File
# Begin Source File
SOURCE=.\LoadBalancing\LB_Random.cpp
# End Source File
+# Begin Source File
+
+SOURCE=.\LoadBalancing\LB_RoundRobin.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\LoadBalancing\LB_ServerRequestInterceptor.cpp
+# End Source File
# End Group
# Begin Group "Header Files"
@@ -203,14 +247,42 @@ SOURCE=.\LoadBalancing\LB_conf.h
# End Source File
# Begin Source File
+SOURCE=.\LoadBalancing\LB_CPU_Monitor.h
+# End Source File
+# Begin Source File
+
SOURCE=.\LoadBalancing\LB_LeastLoaded.h
# End Source File
# Begin Source File
+SOURCE=.\LoadBalancing\LB_LoadAlert.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\LoadBalancing\LB_LoadAlert_Handler.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\LoadBalancing\LB_LoadAlertInfo.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\LoadBalancing\LB_LoadAlertMap.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\LoadBalancing\LB_LoadListMap.h
+# End Source File
+# Begin Source File
+
SOURCE=.\LoadBalancing\LB_LoadManager.h
# End Source File
# Begin Source File
+SOURCE=.\LoadBalancing\LB_LoadMap.h
+# End Source File
+# Begin Source File
+
SOURCE=.\LoadBalancing\LB_MemberLocator.h
# End Source File
# Begin Source File
@@ -219,6 +291,10 @@ SOURCE=.\LoadBalancing\LB_MonitorMap.h
# End Source File
# Begin Source File
+SOURCE=.\LoadBalancing\LB_ORBInitializer.h
+# End Source File
+# Begin Source File
+
SOURCE=.\LoadBalancing\LB_Pull_Handler.h
# End Source File
# Begin Source File
@@ -227,6 +303,14 @@ SOURCE=.\LoadBalancing\LB_Random.h
# End Source File
# Begin Source File
+SOURCE=.\LoadBalancing\LB_RoundRobin.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\LoadBalancing\LB_ServerRequestInterceptor.h
+# End Source File
+# Begin Source File
+
SOURCE=.\CosLoadBalancing\LoadBalancing_export.h
# End Source File
# End Group
@@ -246,7 +330,7 @@ InputPath=.\CosLoadBalancing.idl
InputName=CosLoadBalancing
BuildCmds= \
- ..\..\..\bin\Release\tao_idl -Ge 1 -I../../ -I../../tao -Wb,pre_include=ace/pre.h -Wb,post_include=ace/post.h -Wb,export_macro=TAO_LoadBalancing_Export -Wb,export_include=LoadBalancing/Loadbalancing_export.h $(InputName).idl
+ ..\..\..\bin\Release\tao_idl -Ge 1 -GC -I../../ -I../../tao -Wb,pre_include=ace/pre.h -Wb,post_include=ace/post.h -Wb,export_macro=TAO_LoadBalancing_Export -Wb,export_include=LoadBalancing/Loadbalancing_export.h $(InputName).idl
"$(InputName)C.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
@@ -285,7 +369,7 @@ InputPath=.\CosLoadBalancing.idl
InputName=CosLoadBalancing
BuildCmds= \
- ..\..\..\bin\tao_idl -Ge 1 -I../../ -I../../tao -Wb,pre_include=ace/pre.h -Wb,post_include=ace/post.h -Wb,export_macro=TAO_LoadBalancing_Export -Wb,export_include=LoadBalancing/LoadBalancing_export.h $(InputName).idl
+ ..\..\..\bin\tao_idl -Ge 1 -GC -I../../ -I../../tao -Wb,pre_include=ace/pre.h -Wb,post_include=ace/post.h -Wb,export_macro=TAO_LoadBalancing_Export -Wb,export_include=LoadBalancing/LoadBalancing_export.h $(InputName).idl
"$(InputName)C.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
@@ -348,6 +432,10 @@ SOURCE=.\CosLoadBalancingS_T.i
SOURCE=.\LoadBalancing\LB_LeastLoaded.inl
# End Source File
+# Begin Source File
+
+SOURCE=.\LoadBalancing\LB_LoadAlert.inl
+# End Source File
# End Group
# Begin Group "Template Files"
diff --git a/TAO/orbsvcs/orbsvcs/CosLoadBalancing.idl b/TAO/orbsvcs/orbsvcs/CosLoadBalancing.idl
index da35b5dd205..cadc36d0477 100644
--- a/TAO/orbsvcs/orbsvcs/CosLoadBalancing.idl
+++ b/TAO/orbsvcs/orbsvcs/CosLoadBalancing.idl
@@ -41,35 +41,26 @@ module CosLoadBalancing
typedef PortableGroup::Location Location;
typedef PortableGroup::Properties Properties;
- /// Types used for obtaining and/or reporting loads
+ // Types used for obtaining and/or reporting loads
typedef unsigned long LoadId;
+
+ // OMG defined LoadId constants.
+ const LoadId CPU = 0;
+ const LoadId Disk = 1;
+ const LoadId Memory = 2;
+ const LoadId Network = 3;
+
struct Load {
LoadId id;
float value;
};
typedef sequence<Load> LoadList;
-// typedef unsigned short MonitoringStyle;
-// const MonitoringStyle PULL = 0;
-// const MonitoringStyle PUSH = 1;
-// // const MonitoringStyle NOT_MONITORED = 2;
-
-// typedef unsigned short MonitoringGranularity;
-// const MonitoringGranularity MEMB = 0;
-// const MonitoringGranularity LOC = 1;
-// const MonitoringGranularity LOC_AND_TYPE = 2;
-
-// typedef unsigned short ClientBinding;
-// const ClientBinding PER_SESSION = 0;
-// const ClientBinding PER_REQUEST = 1;
-// const ClientBinding ON_DEMAND = 2;
-
-// typedef unsigned short BalancingPolicy;
-// const BalancingPolicy NON_ADAPTIVE = 0;
-// const BalancingPolicy ADAPTIVE = 1;
-
exception MonitorAlreadyPresent {};
exception LocationNotFound {};
+ exception LoadAlertNotFound {};
+ exception LoadAlertAlreadyPresent {};
+ exception LoadAlertNotAdded {};
exception StrategyNotAdaptive {};
@@ -88,8 +79,11 @@ module CosLoadBalancing
// Get loads, if any, at the given location. Load balancing
// strategies may use this method to query loads at specific
- // locations.
- LoadList get_loads (in PortableGroup::Location the_location)
+ // locations. Returned loads are the effective loads computed by
+ // the Strategy, as opposed to the raw loads maintained by the
+ // LoadManager.
+ LoadList get_loads (in LoadManager load_manager,
+ in PortableGroup::Location the_location)
raises (LocationNotFound);
// Return the next member from the given object group which will
@@ -101,7 +95,7 @@ module CosLoadBalancing
// Ask the Strategy to analyze loads, and enable or disable alerts
// at object group members residing at appropriate locations.
- oneway void analyze_loads (in LoadManager load_manager);
+ // oneway void analyze_loads (in LoadManager load_manager);
// The given loads at the given location should no longer be
// considered when performing load analysis.
@@ -109,9 +103,13 @@ module CosLoadBalancing
raises (LocationNotFound);
};
+ interface CustomStrategy : Strategy {
+ };
+
+ // Property value for built-in load balancing Strategy.
struct StrategyInfo
{
-
+ string name;
Properties props;
};
@@ -119,7 +117,7 @@ module CosLoadBalancing
{
// Forward requests back to the load manager via the object group
// reference.
- void alert (in Object object_group);
+ void enable_alert (in Object object_group);
// Stop forwarding requests, and begin accepting them again.
void disable_alert ();
@@ -141,37 +139,71 @@ module CosLoadBalancing
PortableGroup::ObjectGroupManager,
PortableGroup::GenericFactory
{
-// void register_load_notifier (in LoadNotifier load_notifier);
-
-// LoadNotifier get_load_notifier ()
-// raises (PortableGroup::InterfaceNotFound);
-
// For the PUSH load monitoring style.
void push_loads (in PortableGroup::Location the_location,
in LoadList loads);
+ // Return the raw loads at the given location, as opposed to the
+ // potentially different effective loads returned by the
+ // Strategy::get_loads() method.
+ LoadList get_loads (in PortableGroup::Location the_location)
+ raises (LocationNotFound);
+
+ // Inform member at given location of load alert condition.
+ void enable_alert (in PortableGroup::ObjectGroup object_group,
+ in PortableGroup::Location the_location)
+ raises (PortableGroup::ObjectGroupNotFound,
+ LoadAlertNotFound);
+
+ // Inform member at given location that load alert condition has
+ // passed.
+ void disable_alert (in PortableGroup::ObjectGroup object_group,
+ in PortableGroup::Location the_location)
+ raises (PortableGroup::ObjectGroupNotFound,
+ LoadAlertNotFound);
+
+ // Register a LoadAlert object for the member at the given
+ // location.
+ void register_load_alert (in PortableGroup::ObjectGroup object_group,
+ in PortableGroup::Location the_location,
+ in LoadAlert load_alert)
+ raises (PortableGroup::ObjectGroupNotFound,
+ LoadAlertAlreadyPresent,
+ LoadAlertNotAdded);
+
+ // Retrieve the LoadAlert object for the member at the given
+ // location.
+ LoadAlert get_load_alert (in PortableGroup::ObjectGroup object_group,
+ in PortableGroup::Location the_location)
+ raises (PortableGroup::ObjectGroupNotFound,
+ LoadAlertNotFound);
+
+ // Remove (de-register) the LoadAlert object for the member at the
+ // given location.
+ void remove_load_alert (in PortableGroup::ObjectGroup object_group,
+ in PortableGroup::Location the_location)
+ raises (PortableGroup::ObjectGroupNotFound,
+ LoadAlertNotFound);
+
// The following load monitor methods are only used for the PULL
// load monitoring style.
+
+ // Register a LoadMonitor object for the given location.
void register_load_monitor (in LoadMonitor load_monitor,
in PortableGroup::Location the_location)
raises (MonitorAlreadyPresent);
+ // Retrieve the LoadMonitor object for the given location.
LoadMonitor get_load_monitor (in PortableGroup::Location the_location)
raises (LocationNotFound);
+ // Remove (de-register) the LoadMonitor object for the given
+ // location.
void remove_load_monitor (in PortableGroup::Location the_location)
raises (LocationNotFound);
- void register_alerter (in PortableGroup::ObjectGroup object_group,
- in PortableGroup::Location the_location,
- in Object alert)
- raises (LocationNotFound);
};
-// /// It's not clear this interface is needed for the Load Balancer.
-// interface LoadNotifier
-// {
-// };
};
#pragma prefix ""
diff --git a/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LoadManager.cpp b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LoadManager.cpp
index c0f95b2023c..0513915e264 100644
--- a/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LoadManager.cpp
+++ b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LoadManager.cpp
@@ -43,8 +43,8 @@ TAO_LB_LoadManager::TAO_LB_LoadManager (void)
this->pull_handler_.initialize (&this->monitor_map_, this);
// @note "this->init()" is not called here (in the constructor)
- // since it may thrown in an exception. Throwing an exception
- // in a constructor in an emulated exception environment is
+ // since it may thrown an exception. Throwing an exception in
+ // a constructor in an emulated exception environment is
// problematic since native exception semantics cannot be
// reproduced in such a case. As such, init() must be called
// by whatever code instantiates this LoadManager.
@@ -849,9 +849,6 @@ CORBA::Object_ptr
TAO_LB_LoadManager::next_member (const PortableServer::ObjectId & oid
ACE_ENV_ARG_DECL)
{
- // Pass the cached loads to the balancing strategy so that the
- // strategy may choose which member to forward requests to next.
-
PortableGroup::ObjectGroup_var object_group =
this->object_group_manager_.object_group (oid);
@@ -1046,7 +1043,7 @@ TAO_LB_LoadManager::init (
CORBA::string_dup ("org.omg.CosLoadBalancing.CustomStrategy");
}
-ACE_INLINE CosLoadBalancing::Strategy_ptr
+CosLoadBalancing::Strategy_ptr
TAO_LB_LoadManager::built_in_strategy (const char * strategy)
{
ACE_ASSERT (strategy != 0);