@Override public void close() { try { if (oserver != null) { notificationFinder.stop(); mnp.close(); oserver.stop(); env.close(); reporter.close(); if (cluster != null) { cluster.stop(); } } } catch (Exception e) { throw new RuntimeException(e); } }
@Override public void run() { try { // Its possible that while the notification was in the queue the situation changed and it // should no longer be processed by this worker. So ask as late as possible if this // notification should be processed. if (notificationFinder.shouldProcess(notification)) { workTask.run(); } } catch (Exception e) { log.error("Failed to process work " + Hex.encNonAscii(notification), e); } finally { tracker.remove(notification); workFinished(); } } };
public MiniFluoImpl(FluoConfiguration fluoConfig) { if (!fluoConfig.hasRequiredMiniFluoProps()) { throw new IllegalArgumentException("MiniFluo configuration is not valid"); } config = fluoConfig; try { if (config.getMiniStartAccumulo()) { startMiniAccumulo(); } config.setProperty(FluoConfigurationImpl.MIN_SLEEP_TIME_PROP, 50); config.setProperty(FluoConfigurationImpl.MAX_SLEEP_TIME_PROP, 100); env = new Environment(config); reporter = FluoClientImpl.setupReporters(env, "mini", reporterCounter); oserver = new OracleServer(env); oserver.start(); mnp = new MiniNotificationProcessor(env); notificationFinder = NotificationFinderFactory.newNotificationFinder(env.getConfiguration()); notificationFinder.init(env, mnp); notificationFinder.start(); } catch (Exception e) { throw new RuntimeException(e); } }
} catch (AlreadyAcknowledgedException aae) { status = TxResult.AACKED; notificationFinder.failedToProcess(notification, status); break; } catch (CommitException e) { log.warn("Failed to execute observer " + observer.getClass().getSimpleName() + " notification : " + Hex.encNonAscii(notification), e); notificationFinder.failedToProcess(notification, status); break; } finally {