def _aggregate(input, options, output, timeFieldName):
 aggregator = Aggregator(aggregationInfo=options, inputFields=input.getFields(), timeFieldName=timeFieldName)
 while True:
  inRecord = input.getNextRecord()
  print 'Feeding in: ', inRecord
  (outRecord, aggBookmark) = aggregator.next(record=inRecord, curInputBookmark=None)
  print 'Record out: ', outRecord
  if (outRecord is not None):
   output.appendRecord(outRecord, None)
  if ((inRecord is None) and (outRecord is None)):
   break

def _aggregate ( input , options , output , timeFieldName ) : aggregator = Aggregator ( aggregationInfo = options , inputFields = input . getFields ( ) , timeFieldName = timeFieldName ) while True : inRecord = input . getNextRecord ( ) print 'Feeding in: ' , inRecord ( outRecord , aggBookmark ) = aggregator . next ( record = inRecord , curInputBookmark = None ) print 'Record out: ' , outRecord if ( outRecord is not None ) : output . appendRecord ( outRecord , None ) if ( ( inRecord is None ) and ( outRecord is None ) ) : break
aggregate the input stream and write aggregated records to the output stream .