code
stringlengths
73
34.1k
label
stringclasses
1 value
private void notifyOfEntityEvent(Collection<ITypedReferenceableInstance> entityDefinitions, EntityNotification.OperationType operationType) throws AtlasException { List<EntityNotification> messages = new LinkedList<>(); for (IReferenceableInstance entityDefinition :...
java
private GroovyExpression optimize(GroovyExpression source, GremlinOptimization optimization, OptimizationContext context) { GroovyExpression result = source; if (optimization.appliesTo(source, context)) { //Apply the optimization to the expression. ...
java
public static GroovyExpression copyWithNewLeafNode(AbstractFunctionExpression expr, GroovyExpression newLeaf) { AbstractFunctionExpression result = (AbstractFunctionExpression)expr.copy(); //remove leading anonymous traversal expression, if there is one if(FACTORY.isLeafAnonymousTraversalExpr...
java
@Override public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException { if (isFilteredURI(servletRequest)) { LOG.debug("Is a filtered URI: {}. Passing request downstream.", ...
java
@Override public <T> Collection<T> getPropertyValues(String propertyName, Class<T> type) { return Collections.singleton(getProperty(propertyName, type)); }
java
private boolean isAuthenticated() { Authentication existingAuth = SecurityContextHolder.getContext().getAuthentication(); return !(!(existingAuth != null && existingAuth.isAuthenticated()) || existingAuth instanceof SSOAuthentication); }
java
protected String getJWTFromCookie(HttpServletRequest req) { String serializedJWT = null; Cookie[] cookies = req.getCookies(); if (cookieName != null && cookies != null) { for (Cookie cookie : cookies) { if (cookieName.equals(cookie.getName())) { if...
java
protected String constructLoginURL(HttpServletRequest request, boolean isXMLRequest) { String delimiter = "?"; if (authenticationProviderUrl.contains("?")) { delimiter = "&"; } StringBuilder loginURL = new StringBuilder(); if (isXMLRequest) { String atlasA...
java
protected boolean validateToken(SignedJWT jwtToken) { boolean isValid = validateSignature(jwtToken); if (isValid) { isValid = validateExpiration(jwtToken); if (!isValid) { LOG.warn("Expiration time validation of JWT token failed."); } } else {...
java
protected boolean validateSignature(SignedJWT jwtToken) { boolean valid = false; if (JWSObject.State.SIGNED == jwtToken.getState()) { if (LOG.isDebugEnabled()) { LOG.debug("SSO token is in a SIGNED state"); } if (jwtToken.getSignature() != null) { ...
java
protected boolean validateExpiration(SignedJWT jwtToken) { boolean valid = false; try { Date expires = jwtToken.getJWTClaimsSet().getExpirationTime(); if (expires == null || new Date().before(expires)) { if (LOG.isDebugEnabled()) { LOG.debug("S...
java
boolean hasIncomingEdgesWithLabel(AtlasVertex vertex, String label) throws AtlasBaseException { boolean foundEdges = false; Iterator<AtlasEdge> inEdges = vertex.getEdges(AtlasEdgeDirection.IN).iterator(); while (inEdges.hasNext()) { AtlasEdge edge = inEdges.next(); if (...
java
private boolean validateAtlasRelationshipType(AtlasRelationshipType type) { boolean isValid = false; try { validateAtlasRelationshipDef(type.getRelationshipDef()); isValid = true; } catch (AtlasBaseException abe) { LOG.error("Validation error for AtlasRelation...
java
public static void validateAtlasRelationshipDef(AtlasRelationshipDef relationshipDef) throws AtlasBaseException { AtlasRelationshipEndDef endDef1 = relationshipDef.getEndDef1(); AtlasRelationshipEndDef endDef2 = relationshipDef.getEndDef2(); RelationshipCategory rel...
java
public static int getCompiledQueryCacheCapacity() { try { return ApplicationProperties.get().getInt(COMPILED_QUERY_CACHE_CAPACITY, DEFAULT_COMPILED_QUERY_CACHE_CAPACITY); } catch (AtlasException e) { throw new RuntimeException(e); } }
java
public static int getCompiledQueryCacheEvictionWarningThrottle() { try { return ApplicationProperties.get().getInt(COMPILED_QUERY_CACHE_EVICTION_WARNING_THROTTLE, DEFAULT_COMPILED_QUERY_CACHE_EVICTION_WARNING_THROTTLE); } catch (AtlasException e) { throw new RuntimeException(e); ...
java
public static FieldMapping getFieldMapping(IDataType type) { switch (type.getTypeCategory()) { case CLASS: case TRAIT: return ((HierarchicalType)type).fieldMapping(); case STRUCT: return ((StructType)type).fieldMapping(); default: throw new I...
java
@Override public String getTypeDefinition(String typeName) throws AtlasException { final IDataType dataType = typeSystem.getDataType(IDataType.class, typeName); return TypesSerialization.toJson(typeSystem, dataType.getName()); }
java
@Override public CreateUpdateEntitiesResult createEntities(String entityInstanceDefinition) throws AtlasException { entityInstanceDefinition = ParamChecker.notEmpty(entityInstanceDefinition, "Entity instance definition"); ITypedReferenceableInstance[] typedInstances = deserializeClassInstances(enti...
java
private void validateUniqueAttribute(String entityType, String attributeName) throws AtlasException { ClassType type = typeSystem.getDataType(ClassType.class, entityType); AttributeInfo attribute = type.fieldMapping().fields.get(attributeName); if(attribute == null) { throw new Illeg...
java
@Override public List<String> getEntityList(String entityType) throws AtlasException { validateTypeExists(entityType); return repository.getEntityList(entityType); }
java
@Override public void addTrait(List<String> entityGuids, ITypedStruct traitInstance) throws AtlasException { Preconditions.checkNotNull(entityGuids, "entityGuids list cannot be null"); Preconditions.checkNotNull(traitInstance, "Trait instance cannot be null"); final String traitName = trait...
java
public Iterator<AtlasEdge> getAdjacentEdgesByLabel(AtlasVertex instanceVertex, AtlasEdgeDirection direction, final String edgeLabel) { if (LOG.isDebugEnabled()) { LOG.debug("Finding edges for {} with label {}", string(instanceVertex), edgeLabel); } if(instanceVertex != null && edgeL...
java
public AtlasEdge getEdgeForLabel(AtlasVertex vertex, String edgeLabel) { return getEdgeForLabel(vertex, edgeLabel, AtlasEdgeDirection.OUT); }
java
public void removeEdge(AtlasEdge edge) { String edgeString = null; if (LOG.isDebugEnabled()) { edgeString = string(edge); LOG.debug("Removing {}", edgeString); } graph.removeEdge(edge); if (LOG.isDebugEnabled()) { LOG.info("Removed {}", edg...
java
public void removeVertex(AtlasVertex vertex) { String vertexString = null; if (LOG.isDebugEnabled()) { vertexString = string(vertex); LOG.debug("Removing {}", vertexString); } graph.removeVertex(vertex); if (LOG.isDebugEnabled()) { LOG.info...
java
public Map<String, AtlasVertex> getVerticesForPropertyValues(String property, List<String> values) { if(values.isEmpty()) { return Collections.emptyMap(); } Collection<String> nonNullValues = new HashSet<>(values.size()); for(String value : values) { if(value !=...
java
public Map<String, AtlasVertex> getVerticesForGUIDs(List<String> guids) { return getVerticesForPropertyValues(Constants.GUID_PROPERTY_KEY, guids); }
java
public AtlasVertex getVertexForInstanceByUniqueAttribute(ClassType classType, IReferenceableInstance instance) throws AtlasException { if (LOG.isDebugEnabled()) { LOG.debug("Checking if there is an instance with the same unique attributes for instance {}", instance.toShortString()); ...
java
public List<AtlasVertex> getVerticesForInstancesByUniqueAttribute(ClassType classType, List<? extends IReferenceableInstance> instancesForClass) throws AtlasException { //For each attribute, need to figure out what values to search for and which instance(s) //those values correspond to. Map<Str...
java
public static Titan1Edge createEdge(Titan1Graph graph, Edge source) { if (source == null) { return null; } return new Titan1Edge(graph, source); }
java
public static Titan1Vertex createVertex(Titan1Graph graph, Vertex source) { if (source == null) { return null; } return new Titan1Vertex(graph, source); }
java
public String getAdminStatus() throws AtlasServiceException { String result = AtlasBaseClient.UNKNOWN_STATUS; WebResource resource = getResource(service, STATUS.getPath()); JSONObject response = callAPIWithResource(STATUS, resource, null, JSONObject.class); try { result = res...
java
private WebResource getResource(WebResource service, APIInfo api, String... pathParams) { WebResource resource = service.path(api.getPath()); resource = appendPathParams(resource, pathParams); return resource; }
java
private ObjectNode objectNodeFromElement(final AtlasElement element) { final boolean isEdge = element instanceof AtlasEdge; final boolean showTypes = mode == AtlasGraphSONMode.EXTENDED; final List<String> propertyKeys = isEdge ? this.edgePropertyKeys : this.vertexPropertyKeys; final Elem...
java
public static JSONObject jsonFromElement(final AtlasElement element, final Set<String> propertyKeys, final AtlasGraphSONMode mode) throws JSONException { final AtlasGraphSONUtility graphson = element instanceof AtlasEdge ? new AtlasGraphSONUt...
java
private static char[] getPassword(TextDevice textDevice, String key) { boolean noMatch; char[] cred = new char[0]; char[] passwd1; char[] passwd2; do { passwd1 = textDevice.readPassword("Please enter the password value for %s:", key); passwd2 = textDevice....
java
private static CredentialProvider getCredentialProvider(TextDevice textDevice) throws IOException { String providerPath = textDevice.readLine("Please enter the full path to the credential provider:"); if (providerPath != null) { Configuration conf = new Configuration(false); con...
java
@Override public void start() throws AtlasException { if (!HAConfiguration.isHAEnabled(configuration)) { LOG.info("HA is not enabled, no need to start leader election service"); return; } cacheActiveStateChangeHandlers(); serverId = AtlasServerIdSelector.selec...
java
@Override public void stop() { if (!HAConfiguration.isHAEnabled(configuration)) { LOG.info("HA is not enabled, no need to stop leader election service"); return; } try { leaderLatch.close(); curatorFactory.close(); } catch (IOException ...
java
public void addInstance(IReferenceableInstance instance) throws AtlasException { ClassType classType = typeSystem.getDataType(ClassType.class, instance.getTypeName()); ITypedReferenceableInstance newInstance = classType.convert(instance, Multiplicity.REQUIRED); findReferencedInstancesToPreLoad(...
java
public static boolean isHAEnabled(Configuration configuration) { boolean ret = false; if (configuration.containsKey(HAConfiguration.ATLAS_SERVER_HA_ENABLED_KEY)) { ret = configuration.getBoolean(ATLAS_SERVER_HA_ENABLED_KEY); } else { String[] ids = configuration.getStrin...
java
public static String getBoundAddressForId(Configuration configuration, String serverId) { String hostPort = configuration.getString(ATLAS_SERVER_ADDRESS_PREFIX +serverId); boolean isSecure = configuration.getBoolean(SecurityProperties.TLS_ENABLED); String protocol = (isSecure) ? "https://" : "ht...
java
protected org.apache.commons.configuration.Configuration getApplicationConfiguration() { try { return ApplicationProperties.get(); } catch (AtlasException e) { LOG.warn("Error reading application configuration", e); } return null; }
java
public static String getUserFromRequest(HttpServletRequest httpRequest) { String user = httpRequest.getRemoteUser(); if (!StringUtils.isEmpty(user)) { return user; } user = httpRequest.getParameter("user.name"); // available in query-param if (!StringUtils.isEmpty(us...
java
public static String getRequestURI(HttpServletRequest httpRequest) { final StringBuilder url = new StringBuilder(100).append(httpRequest.getRequestURI()); if (httpRequest.getQueryString() != null) { url.append('?').append(httpRequest.getQueryString()); } return url.toString(...
java
public void update(String serverId) throws AtlasBaseException { try { CuratorFramework client = curatorFactory.clientInstance(); HAConfiguration.ZookeeperProperties zookeeperProperties = HAConfiguration.getZookeeperProperties(configuration); String atlasSe...
java
public String getActiveServerAddress() { CuratorFramework client = curatorFactory.clientInstance(); String serverAddress = null; try { HAConfiguration.ZookeeperProperties zookeeperProperties = HAConfiguration.getZookeeperProperties(configuration); byte...
java
@DELETE @Path("/guid/{guid}") @Consumes({Servlets.JSON_MEDIA_TYPE, MediaType.APPLICATION_JSON}) @Produces(Servlets.JSON_MEDIA_TYPE) public EntityMutationResponse deleteByGuid(@PathParam("guid") final String guid) throws AtlasBaseException { AtlasPerfTracer perf = null; try { ...
java
@GET @Path("/guid/{guid}/classification/{classificationName}") @Produces(Servlets.JSON_MEDIA_TYPE) public AtlasClassification getClassification(@PathParam("guid") String guid, @PathParam("classificationName") final String classificationName) throws AtlasBaseException { AtlasPerfTracer perf = null; ...
java
@POST @Path("/guid/{guid}/classifications") @Consumes({Servlets.JSON_MEDIA_TYPE, MediaType.APPLICATION_JSON}) @Produces(Servlets.JSON_MEDIA_TYPE) public void addClassifications(@PathParam("guid") final String guid, List<AtlasClassification> classifications) throws AtlasBaseException { AtlasPerfT...
java
@PUT @Path("/guid/{guid}/classifications") @Produces(Servlets.JSON_MEDIA_TYPE) public void updateClassification(@PathParam("guid") final String guid, List<AtlasClassification> classifications) throws AtlasBaseException { AtlasPerfTracer perf = null; try { if (AtlasPerfTracer.isP...
java
@DELETE @Path("/guid/{guid}/classification/{classificationName}") @Produces(Servlets.JSON_MEDIA_TYPE) public void deleteClassification(@PathParam("guid") String guid, @PathParam("classificationName") final String classificationName) throws AtlasBaseException { At...
java
@GET @Path("/bulk") @Consumes(Servlets.JSON_MEDIA_TYPE) @Produces(Servlets.JSON_MEDIA_TYPE) public AtlasEntitiesWithExtInfo getByGuids(@QueryParam("guid") List<String> guids) throws AtlasBaseException { AtlasPerfTracer perf = null; try { if (AtlasPerfTracer.isPerfTraceEnable...
java
@DELETE @Path("/bulk") @Consumes(Servlets.JSON_MEDIA_TYPE) @Produces(Servlets.JSON_MEDIA_TYPE) public EntityMutationResponse deleteByGuids(@QueryParam("guid") final List<String> guids) throws AtlasBaseException { AtlasPerfTracer perf = null; try { if (AtlasPerfTracer.isPerfT...
java
@POST @Path("/bulk/classification") @Consumes({Servlets.JSON_MEDIA_TYPE, MediaType.APPLICATION_JSON}) @Produces(Servlets.JSON_MEDIA_TYPE) public void addClassification(ClassificationAssociateRequest request) throws AtlasBaseException { AtlasPerfTracer perf = null; try { if (...
java
private void validateUniqueAttribute(AtlasEntityType entityType, Map<String, Object> attributes) throws AtlasBaseException { if (MapUtils.isEmpty(attributes)) { throw new AtlasBaseException(AtlasErrorCode.ATTRIBUTE_UNIQUE_INVALID, entityType.getTypeName(), ""); } for (String attribu...
java
public static <T> T notNull(T obj, String name) { if (obj == null) { throw new IllegalArgumentException(name + " cannot be null"); } return obj; }
java
public static <T> Collection<T> notEmpty(Collection<T> list, String name) { notNull(list, name); if (list.isEmpty()) { throw new IllegalArgumentException(String.format("Collection %s is empty", name)); } return list; }
java
public static void lessThan(long value, long maxValue, String name) { if (value <= 0) { throw new IllegalArgumentException(name + " should be > 0, current value " + value); } if (value > maxValue) { throw new IllegalArgumentException(name + " should be <= " + maxValue + "...
java
@GET @Path("/typedef/name/{name}") @Produces(Servlets.JSON_MEDIA_TYPE) public AtlasBaseTypeDef getTypeDefByName(@PathParam("name") String name) throws AtlasBaseException { AtlasBaseTypeDef ret = typeDefStore.getByName(name); return ret; }
java
@GET @Path("/enumdef/guid/{guid}") @Produces(Servlets.JSON_MEDIA_TYPE) public AtlasEnumDef getEnumDefByGuid(@PathParam("guid") String guid) throws AtlasBaseException { AtlasEnumDef ret = typeDefStore.getEnumDefByGuid(guid); return ret; }
java
@GET @Path("/structdef/guid/{guid}") @Produces(Servlets.JSON_MEDIA_TYPE) public AtlasStructDef getStructDefByGuid(@PathParam("guid") String guid) throws AtlasBaseException { AtlasStructDef ret = typeDefStore.getStructDefByGuid(guid); return ret; }
java
@GET @Path("/classificationdef/guid/{guid}") @Produces(Servlets.JSON_MEDIA_TYPE) public AtlasClassificationDef getClassificationDefByGuid(@PathParam("guid") String guid) throws AtlasBaseException { AtlasClassificationDef ret = typeDefStore.getClassificationDefByGuid(guid); return ret; }
java
@GET @Path("/entitydef/guid/{guid}") @Produces(Servlets.JSON_MEDIA_TYPE) public AtlasEntityDef getEntityDefByGuid(@PathParam("guid") String guid) throws AtlasBaseException { AtlasEntityDef ret = typeDefStore.getEntityDefByGuid(guid); return ret; }
java
@GET @Path("/relationshipdef/guid/{guid}") @Produces(Servlets.JSON_MEDIA_TYPE) public AtlasRelationshipDef getRelationshipDefByGuid(@PathParam("guid") String guid) throws AtlasBaseException { AtlasRelationshipDef ret = typeDefStore.getRelationshipDefByGuid(guid); return ret; }
java
private SearchFilter getSearchFilter(HttpServletRequest httpServletRequest) { SearchFilter ret = new SearchFilter(); Set<String> keySet = httpServletRequest.getParameterMap().keySet(); for (String key : keySet) { ret.setParam(String.valueOf(key), String.valueOf(httpServletRequest.get...
java
public boolean equalsContents(Object o) { if(this == o) { return true; } if(o == null) { return false; } if (o.getClass() != getClass()) { return false; } if(!super.equalsContents(o)) { return false; } ...
java
private void validateEntityAssociations(String guid, List<AtlasClassification> classifications) throws AtlasBaseException { List<String> entityClassifications = getClassificationNames(guid); for (AtlasClassification classification : classifications) { String newClassification = classificati...
java
public static AtlasElementPropertyConfig includeProperties(final Set<String> vertexPropertyKeys, final Set<String> edgePropertyKeys) { return new AtlasElementPropertyConfig(vertexPropertyKeys, edgePropertyKeys, ElementPropertiesRule.INCLUDE, ...
java
public static AtlasElementPropertyConfig excludeProperties(final Set<String> vertexPropertyKeys, final Set<String> edgePropertyKeys) { return new AtlasElementPropertyConfig(vertexPropertyKeys, edgePropertyKeys, ElementPropertiesRule.EXCLUDE, ...
java
@GET @Path("/dsl") @Consumes(Servlets.JSON_MEDIA_TYPE) @Produces(Servlets.JSON_MEDIA_TYPE) public AtlasSearchResult searchUsingDSL(@QueryParam("query") String query, @QueryParam("typeName") String typeName, ...
java
@GET @Path("/attribute") @Consumes(Servlets.JSON_MEDIA_TYPE) @Produces(Servlets.JSON_MEDIA_TYPE) public AtlasSearchResult searchUsingAttribute(@QueryParam("attrName") String attrName, @QueryParam("attrValuePrefix") String attrValuePrefix, ...
java
@GET @Path("{guid}") @Produces(Servlets.JSON_MEDIA_TYPE) public Response getEntityDefinition(@PathParam("guid") String guid) { if (LOG.isDebugEnabled()) { LOG.debug("==> EntityResource.getEntityDefinition({})", guid); } AtlasPerfTracer perf = null; try { ...
java
public Response getEntityListByType(String entityType) { try { Preconditions.checkNotNull(entityType, "Entity type cannot be null"); if (LOG.isDebugEnabled()) { LOG.debug("Fetching entity list for type={} ", entityType); } final List<String> enti...
java
public Response getEntityDefinitionByAttribute(String entityType, String attribute, String value) { try { if (LOG.isDebugEnabled()) { LOG.debug("Fetching entity definition for type={}, qualified name={}", entityType, value); } entityType = ParamChecker.notEmp...
java
@GET @Path("{guid}/traitDefinitions") @Produces(Servlets.JSON_MEDIA_TYPE) public Response getTraitDefinitionsForEntity(@PathParam("guid") String guid){ if (LOG.isDebugEnabled()) { LOG.debug("==> EntityResource.getTraitDefinitionsForEntity({})", guid); } AtlasPerfTracer p...
java
@GET @Path("{guid}/traitDefinitions/{traitName}") @Produces(Servlets.JSON_MEDIA_TYPE) public Response getTraitDefinitionForEntity(@PathParam("guid") String guid, @PathParam("traitName") String traitName){ if (LOG.isDebugEnabled()) { LOG.debug("==> EntityResource.getTraitDefinitionForEnti...
java
@GET @Path("{guid}/audit") @Produces(Servlets.JSON_MEDIA_TYPE) public Response getAuditEvents(@PathParam("guid") String guid, @QueryParam("startKey") String startKey, @QueryParam("count") @DefaultValue("100") short count) { if (LOG.isDebugEnabled()) { L...
java
public boolean isOrderExpression(GroovyExpression expr) { if (expr instanceof FunctionCallExpression) { FunctionCallExpression functionCallExpression = (FunctionCallExpression) expr; if (functionCallExpression.getFunctionName().equals(ORDER_METHOD)) { return true; ...
java
public GroovyExpression generateUnaryHasExpression(GroovyExpression parent, String fieldName) { return new FunctionCallExpression(TraversalStepType.FILTER, parent, HAS_METHOD, new LiteralExpression(fieldName)); }
java
protected GroovyExpression generateLoopEmitExpression(GraphPersistenceStrategies s, IDataType dataType) { return typeTestExpression(s, dataType.getName(), getCurrentObjectExpression()); }
java
public GroovyExpression generateAliasExpression(GroovyExpression parent, String alias) { return new FunctionCallExpression(TraversalStepType.SIDE_EFFECT, parent, AS_METHOD, new LiteralExpression(alias)); }
java
public GroovyExpression generateAdjacentVerticesExpression(GroovyExpression parent, AtlasEdgeDirection dir) { return new FunctionCallExpression(TraversalStepType.FLAT_MAP_TO_ELEMENTS, parent, getGremlinFunctionName(dir)); }
java
public GroovyExpression generateAdjacentVerticesExpression(GroovyExpression parent, AtlasEdgeDirection dir, String label) { return new FunctionCallExpression(TraversalStepType.FLAT_MAP_TO_ELEMENTS, parent, getGremlinFunctionName(dir), new LiteralExpression(label)); }
java
public GroovyExpression generateCountExpression(GroovyExpression itExpr) { GroovyExpression collectionExpr = new CastExpression(itExpr,"Collection"); return new FunctionCallExpression(collectionExpr, "size"); }
java
public String getAliasNameIfRelevant(GroovyExpression expr) { if(!(expr instanceof FunctionCallExpression)) { return null; } FunctionCallExpression fc = (FunctionCallExpression)expr; if(! fc.getFunctionName().equals(AS_METHOD)) { return null; } Lite...
java
@GET @Path("stack") @Produces(MediaType.TEXT_PLAIN) public String getThreadDump() { if (LOG.isDebugEnabled()) { LOG.debug("==> AdminResource.getThreadDump()"); } ThreadGroup topThreadGroup = Thread.currentThread().getThreadGroup(); while (topThreadGroup.getParen...
java
@GET @Path("version") @Produces(Servlets.JSON_MEDIA_TYPE) public Response getVersion() { if (LOG.isDebugEnabled()) { LOG.debug("==> AdminResource.getVersion()"); } if (version == null) { try { PropertiesConfiguration configProperties = new Pro...
java
private Referenceable registerDatabase(String databaseName) throws Exception { Referenceable dbRef = getDatabaseReference(clusterName, databaseName); Database db = hiveClient.getDatabase(databaseName); if (db != null) { if (dbRef == null) { dbRef = createDBInstance(d...
java
private Referenceable registerInstance(Referenceable referenceable) throws Exception { String typeName = referenceable.getTypeName(); LOG.debug("creating instance of type {}", typeName); String entityJSON = InstanceSerialization.toJson(referenceable, true); LOG.debug("Submitting new ent...
java
private Referenceable getDatabaseReference(String clusterName, String databaseName) throws Exception { LOG.debug("Getting reference for database {}", databaseName); String typeName = HiveDataTypes.HIVE_DB.getName(); return getEntityReference(typeName, getDBQualifiedName(clusterName, databaseNam...
java
public static String getDBQualifiedName(String clusterName, String dbName) { return String.format("%s@%s", dbName.toLowerCase(), clusterName); }
java
private int importTables(Referenceable databaseReferenceable, String databaseName, final boolean failOnError) throws Exception { int tablesImported = 0; List<String> hiveTables = hiveClient.getAllTables(databaseName); LOG.info("Importing tables {} for db {}", hiveTables.toString(), databaseName)...
java
private Referenceable getTableReference(Table hiveTable) throws Exception { LOG.debug("Getting reference for table {}.{}", hiveTable.getDbName(), hiveTable.getTableName()); String typeName = HiveDataTypes.HIVE_TABLE.getName(); String tblQualifiedName = getTableQualifiedName(getClusterName(), h...
java
public Referenceable createTableInstance(Referenceable dbReference, Table hiveTable) throws AtlasHookException { return createOrUpdateTableInstance(dbReference, null, hiveTable); }
java
@Override public GroovyExpression apply(GroovyExpression expr, OptimizationContext context) { FunctionCallExpression exprAsFunction = (FunctionCallExpression)expr; GroovyExpression result = exprAsFunction.getCaller(); List<GroovyExpression> nonExtractableArguments = new ArrayList<>(); ...
java
private void updateCurrentFunction(AbstractFunctionExpression parentExpr) { GroovyExpression expr = parentExpr.getCaller(); if (expr instanceof AbstractFunctionExpression) { AbstractFunctionExpression exprAsFunction = (AbstractFunctionExpression) expr; GroovyExpression exprCaller...
java
private boolean creatingFunctionShortensGremlin(GroovyExpression headExpr) { int tailLength = getTailLength(); int length = headExpr.toString().length() - tailLength; int overhead = 0; if (nextFunctionBodyStart instanceof AbstractFunctionExpression) { overhead = functionDefL...
java
private AtlasEdge createInverseReference(AtlasAttribute inverseAttribute, AtlasStructType inverseAttributeType, AtlasVertex inverseVertex, AtlasVertex vertex) throws AtlasBaseException { String propertyName = AtlasGraphUtilsV1.getQualifiedAttributePropertyKey(in...
java