@Test public void cleanup() throws Exception { processor.cleanup(); }
@OnStopped public void cleanup() { validationResourceHolder.set(null); ComponentLog log = getLogger(); sendHeartBeat.set(false); for(Map<HiveEndPoint, HiveWriter> allWriters : threadWriterList) { for (Map.Entry<HiveEndPoint, HiveWriter> entry : allWriters.entrySet()) { try { HiveWriter w = entry.getValue(); w.flushAndClose(); } catch (Exception ex) { log.warn("Error while closing writer to " + entry.getKey() + ". Exception follows.", ex); if (ex instanceof InterruptedException) { Thread.currentThread().interrupt(); } } } allWriters.clear(); } if (callTimeoutPool != null) { callTimeoutPool.shutdown(); try { while (!callTimeoutPool.isTerminated()) { callTimeoutPool.awaitTermination(callTimeout, TimeUnit.MILLISECONDS); } } catch (Throwable t) { log.warn("shutdown interrupted on " + callTimeoutPool, t); } callTimeoutPool = null; } ugi = null; }
PutHiveStreaming extends AbstractSessionFactoryProcessor { @OnStopped public void cleanup() { validationResourceHolder.set(null); ComponentLog log = getLogger(); sendHeartBeat.set(false); for(Map<HiveEndPoint, HiveWriter> allWriters : threadWriterList) { for (Map.Entry<HiveEndPoint, HiveWriter> entry : allWriters.entrySet()) { try { HiveWriter w = entry.getValue(); w.flushAndClose(); } catch (Exception ex) { log.warn("Error while closing writer to " + entry.getKey() + ". Exception follows.", ex); if (ex instanceof InterruptedException) { Thread.currentThread().interrupt(); } } } allWriters.clear(); } if (callTimeoutPool != null) { callTimeoutPool.shutdown(); try { while (!callTimeoutPool.isTerminated()) { callTimeoutPool.awaitTermination(callTimeout, TimeUnit.MILLISECONDS); } } catch (Throwable t) { log.warn("shutdown interrupted on " + callTimeoutPool, t); } callTimeoutPool = null; } ugi = null; } }
PutHiveStreaming extends AbstractSessionFactoryProcessor { @OnStopped public void cleanup() { validationResourceHolder.set(null); ComponentLog log = getLogger(); sendHeartBeat.set(false); for(Map<HiveEndPoint, HiveWriter> allWriters : threadWriterList) { for (Map.Entry<HiveEndPoint, HiveWriter> entry : allWriters.entrySet()) { try { HiveWriter w = entry.getValue(); w.flushAndClose(); } catch (Exception ex) { log.warn("Error while closing writer to " + entry.getKey() + ". Exception follows.", ex); if (ex instanceof InterruptedException) { Thread.currentThread().interrupt(); } } } allWriters.clear(); } if (callTimeoutPool != null) { callTimeoutPool.shutdown(); try { while (!callTimeoutPool.isTerminated()) { callTimeoutPool.awaitTermination(callTimeout, TimeUnit.MILLISECONDS); } } catch (Throwable t) { log.warn("shutdown interrupted on " + callTimeoutPool, t); } callTimeoutPool = null; } ugi = null; }  }
PutHiveStreaming extends AbstractSessionFactoryProcessor { @OnStopped public void cleanup() { validationResourceHolder.set(null); ComponentLog log = getLogger(); sendHeartBeat.set(false); for(Map<HiveEndPoint, HiveWriter> allWriters : threadWriterList) { for (Map.Entry<HiveEndPoint, HiveWriter> entry : allWriters.entrySet()) { try { HiveWriter w = entry.getValue(); w.flushAndClose(); } catch (Exception ex) { log.warn("Error while closing writer to " + entry.getKey() + ". Exception follows.", ex); if (ex instanceof InterruptedException) { Thread.currentThread().interrupt(); } } } allWriters.clear(); } if (callTimeoutPool != null) { callTimeoutPool.shutdown(); try { while (!callTimeoutPool.isTerminated()) { callTimeoutPool.awaitTermination(callTimeout, TimeUnit.MILLISECONDS); } } catch (Throwable t) { log.warn("shutdown interrupted on " + callTimeoutPool, t); } callTimeoutPool = null; } ugi = null; }  @Override Set<Relationship> getRelationships(); @OnScheduled void setup(final ProcessContext context); @Override void onTrigger(ProcessContext context, ProcessSessionFactory sessionFactory); @OnStopped void cleanup(); }
PutHiveStreaming extends AbstractSessionFactoryProcessor { @OnStopped public void cleanup() { validationResourceHolder.set(null); ComponentLog log = getLogger(); sendHeartBeat.set(false); for(Map<HiveEndPoint, HiveWriter> allWriters : threadWriterList) { for (Map.Entry<HiveEndPoint, HiveWriter> entry : allWriters.entrySet()) { try { HiveWriter w = entry.getValue(); w.flushAndClose(); } catch (Exception ex) { log.warn("Error while closing writer to " + entry.getKey() + ". Exception follows.", ex); if (ex instanceof InterruptedException) { Thread.currentThread().interrupt(); } } } allWriters.clear(); } if (callTimeoutPool != null) { callTimeoutPool.shutdown(); try { while (!callTimeoutPool.isTerminated()) { callTimeoutPool.awaitTermination(callTimeout, TimeUnit.MILLISECONDS); } } catch (Throwable t) { log.warn("shutdown interrupted on " + callTimeoutPool, t); } callTimeoutPool = null; } ugi = null; }  @Override Set<Relationship> getRelationships(); @OnScheduled void setup(final ProcessContext context); @Override void onTrigger(ProcessContext context, ProcessSessionFactory sessionFactory); @OnStopped void cleanup(); static final String HIVE_STREAMING_RECORD_COUNT_ATTR; static final PropertyDescriptor METASTORE_URI; static final PropertyDescriptor HIVE_CONFIGURATION_RESOURCES; static final PropertyDescriptor DB_NAME; static final PropertyDescriptor TABLE_NAME; static final PropertyDescriptor PARTITION_COLUMNS; static final PropertyDescriptor AUTOCREATE_PARTITIONS; static final PropertyDescriptor MAX_OPEN_CONNECTIONS; static final PropertyDescriptor HEARTBEAT_INTERVAL; static final PropertyDescriptor TXNS_PER_BATCH; static final PropertyDescriptor RECORDS_PER_TXN; static final PropertyDescriptor CALL_TIMEOUT; static final PropertyDescriptor ROLLBACK_ON_FAILURE; static final Relationship REL_SUCCESS; static final Relationship REL_FAILURE; static final Relationship REL_RETRY; }