private AtlasTypesDef getTypeDefs(String ... typeNames) throws AtlasServiceException { final AtlasTypesDef typeDefs = new AtlasTypesDef(); for (int i = 0; i < typeNames.length; i++) { final MultivaluedMap<String, String> searchParams = new MultivaluedMapImpl(); searchParams.add(SearchFilter.PARAM_NAME, typeNames[i]); final AtlasTypesDef typeDef = atlasClient.getAllTypeDefs(new SearchFilter(searchParams)); typeDefs.getEntityDefs().addAll(typeDef.getEntityDefs()); } logger.debug("typeDefs={}", typeDefs); return typeDefs; }
final AtlasTypesDef type = new AtlasTypesDef();
public static AtlasTypesDef getTypesDef(List<AtlasEnumDef> enums, List<AtlasStructDef> structs, List<AtlasClassificationDef> traits, List<AtlasEntityDef> classes) { return new AtlasTypesDef(enums, structs, traits, classes); }
public static AtlasTypesDef getTypesDef(List<AtlasEnumDef> enums, List<AtlasStructDef> structs, List<AtlasClassificationDef> traits, List<AtlasEntityDef> classes) { return new AtlasTypesDef(enums, structs, traits, classes); }
public AtlasExportData() { typesDef = new AtlasTypesDef(); entities = new HashMap<>(); entityCreationOrder = new ArrayList<>(); }
@Deprecated public AtlasStructDef createStructDef(AtlasStructDef structDef) throws AtlasServiceException { AtlasTypesDef atlasTypesDef = new AtlasTypesDef(); atlasTypesDef.getStructDefs().add(structDef); AtlasTypesDef created = createAtlasTypeDefs(atlasTypesDef); assert created != null; assert created.getStructDefs() != null; return created.getStructDefs().get(0); }
@Deprecated public AtlasEnumDef createEnumDef(AtlasEnumDef enumDef) throws AtlasServiceException { AtlasTypesDef atlasTypesDef = new AtlasTypesDef(); atlasTypesDef.getEnumDefs().add(enumDef); AtlasTypesDef created = createAtlasTypeDefs(atlasTypesDef); assert created != null; assert created.getEnumDefs() != null; return created.getEnumDefs().get(0); }
@Deprecated public AtlasClassificationDef createClassificationDef(AtlasClassificationDef classificationDef) throws AtlasServiceException { AtlasTypesDef atlasTypesDef = new AtlasTypesDef(); atlasTypesDef.getClassificationDefs().add(classificationDef); AtlasTypesDef created = createAtlasTypeDefs(atlasTypesDef); assert created != null; assert created.getClassificationDefs() != null; return created.getClassificationDefs().get(0); }
@Deprecated public AtlasEntityDef createEntityDef(AtlasEntityDef entityDef) throws AtlasServiceException { AtlasTypesDef atlasTypesDef = new AtlasTypesDef(); atlasTypesDef.getEntityDefs().add(entityDef); AtlasTypesDef created = createAtlasTypeDefs(atlasTypesDef); assert created != null; assert created.getEntityDefs() != null; return created.getEntityDefs().get(0); }
@Deprecated public AtlasClassificationDef createClassificationDef(AtlasClassificationDef classificationDef) throws AtlasServiceException { AtlasTypesDef atlasTypesDef = new AtlasTypesDef(); atlasTypesDef.getClassificationDefs().add(classificationDef); AtlasTypesDef created = createAtlasTypeDefs(atlasTypesDef); assert created != null; assert created.getClassificationDefs() != null; return created.getClassificationDefs().get(0); }
@Deprecated public AtlasEntityDef createEntityDef(AtlasEntityDef entityDef) throws AtlasServiceException { AtlasTypesDef atlasTypesDef = new AtlasTypesDef(); atlasTypesDef.getEntityDefs().add(entityDef); AtlasTypesDef created = createAtlasTypeDefs(atlasTypesDef); assert created != null; assert created.getEntityDefs() != null; return created.getEntityDefs().get(0); }
@Deprecated public AtlasClassificationDef createClassificationDef(AtlasClassificationDef classificationDef) throws AtlasServiceException { AtlasTypesDef atlasTypesDef = new AtlasTypesDef(); atlasTypesDef.getClassificationDefs().add(classificationDef); AtlasTypesDef created = createAtlasTypeDefs(atlasTypesDef); assert created != null; assert created.getClassificationDefs() != null; return created.getClassificationDefs().get(0); }
private AtlasTypesDef getTypeDefs(String ... typeNames) throws AtlasServiceException { final AtlasTypesDef typeDefs = new AtlasTypesDef(); for (int i = 0; i < typeNames.length; i++) { final MultivaluedMap<String, String> searchParams = new MultivaluedMapImpl(); searchParams.add(SearchFilter.PARAM_NAME, typeNames[i]); final AtlasTypesDef typeDef = atlasClient.getAllTypeDefs(new SearchFilter(searchParams)); typeDefs.getEntityDefs().addAll(typeDef.getEntityDefs()); } logger.debug("typeDefs={}", typeDefs); return typeDefs; }
private String getCreateTag(String classificationName) throws AtlasBaseException { AtlasClassificationDef classificationDef = typeRegistry.getClassificationDefByName(classificationName); if(classificationDef != null) { return classificationName; } classificationDef = new AtlasClassificationDef(classificationName); AtlasTypesDef typesDef = new AtlasTypesDef(); typesDef.setClassificationDefs(Collections.singletonList(classificationDef)); typeDefStore.createTypesDef(typesDef); LOG.info("created classification: {}", classificationName); return classificationName; } }
protected void createTag(String tagName, String attributeType) { try { AtlasTypesDef typesDef = new AtlasTypesDef(); getTagWithName(typesDef, tagName, attributeType); typeDefStore.createTypesDef(typesDef); } catch (AtlasBaseException e) { fail("Tag creation should've succeeded"); } }
protected void createTag(String tagName, String attributeType) { try { AtlasTypesDef typesDef = new AtlasTypesDef(); getTagWithName(typesDef, tagName, attributeType); typeDefStore.createTypesDef(typesDef); } catch (AtlasBaseException e) { fail("Tag creation should've succeeded"); } }
@DataProvider public Object[][] allCreatedTypes(){ // Capture all the types that are getting created or updated here. AtlasTypesDef updatedTypeDefs = TestUtilsV2.defineValidUpdatedDeptEmployeeTypes(); AtlasTypesDef allTypeDefs = new AtlasTypesDef(); allTypeDefs.getEnumDefs().addAll(updatedTypeDefs.getEnumDefs()); allTypeDefs.getStructDefs().addAll(updatedTypeDefs.getStructDefs()); allTypeDefs.getClassificationDefs().addAll(updatedTypeDefs.getClassificationDefs()); allTypeDefs.getEntityDefs().addAll(updatedTypeDefs.getEntityDefs()); allTypeDefs.getEntityDefs().addAll(TestUtilsV2.getEntityWithValidSuperType()); return new Object[][] {{allTypeDefs}}; }
private void loadSampleClassificationDefs() throws AtlasBaseException { AtlasClassificationDef tag1 = new AtlasClassificationDef("tag1"); AtlasClassificationDef tag2 = new AtlasClassificationDef("tag2"); AtlasClassificationDef tag3 = new AtlasClassificationDef("tag3"); AtlasClassificationDef tag4 = new AtlasClassificationDef("tag4"); AtlasClassificationDef PII = new AtlasClassificationDef("PII"); PII.addAttribute(new AtlasAttributeDef("type", "string")); PII.addAttribute(new AtlasAttributeDef("valid", "boolean")); typeDefStore.createTypesDef(new AtlasTypesDef(Collections.emptyList(), Collections.emptyList(), Arrays.asList(tag1, tag2, tag3, tag4, PII), Collections.emptyList(), Collections.emptyList())); }
protected void createClassificationTypes() { List<AtlasClassificationDef> cds = Arrays.asList(new AtlasClassificationDef(DIMENSION_CLASSIFICATION, "Dimension Classification", "1.0"), new AtlasClassificationDef(FACT_CLASSIFICATION, "Fact Classification", "1.0"), new AtlasClassificationDef(PII_CLASSIFICATION, "PII Classification", "1.0"), new AtlasClassificationDef(METRIC_CLASSIFICATION, "Metric Classification", "1.0"), new AtlasClassificationDef(ETL_CLASSIFICATION, "ETL Classification", "1.0"), new AtlasClassificationDef(JDBC_CLASSIFICATION, "JdbcAccess Classification", "1.0"), new AtlasClassificationDef(LOGDATA_CLASSIFICATION, "LogData Classification", "1.0")); AtlasTypesDef tds = new AtlasTypesDef(Collections.<AtlasEnumDef>emptyList(), Collections.<AtlasStructDef>emptyList(), cds, Collections.<AtlasEntityDef>emptyList()); createUpdateClassificationDef(tds); }
private void loadSampleClassificationDefs() throws AtlasBaseException { AtlasClassificationDef tag1 = new AtlasClassificationDef("tag1"); AtlasClassificationDef tag2 = new AtlasClassificationDef("tag2"); AtlasClassificationDef tag3 = new AtlasClassificationDef("tag3"); AtlasClassificationDef tag4 = new AtlasClassificationDef("tag4"); AtlasClassificationDef PII = new AtlasClassificationDef("PII"); PII.addAttribute(new AtlasAttributeDef("type", "string")); PII.addAttribute(new AtlasAttributeDef("valid", "boolean")); typeDefStore.createTypesDef(new AtlasTypesDef(Collections.emptyList(), Collections.emptyList(), Arrays.asList(tag1, tag2, tag3, tag4, PII), Collections.emptyList(), Collections.emptyList())); }