Top Description Interfaces Classes
[default module]

Package io.rsocket.loadbalance

Annotations
@NonNullApi
Imports
reactor.util.annotation.NonNullApi

Support client load-balancing in RSocket Java.

Interface Summary

Modifier and TypeInterface and Description
public interface
ClientLoadbalanceStrategy

A LoadbalanceStrategy with an interest in configuring the RSocketConnector for connecting to load-balance targets in order to hook into request lifecycle and track usage statistics.

public interface
LoadbalanceStrategy

Strategy to select an RSocket given a list of instances for load-balancing purposes.

pack-priv interface
public interface
WeightedStats

Contract to expose the stats required in WeightedLoadbalanceStrategy to calculate an algorithmic weight for an RSocket.

Class Summary

Modifier and TypeClass and Description
public class
BaseWeightedStats

Implementation of WeightedStats that manages tracking state and exposes the required stats.

pack-priv class
Ewma

Compute the exponential weighted moving average of a series of values.

pack-priv abstract class
pack-priv class
FrugalQuantile

Reference: Ma, Qiang, S.

pack-priv class
Int2LongHashMap

A open addressing with linear probing hash map specialised for primitive key and value pairs.

public class
LoadbalanceRSocketClient

An implementation of RSocketClient backed by a pool of RSocket instances and using a LoadbalanceStrategy to select the RSocket to use for a given request.

public class
LoadbalanceTarget

Representation for a load-balance target used as input to LoadbalanceRSocketClient that in turn maintains and peridodically updates a list of current load-balance targets.

pack-priv class
Median

This implementation gives better results because it considers more data-point.

pack-priv abstract class
pack-priv class
PooledRSocket

Default implementation of RSocket stored in RSocketPool

pack-priv class
public class
RoundRobinLoadbalanceStrategy

Simple LoadbalanceStrategy that selects the RSocket to use in round-robin order.

pack-priv class
public class
WeightedLoadbalanceStrategy

LoadbalanceStrategy that assigns a weight to each RSocket based on availability and usage statistics.

public class
WeightedStatsRequestInterceptor

RequestInterceptor that hooks into request lifecycle and calls methods of the parent class to manage tracking state and expose WeightedStats.

pack-priv class
WeightedStatsRSocketProxy

Package private RSocketProxy used from WeightedStats#wrap(RSocket) to attach a WeightedStats instance to an RSocket.