incubator-atlas git commit: ATLAS-1981: Cache escaped type-query string to avoid repeated computation

2017-07-21 Thread madhan
Repository: incubator-atlas
Updated Branches:
  refs/heads/0.8-incubating 47d11cc38 -> f800575ef


ATLAS-1981: Cache escaped type-query string to avoid repeated computation

(cherry picked from commit e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b)


Project: http://git-wip-us.apache.org/repos/asf/incubator-atlas/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-atlas/commit/f800575e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-atlas/tree/f800575e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-atlas/diff/f800575e

Branch: refs/heads/0.8-incubating
Commit: f800575eff23f7fd05f3f79b59dd6567b4a33f1c
Parents: 47d11cc
Author: Madhan Neethiraj 
Authored: Fri Jul 21 09:28:44 2017 -0700
Committer: Madhan Neethiraj 
Committed: Fri Jul 21 12:25:39 2017 -0700

--
 .../org/apache/atlas/repository/Constants.java  |  4 +-
 .../org/apache/atlas/model/TypeCategory.java|  2 +-
 .../atlas/type/AtlasClassificationType.java | 30 ---
 .../org/apache/atlas/type/AtlasEntityType.java  | 28 +++---
 .../org/apache/atlas/type/AtlasStructType.java  | 40 +++
 .../java/org/apache/atlas/type/AtlasType.java   |  3 ++
 .../apache/atlas/type/AtlasTypeRegistry.java|  4 ++
 .../ClassificationSearchProcessor.java  | 17 +++---
 .../atlas/discovery/EntityDiscoveryService.java | 32 ++--
 .../atlas/discovery/EntitySearchProcessor.java  | 18 ---
 .../discovery/FullTextSearchProcessor.java  | 23 -
 .../apache/atlas/discovery/SearchProcessor.java | 54 
 .../graph/v1/AtlasTypeDefGraphStoreV1.java  |  3 ++
 .../typestore/GraphBackedTypeStore.java |  8 +++
 .../atlas/typesystem/types/DataTypes.java   |  3 +-
 15 files changed, 162 insertions(+), 107 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/f800575e/common/src/main/java/org/apache/atlas/repository/Constants.java
--
diff --git a/common/src/main/java/org/apache/atlas/repository/Constants.java 
b/common/src/main/java/org/apache/atlas/repository/Constants.java
index 7156d56..62d74f8 100644
--- a/common/src/main/java/org/apache/atlas/repository/Constants.java
+++ b/common/src/main/java/org/apache/atlas/repository/Constants.java
@@ -92,8 +92,8 @@ public final class Constants {
 public static final String QUALIFIED_NAME = "Referenceable.qualifiedName";
 public static final String TYPE_NAME_PROPERTY_KEY = 
INTERNAL_PROPERTY_KEY_PREFIX + "typeName";
 public static final String INDEX_SEARCH_MAX_RESULT_SET_SIZE = 
"atlas.graph.index.search.max-result-set-size";
-public static final String INDEX_SEARCH_MAX_TYPES_COUNT = 
"atlas.graph.index.search.max-types-count";
-public static final String INDEX_SEARCH_MAX_TAGS_COUNT = 
"atlas.graph.index.search.max-tags-count";
+public static final String INDEX_SEARCH_TYPES_MAX_QUERY_STR_LENGTH = 
"atlas.graph.index.search.types.max-query-str-length";
+public static final String INDEX_SEARCH_TAGS_MAX_QUERY_STR_LENGTH  = 
"atlas.graph.index.search.tags.max-query-str-length";
 
 private Constants() {
 }

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/f800575e/intg/src/main/java/org/apache/atlas/model/TypeCategory.java
--
diff --git a/intg/src/main/java/org/apache/atlas/model/TypeCategory.java 
b/intg/src/main/java/org/apache/atlas/model/TypeCategory.java
index e47a8a7..f06f64f 100644
--- a/intg/src/main/java/org/apache/atlas/model/TypeCategory.java
+++ b/intg/src/main/java/org/apache/atlas/model/TypeCategory.java
@@ -18,5 +18,5 @@
 package org.apache.atlas.model;
 
 public enum TypeCategory {
-PRIMITIVE, OBJECT_ID_TYPE, ENUM, STRUCT, CLASSIFICATION, ENTITY, ARRAY, MAP
+PRIMITIVE, OBJECT_ID_TYPE, ENUM, STRUCT, CLASSIFICATION, ENTITY, ARRAY, 
MAP, RELATIONSHIP
 }

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/f800575e/intg/src/main/java/org/apache/atlas/type/AtlasClassificationType.java
--
diff --git 
a/intg/src/main/java/org/apache/atlas/type/AtlasClassificationType.java 
b/intg/src/main/java/org/apache/atlas/type/AtlasClassificationType.java
index c1c3add..56c3ed3 100644
--- a/intg/src/main/java/org/apache/atlas/type/AtlasClassificationType.java
+++ b/intg/src/main/java/org/apache/atlas/type/AtlasClassificationType.java
@@ -45,10 +45,11 @@ public class AtlasClassificationType extends 
AtlasStructType {
 
 private final AtlasClassificationDef classificationDef;
 
-private List superTypes = 
Collections.emptyList();
-private Set   allSuperTypes  = 
Collections.emptySet();
-private Set   allSubTypes= 

svn commit: r20524 - /release/atlas/

2017-07-21 Thread pono
Author: pono
Date: Fri Jul 21 20:19:24 2017
New Revision: 20524

Log:
graduate atlas

Added:
release/atlas/
  - copied from r20523, release/incubator/atlas/



svn commit: r20523 - /dev/incubator/atlas/

2017-07-21 Thread pono
Author: pono
Date: Fri Jul 21 20:19:01 2017
New Revision: 20523

Log:
graduate atlas

Removed:
dev/incubator/atlas/



atlas git commit: ATLAS-1960: fixed handling of import/export APIs in HA configuration

2017-07-21 Thread madhan
Repository: atlas
Updated Branches:
  refs/heads/0.8-incubating f800575ef -> 165886de9


ATLAS-1960: fixed handling of import/export APIs in HA configuration

Signed-off-by: Madhan Neethiraj 
(cherry picked from commit d23d61b2a88a472978dcd15428a61dfa48d31215)


Project: http://git-wip-us.apache.org/repos/asf/atlas/repo
Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/165886de
Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/165886de
Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/165886de

Branch: refs/heads/0.8-incubating
Commit: 165886de944b308d18a75e373d97dab52b1b374e
Parents: f800575
Author: ashutoshm 
Authored: Fri Jul 21 12:17:42 2017 -0700
Committer: Madhan Neethiraj 
Committed: Fri Jul 21 19:44:40 2017 -0700

--
 .../atlas/web/filters/ActiveServerFilter.java   | 15 -
 .../web/filters/ActiveServerFilterTest.java | 35 
 2 files changed, 42 insertions(+), 8 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/atlas/blob/165886de/webapp/src/main/java/org/apache/atlas/web/filters/ActiveServerFilter.java
--
diff --git 
a/webapp/src/main/java/org/apache/atlas/web/filters/ActiveServerFilter.java 
b/webapp/src/main/java/org/apache/atlas/web/filters/ActiveServerFilter.java
index 36f2688..29d829f 100644
--- a/webapp/src/main/java/org/apache/atlas/web/filters/ActiveServerFilter.java
+++ b/webapp/src/main/java/org/apache/atlas/web/filters/ActiveServerFilter.java
@@ -100,10 +100,23 @@ public class ActiveServerFilter implements Filter {
 }
 }
 
+final String adminUriNotFiltered[] = { "/admin/export", "/admin/import", 
"/admin/importfile" };
 private boolean isFilteredURI(ServletRequest servletRequest) {
 HttpServletRequest httpServletRequest = (HttpServletRequest) 
servletRequest;
 String requestURI = httpServletRequest.getRequestURI();
-return requestURI.contains("/admin/");
+
+if(requestURI.contains("/admin/")) {
+for (String s : adminUriNotFiltered) {
+if (requestURI.contains(s)) {
+LOG.error("URL not supported in HA mode: {}", requestURI);
+return false;
+}
+}
+
+return true;
+} else {
+return false;
+}
 }
 
 boolean isInstanceActive() {

http://git-wip-us.apache.org/repos/asf/atlas/blob/165886de/webapp/src/test/java/org/apache/atlas/web/filters/ActiveServerFilterTest.java
--
diff --git 
a/webapp/src/test/java/org/apache/atlas/web/filters/ActiveServerFilterTest.java 
b/webapp/src/test/java/org/apache/atlas/web/filters/ActiveServerFilterTest.java
index a8d1110..3396072 100644
--- 
a/webapp/src/test/java/org/apache/atlas/web/filters/ActiveServerFilterTest.java
+++ 
b/webapp/src/test/java/org/apache/atlas/web/filters/ActiveServerFilterTest.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -99,7 +99,28 @@ public class ActiveServerFilterTest {
 
 activeServerFilter.doFilter(servletRequest, servletResponse, 
filterChain);
 
-verify(servletResponse).sendRedirect(ACTIVE_SERVER_ADDRESS+"types");
+verify(servletResponse).sendRedirect(ACTIVE_SERVER_ADDRESS + "types");
+}
+
+
+@Test
+public void 
adminImportRequestsToPassiveServerShouldToActiveServerAddress() throws 
IOException, ServletException {
+String importExportUrls[] = {"api/admin/export", "api/admin/import", 
"api/admin/importfile"};
+
+for (String partialUrl : importExportUrls) {
+
when(serviceState.getState()).thenReturn(ServiceState.ServiceStateValue.PASSIVE);
+when(servletRequest.getRequestURI()).thenReturn(partialUrl);
+
+ActiveServerFilter activeServerFilter = new 
ActiveServerFilter(activeInstanceState, serviceState);
+
+
when(activeInstanceState.getActiveServerAddress()).thenReturn(ACTIVE_SERVER_ADDRESS);
+when(servletRequest.getRequestURI()).thenReturn(partialUrl);
+when(servletRequest.getMethod()).thenReturn(HttpMethod.GET);
+
+activeServerFilter.doFilter(servletRequest, servletResponse, 
filterChain);
+
+