org.kitesdk.morphline.base.Notifications.getLifecycleEvents()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(6.6k)|赞(0)|评价(0)|浏览(169)

本文整理了Java中org.kitesdk.morphline.base.Notifications.getLifecycleEvents()方法的一些代码示例,展示了Notifications.getLifecycleEvents()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Notifications.getLifecycleEvents()方法的具体详情如下:
包路径:org.kitesdk.morphline.base.Notifications
类名称:Notifications
方法名:getLifecycleEvents

Notifications.getLifecycleEvents介绍

[英]Get all lifecycle events from the given record.
[中]

代码示例

代码示例来源:origin: kite-sdk/kite

  1. /**
  2. * Determine whether or not the given notification contains the given lifecycle event.
  3. * @param notification A {@link Record} that represents a notification.
  4. * @param event A {@link LifecycleEvent} enumeration that is to be searched for in the given notification.
  5. */
  6. public static boolean containsLifecycleEvent(Record notification, LifecycleEvent event) {
  7. return getLifecycleEvents(notification).contains(event);
  8. }

代码示例来源:origin: org.kitesdk/kite-morphlines-core

  1. /**
  2. * Determine whether or not the given notification contains the given lifecycle event.
  3. * @param notification A {@link Record} that represents a notification.
  4. * @param event A {@link LifecycleEvent} enumeration that is to be searched for in the given notification.
  5. */
  6. public static boolean containsLifecycleEvent(Record notification, LifecycleEvent event) {
  7. return getLifecycleEvents(notification).contains(event);
  8. }

代码示例来源:origin: cloudera-labs/envelope

  1. @Override
  2. public void notify(Record notification) {
  3. for (Object event : Notifications.getLifecycleEvents(notification)) {
  4. if (event == Notifications.LifecycleEvent.START_SESSION) {
  5. reset();
  6. }
  7. }
  8. }

代码示例来源:origin: org.kitesdk/kite-morphlines-maxmind

  1. @Override
  2. protected void doNotify(Record notification) {
  3. for (Object event : Notifications.getLifecycleEvents(notification)) {
  4. if (event == Notifications.LifecycleEvent.SHUTDOWN) {
  5. try {
  6. databaseReader.close();
  7. } catch (IOException e) {
  8. LOG.warn("Cannot close Maxmind database: " + databaseFile, e);
  9. }
  10. }
  11. }
  12. super.doNotify(notification);
  13. }

代码示例来源:origin: kite-sdk/kite

  1. @Override
  2. protected void doNotify(Record notification) {
  3. for (Object event : Notifications.getLifecycleEvents(notification)) {
  4. if (event == Notifications.LifecycleEvent.SHUTDOWN) {
  5. try {
  6. databaseReader.close();
  7. } catch (IOException e) {
  8. LOG.warn("Cannot close Maxmind database: " + databaseFile, e);
  9. }
  10. }
  11. }
  12. super.doNotify(notification);
  13. }

代码示例来源:origin: kite-sdk/kite

  1. @Override
  2. protected void doNotify(Record notification) {
  3. for (Object event : Notifications.getLifecycleEvents(notification)) {
  4. if (event == Notifications.LifecycleEvent.SHUTDOWN) {
  5. synchronized (SERVERS) {
  6. Server server = SERVERS.remove(port);
  7. if (server != null) {
  8. try {
  9. server.stop();
  10. server.join();
  11. } catch (Exception e) {
  12. throw new MorphlineRuntimeException(e);
  13. }
  14. }
  15. }
  16. }
  17. }
  18. super.doNotify(notification);
  19. }

代码示例来源:origin: org.kitesdk/kite-morphlines-metrics-servlets

  1. @Override
  2. protected void doNotify(Record notification) {
  3. for (Object event : Notifications.getLifecycleEvents(notification)) {
  4. if (event == Notifications.LifecycleEvent.SHUTDOWN) {
  5. synchronized (SERVERS) {
  6. Server server = SERVERS.remove(port);
  7. if (server != null) {
  8. try {
  9. server.stop();
  10. server.join();
  11. } catch (Exception e) {
  12. throw new MorphlineRuntimeException(e);
  13. }
  14. }
  15. }
  16. }
  17. }
  18. super.doNotify(notification);
  19. }

代码示例来源:origin: com.stratio.morphlines/geoip

  1. @Override
  2. protected void doNotify(Record notification) {
  3. for (Object event : Notifications.getLifecycleEvents(notification)) {
  4. if (event == Notifications.LifecycleEvent.SHUTDOWN) {
  5. try {
  6. databaseReader.close();
  7. } catch (IOException e) {
  8. LOG.warn("Cannot close Maxmind database: "
  9. + databaseFile, e);
  10. }
  11. }
  12. }
  13. super.doNotify(notification);
  14. }
  15. }

代码示例来源:origin: kite-sdk/kite

  1. @Override
  2. protected void doNotify(Record notification) {
  3. for (Object event : Notifications.getLifecycleEvents(notification)) {
  4. if (event == Notifications.LifecycleEvent.SHUTDOWN) {
  5. synchronized (REGISTRIES) {
  6. Map<String, JmxReporter> reporters = REGISTRIES.get(getContext().getMetricRegistry());
  7. if (reporters != null) {
  8. JmxReporter reporter = reporters.remove(domain);
  9. if (reporter != null) {
  10. reporter.stop();
  11. }
  12. }
  13. }
  14. }
  15. }
  16. super.doNotify(notification);
  17. }

代码示例来源:origin: org.kitesdk/kite-morphlines-core

  1. @Override
  2. protected void doNotify(Record notification) {
  3. for (Object event : Notifications.getLifecycleEvents(notification)) {
  4. if (event == Notifications.LifecycleEvent.SHUTDOWN) {
  5. synchronized (REGISTRIES) {
  6. Map<String, Slf4jReporter> reporters = REGISTRIES.get(getContext().getMetricRegistry());
  7. if (reporters != null) {
  8. Slf4jReporter reporter = reporters.remove(logger);
  9. if (reporter != null) {
  10. reporter.stop();
  11. }
  12. }
  13. }
  14. }
  15. }
  16. super.doNotify(notification);
  17. }

代码示例来源:origin: org.kitesdk/kite-morphlines-core

  1. @Override
  2. protected void doNotify(Record notification) {
  3. for (Object event : Notifications.getLifecycleEvents(notification)) {
  4. if (event == Notifications.LifecycleEvent.SHUTDOWN) {
  5. synchronized (REGISTRIES) {
  6. Map<File, CsvReporter> reporters = REGISTRIES.get(getContext().getMetricRegistry());
  7. if (reporters != null) {
  8. CsvReporter reporter = reporters.remove(outputDir);
  9. if (reporter != null) {
  10. reporter.stop();
  11. }
  12. }
  13. }
  14. }
  15. }
  16. super.doNotify(notification);
  17. }

代码示例来源:origin: org.kitesdk/kite-morphlines-core

  1. @Override
  2. protected void doNotify(Record notification) {
  3. for (Object event : Notifications.getLifecycleEvents(notification)) {
  4. if (event == Notifications.LifecycleEvent.SHUTDOWN) {
  5. synchronized (REGISTRIES) {
  6. Map<String, JmxReporter> reporters = REGISTRIES.get(getContext().getMetricRegistry());
  7. if (reporters != null) {
  8. JmxReporter reporter = reporters.remove(domain);
  9. if (reporter != null) {
  10. reporter.stop();
  11. }
  12. }
  13. }
  14. }
  15. }
  16. super.doNotify(notification);
  17. }

代码示例来源:origin: kite-sdk/kite

  1. @Override
  2. protected void doNotify(Record notification) {
  3. for (Object event : Notifications.getLifecycleEvents(notification)) {
  4. if (event == Notifications.LifecycleEvent.SHUTDOWN) {
  5. synchronized (REGISTRIES) {
  6. Map<File, CsvReporter> reporters = REGISTRIES.get(getContext().getMetricRegistry());
  7. if (reporters != null) {
  8. CsvReporter reporter = reporters.remove(outputDir);
  9. if (reporter != null) {
  10. reporter.stop();
  11. }
  12. }
  13. }
  14. }
  15. }
  16. super.doNotify(notification);
  17. }

代码示例来源:origin: kite-sdk/kite

  1. @Override
  2. protected void doNotify(Record notification) {
  3. for (Object event : Notifications.getLifecycleEvents(notification)) {
  4. if (event == Notifications.LifecycleEvent.SHUTDOWN) {
  5. synchronized (REGISTRIES) {
  6. Map<String, Slf4jReporter> reporters = REGISTRIES.get(getContext().getMetricRegistry());
  7. if (reporters != null) {
  8. Slf4jReporter reporter = reporters.remove(logger);
  9. if (reporter != null) {
  10. reporter.stop();
  11. }
  12. }
  13. }
  14. }
  15. }
  16. super.doNotify(notification);
  17. }

代码示例来源:origin: org.apache.solr/solr-morphlines-core

  1. @Override
  2. protected void doNotify(Record notification) {
  3. for (Object event : Notifications.getLifecycleEvents(notification)) {
  4. if (event == Notifications.LifecycleEvent.BEGIN_TRANSACTION) {
  5. try {

代码示例来源:origin: org.kitesdk/kite-morphlines-solr-core

  1. @Override
  2. protected void doNotify(Record notification) {
  3. for (Object event : Notifications.getLifecycleEvents(notification)) {
  4. if (event == Notifications.LifecycleEvent.BEGIN_TRANSACTION) {
  5. try {

代码示例来源:origin: kite-sdk/kite

  1. @Override
  2. protected void doNotify(Record notification) {
  3. for (Object event : Notifications.getLifecycleEvents(notification)) {
  4. if (event == Notifications.LifecycleEvent.BEGIN_TRANSACTION) {
  5. try {

相关文章