@SuppressWarnings("unchecked") private QueryElementFactHandle createQueryResultHandle(PropagationContext context, InternalWorkingMemory workingMemory, Object[] objects) { QueryElementFactHandle handle = null; ProtobufMessages.FactHandle _handle = null; if( context.getReaderContext() != null ) { Map<TupleKey, QueryElementContext> map = (Map<TupleKey, QueryElementContext>) context.getReaderContext().nodeMemories.get( node.getId() ); if( map != null ) { QueryElementContext _context = map.get( PersisterHelper.createTupleKey( leftTuple ) ); if( _context != null ) { _handle = _context.results.removeFirst(); } } } if( _handle != null ) { // create a handle with the given id handle = new QueryElementFactHandle( objects, _handle.getId(), _handle.getRecency() ); } else { handle = new QueryElementFactHandle( objects, workingMemory.getFactHandleFactory().getAtomicId().incrementAndGet(), workingMemory.getFactHandleFactory().getAtomicRecency().incrementAndGet() ); } return handle; }
_handle.getRecency(), objectTypeConf, workingMemory,
@SuppressWarnings("unchecked") private InternalFactHandle createFactHandle(final PropagationContext context, final InternalWorkingMemory workingMemory, final LeftTuple leftTuple ) { InternalFactHandle handle = null; ProtobufMessages.FactHandle _handle = null; if( context.getReaderContext() != null ) { Map<TupleKey, QueryElementContext> map = (Map<TupleKey, QueryElementContext>) context.getReaderContext().nodeMemories.get( getId() ); if( map != null ) { _handle = map.get( PersisterHelper.createTupleKey( leftTuple ) ).handle; } } if( _handle != null ) { // create a handle with the given id handle = workingMemory.getFactHandleFactory().newFactHandle( _handle.getId(), null, _handle.getRecency(), null, workingMemory, workingMemory ); } else { handle = workingMemory.getFactHandleFactory().newFactHandle( null, null, workingMemory, workingMemory ); } return handle; }
handle = new DefaultFactHandle( _handle.getId(), object, _handle.getRecency(), entryPoint, typeConf != null && typeConf.isTrait() ); handle = new QueryElementFactHandle( object, _handle.getId(), _handle.getRecency() ); break; handle = new EventFactHandle( _handle.getId(), object, _handle.getRecency(), _handle.getTimestamp(), _handle.getDuration(),
_handle.getRecency(), workingMemory.getObjectTypeConfigurationRegistry().getObjectTypeConf( context.getEntryPoint(), result ),
setRecency(other.getRecency());
@SuppressWarnings("unchecked") private InternalFactHandle createFactHandle(final LeftTuple leftTuple, final PropagationContext context, final InternalWorkingMemory workingMemory) { InternalFactHandle handle = null; ProtobufMessages.FactHandle _handle = null; if( context.getReaderContext() != null ) { Map<ProtobufInputMarshaller.TupleKey, ProtobufMessages.FactHandle> map = (Map<ProtobufInputMarshaller.TupleKey, ProtobufMessages.FactHandle>) context.getReaderContext().nodeMemories.get( getId() ); if( map != null ) { _handle = map.get( PersisterHelper.createTupleKey( leftTuple ) ); } } if( _handle != null ) { // create a handle with the given id handle = workingMemory.getFactHandleFactory().newFactHandle( _handle.getId(), leftTuple, _handle.getRecency(), workingMemory.getObjectTypeConfigurationRegistry().getObjectTypeConf( context.getEntryPoint(), leftTuple ), workingMemory, null ); // so far, result is not an event } else { handle = workingMemory.getFactHandleFactory().newFactHandle( leftTuple, workingMemory.getObjectTypeConfigurationRegistry().getObjectTypeConf( context.getEntryPoint(), leftTuple ), workingMemory, null ); // so far, result is not an event } return handle; }