switch(privObject.getType()){ case DATABASE: dbname = privObject.getDatabase().getName(); break; case TABLE: break; case FUNCTION: if(privObject.getDatabase() != null) { dbname = privObject.getDatabase().getName();
switch(privObject.getType()){ case DATABASE: dbname = privObject.getDatabase().getName(); break; case TABLE: break; case FUNCTION: if(privObject.getDatabase() != null) { dbname = privObject.getDatabase().getName();
switch (e.getType()) { case DATABASE: databases.add(e.getDatabase()); break; case TABLE:
switch (e.getType()) { case DATABASE: databases.add(e.getDatabase()); break; case TABLE:
protected String getQualifiedName(Entity entity) throws Exception { switch (entity.getType()) { case DATABASE: return getQualifiedName(entity.getDatabase()); case TABLE: case PARTITION: return getQualifiedName(entity.getTable()); case DFS_DIR: return getQualifiedName(entity.getLocation()); } return null; }
public List<AtlasObjectId> getEntities() throws Exception { List<AtlasObjectId> ret = new ArrayList<>(); for (Entity entity : getHiveContext().getOutputs()) { if (entity.getType() == Entity.Type.DATABASE) { String dbQName = getQualifiedName(entity.getDatabase()); AtlasObjectId dbId = new AtlasObjectId(HIVE_TYPE_DB, ATTRIBUTE_QUALIFIED_NAME, dbQName); context.removeFromKnownDatabase(dbQName); ret.add(dbId); } else if (entity.getType() == Entity.Type.TABLE) { String tblQName = getQualifiedName(entity.getTable()); AtlasObjectId dbId = new AtlasObjectId(HIVE_TYPE_TABLE, ATTRIBUTE_QUALIFIED_NAME, tblQName); context.removeFromKnownTable(tblQName); ret.add(dbId); } } return ret; } }
switch(privObject.getType()){ case DATABASE: dbname = privObject.getDatabase().getName(); break; case TABLE: break; case FUNCTION: if(privObject.getDatabase() != null) { dbname = privObject.getDatabase().getName();
public AtlasEntitiesWithExtInfo getEntities() throws Exception { AtlasEntitiesWithExtInfo ret = new AtlasEntitiesWithExtInfo(); for (Entity entity : getHiveContext().getOutputs()) { if (entity.getType() == Entity.Type.DATABASE) { Database db = entity.getDatabase(); if (db != null) { db = getHive().getDatabase(db.getName()); } if (db != null) { AtlasEntity dbEntity = toDbEntity(db); ret.addEntity(dbEntity); } else { LOG.error("CreateDatabase.getEntities(): failed to retrieve db"); } } } addProcessedEntities(ret); return ret; } }
db = entity.getDatabase(); break;
switch (entity.getType()) { case DATABASE: return entity.getDatabase().getName(); case TABLE: return String.format("%s.%s",
switch (entity.getType()) { case DATABASE: return entity.getDatabase().getName(); case TABLE: return String.format("%s.%s",
protected AtlasEntity toAtlasEntity(Entity entity, AtlasEntityExtInfo entityExtInfo) throws Exception { AtlasEntity ret = null; switch (entity.getType()) { case DATABASE: { Database db = getHive().getDatabase(entity.getDatabase().getName()); ret = toDbEntity(db); } break; case TABLE: case PARTITION: { Table table = getHive().getTable(entity.getTable().getDbName(), entity.getTable().getTableName()); ret = toTableEntity(table, entityExtInfo); } break; case DFS_DIR: { URI location = entity.getLocation(); if (location != null) { ret = getPathEntity(new Path(entity.getLocation()), entityExtInfo); } } break; default: break; } return ret; }
switch (entity.getType()) { case DATABASE: Database db = entity.getDatabase(); return serializer.toString(db); case TABLE:
switch (entity.getType()) { case DATABASE: Database db = entity.getDatabase(); return serializer.toString(db); case TABLE: