public WorkerId(ProgramId programId) { super(programId.getParent(), ProgramType.WORKER, programId.getEntityName()); }
public ServiceId(ProgramId programId) { super(programId.getParent(), ProgramType.SERVICE, programId.getEntityName()); }
@Override public Map<String, String> getSystemPropertiesToAdd() { ImmutableMap.Builder<String, String> properties = ImmutableMap.builder(); properties.put(ENTITY_NAME_KEY, programId.getEntityName()); properties.put(VERSION_KEY, programId.getVersion()); String description = programSpec.getDescription(); if (!Strings.isNullOrEmpty(description)) { properties.put(DESCRIPTION_KEY, description); } properties.put(CREATION_TIME_KEY, creationTime); return properties.build(); }
public WorkerId(ProgramId programId) { super(programId.getParent(), ProgramType.WORKER, programId.getEntityName()); }
public ServiceId(ProgramId programId) { super(programId.getParent(), ProgramType.SERVICE, programId.getEntityName()); }
@Override public Map<String, String> getSystemPropertiesToAdd() { ImmutableMap.Builder<String, String> properties = ImmutableMap.builder(); properties.put(ENTITY_NAME_KEY, programId.getEntityName()); properties.put(VERSION_KEY, programId.getVersion()); String description = programSpec.getDescription(); if (!Strings.isNullOrEmpty(description)) { properties.put(DESCRIPTION_KEY, description); } if (!existing) { properties.put(CREATION_TIME_KEY, String.valueOf(System.currentTimeMillis())); } return properties.build(); }
private static String makeProgramKey(ProgramId program) { return Joiner.on('.').join(program.getType().getCategoryName().toLowerCase(), program.getNamespace(), program.getApplication(), program.getEntityName()); }
private static String makeProgramKey(ProgramId program) { return Joiner.on('.').join(program.getType().getCategoryName().toLowerCase(), program.getNamespace(), program.getApplication(), program.getEntityName()); }
@Override public Void call() throws Exception { String namespace = String.format("%s.%s", programId.getApplication(), programId.getProgram()); NamespaceId namespaceId = programId.getNamespaceId(); for (Map.Entry<String, Collection<Long>> entry : streamGroups.asMap().entrySet()) { streamConsumerFactory.dropAll(namespaceId.stream(entry.getKey()), namespace, entry.getValue()); } queueAdmin.dropAllForFlow(programId.getParent().flow(programId.getEntityName())); return null; } });
@Override public MDSKey getKey(ProgramId programId) { MDSKey.Builder keyBuilder = new MDSKey.Builder() .add(programId.getNamespace()) .add(programId.getApplication()); // If programId is empty, this is actually applicationId if (!programId.getEntityName().isEmpty()) { keyBuilder.add(programId.getType().getCategoryName()); keyBuilder.add(programId.getEntityName()); } return keyBuilder.build(); }
@Override public MDSKey getKey(ProgramId programId) { MDSKey.Builder keyBuilder = new MDSKey.Builder() .add(programId.getNamespace()) .add(programId.getApplication()); // If programId is empty, this is actually applicationId if (!programId.getEntityName().isEmpty()) { keyBuilder.add(programId.getType().getCategoryName()); keyBuilder.add(programId.getEntityName()); } return keyBuilder.build(); }
private void addProgram(MDSKey.Builder keyBuilder, ProgramId program) { keyBuilder.add(PROGRAM_MARKER) .add(program.getNamespace()) .add(program.getParent().getEntityName()) .add(program.getType().getCategoryName()) .add(program.getEntityName()); }
private void addProgram(MDSKey.Builder keyBuilder, ProgramId program) { keyBuilder.add(PROGRAM_MARKER) .add(program.getNamespace()) .add(program.getParent().getEntityName()) .add(program.getType().getCategoryName()) .add(program.getEntityName()); }
@Override public void process(ApplicationDeployable appSpec) throws Exception { List<ProgramSpecification> deletedSpecs = store.getDeletedProgramSpecifications(appSpec.getApplicationId(), appSpec.getSpecification()); // TODO: this should also delete logs and run records (or not?), and do it for all program types [CDAP-2187] List<String> deletedFlows = Lists.newArrayList(); for (ProgramSpecification spec : deletedSpecs) { //call the deleted spec ProgramType type = ProgramTypes.fromSpecification(spec); final ProgramId programId = appSpec.getApplicationId().program(type, spec.getName()); programTerminator.stop(programId); programScheduler.deleteSchedules(programId); programScheduler.modifySchedulesTriggeredByDeletedProgram(programId); // drop all queues and stream states of a deleted flow if (ProgramType.FLOW.equals(type)) { FlowUtils.clearDeletedFlow(impersonator, queueAdmin, streamConsumerFactory, programId, (FlowSpecification) spec); deletedFlows.add(programId.getEntityName()); } // Remove metadata for the deleted program metadataStore.removeMetadata(programId.toMetadataEntity()); } if (!deletedFlows.isEmpty()) { deleteMetrics(appSpec.getApplicationId(), deletedFlows); } emit(appSpec); }
DatasetId customDataset1 = customNamespace.dataset(dataset1.getEntityName()); ProgramRunId customRun1 = customNamespace.app(program1.getApplication()).program(program1.getType(), program1.getEntityName()).run(run1.getEntityName()); Assert.assertEquals(new Lineage(ImmutableSet.of()), lineageAdmin.computeLineage(customDataset1, 500,
ProgramRunId customRun1 = customNamespace.app( program1.getApplication()).program(program1.getType(), program1.getEntityName()).run(run1.getEntityName() ); Assert.assertEquals(new Lineage(ImmutableSet.of()),