public interface IConnection extends AutoCloseable
Modifier and Type | Method and Description |
---|---|
void |
close()
close this connection
|
Map<Integer,Load> |
getLoad(Collection<Integer> tasks)
Get the current load for the given tasks
|
int |
getPort()
Get the port for this connection
|
void |
registerNewConnectionResponse(Supplier<Object> cb)
Register a response generator to be used to send an initial response when a new client connects.
|
void |
registerRecv(IConnectionCallback cb)
Register a callback to be notified when data is ready to be processed.
|
void |
send(Iterator<TaskMessage> msgs)
send batch messages
|
void |
sendBackPressureStatus(BackPressureStatus bpStatus)
Sends the back pressure metrics to all downstream connections.
|
void |
sendLoadMetrics(Map<Integer,Double> taskToLoad)
Send load metrics to all downstream connections.
|
void registerRecv(IConnectionCallback cb)
Register a callback to be notified when data is ready to be processed.
cb
- the callback to process the messages.void registerNewConnectionResponse(Supplier<Object> cb)
Register a response generator to be used to send an initial response when a new client connects.
cb
- the callback to process the connection.void sendLoadMetrics(Map<Integer,Double> taskToLoad)
Send load metrics to all downstream connections.
taskToLoad
- a map from the task id to the load for that task.void sendBackPressureStatus(BackPressureStatus bpStatus)
Sends the back pressure metrics to all downstream connections.
void send(Iterator<TaskMessage> msgs)
send batch messages
msgs
- Map<Integer,Load> getLoad(Collection<Integer> tasks)
Get the current load for the given tasks
tasks
- the tasks to look for.int getPort()
Get the port for this connection
void close()
close this connection
close
in interface AutoCloseable
Copyright © 2019 The Apache Software Foundation. All rights reserved.