com.hazelcast.nio.tcp.iobalancer
public class IOBalancer extends Object
com.hazelcast.nio.tcp.handlermigration.HandlerBalancer
tries to detect such situations and fix
them by moving ReadHandler
and WriteHandler
between
threads.
It measures number of events serviced by each handler in a given interval and if imbalance is detected then it
schedules handler migration to fix the situation. The exact migration strategy can be customized via
MigrationStrategy
.
Measuring interval can be customized via GroupProperties.IO_BALANCER_INTERVAL_SECONDS
It doesn't leverage ConnectionListener
capability
provided by ConnectionManager
to observe connections as it has to be notified
right after a physical TCP connection is created whilst ConnectionListener
is notified only
after a successful (Hazelcast) binding process.Constructor and Description |
---|
IOBalancer(InSelectorImpl[] inSelectors,
OutSelectorImpl[] outSelectors,
HazelcastThreadGroup threadGroup,
int migrationIntervalSeconds,
LoggingService loggingService) |
Modifier and Type | Method and Description |
---|---|
void |
connectionAdded(Connection connection) |
void |
connectionRemoved(Connection connection) |
void |
start() |
void |
stop() |
public IOBalancer(InSelectorImpl[] inSelectors, OutSelectorImpl[] outSelectors, HazelcastThreadGroup threadGroup, int migrationIntervalSeconds, LoggingService loggingService)
public void connectionAdded(Connection connection)
public void connectionRemoved(Connection connection)
public void stop()
public void start()
Copyright © 2015 Hazelcast, Inc.. All Rights Reserved.