/** * Get final state for this object. By default this returns an empty {@link gobblin.configuration.State}, but * concrete subclasses can add information that will be added to the task state. * @return Empty {@link gobblin.configuration.State}. */ @Override public State getFinalState() { return new State(); }
@Override public State getExecutionMetadata() { return new State(); }
/** * Get final state for this object. By default this returns an empty {@link gobblin.configuration.State}, but * concrete subclasses can add information that will be added to the task state. * @return Empty {@link gobblin.configuration.State}. */ @Override public State getFinalState() { return new State(); } }
@Override public State getPersistentState() { return new State(); }
public Builder() { this.inputPaths = Sets.newHashSet(); this.inputLatePaths = Sets.newHashSet(); this.renamePaths = Sets.newHashSet(); this.jobProps = new State(); }
/** * Get an instance with no master password, which cannot encrypt or decrypt passwords. */ public static PasswordManager getInstance() { try { Optional<String> absent = Optional.absent(); return CACHED_INSTANCES.get(new AbstractMap.SimpleEntry<>(absent, shouldUseStrongEncryptor(new State()))); } catch (ExecutionException e) { throw new RuntimeException("Unable to get an instance of PasswordManager", e); } }
/** * Default constructor used for deserialization. */ public WorkUnitState() { this.workUnit = WorkUnit.createEmpty(); this.jobState = new State(); // Not available on deserialization this.taskBroker = null; }
/** * Get an instance. The location of the master password file is provided via "encrypt.key.loc". */ public static PasswordManager getInstance(Properties props) { return getInstance(new State(props)); }
/** * Get an instance. The master password file is given by masterPwdLoc. */ public static PasswordManager getInstance(Path masterPwdLoc) { try { return CACHED_INSTANCES .get(new AbstractMap.SimpleEntry<>(getMasterPassword(masterPwdLoc), shouldUseStrongEncryptor(new State()))); } catch (ExecutionException e) { throw new RuntimeException("Unable to get an instance of PasswordManager", e); } }
public static State getStateFromConf(Configuration conf) { State state = new State(); for (Entry<String, String> entry : conf) { state.setProp(entry.getKey(), entry.getValue()); } return state; }
Builder withState(State state) { this.state = new State(); this.state.addAll(state); return this; }
@SuppressWarnings("unchecked") public T withProps(State props) { this.props = new State(props.getProperties()); return (T) this; }
/** * Convert a given {@link Config} to a {@link State} instance. * * @param config the given {@link Config} instance * @return a {@link State} instance */ public static State configToState(Config config) { return new State(configToProperties(config)); }
/** * Called once on {@link #startUp()} to start metrics. */ @VisibleForTesting protected void buildMetricsContextAndMetrics() { this.metricContext = Instrumented.getMetricContext(new gobblin.configuration.State(ConfigUtils.configToProperties(config)), this.getClass(), getTagsForMetrics()); createMetrics(); }
public MetricContext getDefaultMetricContext() { if (_gobblinEnv.isPresent()) { return _gobblinEnv.get().getMetricContext() .childBuilder(JobExecutionLauncher.class.getSimpleName()).build(); } gobblin.configuration.State fakeState = new gobblin.configuration.State(getSysConfig().getConfigAsProperties()); List<Tag<?>> tags = new ArrayList<>(); MetricContext res = Instrumented.getMetricContext(fakeState, Launcher.class, tags); return res; }
private static State getSerDeProps(SerDeInfo si) { State serDeProps = new State(); for (Map.Entry<String, String> entry : si.getParameters().entrySet()) { serDeProps.setProp(entry.getKey(), entry.getValue()); } if (si.isSetSerializationLib()) { serDeProps.setProp(HiveConstants.SERDE_TYPE, si.getSerializationLib()); } return serDeProps; }
public MetricContext getDefaultMetricContext() { gobblin.configuration.State fakeState = new gobblin.configuration.State(getSysConfig().getConfigAsProperties()); List<Tag<?>> tags = new ArrayList<>(); tags.add(new Tag<>(StandardMetrics.INSTANCE_NAME_TAG, getInstanceName())); MetricContext res = Instrumented.getMetricContext(fakeState, StandardGobblinInstanceDriver.class, tags); return res; }
private MetricContext getDefaultMetricContext() { gobblin.configuration.State fakeState = new gobblin.configuration.State(getSysConfig().getConfigAsProperties()); return Instrumented.getMetricContext(fakeState, StandardGobblinInstanceLauncher.class); }
private MetricContext constructMetricContext(Configurable sysConfig, Logger log) { gobblin.configuration.State tmpState = new gobblin.configuration.State(sysConfig.getConfigAsProperties()); return GobblinMetrics.isEnabled(sysConfig.getConfig()) ? Instrumented.getMetricContext(tmpState, getClass()) : null; }
public static void modifyDatasetStateToRecompact (Dataset dataset) { // Modify the dataset for recompaction LOG.info ("{} changes to recompact mode", dataset.getDatasetName()); State recompactState = new State(); recompactState.setProp(MRCompactor.COMPACTION_RECOMPACT_FROM_DEST_PATHS, Boolean.TRUE); recompactState.setProp(MRCompactor.COMPACTION_JOB_LATE_DATA_MOVEMENT_TASK, Boolean.FALSE); dataset.modifyDatasetForRecompact(recompactState); dataset.setState(VERIFIED); }