public class InvocationRegistry extends Object
Response
comes in, the
appropriate invocation can be looked up.
Some idea's:
- use an ringbuffer to store all invocations instead of a CHM. The call-id can be used as sequence-id for this
ringbuffer. It can be that you run in slots that have not been released; if that happens, just keep increasing
the sequence (although you now get sequence-gaps).
- pre-allocate all invocations. Because the ringbuffer has a fixed capacity, pre-allocation should be easy. Also
the PartitionInvocation and TargetInvocation can be folded into Invocation.Constructor and Description |
---|
InvocationRegistry(NodeEngineImpl nodeEngine,
ILogger logger,
BackpressureRegulator backpressureRegulator,
int concurrencyLevel) |
Modifier and Type | Method and Description |
---|---|
void |
deregister(com.hazelcast.spi.impl.operationservice.impl.Invocation invocation)
Deregisters an invocation.
|
Set<Map.Entry<Long,com.hazelcast.spi.impl.operationservice.impl.Invocation>> |
entrySet()
Intention to expose the entry set is to mutate it.
|
com.hazelcast.spi.impl.operationservice.impl.Invocation |
get(long callId)
Gets the invocation for the given call id.
|
long |
getLastCallId() |
Collection<com.hazelcast.spi.impl.operationservice.impl.Invocation> |
invocations() |
void |
notify(Response response,
Address sender)
Notifies the invocation that a Response is available.
|
void |
notifyBackupComplete(long callId) |
void |
register(com.hazelcast.spi.impl.operationservice.impl.Invocation invocation)
Registers an invocation.
|
void |
reset() |
void |
shutdown() |
int |
size()
Returns the number of pending invocations.
|
public InvocationRegistry(NodeEngineImpl nodeEngine, ILogger logger, BackpressureRegulator backpressureRegulator, int concurrencyLevel)
public long getLastCallId()
public void register(com.hazelcast.spi.impl.operationservice.impl.Invocation invocation)
invocation
- The invocation to register.public void deregister(com.hazelcast.spi.impl.operationservice.impl.Invocation invocation)
invocation
- The Invocation to deregister.public int size()
public Collection<com.hazelcast.spi.impl.operationservice.impl.Invocation> invocations()
public Set<Map.Entry<Long,com.hazelcast.spi.impl.operationservice.impl.Invocation>> entrySet()
public com.hazelcast.spi.impl.operationservice.impl.Invocation get(long callId)
callId
- the callId.public void notify(Response response, Address sender)
response
- The response that is available.sender
- Endpoint who sent the responsepublic void notifyBackupComplete(long callId)
public void reset()
public void shutdown()
Copyright © 2017 Hazelcast, Inc.. All Rights Reserved.