public void ProcessView( EventBean[] newData, EventBean[] oldData, bool isGenerateSynthetic) { var newDataMultiKey = processor.GenerateGroupKeyArrayView(newData, true); var oldDataMultiKey = processor.GenerateGroupKeyArrayView(oldData, false); var eventsPerStream = new EventBean[1]; if (newData != null) { // apply new data to aggregates var count = 0; foreach (var aNewData in newData) { var mk = newDataMultiKey[count]; eventsPerStream[0] = aNewData; processor.AggregationService.ApplyEnter(eventsPerStream, mk, processor.GetAgentInstanceContext()); count++; } } if (oldData != null) { // apply old data to aggregates var count = 0; foreach (var anOldData in oldData) { eventsPerStream[0] = anOldData; processor.AggregationService.ApplyLeave( eventsPerStream, oldDataMultiKey[count], processor.GetAgentInstanceContext()); count++; } } if (processor.IsSelectRStream) { processor.GenerateOutputBatchedViewPerKey( oldData, oldDataMultiKey, false, isGenerateSynthetic, outputLastUnordGroupOld, null, eventsPerStream); } processor.GenerateOutputBatchedViewPerKey( newData, newDataMultiKey, false, isGenerateSynthetic, outputLastUnordGroupNew, null, eventsPerStream); }
public void ProcessView( EventBean[] newData, EventBean[] oldData, bool isGenerateSynthetic) { var newDataMultiKey = processor.GenerateGroupKeyArrayView(newData, true); var oldDataMultiKey = processor.GenerateGroupKeyArrayView(oldData, false); ISet<object> keysSeenRemoved = new HashSet<object>(); var eventsPerStreamOneStream = new EventBean[1]; if (newData != null) { // apply new data to aggregates var count = 0; foreach (var aNewData in newData) { EventBean[] eventsPerStream = {aNewData}; var mk = newDataMultiKey[count]; repsPerGroup.Put(mk, eventsPerStream); lastSeenKeys.Add(mk); processor.AggregationService.ApplyEnter(eventsPerStream, mk, processor.GetAgentInstanceContext()); count++; } } if (oldData != null) { // apply old data to aggregates var count = 0; foreach (var anOldData in oldData) { var mk = oldDataMultiKey[count]; lastSeenKeys.Add(mk); keysSeenRemoved.Add(mk); eventsPerStreamOneStream[0] = anOldData; processor.AggregationService.ApplyLeave( eventsPerStreamOneStream, oldDataMultiKey[count], processor.GetAgentInstanceContext()); count++; } } if (processor.IsSelectRStream) { processor.GenerateOutputBatchedViewUnkeyed( oldData, oldDataMultiKey, false, isGenerateSynthetic, eventsOld, null, eventsPerStreamOneStream); } processor.GenerateOutputBatchedViewUnkeyed( newData, newDataMultiKey, true, isGenerateSynthetic, eventsNew, null, eventsPerStreamOneStream); foreach (var keySeen in keysSeenRemoved) { var newEvent = processor.GenerateOutputBatchedSingle( keySeen, repsPerGroup.Get(keySeen), true, isGenerateSynthetic); if (newEvent != null) { eventsNew.Add(newEvent); } } }