Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimization: BasicOperationService delete remotecallkey #4079

Closed
pveentjer opened this issue Nov 13, 2014 · 0 comments · Fixed by #4095
Closed

Optimization: BasicOperationService delete remotecallkey #4079

pveentjer opened this issue Nov 13, 2014 · 0 comments · Fixed by #4095
Labels
Milestone

Comments

@pveentjer
Copy link
Contributor

Currently for certain types of remote executed calls, we store the call into the 'executingCalls' map. The key (and value) is a RemoteCallKey object. The functionality provided is the ability to ask on the remote side if an operation is still executing.

But for partitionaware operation this isn't needed. When an operation is scheduled by a partition specific operation thread, the operation can be stored in a volatile field in that thread.

If you want to ask if a specific operation is still executing, you just go to the correct partition thread based on the partition id, and read out that currentOperation field and check the fields (e.g. address and callid).

This requires some changes in the basic operation scheduler because it needs to have access to the operation object instead of a packet. So instead of doing:

Object task = workQueue.get();
operationHandler.handle(task)

It will do a a

Object task = workQueue.get();
Operation operation = operationHandler.deserialize(task);
currentOperation = operation;
try{
    operationHandler.handle(operation);
}finally{
     currentOperation = null;
}

Where currentOperation is a volatile field in that operation thread.

For non partition specific operations we can keep using the RemoteCallKey, or we can just iterate over all non partition specific threads and check if the operation is running.

The added value of this fix is that:

  • less object litter
  • we replace a CHM.put and a CHM.remove by 2 volatile writes. We can even make them AtomicReference.lazyset calls.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants