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

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

本文整理了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

@Override
public void stop() {
 Notifications.notifyShutdown(morphline);
}

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

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

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

@Override
public void stop() {
 Notifications.notifyShutdown(morphline);
}

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

public void cleanup() {
 Notifications.notifyCommitTransaction(morphline);
 Notifications.notifyShutdown(morphline);
}

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

public void cleanup() {
 Notifications.notifyCommitTransaction(morphline);
 Notifications.notifyShutdown(morphline);
}

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

@Override
public void cleanup(Emitter<T> emitter) {
 try {
  collector.setEmitter(emitter);
  Notifications.notifyCommitTransaction(morphline);
  Notifications.notifyShutdown(morphline);
 } finally {
  addMetricsToMRCounters(morphlineContext.getMetricRegistry());
 }
}

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

@Test
public void testStartReportingMetricsToSLF4J() throws Exception {
 morphline = createMorphline("test-morphlines/startReportingMetricsToSLF4J");    
 Record record = new Record();
 String msg = "foo";
 record.put(Fields.MESSAGE, msg);
 Record expected = new Record();
 expected.put(Fields.MESSAGE, msg);
 processAndVerifySuccess(record, expected);
 Notifications.notifyShutdown(morphline);
 Notifications.notifyShutdown(morphline);
}

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

len2 = len2b;
Notifications.notifyShutdown(morphline);
 assertEquals(len1, testMetricsOutput1.length());
 assertEquals(len2, testMetricsOutput2.length());
 Notifications.notifyShutdown(morphline);
Notifications.notifyShutdown(morphline);

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

/** Usage: java ... <morphline.conf> <dataFile1> ... <dataFileN> */
 public static void main(String[] args) throws IOException {
  // compile morphline.conf file on the fly
  File morphlineFile = new File(args[0]);
  String morphlineId = null;
  MorphlineContext morphlineContext = new MorphlineContext.Builder().build();
  Command morphline = new Compiler().compile(morphlineFile, morphlineId, morphlineContext, null);
  
  // process each input data file
  Notifications.notifyBeginTransaction(morphline);
  try {
   for (int i = 1; i < args.length; i++) {
    InputStream in = new BufferedInputStream(new FileInputStream(new File(args[i])));
    Record record = new Record();
    record.put(Fields.ATTACHMENT_BODY, in);      
    Notifications.notifyStartSession(morphline);
    boolean success = morphline.process(record);
    if (!success) {
     System.out.println("Morphline failed to process record: " + record);
    }
    in.close();
   }
   Notifications.notifyCommitTransaction(morphline);
  } catch (RuntimeException e) {
   Notifications.notifyRollbackTransaction(morphline);
   morphlineContext.getExceptionHandler().handleException(e, null);
  }
  Notifications.notifyShutdown(morphline);
 }
}

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

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

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

Notifications.notifyShutdown(morphline);

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

@Test
public void testLoadSolrBasic() throws Exception {
 //System.setProperty("ENV_SOLR_HOME", testSolrHome + File.separator + "collection1");
 morphline = createMorphline("test-morphlines" + File.separator + "loadSolrBasic");    
 //System.clearProperty("ENV_SOLR_HOME");
 Record record = new Record();
 record.put(Fields.ID, "id0");
 record.put("first_name", "Nadja"); // will be sanitized
 startSession();
 Notifications.notifyBeginTransaction(morphline);
 assertTrue(morphline.process(record));
 assertEquals(1, collector.getNumStartEvents());
 Notifications.notifyCommitTransaction(morphline);
 Record expected = new Record();
 expected.put(Fields.ID, "id0");
 assertEquals(Arrays.asList(expected), collector.getRecords());
 assertEquals(1, queryResultSetSize("*:*"));
 Notifications.notifyRollbackTransaction(morphline);
 Notifications.notifyShutdown(morphline);
}

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

Notifications.notifyShutdown(morphline);

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

Notifications.notifyShutdown(morphline);

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

Notifications.notifyShutdown(morphline);

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

Notifications.notifyShutdown(morphline);

相关文章