Repository: incubator-atlas Updated Branches: refs/heads/master 03684a056 -> db18c8240
ATLAS-1431 Add configuration property to disable full text mapper Signed-off-by: Jeff Hagelberg <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/incubator-atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-atlas/commit/db18c824 Tree: http://git-wip-us.apache.org/repos/asf/incubator-atlas/tree/db18c824 Diff: http://git-wip-us.apache.org/repos/asf/incubator-atlas/diff/db18c824 Branch: refs/heads/master Commit: db18c82409dc2c2dadba4a19aea44a97a7e64776 Parents: 03684a0 Author: Wojciech Wojcik <[email protected]> Authored: Wed Feb 8 14:24:21 2017 -0500 Committer: Jeff Hagelberg <[email protected]> Committed: Wed Feb 8 14:31:29 2017 -0500 ---------------------------------------------------------------------- distro/src/conf/atlas-application.properties | 8 +++++++- release-log.txt | 1 + .../repository/graph/TypedInstanceToGraphMapper.java | 6 ++++++ .../apache/atlas/util/AtlasRepositoryConfiguration.java | 11 +++++++++++ 4 files changed, 25 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/db18c824/distro/src/conf/atlas-application.properties ---------------------------------------------------------------------- diff --git a/distro/src/conf/atlas-application.properties b/distro/src/conf/atlas-application.properties index 3e71a26..b2b8e74 100755 --- a/distro/src/conf/atlas-application.properties +++ b/distro/src/conf/atlas-application.properties @@ -238,4 +238,10 @@ atlas.metric.query.cache.ttlInSecs=900 # the specified number of evictions have occurred. If the eviction # warning threshold <= 0, no eviction warnings will be issued. -#atlas.CompiledQueryCache.evictionWarningThrottle=0 \ No newline at end of file +#atlas.CompiledQueryCache.evictionWarningThrottle=0 + + +######### Full Text Search Configuration ######### + +#Set to false to disable full text search. +#atlas.search.fulltext.enable=true http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/db18c824/release-log.txt ---------------------------------------------------------------------- diff --git a/release-log.txt b/release-log.txt index 5a12669..c907e67 100644 --- a/release-log.txt +++ b/release-log.txt @@ -9,6 +9,7 @@ ATLAS-1060 Add composite indexes for exact match performance improvements for al ATLAS-1127 Modify creation and modification timestamps to Date instead of Long(sumasai) ALL CHANGES: +ATLAS-1385 Add configuration property to disable full text mapper (wwojcik via jnhagelb) ATLAS-746 After updating a set of entities, response contains only the first entity definition (jnhagelb) ATLAS-1510 Consolidate/batch calls to GraphBackedTypeStore.findVertex() (jnhagelb) ATLAS-1388 Cache entities that are created/updated (jnhagelb) http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/db18c824/repository/src/main/java/org/apache/atlas/repository/graph/TypedInstanceToGraphMapper.java ---------------------------------------------------------------------- diff --git a/repository/src/main/java/org/apache/atlas/repository/graph/TypedInstanceToGraphMapper.java b/repository/src/main/java/org/apache/atlas/repository/graph/TypedInstanceToGraphMapper.java index d9c7feb..e2bc028 100644 --- a/repository/src/main/java/org/apache/atlas/repository/graph/TypedInstanceToGraphMapper.java +++ b/repository/src/main/java/org/apache/atlas/repository/graph/TypedInstanceToGraphMapper.java @@ -56,6 +56,7 @@ import org.apache.atlas.typesystem.types.ObjectGraphWalker; import org.apache.atlas.typesystem.types.TraitType; import org.apache.atlas.typesystem.types.TypeSystem; import org.apache.atlas.typesystem.types.TypeUtils; +import org.apache.atlas.util.AtlasRepositoryConfiguration; import org.apache.atlas.utils.MD5Utils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -373,6 +374,11 @@ public final class TypedInstanceToGraphMapper { private void addFullTextProperty(List<ITypedReferenceableInstance> instances, FullTextMapper fulltextMapper) throws AtlasException { + + if(! AtlasRepositoryConfiguration.isFullTextSearchEnabled()) { + return; + } + for (ITypedReferenceableInstance typedInstance : instances) { // Traverse AtlasVertex instanceVertex = getClassVertex(typedInstance); String fullText = fulltextMapper.mapRecursive(instanceVertex, true); http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/db18c824/repository/src/main/java/org/apache/atlas/util/AtlasRepositoryConfiguration.java ---------------------------------------------------------------------- diff --git a/repository/src/main/java/org/apache/atlas/util/AtlasRepositoryConfiguration.java b/repository/src/main/java/org/apache/atlas/util/AtlasRepositoryConfiguration.java index aab6ee1..ee37e57 100644 --- a/repository/src/main/java/org/apache/atlas/util/AtlasRepositoryConfiguration.java +++ b/repository/src/main/java/org/apache/atlas/util/AtlasRepositoryConfiguration.java @@ -57,6 +57,17 @@ public class AtlasRepositoryConfiguration { private static final Integer DEFAULT_TYPE_UPDATE_LOCK_MAX_WAIT_TIME_IN_SECONDS = Integer.valueOf(15); private static Integer typeUpdateLockMaxWaitTimeInSeconds = null; + private static final String ENABLE_FULLTEXT_SEARCH_PROPERTY = "atlas.search.fulltext.enable"; + + /** + * Configures whether the full text vertex property is populated. Turning this off + * effectively disables full text searches, since all no entities created or updated after + * turning this off will match full text searches. + */ + public static boolean isFullTextSearchEnabled() throws AtlasException { + return ApplicationProperties.get().getBoolean(ENABLE_FULLTEXT_SEARCH_PROPERTY, true); + } + @SuppressWarnings("unchecked") public static Class<? extends TypeCache> getTypeCache() { // Get the type cache implementation class from Atlas configuration.
