Class SimpleServerSelectionProvider

java.lang.Object
com.illumon.iris.controller.SimpleServerSelectionProvider
All Implemented Interfaces:
IServerSelectionProvider

public class SimpleServerSelectionProvider
extends Object
implements IServerSelectionProvider
Simple implementation of IServerSelectionProvider. This performs round-robin based on server availability and current usage, selecting from available server with the requested available heap, based on lowest heap utilization percentage and worker count. In its current form it is probably not suitable for production use because more intelligence is needed for small and large heap requests. It is driven by the following properties. All properties are required for all groups, unless indicated as optional.
  • PROP_ACTIVE_GROUPS specifies the names of the active groups. This drives the rest of the properties - these group names are used to derive the other property names.
  • All other properties start with PROP_PREFIX followed by the group name, and the property being specified.
  • PROP_SERVER_CLASS_SUFFIX specifies the server class for this group. Only servers of this class will be chosen when a server is requested. Typical values are Query and Merge. If this isn't supplied, then the value specified by the property PersistentQueryDbServerConfig.DEFAULT_SERVER_CLASS_PROP will be used.
  • PROP_SERVERS_SUFFIX is optional and specifies the servers in this group. If it's not specified, all servers of the specified class will be in this group.
  • PROP_MAX_HEAP_PER_WORKER_SUFFIX specifies the maximum heap in MB allowed per worker for this group. If it's not specified or is 0, then the value from PROP_DEFAULT_TOTAL_HEAP_SUFFIX will be used.
  • PROP_DEFAULT_TOTAL_HEAP_SUFFIX specifies the default total heap for each server for this group. This will be updated by the controller after it gets a connection to each dispatcher.
For example:

SimpleServerSelectionProvider.ActiveGroups=AutoQuery,AutoMerge

SimpleServerSelectionProvider.Group.AutoQuery.ServerClass=Query

# No servers specified by an AutoQuery.Servers property, so all query servers will be in this group

SimpleServerSelectionProvider.Group.AutoQuery.MaxHeapMBPerWorker=32768

SimpleServerSelectionProvider.Group.AutoQuery.DefaultHeapMBPerServer=65536

SimpleServerSelectionProvider.Group.AutoMerge.ServerClass=Merge

SimpleServerSelectionProvider.Group.AutoMerge.Servers=Merge_Server_1,Merge_Server_2

SimpleServerSelectionProvider.Group.AutoMerge.MaxHeapMBPerWorker=32768

SimpleServerSelectionProvider.Group.AutoMerge.DefaultHeapMBPerServer=65536

This implementation is fully reloadable.