/** * Creates a {@link ProgramRunId} of this program id with the given run id. */ public ProgramRunId run(String run) { return new ProgramRunId(new ApplicationId(getNamespace(), getApplication(), getVersion()), type, program, run); }
@Override public ProgramId getParent() { return new ProgramId(new ApplicationId(getNamespace(), getApplication(), getVersion()), ProgramType.FLOW, getFlow()); }
public ProgramSchedule(String name, String description, ProgramId programId, Map<String, String> properties, Trigger trigger, List<? extends Constraint> constraints, long timeoutMillis) { this.description = description; this.programId = programId; this.scheduleId = programId.getParent().schedule(name); this.properties = properties; this.trigger = trigger; this.constraints = constraints; this.timeoutMillis = timeoutMillis; }
@Override public ProgramId getParent() { return new ProgramId(new ApplicationId(getNamespace(), getApplication(), getVersion()), getType(), getProgram()); }
public FlowletId flowlet(String flowlet) { if (type != ProgramType.FLOW) { throw new IllegalArgumentException("Expected program type for flowlet to be " + ProgramType.FLOW); } return new FlowletId(new ApplicationId(getNamespace(), getApplication(), getVersion()), program, flowlet); }
@Override public ProgramId getId() { return new ApplicationId(NamespaceId.DEFAULT.getNamespace(), "dummyApp").worker("dummy"); }
public NamespaceId getNamespaceId() { return new NamespaceId(getNamespace()); } }
public NamespaceId getNamespaceId() { return new NamespaceId(moduleBeingAdded.getNamespace()); }
private void addRuns(Store store, ProgramRunId... runs) { for (ProgramRunId run : runs) { ArtifactId artifactId = run.getNamespaceId().artifact("testArtifact", "1.0").toApiArtifactId(); setStartAndRunning(store, run.getParent(), run.getEntityName(), artifactId); } }
/** * Return which entity scope this profile is in * * @return entity scope the profile is in */ public EntityScope getScope() { return getNamespaceId().equals(NamespaceId.SYSTEM) ? EntityScope.SYSTEM : EntityScope.USER; }
private void generateMetadataUpdates() { store.addTags(MetadataScope.USER, dataset.toMetadataEntity(), datasetTags); store.addProperties(MetadataScope.USER, app.toMetadataEntity(), appProperties); store.addTags(MetadataScope.USER, app.toMetadataEntity(), appTags); store.addTags(MetadataScope.USER, service.toMetadataEntity(), tags); store.removeTags(MetadataScope.USER, service.toMetadataEntity()); store.removeTags(MetadataScope.USER, dataset.toMetadataEntity(), datasetTags); store.removeMetadata(MetadataScope.USER, app.toMetadataEntity()); }
public FlowletQueueId queue(String queue) { // Note: FlowletQueueId is not versioned return new FlowletQueueId(getNamespace(), getApplication(), getFlow(), flowlet, queue); }
@Override public String apply(TopicId topicId) { return topicId.getTopic(); } };
/** * Returns an empty {@link MetadataRecord} in the specified {@link MetadataScope}. */ public MetadataRecord(NamespacedEntityId entityId, MetadataScope scope) { this(entityId.toMetadataEntity(), scope); }
@Override public ProgramId getParent() { return new ProgramId(new ApplicationId(getNamespace(), getApplication(), getVersion()), getType(), getProgram()); }
/** * Creates a {@link ProgramRunId} of this program id with the given run id. */ public ProgramRunId run(String run) { return new ProgramRunId(new ApplicationId(getNamespace(), getApplication(), getVersion()), type, program, run); }
public NamespaceId getNamespaceId() { return new NamespaceId(getNamespace()); } }
/** * Return which entity scope this profile is in * * @return entity scope the profile is in */ public EntityScope getScope() { return getNamespaceId().equals(NamespaceId.SYSTEM) ? EntityScope.SYSTEM : EntityScope.USER; }
public ProgramSchedule(String name, String description, ProgramId programId, Map<String, String> properties, Trigger trigger, List<? extends Constraint> constraints, long timeoutMillis) { this.description = description; this.programId = programId; this.scheduleId = programId.getParent().schedule(name); this.properties = properties; this.trigger = trigger; this.constraints = constraints; this.timeoutMillis = timeoutMillis; }
/** * Returns an empty {@link MetadataRecord} in the specified {@link MetadataScope}. */ public MetadataRecord(NamespacedEntityId entityId, MetadataScope scope, Map<String, String> properties, Set<String> tags) { this(entityId.toMetadataEntity(), scope, properties, tags); }