private void stopGobblinInstanceDriver() { try { driver.stopAsync(); driver.awaitTerminated(EmbeddedGobblin.this.shutdownTimeout.getTimeout(), EmbeddedGobblin.this.shutdownTimeout .getTimeUnit()); } catch (TimeoutException te) { log.error("Failed to shutdown Gobblin instance driver."); } } });
public ResolvedJobSpec(JobSpec other, GobblinInstanceDriver driver) throws SpecNotFoundException, JobTemplate.TemplateException { this(other, driver.getJobCatalog()); }
/** {@inheritDoc} */ @Override protected void shutDown() throws Exception { instance.getLog().info("Plugin shutdown: " + this); }
@Override public JobSpecMonitor forJobCatalog(GobblinInstanceDriver instanceDriver, MutableJobCatalog jobCatalog) throws IOException { Config config = instanceDriver.getSysConfig().getConfig().getConfig(CONFIG_PREFIX).withFallback(DEFAULTS); return forConfig(config, jobCatalog); }
driver.registerJobLifecycleListener(listener); driver.startAsync(); driver.stopAsync(); driver.awaitTerminated(this.shutdownTimeout.getTimeout(), this.shutdownTimeout.getTimeUnit()); throw new TimeoutException("Timeout waiting for job to start.");
public StandardMetrics(final GobblinInstanceDriver parent) { this.uptimeMs = parent.getMetricContext().newContextAwareGauge(UPTIMEMS_NAME, new Gauge<Long>() { @Override public Long getValue() { return startTimeMs > 0 ? System.currentTimeMillis() - startTimeMs : 0; } }); this.upFlag = parent.getMetricContext().newContextAwareGauge(UPFLAG_NAME, new Gauge<Integer>() { @Override public Integer getValue() { switch (parent.state()) { case RUNNING: return 1; case FAILED: return -1; default: return 0; } } }); this.numUnclassifiedErrors = parent.getMetricContext().contextAwareCounter(NUM_UNCLASSIFIED_ERRORS_NAME); parent.addListener(this, new Executor() { @Override public void execute(Runnable command) { command.run(); } }); }
@Override public Integer getValue() { switch (parent.state()) { case RUNNING: return 1; case FAILED: return -1; default: return 0; } } });
@Override protected void startUp() throws Exception { instance.registerJobLifecycleListener(new EmailNotificationListerner()); LOGGER.info("Started Email Notification Plugin"); }
public GobblinMetricsPlugin(GobblinInstanceDriver instance) { super(instance); this.metrics = GobblinMetrics.get(getInstance().getInstanceName()); }
@Override public JobSpecMonitor forJobCatalog(GobblinInstanceDriver instanceDriver, MutableJobCatalog jobCatalog) throws IOException { Config config = instanceDriver.getSysConfig().getConfig().getConfig(CONFIG_PREFIX).withFallback(DEFAULTS); return forConfig(config, jobCatalog); }
@Override public GobblinInstancePlugin createPlugin(GobblinInstanceDriver instance) { Config sysConfig = instance.getSysConfig().getConfig(); if (!sysConfig.hasPath(PluginStaticKeys.LOGIN_USER_FULL_KEY)) { throw new RuntimeException("Missing required sys config: " + PluginStaticKeys.LOGIN_USER_FULL_KEY); } if (!sysConfig.hasPath(PluginStaticKeys.LOGIN_USER_KEYTAB_FILE_FULL_KEY)) { throw new RuntimeException("Missing required sys config: " + PluginStaticKeys.LOGIN_USER_KEYTAB_FILE_FULL_KEY); } String loginUser = sysConfig.getString(PluginStaticKeys.LOGIN_USER_FULL_KEY); String loginUserKeytabFile = sysConfig.getString(PluginStaticKeys.LOGIN_USER_KEYTAB_FILE_FULL_KEY); return new HadoopKerberosKeytabAuthenticationPlugin(instance, loginUser, loginUserKeytabFile); } }
@Override protected void startUp() throws Exception { this.metrics.startMetricReporting(getInstance().getSysConfig().getConfigAsProperties()); }
private HadoopKerberosKeytabAuthenticationPlugin(GobblinInstanceDriver instance, String loginUser, String loginUserKeytabFile) { super(instance); Config sysConfig = instance.getSysConfig().getConfig(); _loginUser = loginUser; _loginUserKeytabFile = loginUserKeytabFile; HadoopConfigLoader configLoader = new HadoopConfigLoader(sysConfig); _hadoopConf = configLoader.getConf(); }