Commit b4e4f604 by Pinal Committed by nixonrodrigues

ATLAS-3938 : Import Hive Script: Support deletion of non existing database and table entities

parent d0de3897
...@@ -139,6 +139,7 @@ do ...@@ -139,6 +139,7 @@ do
--database) IMPORT_ARGS="$IMPORT_ARGS --database $1"; shift;; --database) IMPORT_ARGS="$IMPORT_ARGS --database $1"; shift;;
--table) IMPORT_ARGS="$IMPORT_ARGS --table $1"; shift;; --table) IMPORT_ARGS="$IMPORT_ARGS --table $1"; shift;;
--filename) IMPORT_ARGS="$IMPORT_ARGS --filename $1"; shift;; --filename) IMPORT_ARGS="$IMPORT_ARGS --filename $1"; shift;;
-deleteNonExisting) IMPORT_ARGS="$IMPORT_ARGS -deleteNonExisting";;
"") break;; "") break;;
*) JVM_ARGS="$JVM_ARGS $option" *) JVM_ARGS="$JVM_ARGS $option"
esac esac
......
...@@ -123,6 +123,8 @@ public class AtlasClientV2 extends AtlasBaseClient { ...@@ -123,6 +123,8 @@ public class AtlasClientV2 extends AtlasBaseClient {
private static final String RELATIONSHIPS_URI = BASE_URI + "v2/relationship/"; private static final String RELATIONSHIPS_URI = BASE_URI + "v2/relationship/";
private static final String BULK_HEADERS = "bulk/headers"; private static final String BULK_HEADERS = "bulk/headers";
private static final String BULK_SET_CLASSIFICATIONS = "bulk/setClassifications"; private static final String BULK_SET_CLASSIFICATIONS = "bulk/setClassifications";
private static final String RELATIONSHIP_URI = DISCOVERY_URI + "/relationship";
//Glossary APIs //Glossary APIs
private static final String GLOSSARY_URI = BASE_URI + "v2/glossary"; private static final String GLOSSARY_URI = BASE_URI + "v2/glossary";
...@@ -664,16 +666,22 @@ public class AtlasClientV2 extends AtlasBaseClient { ...@@ -664,16 +666,22 @@ public class AtlasClientV2 extends AtlasBaseClient {
} }
public AtlasSearchResult basicSearch(String typeName, String classification, String query, boolean excludeDeletedEntities, int limit, int offset) throws AtlasServiceException { public AtlasSearchResult basicSearch(String typeName, String classification, String query, boolean excludeDeletedEntities, int limit, int offset) throws AtlasServiceException {
MultivaluedMap<String, String> queryParams = new MultivaluedMapImpl(); return this.basicSearch(typeName, null, classification, query, excludeDeletedEntities, limit, offset);
}
queryParams.add("typeName", typeName); public AtlasSearchResult basicSearch(String typeName, SearchParameters.FilterCriteria entityFilters, String classification, String query, boolean excludeDeletedEntities, int limit, int offset) throws AtlasServiceException {
queryParams.add("classification", classification); SearchParameters parameters = new SearchParameters();
queryParams.add(QUERY, query); parameters.setTypeName(typeName);
queryParams.add("excludeDeletedEntities", String.valueOf(excludeDeletedEntities)); parameters.setClassification(classification);
queryParams.add(LIMIT, String.valueOf(limit)); parameters.setQuery(query);
queryParams.add(OFFSET, String.valueOf(offset)); parameters.setExcludeDeletedEntities(excludeDeletedEntities);
parameters.setLimit(limit);
parameters.setOffset(offset);
if (entityFilters != null){
parameters.setEntityFilters(entityFilters);
}
return callAPI(API_V2.BASIC_SEARCH, AtlasSearchResult.class, queryParams); return callAPI(API_V2.BASIC_SEARCH, AtlasSearchResult.class, parameters);
} }
public AtlasSearchResult facetedSearch(SearchParameters searchParameters) throws AtlasServiceException { public AtlasSearchResult facetedSearch(SearchParameters searchParameters) throws AtlasServiceException {
...@@ -1202,7 +1210,7 @@ public class AtlasClientV2 extends AtlasBaseClient { ...@@ -1202,7 +1210,7 @@ public class AtlasClientV2 extends AtlasBaseClient {
// Discovery APIs // Discovery APIs
public static final API_V2 DSL_SEARCH = new API_V2(DSL_SEARCH_URI, HttpMethod.GET, Response.Status.OK); public static final API_V2 DSL_SEARCH = new API_V2(DSL_SEARCH_URI, HttpMethod.GET, Response.Status.OK);
public static final API_V2 FULL_TEXT_SEARCH = new API_V2(FULL_TEXT_SEARCH_URI, HttpMethod.GET, Response.Status.OK); public static final API_V2 FULL_TEXT_SEARCH = new API_V2(FULL_TEXT_SEARCH_URI, HttpMethod.GET, Response.Status.OK);
public static final API_V2 BASIC_SEARCH = new API_V2(BASIC_SEARCH_URI, HttpMethod.GET, Response.Status.OK); public static final API_V2 BASIC_SEARCH = new API_V2(BASIC_SEARCH_URI, HttpMethod.POST, Response.Status.OK);
public static final API_V2 FACETED_SEARCH = new API_V2(FACETED_SEARCH_URI, HttpMethod.POST, Response.Status.OK); public static final API_V2 FACETED_SEARCH = new API_V2(FACETED_SEARCH_URI, HttpMethod.POST, Response.Status.OK);
public static final API_V2 ATTRIBUTE_SEARCH = new API_V2(DISCOVERY_URI+ "/attribute", HttpMethod.GET, Response.Status.OK); public static final API_V2 ATTRIBUTE_SEARCH = new API_V2(DISCOVERY_URI+ "/attribute", HttpMethod.GET, Response.Status.OK);
public static final API_V2 RELATIONSHIP_SEARCH = new API_V2(DISCOVERY_URI+ "/relationship", HttpMethod.GET, Response.Status.OK); public static final API_V2 RELATIONSHIP_SEARCH = new API_V2(DISCOVERY_URI+ "/relationship", HttpMethod.GET, Response.Status.OK);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment