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

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

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

Notifications.notifyShutdown介绍

[英]Notify the given command that a shutdown command has been issued.
[中]通知给定命令已发出关机命令。

代码示例

代码示例来源:origin: apache/flume

  1. @Override
  2. public void stop() {
  3. Notifications.notifyShutdown(morphline);
  4. }

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

  1. @Override
  2. public void close() throws IOException {
  3. Notifications.notifyShutdown(this.morphline);
  4. }

代码示例来源:origin: org.apache.flume.flume-ng-sinks/flume-ng-morphline-solr-sink

  1. @Override
  2. public void stop() {
  3. Notifications.notifyShutdown(morphline);
  4. }

代码示例来源:origin: com.cloudera.search/search-mr

  1. public void cleanup() {
  2. Notifications.notifyCommitTransaction(morphline);
  3. Notifications.notifyShutdown(morphline);
  4. }

代码示例来源:origin: cloudera/search

  1. public void cleanup() {
  2. Notifications.notifyCommitTransaction(morphline);
  3. Notifications.notifyShutdown(morphline);
  4. }

代码示例来源:origin: cloudera/search

  1. @Override
  2. public void cleanup(Emitter<T> emitter) {
  3. try {
  4. collector.setEmitter(emitter);
  5. Notifications.notifyCommitTransaction(morphline);
  6. Notifications.notifyShutdown(morphline);
  7. } finally {
  8. addMetricsToMRCounters(morphlineContext.getMetricRegistry());
  9. }
  10. }

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

  1. @Test
  2. public void testStartReportingMetricsToSLF4J() throws Exception {
  3. morphline = createMorphline("test-morphlines/startReportingMetricsToSLF4J");
  4. Record record = new Record();
  5. String msg = "foo";
  6. record.put(Fields.MESSAGE, msg);
  7. Record expected = new Record();
  8. expected.put(Fields.MESSAGE, msg);
  9. processAndVerifySuccess(record, expected);
  10. Notifications.notifyShutdown(morphline);
  11. Notifications.notifyShutdown(morphline);
  12. }

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

  1. len2 = len2b;
  2. Notifications.notifyShutdown(morphline);
  3. assertEquals(len1, testMetricsOutput1.length());
  4. assertEquals(len2, testMetricsOutput2.length());
  5. Notifications.notifyShutdown(morphline);
  6. Notifications.notifyShutdown(morphline);

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

  1. /** Usage: java ... <morphline.conf> <dataFile1> ... <dataFileN> */
  2. public static void main(String[] args) throws IOException {
  3. // compile morphline.conf file on the fly
  4. File morphlineFile = new File(args[0]);
  5. String morphlineId = null;
  6. MorphlineContext morphlineContext = new MorphlineContext.Builder().build();
  7. Command morphline = new Compiler().compile(morphlineFile, morphlineId, morphlineContext, null);
  8. // process each input data file
  9. Notifications.notifyBeginTransaction(morphline);
  10. try {
  11. for (int i = 1; i < args.length; i++) {
  12. InputStream in = new BufferedInputStream(new FileInputStream(new File(args[i])));
  13. Record record = new Record();
  14. record.put(Fields.ATTACHMENT_BODY, in);
  15. Notifications.notifyStartSession(morphline);
  16. boolean success = morphline.process(record);
  17. if (!success) {
  18. System.out.println("Morphline failed to process record: " + record);
  19. }
  20. in.close();
  21. }
  22. Notifications.notifyCommitTransaction(morphline);
  23. } catch (RuntimeException e) {
  24. Notifications.notifyRollbackTransaction(morphline);
  25. morphlineContext.getExceptionHandler().handleException(e, null);
  26. }
  27. Notifications.notifyShutdown(morphline);
  28. }
  29. }

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

  1. Notifications.notifyShutdown(morphline);
  2. assertMBeanInstanceNotFound(obj1Name, mBeanServer);
  3. assertMBeanInstanceNotFound(obj2Name, mBeanServer);

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

  1. Notifications.notifyShutdown(morphline);

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

  1. @Test
  2. public void testLoadSolrBasic() throws Exception {
  3. //System.setProperty("ENV_SOLR_HOME", testSolrHome + File.separator + "collection1");
  4. morphline = createMorphline("test-morphlines" + File.separator + "loadSolrBasic");
  5. //System.clearProperty("ENV_SOLR_HOME");
  6. Record record = new Record();
  7. record.put(Fields.ID, "id0");
  8. record.put("first_name", "Nadja"); // will be sanitized
  9. startSession();
  10. Notifications.notifyBeginTransaction(morphline);
  11. assertTrue(morphline.process(record));
  12. assertEquals(1, collector.getNumStartEvents());
  13. Notifications.notifyCommitTransaction(morphline);
  14. Record expected = new Record();
  15. expected.put(Fields.ID, "id0");
  16. assertEquals(Arrays.asList(expected), collector.getRecords());
  17. assertEquals(1, queryResultSetSize("*:*"));
  18. Notifications.notifyRollbackTransaction(morphline);
  19. Notifications.notifyShutdown(morphline);
  20. }

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

  1. Notifications.notifyShutdown(morphline);

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

  1. Notifications.notifyShutdown(morphline);

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

  1. Notifications.notifyShutdown(morphline);

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

  1. Notifications.notifyShutdown(morphline);

相关文章