private static String getArrayTypeName(String attrType) { String ret = null; if (isArrayType(attrType)) { Set<String> typeNames = AtlasTypeUtil.getReferencedTypeNames(attrType); if (typeNames.size() > 0) { ret = typeNames.iterator().next(); } } return ret; }
private static String getArrayTypeName(String attrType) { String ret = null; if (isArrayType(attrType)) { Set<String> typeNames = AtlasTypeUtil.getReferencedTypeNames(attrType); if (typeNames.size() > 0) { ret = typeNames.iterator().next(); } } return ret; }
private String getAttributeTypeName(String typeName) { if (AtlasTypeUtil.isArrayType(typeName)) { int startIdx = ATLAS_TYPE_ARRAY_PREFIX.length(); int endIdx = typeName.length() - ATLAS_TYPE_ARRAY_SUFFIX.length(); String elementTypeName = typeName.substring(startIdx, endIdx).trim(); return elementTypeName; } else if (AtlasTypeUtil.isMapType(typeName)) { int startIdx = ATLAS_TYPE_MAP_PREFIX.length(); int endIdx = typeName.length() - ATLAS_TYPE_MAP_SUFFIX.length(); String[] keyValueTypes = typeName.substring(startIdx, endIdx).split(ATLAS_TYPE_MAP_KEY_VAL_SEP, 2); String valueTypeName = keyValueTypes.length > 1 ? keyValueTypes[1].trim() : null; return valueTypeName; } return typeName; }
private void cleanupIndexForAttribute(AtlasGraphManagement management, String typeName, AtlasAttributeDef attributeDef) { final String propertyName = AtlasGraphUtilsV2.encodePropertyKey(typeName + "." + attributeDef.getName()); String attribTypeName = attributeDef.getTypeName(); boolean isBuiltInType = AtlasTypeUtil.isBuiltInType(attribTypeName); boolean isArrayType = isArrayType(attribTypeName); boolean isMapType = isMapType(attribTypeName); try { AtlasType atlasType = typeRegistry.getType(attribTypeName); if (isClassificationType(atlasType) || isEntityType(atlasType)) { LOG.warn("Ignoring non-indexable attribute {}", attribTypeName); } else if (isBuiltInType || isEnumType(atlasType) || isArrayType || isMapType) { cleanupIndex(management, propertyName); } else if (isStructType(atlasType)) { AtlasStructDef structDef = typeRegistry.getStructDefByName(attribTypeName); cleanupIndices(management, structDef); } } catch (AtlasBaseException e) { LOG.error("No type exists for {}", attribTypeName, e); } }
String attribTypeName = attributeDef.getTypeName(); boolean isBuiltInType = AtlasTypeUtil.isBuiltInType(attribTypeName); boolean isArrayType = isArrayType(attribTypeName); boolean isMapType = isMapType(attribTypeName);