예제 #1
0
 @Override
 public void onEvent(TwoPhaseEvent<SparseItem> event, long sequence, boolean endOfBatch)
     throws Exception {
   double prediction = algorithm.learn(event.output(), increment);
   model.writeToModel(increment);
   outputFormat.emit(event.output(), prediction);
 }
예제 #2
0
 @Override
 public void onShutdown() {
   try {
     outputFormat.close();
   } catch (IOException e) {
     logger.error("Failed to close", e);
   } finally {
     phaser.arriveAndDeregister();
   }
 }