/**
* Returns a positive Ack if this fragment is accepted.
*/
private Ack incomingRecordBatch(RemoteConnection connection, FragmentRecordBatch fragmentBatch, ByteBuf body) throws FragmentSetupException{
FragmentHandle handle = fragmentBatch.getHandle();
IncomingFragmentHandler handler = handlers.get(handle);
// Create a handler if there isn't already one.
if(handler == null){
PlanFragment fragment = bee.getContext().getCache().getFragment(handle);
if(fragment == null){
logger.error("Received batch where fragment was not in cache.");
return Acks.FAIL;
}
IncomingFragmentHandler newHandler = new RemoteFragmentHandler(fragment, bee.getContext(), bee.getContext().getBitCom().getTunnel(fragment.getForeman()));
// since their could be a race condition on the check, we'll use putIfAbsent so we don't have two competing handlers.
handler = handlers.putIfAbsent(fragment.getHandle(), newHandler);
if(handler == null){