com.hazelcast.spi.impl.operationservice.impl
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(OperationServiceImpl operationService,
int concurrencyLevel) |
Modifier and Type | Method and Description |
---|---|
void |
awaitTermination(long timeoutMillis) |
void |
deregister(com.hazelcast.spi.impl.operationservice.impl.Invocation invocation)
Deregisters an invocation.
|
com.hazelcast.spi.impl.operationservice.impl.Invocation |
get(long callId)
Gets the invocation for the given call id.
|
double |
getInvocationUsagePercentage() |
long |
getLastCallId() |
void |
notify(Response response)
Notifies the invocation that a Response is available.
|
void |
notifyBackupComplete(long callId) |
void |
onMemberLeft(MemberImpl member) |
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(OperationServiceImpl operationService, 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 double getInvocationUsagePercentage()
public int size()
public com.hazelcast.spi.impl.operationservice.impl.Invocation get(long callId)
callId
- the callId.public void notify(Response response)
response
- The response that is available.public void notifyBackupComplete(long callId)
public void onMemberLeft(MemberImpl member)
public void reset()
public void shutdown()
public void awaitTermination(long timeoutMillis) throws InterruptedException
InterruptedException
Copyright © 2015 Hazelcast, Inc.. All Rights Reserved.