/** * Override a Gobblin system configuration. Format "<key>:<value>" */ public EmbeddedGobblin sysConfig(String keyValue) { List<String> split = KEY_VALUE_SPLITTER.splitToList(keyValue); if (split.size() != 2) { throw new RuntimeException("Cannot parse " + keyValue + ". Expected <key>:<value>."); } return sysConfig(split.get(0), split.get(1)); }
/** * Load Kerberos keytab for authentication. Crendetials format "<login-user>:<keytab-file>". */ @CliObjectOption(description = "Authenticate using kerberos. Format: \"<login-user>:<keytab-file>\".") public EmbeddedGobblin kerberosAuthentication(String credentials) { List<String> split = Splitter.on(":").splitToList(credentials); if (split.size() != 2) { throw new RuntimeException("Cannot parse " + credentials + ". Expected <login-user>:<keytab-file>"); } try { usePlugin(PluginStaticKeys.HADOOP_LOGIN_FROM_KEYTAB_ALIAS); } catch (ReflectiveOperationException roe) { throw new RuntimeException(String.format("Could not instantiate %s. Make sure gobblin-runtime-hadoop is in your classpath.", PluginStaticKeys.HADOOP_LOGIN_FROM_KEYTAB_ALIAS), roe); } sysConfig(PluginStaticKeys.LOGIN_USER_FULL_KEY, split.get(0)); sysConfig(PluginStaticKeys.LOGIN_USER_KEYTAB_FILE_FULL_KEY, split.get(1)); return this; }
/** * Enable metrics. Does not start any reporters. */ public EmbeddedGobblin enableMetrics() { this.usePlugin(new GobblinMetricsPlugin.Factory()); this.sysConfig(ConfigurationKeys.METRICS_ENABLED_KEY, Boolean.toString(true)); return this; }