@Override public <T extends Dataset> T getDataset(final String name, final Map<String, String> arguments, final AccessType accessType) throws DatasetInstantiationException { return getDataset(programRunId.getNamespace(), name, arguments, accessType); }
@Override public <T extends Dataset> T getDataset(final String name, final Map<String, String> arguments, final AccessType accessType) throws DatasetInstantiationException { return getDataset(programRunId.getNamespace(), name, arguments, accessType); }
private ProvisionerContext createContext(ProgramRunId programRunId, String userId, Map<String, String> properties, SSHContext sshContext) { Map<String, String> evaluated = evaluateMacros(secureStore, userId, programRunId.getNamespace(), properties); return new DefaultProvisionerContext(programRunId, evaluated, sparkCompat, sshContext); }
private ProvisionerContext createContext(ProgramRunId programRunId, String userId, Map<String, String> properties, SSHContext sshContext) { Map<String, String> evaluated = evaluateMacros(secureStore, userId, programRunId.getNamespace(), properties); return new DefaultProvisionerContext(programRunId, evaluated, sparkCompat, sshContext); }
@Override public Iterable<String> toIdParts() { return Collections.unmodifiableList( Arrays.asList(getNamespace(), getApplication(), getVersion(), getType().getPrettyName().toLowerCase(), getProgram(), run) ); }
@Override public Iterable<String> toIdParts() { return Collections.unmodifiableList( Arrays.asList(getNamespace(), getApplication(), getVersion(), getType().getPrettyName().toLowerCase(), getProgram(), run) ); }
public DefaultProvisionerContext(ProgramRunId programRunId, Map<String, String> properties, SparkCompat sparkCompat, SSHContext sshContext) { this.programRun = new ProgramRun(programRunId.getNamespace(), programRunId.getApplication(), programRunId.getProgram(), programRunId.getRun()); this.properties = Collections.unmodifiableMap(new HashMap<>(properties)); this.sshContext = sshContext; this.sparkCompat = sparkCompat; this.cdapVersion = ProjectInfo.getVersion().toString(); }
public DefaultProvisionerContext(ProgramRunId programRunId, Map<String, String> properties, SparkCompat sparkCompat, SSHContext sshContext) { this.programRun = new ProgramRun(programRunId.getNamespace(), programRunId.getApplication(), programRunId.getProgram(), programRunId.getRun()); this.properties = Collections.unmodifiableMap(new HashMap<>(properties)); this.sshContext = sshContext; this.sparkCompat = sparkCompat; this.cdapVersion = ProjectInfo.getVersion().toString(); }
@Override public int hashCode() { Integer hashCode = this.hashCode; if (hashCode == null) { this.hashCode = hashCode = Objects.hash(super.hashCode(), getNamespace(), getApplication(), getVersion(), getType(), getProgram(), run); } return hashCode; }
@Override public int hashCode() { Integer hashCode = this.hashCode; if (hashCode == null) { this.hashCode = hashCode = Objects.hash(super.hashCode(), getNamespace(), getApplication(), getVersion(), getType(), getProgram(), run); } return hashCode; }
public static LoggingContext getLoggingContextWithRunId(ProgramRunId programRun, Map<String, String> systemArgs) { return getLoggingContext(programRun.getNamespace(), programRun.getApplication(), programRun.getProgram(), programRun.getType(), programRun.getRun(), systemArgs); }
private Map<String, String> getMetricsTags(ProgramRunId programRunId, ProfileId profileId) { return ImmutableMap.<String, String>builder() .put(Constants.Metrics.Tag.PROFILE_SCOPE, profileId.getScope().name()) .put(Constants.Metrics.Tag.PROFILE, profileId.getProfile()) .put(Constants.Metrics.Tag.NAMESPACE, programRunId.getNamespace()) .put(Constants.Metrics.Tag.PROGRAM_TYPE, programRunId.getType().getPrettyName()) .put(Constants.Metrics.Tag.APP, programRunId.getApplication()) .put(Constants.Metrics.Tag.PROGRAM, programRunId.getProgram()) .put(Constants.Metrics.Tag.RUN_ID, programRunId.getRun()) .build(); }
@Override public ProgramId getParent() { return new ProgramId(new ApplicationId(getNamespace(), getApplication(), getVersion()), getType(), getProgram()); }
protected MDSKey.Builder getProgramKeyBuilder(String recordType, @Nullable ProgramRunId programRunId) { MDSKey.Builder builder = new MDSKey.Builder().add(recordType); if (programRunId != null) { builder.add(programRunId.getNamespace()); builder.add(programRunId.getApplication()); builder.add(programRunId.getVersion()); builder.add(programRunId.getType().name()); builder.add(programRunId.getProgram()); builder.add(programRunId.getRun()); } return builder; } }
public DashboardProgramRunRecord(ProgramRunId runId, RunRecord runRecord, ArtifactId artifactId, String user, String startMethod) { this(runId.getNamespace(), ArtifactSummary.from(artifactId), new ApplicationNameVersion(runId.getApplication(), runId.getVersion()), runId.getType().name(), runId.getProgram(), runId.getRun(), user, startMethod, runRecord.getStartTs(), runRecord.getRunTs(), runRecord.getSuspendTs(), runRecord.getResumeTs(), runRecord.getStopTs(), runRecord.getStatus()); }
public DashboardProgramRunRecord(ProgramRunId runId, RunRecord runRecord, ArtifactId artifactId, String user, String startMethod) { this(runId.getNamespace(), ArtifactSummary.from(artifactId), new ApplicationNameVersion(runId.getApplication(), runId.getVersion()), runId.getType().name(), runId.getProgram(), runId.getRun(), user, startMethod, runRecord.getStartTs(), runRecord.getRunTs(), runRecord.getSuspendTs(), runRecord.getResumeTs(), runRecord.getStopTs(), runRecord.getStatus()); }
private byte[] createRowKey(long timestampInSeconds, ProgramRunId programRunId) { MDSKey.Builder builder = new MDSKey.Builder(); // add namespace at the beginning builder.add(programRunId.getNamespace()); // add timestamp builder.add(timestampInSeconds); // add program runId fields, skip namespace as that is part of row key builder.add(programRunId.getApplication()); builder.add(programRunId.getType().name()); builder.add(programRunId.getProgram()); builder.add(programRunId.getRun()); return builder.build().getKey(); }
private MDSKey getKey(ProgramRunId programRunId) { return new MDSKey.Builder().add(KEY_PREFIX) .add(programRunId.getNamespace()) .add(programRunId.getApplication()) .add(programRunId.getVersion()) .add(programRunId.getType().name()) .add(programRunId.getProgram()) .add(programRunId.getRun()) .build(); }
private MDSKey getKey(ProgramRunId programRunId) { return new MDSKey.Builder().add(KEY_PREFIX) .add(programRunId.getNamespace()) .add(programRunId.getApplication()) .add(programRunId.getVersion()) .add(programRunId.getType().name()) .add(programRunId.getProgram()) .add(programRunId.getRun()) .build(); }
private MDSKey getRowKey(ProvisioningTaskKey key) { ProgramRunId programRunId = key.getProgramRunId(); return new MDSKey.Builder().add(STATE_PREFIX) .add(programRunId.getNamespace()) .add(programRunId.getApplication()) .add(programRunId.getVersion()) .add(programRunId.getType().name()) .add(programRunId.getProgram()) .add(programRunId.getRun()) .add(key.getType().name()) .build(); } }