http://git-wip-us.apache.org/repos/asf/atlas/blob/2bc6f907/common/src/test/resources/solr/core-template/solrconfig.xml ---------------------------------------------------------------------- diff --git a/common/src/test/resources/solr/core-template/solrconfig.xml b/common/src/test/resources/solr/core-template/solrconfig.xml new file mode 100644 index 0000000..9264f99 --- /dev/null +++ b/common/src/test/resources/solr/core-template/solrconfig.xml @@ -0,0 +1,589 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file 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 + + 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. + See the License for the specific language governing permissions and + limitations under the License. +--> + +<!-- + For more details about configurations options that may appear in + this file, see http://wiki.apache.org/solr/SolrConfigXml. +--> +<config> + <!-- In all configuration below, a prefix of "solr." for class names + is an alias that causes solr to search appropriate packages, + including org.apache.solr.(search|update|request|core|analysis) + + You may also specify a fully qualified Java classname if you + have your own custom plugins. + --> + + <!-- Controls what version of Lucene various components of Solr + adhere to. Generally, you want to use the latest version to + get all bug fixes and improvements. It is highly recommended + that you fully re-index after changing this setting as it can + affect both how text is indexed and queried. + --> + <luceneMatchVersion>5.0.0</luceneMatchVersion> + + <!-- Data Directory + + Used to specify an alternate directory to hold all index data + other than the default ./data under the Solr home. If + replication is in use, this should match the replication + configuration. + --> + <dataDir>${solr.data.dir:}</dataDir> + + + <!-- The DirectoryFactory to use for indexes. + + solr.StandardDirectoryFactory is filesystem + based and tries to pick the best implementation for the current + JVM and platform. solr.NRTCachingDirectoryFactory, the default, + wraps solr.StandardDirectoryFactory and caches small files in memory + for better NRT performance. + + One can force a particular implementation via solr.MMapDirectoryFactory, + solr.NIOFSDirectoryFactory, or solr.SimpleFSDirectoryFactory. + + solr.RAMDirectoryFactory is memory based, not + persistent, and doesn't work with replication. + --> + <directoryFactory name="DirectoryFactory" + class="${solr.directoryFactory:solr.NRTCachingDirectoryFactory}"> + </directoryFactory> + + <!-- The CodecFactory for defining the format of the inverted index. + The default implementation is SchemaCodecFactory, which is the official Lucene + index format, but hooks into the schema to provide per-field customization of + the postings lists and per-document values in the fieldType element + (postingsFormat/docValuesFormat). Note that most of the alternative implementations + are experimental, so if you choose to customize the index format, it's a good + idea to convert back to the official format e.g. via IndexWriter.addIndexes(IndexReader) + before upgrading to a newer version to avoid unnecessary reindexing. + --> + <codecFactory class="solr.SchemaCodecFactory"/> + + <schemaFactory class="ClassicIndexSchemaFactory"/> + + <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + Index Config - These settings control low-level behavior of indexing + Most example settings here show the default value, but are commented + out, to more easily see where customizations have been made. + + Note: This replaces <indexDefaults> and <mainIndex> from older versions + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --> + <indexConfig> + + <!-- LockFactory + + This option specifies which Lucene LockFactory implementation + to use. + + single = SingleInstanceLockFactory - suggested for a + read-only index or when there is no possibility of + another process trying to modify the index. + native = NativeFSLockFactory - uses OS native file locking. + Do not use when multiple solr webapps in the same + JVM are attempting to share a single index. + simple = SimpleFSLockFactory - uses a plain file for locking + + Defaults: 'native' is default for Solr3.6 and later, otherwise + 'simple' is the default + + More details on the nuances of each LockFactory... + http://wiki.apache.org/lucene-java/AvailableLockFactories + --> + <lockType>${solr.lock.type:native}</lockType> + + <!-- Lucene Infostream + + To aid in advanced debugging, Lucene provides an "InfoStream" + of detailed information when indexing. + + Setting the value to true will instruct the underlying Lucene + IndexWriter to write its info stream to solr's log. By default, + this is enabled here, and controlled through log4j.properties. + --> + <infoStream>true</infoStream> + </indexConfig> + + + <!-- JMX + + This example enables JMX if and only if an existing MBeanServer + is found, use this if you want to configure JMX through JVM + parameters. Remove this to disable exposing Solr configuration + and statistics to JMX. + + For more details see http://wiki.apache.org/solr/SolrJmx + --> + <jmx /> + <!-- If you want to connect to a particular server, specify the + agentId + --> + <!-- <jmx agentId="myAgent" /> --> + <!-- If you want to start a new MBeanServer, specify the serviceUrl --> + <!-- <jmx serviceUrl="service:jmx:rmi:///jndi/rmi://localhost:9999/solr"/> + --> + + <!-- The default high-performance update handler --> + <updateHandler class="solr.DirectUpdateHandler2"> + + <!-- Enables a transaction log, used for real-time get, durability, and + and solr cloud replica recovery. The log can grow as big as + uncommitted changes to the index, so use of a hard autoCommit + is recommended (see below). + "dir" - the target directory for transaction logs, defaults to the + solr data directory. --> + <updateLog> + <str name="dir">${solr.ulog.dir:}</str> + </updateLog> + + <!-- AutoCommit + + Perform a hard commit automatically under certain conditions. + Instead of enabling autoCommit, consider using "commitWithin" + when adding documents. + + http://wiki.apache.org/solr/UpdateXmlMessages + + maxDocs - Maximum number of documents to add since the last + commit before automatically triggering a new commit. + + maxTime - Maximum amount of time in ms that is allowed to pass + since a document was added before automatically + triggering a new commit. + openSearcher - if false, the commit causes recent index changes + to be flushed to stable storage, but does not cause a new + searcher to be opened to make those changes visible. + + If the updateLog is enabled, then it's highly recommended to + have some sort of hard autoCommit to limit the log size. + --> + <autoCommit> + <maxTime>${solr.autoCommit.maxTime:15000}</maxTime> + <openSearcher>false</openSearcher> + </autoCommit> + + <!-- softAutoCommit is like autoCommit except it causes a + 'soft' commit which only ensures that changes are visible + but does not ensure that data is synced to disk. This is + faster and more near-realtime friendly than a hard commit. + --> + <autoSoftCommit> + <maxTime>${solr.autoSoftCommit.maxTime:-1}</maxTime> + </autoSoftCommit> + + </updateHandler> + + <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + Query section - these settings control query time things like caches + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --> + <query> + <!-- Max Boolean Clauses + + Maximum number of clauses in each BooleanQuery, an exception + is thrown if exceeded. + + ** WARNING ** + + This option actually modifies a global Lucene property that + will affect all SolrCores. If multiple solrconfig.xml files + disagree on this property, the value at any given moment will + be based on the last SolrCore to be initialized. + + --> + <maxBooleanClauses>1024</maxBooleanClauses> + + + <!-- Solr Internal Query Caches + + There are two implementations of cache available for Solr, + LRUCache, based on a synchronized LinkedHashMap, and + FastLRUCache, based on a ConcurrentHashMap. + + FastLRUCache has faster gets and slower puts in single + threaded operation and thus is generally faster than LRUCache + when the hit ratio of the cache is high (> 75%), and may be + faster under other scenarios on multi-cpu systems. + --> + + <!-- Filter Cache + + Cache used by SolrIndexSearcher for filters (DocSets), + unordered sets of *all* documents that match a query. When a + new searcher is opened, its caches may be prepopulated or + "autowarmed" using data from caches in the old searcher. + autowarmCount is the number of items to prepopulate. For + LRUCache, the autowarmed items will be the most recently + accessed items. + + Parameters: + class - the SolrCache implementation LRUCache or + (LRUCache or FastLRUCache) + size - the maximum number of entries in the cache + initialSize - the initial capacity (number of entries) of + the cache. (see java.util.HashMap) + autowarmCount - the number of entries to prepopulate from + and old cache. + --> + <filterCache class="solr.FastLRUCache" + size="512" + initialSize="512" + autowarmCount="0"/> + + <!-- Query Result Cache + + Caches results of searches - ordered lists of document ids + (DocList) based on a query, a sort, and the range of documents requested. + --> + <queryResultCache class="solr.LRUCache" + size="512" + initialSize="512" + autowarmCount="0"/> + + <!-- Document Cache + + Caches Lucene Document objects (the stored fields for each + document). Since Lucene internal document ids are transient, + this cache will not be autowarmed. + --> + <documentCache class="solr.LRUCache" + size="512" + initialSize="512" + autowarmCount="0"/> + + <!-- custom cache currently used by block join --> + <cache name="perSegFilter" + class="solr.search.LRUCache" + size="10" + initialSize="0" + autowarmCount="10" + regenerator="solr.NoOpRegenerator" /> + + <!-- Lazy Field Loading + + If true, stored fields that are not requested will be loaded + lazily. This can result in a significant speed improvement + if the usual case is to not load all stored fields, + especially if the skipped fields are large compressed text + fields. + --> + <enableLazyFieldLoading>true</enableLazyFieldLoading> + + <!-- Result Window Size + + An optimization for use with the queryResultCache. When a search + is requested, a superset of the requested number of document ids + are collected. For example, if a search for a particular query + requests matching documents 10 through 19, and queryWindowSize is 50, + then documents 0 through 49 will be collected and cached. Any further + requests in that range can be satisfied via the cache. + --> + <queryResultWindowSize>20</queryResultWindowSize> + + <!-- Maximum number of documents to cache for any entry in the + queryResultCache. + --> + <queryResultMaxDocsCached>200</queryResultMaxDocsCached> + + <!-- Use Cold Searcher + + If a search request comes in and there is no current + registered searcher, then immediately register the still + warming searcher and use it. If "false" then all requests + will block until the first searcher is done warming. + --> + <useColdSearcher>false</useColdSearcher> + + <!-- Max Warming Searchers + + Maximum number of searchers that may be warming in the + background concurrently. An error is returned if this limit + is exceeded. + + Recommend values of 1-2 for read-only slaves, higher for + masters w/o cache warming. + --> + <maxWarmingSearchers>2</maxWarmingSearchers> + + </query> + + + <!-- Request Dispatcher + + This section contains instructions for how the SolrDispatchFilter + should behave when processing requests for this SolrCore. + + handleSelect is a legacy option that affects the behavior of requests + such as /select?qt=XXX + + handleSelect="true" will cause the SolrDispatchFilter to process + the request and dispatch the query to a handler specified by the + "qt" param, assuming "/select" isn't already registered. + + handleSelect="false" will cause the SolrDispatchFilter to + ignore "/select" requests, resulting in a 404 unless a handler + is explicitly registered with the name "/select" + + handleSelect="true" is not recommended for new users, but is the default + for backwards compatibility + --> + <requestDispatcher handleSelect="false" > + <!-- Request Parsing + + These settings indicate how Solr Requests may be parsed, and + what restrictions may be placed on the ContentStreams from + those requests + + enableRemoteStreaming - enables use of the stream.file + and stream.url parameters for specifying remote streams. + + multipartUploadLimitInKB - specifies the max size (in KiB) of + Multipart File Uploads that Solr will allow in a Request. + + formdataUploadLimitInKB - specifies the max size (in KiB) of + form data (application/x-www-form-urlencoded) sent via + POST. You can use POST to pass request parameters not + fitting into the URL. + + addHttpRequestToContext - if set to true, it will instruct + the requestParsers to include the original HttpServletRequest + object in the context map of the SolrQueryRequest under the + key "httpRequest". It will not be used by any of the existing + Solr components, but may be useful when developing custom + plugins. + + *** WARNING *** + The settings below authorize Solr to fetch remote files, You + should make sure your system has some authentication before + using enableRemoteStreaming="true" + + --> + <requestParsers enableRemoteStreaming="true" + multipartUploadLimitInKB="2048000" + formdataUploadLimitInKB="2048" + addHttpRequestToContext="false"/> + + <!-- HTTP Caching + + Set HTTP caching related parameters (for proxy caches and clients). + + The options below instruct Solr not to output any HTTP Caching + related headers + --> + <httpCaching never304="true" /> + + </requestDispatcher> + + <!-- Request Handlers + + http://wiki.apache.org/solr/SolrRequestHandler + + Incoming queries will be dispatched to a specific handler by name + based on the path specified in the request. + + Legacy behavior: If the request path uses "/select" but no Request + Handler has that name, and if handleSelect="true" has been specified in + the requestDispatcher, then the Request Handler is dispatched based on + the qt parameter. Handlers without a leading '/' are accessed this way + like so: http://host/app/[core/]select?qt=name If no qt is + given, then the requestHandler that declares default="true" will be + used or the one named "standard". + + If a Request Handler is declared with startup="lazy", then it will + not be initialized until the first request that uses it. + + --> + <!-- SearchHandler + + http://wiki.apache.org/solr/SearchHandler + + For processing Search Queries, the primary Request Handler + provided with Solr is "SearchHandler" It delegates to a sequent + of SearchComponents (see below) and supports distributed + queries across multiple shards + --> + <requestHandler name="/select" class="solr.SearchHandler"> + <!-- default values for query parameters can be specified, these + will be overridden by parameters in the request + --> + <lst name="defaults"> + <str name="echoParams">explicit</str> + <int name="rows">10</int> + </lst> + + </requestHandler> + + <!-- A request handler that returns indented JSON by default --> + <requestHandler name="/query" class="solr.SearchHandler"> + <lst name="defaults"> + <str name="echoParams">explicit</str> + <str name="wt">json</str> + <str name="indent">true</str> + <str name="df">text</str> + </lst> + </requestHandler> + + <!-- + The export request handler is used to export full sorted result sets. + Do not change these defaults. + --> + <requestHandler name="/export" class="solr.SearchHandler"> + <lst name="invariants"> + <str name="rq">{!xport}</str> + <str name="wt">xsort</str> + <str name="distrib">false</str> + </lst> + + <arr name="components"> + <str>query</str> + </arr> + </requestHandler> + + + <initParams path="/update/**,/query,/select,/tvrh,/elevate,/spell"> + <lst name="defaults"> + <str name="df">text</str> + </lst> + </initParams> + + <!-- Field Analysis Request Handler + + RequestHandler that provides much the same functionality as + analysis.jsp. Provides the ability to specify multiple field + types and field names in the same request and outputs + index-time and query-time analysis for each of them. + + Request parameters are: + analysis.fieldname - field name whose analyzers are to be used + + analysis.fieldtype - field type whose analyzers are to be used + analysis.fieldvalue - text for index-time analysis + q (or analysis.q) - text for query time analysis + analysis.showmatch (true|false) - When set to true and when + query analysis is performed, the produced tokens of the + field value analysis will be marked as "matched" for every + token that is produces by the query analysis + --> + <requestHandler name="/analysis/field" + startup="lazy" + class="solr.FieldAnalysisRequestHandler" /> + + + <!-- Document Analysis Handler + + http://wiki.apache.org/solr/AnalysisRequestHandler + + An analysis handler that provides a breakdown of the analysis + process of provided documents. This handler expects a (single) + content stream with the following format: + + <docs> + <doc> + <field name="id">1</field> + <field name="name">The Name</field> + <field name="text">The Text Value</field> + </doc> + <doc>...</doc> + <doc>...</doc> + ... + </docs> + + Note: Each document must contain a field which serves as the + unique key. This key is used in the returned response to associate + an analysis breakdown to the analyzed document. + + Like the FieldAnalysisRequestHandler, this handler also supports + query analysis by sending either an "analysis.query" or "q" + request parameter that holds the query text to be analyzed. It + also supports the "analysis.showmatch" parameter which when set to + true, all field tokens that match the query tokens will be marked + as a "match". + --> + <requestHandler name="/analysis/document" + class="solr.DocumentAnalysisRequestHandler" + startup="lazy" /> + + <!-- Echo the request contents back to the client --> + <requestHandler name="/debug/dump" class="solr.DumpRequestHandler" > + <lst name="defaults"> + <str name="echoParams">explicit</str> + <str name="echoHandler">true</str> + </lst> + </requestHandler> + + + + <!-- Search Components + + Search components are registered to SolrCore and used by + instances of SearchHandler (which can access them by name) + + By default, the following components are available: + + <searchComponent name="query" class="solr.QueryComponent" /> + <searchComponent name="facet" class="solr.FacetComponent" /> + <searchComponent name="mlt" class="solr.MoreLikeThisComponent" /> + <searchComponent name="highlight" class="solr.HighlightComponent" /> + <searchComponent name="stats" class="solr.StatsComponent" /> + <searchComponent name="debug" class="solr.DebugComponent" /> + + --> + + <!-- Terms Component + + http://wiki.apache.org/solr/TermsComponent + + A component to return terms and document frequency of those + terms + --> + <searchComponent name="terms" class="solr.TermsComponent"/> + + <!-- A request handler for demonstrating the terms component --> + <requestHandler name="/terms" class="solr.SearchHandler" startup="lazy"> + <lst name="defaults"> + <bool name="terms">true</bool> + <bool name="distrib">false</bool> + </lst> + <arr name="components"> + <str>terms</str> + </arr> + </requestHandler> + + <!-- Legacy config for the admin interface --> + <admin> + <defaultQuery>*:*</defaultQuery> + </admin> + + + <!--JanusGraph specific--> + <updateRequestProcessorChain default="true"> + <processor class="solr.TimestampUpdateProcessorFactory"> + <str name="fieldName">timestamp</str> + </processor> + <processor class="solr.processor.DocExpirationUpdateProcessorFactory"> + <int name="autoDeletePeriodSeconds">5</int> + <str name="ttlFieldName">ttl</str> + <str name="expirationFieldName">expire_at</str> + </processor> + <processor class="solr.FirstFieldValueUpdateProcessorFactory"> + <str name="fieldName">expire_at_dt</str> + </processor> + <processor class="solr.LogUpdateProcessorFactory"/> + <processor class="solr.RunUpdateProcessorFactory"/> + </updateRequestProcessorChain> +</config>
http://git-wip-us.apache.org/repos/asf/atlas/blob/2bc6f907/common/src/test/resources/solr/core-template/stopwords.txt ---------------------------------------------------------------------- diff --git a/common/src/test/resources/solr/core-template/stopwords.txt b/common/src/test/resources/solr/core-template/stopwords.txt new file mode 100644 index 0000000..ae1e83e --- /dev/null +++ b/common/src/test/resources/solr/core-template/stopwords.txt @@ -0,0 +1,14 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file 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 +# +# 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. +# See the License for the specific language governing permissions and +# limitations under the License. http://git-wip-us.apache.org/repos/asf/atlas/blob/2bc6f907/common/src/test/resources/solr/core-template/synonyms.txt ---------------------------------------------------------------------- diff --git a/common/src/test/resources/solr/core-template/synonyms.txt b/common/src/test/resources/solr/core-template/synonyms.txt new file mode 100644 index 0000000..0ef0e8d --- /dev/null +++ b/common/src/test/resources/solr/core-template/synonyms.txt @@ -0,0 +1,28 @@ +# The ASF licenses this file 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 +# +# 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. +# See the License for the specific language governing permissions and +# limitations under the License. + +#----------------------------------------------------------------------- +#some test synonym mappings unlikely to appear in real input text +aaafoo => aaabar +bbbfoo => bbbfoo bbbbar +cccfoo => cccbar cccbaz +fooaaa,baraaa,bazaaa + +# Some synonym groups specific to this example +GB,gib,gigabyte,gigabytes +MB,mib,megabyte,megabytes +Television, Televisions, TV, TVs +#notice we use "gib" instead of "GiB" so any WordDelimiterFilter coming +#after us won't split it into two words. + +# Synonym mappings can be used for spelling correction too +pixima => pixma http://git-wip-us.apache.org/repos/asf/atlas/blob/2bc6f907/common/src/test/resources/solr/solr.xml ---------------------------------------------------------------------- diff --git a/common/src/test/resources/solr/solr.xml b/common/src/test/resources/solr/solr.xml new file mode 100644 index 0000000..041f005 --- /dev/null +++ b/common/src/test/resources/solr/solr.xml @@ -0,0 +1,47 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file 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 + + 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. + See the License for the specific language governing permissions and + limitations under the License. +--> + +<!-- + This is an example of a simple "solr.xml" file for configuring one or + more Solr Cores, as well as allowing Cores to be added, removed, and + reloaded via HTTP requests. + + More information about options available in this configuration file, + and Solr Core administration can be found online: + http://wiki.apache.org/solr/CoreAdmin +--> + +<solr> + + <solrcloud> + <str name="host">${host:127.0.0.1}</str> + <int name="hostPort">${hostPort:8983}</int> + <str name="hostContext">${hostContext:solr}</str> + <int name="zkClientTimeout">${zkClientTimeout:30000}</int> + <bool name="genericCoreNodeNames">${genericCoreNodeNames:true}</bool> + <int name="distribUpdateConnTimeout">${distribUpdateConnTimeout:15000}</int> + <int name="distribUpdateSoTimeout">${distribUpdateSoTimeout:120000}</int> + </solrcloud> + + <shardHandlerFactory name="shardHandlerFactory" + class="HttpShardHandlerFactory"> + <int name="socketTimeout">${socketTimeout:120000}</int> + <int name="connTimeout">${connTimeout:15000}</int> + </shardHandlerFactory> + +</solr> http://git-wip-us.apache.org/repos/asf/atlas/blob/2bc6f907/graphdb/common/src/test/java/org/apache/atlas/graph/GraphSandboxUtil.java ---------------------------------------------------------------------- diff --git a/graphdb/common/src/test/java/org/apache/atlas/graph/GraphSandboxUtil.java b/graphdb/common/src/test/java/org/apache/atlas/graph/GraphSandboxUtil.java index 3cccd84..b8a9a49 100644 --- a/graphdb/common/src/test/java/org/apache/atlas/graph/GraphSandboxUtil.java +++ b/graphdb/common/src/test/java/org/apache/atlas/graph/GraphSandboxUtil.java @@ -58,4 +58,20 @@ public class GraphSandboxUtil { UUID uuid = UUID.randomUUID(); create(uuid.toString()); } + + // Need to start local Solr Cloud for JanusGraph 0.2.0 + public static boolean useLocalSolr() { + boolean ret = false; + + try { + Configuration conf = ApplicationProperties.get(); + Object property = conf.getProperty("atlas.graph.index.search.solr.embedded"); + + if (property != null && property instanceof String) { + ret = Boolean.valueOf((String) property); + } + } catch (AtlasException ignored) {} + + return ret; + } } http://git-wip-us.apache.org/repos/asf/atlas/blob/2bc6f907/graphdb/janus/pom.xml ---------------------------------------------------------------------- diff --git a/graphdb/janus/pom.xml b/graphdb/janus/pom.xml index ad96db3..aadb65f 100644 --- a/graphdb/janus/pom.xml +++ b/graphdb/janus/pom.xml @@ -35,7 +35,7 @@ <properties> <tinkerpop.version>3.2.6</tinkerpop.version> - <janus.version>0.1.1</janus.version> + <janus.version>0.2.0</janus.version> <checkstyle.failOnViolation>false</checkstyle.failOnViolation> </properties> @@ -63,6 +63,12 @@ <groupId>org.janusgraph</groupId> <artifactId>janusgraph-core</artifactId> <version>${janus.version}</version> + <exclusions> + <exclusion> + <groupId>com.codahale.metrics</groupId> + <artifactId>*</artifactId> + </exclusion> + </exclusions> </dependency> <dependency> @@ -121,11 +127,11 @@ <version>${janus.version}</version> </dependency> - <!-- JanusGraph 0.1.1 is dependent on solr-solrj 5.2.1 --> + <!-- JanusGraph 0.2.0 is dependent on solr-solrj 7.0.0 --> <dependency> <groupId>org.apache.solr</groupId> <artifactId>solr-solrj</artifactId> - <version>5.2.1</version> + <version>7.0.0</version> </dependency> <dependency> @@ -155,6 +161,13 @@ <scope>test</scope> </dependency> + <dependency> + <groupId>org.apache.atlas</groupId> + <artifactId>atlas-common</artifactId> + <type>test-jar</type> + <version>${project.version}</version> + <scope>test</scope> + </dependency> </dependencies> @@ -188,12 +201,38 @@ <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> - <version>2.18.1</version> + <version>${surefire.version}</version> <configuration> <skip>${skipUTs}</skip> </configuration> </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-dependency-plugin</artifactId> + <executions> + <execution> + <id>unpack</id> + <phase>compile</phase> + <goals> + <goal>unpack</goal> + </goals> + <configuration> + <artifactItems> + <artifactItem> + <groupId>org.apache.atlas</groupId> + <artifactId>atlas-common</artifactId> + <type>test-jar</type> + <version>${project.version}</version> + <excludes>org/**, META-INF/**</excludes> + <outputDirectory>${project.build.directory}/local_solr</outputDirectory> + </artifactItem> + </artifactItems> + </configuration> + </execution> + </executions> + </plugin> + </plugins> </build> http://git-wip-us.apache.org/repos/asf/atlas/blob/2bc6f907/graphdb/janus/src/main/java/org/apache/atlas/repository/graphdb/janus/AtlasJanusGraph.java ---------------------------------------------------------------------- diff --git a/graphdb/janus/src/main/java/org/apache/atlas/repository/graphdb/janus/AtlasJanusGraph.java b/graphdb/janus/src/main/java/org/apache/atlas/repository/graphdb/janus/AtlasJanusGraph.java index 7c96806..ad34787 100644 --- a/graphdb/janus/src/main/java/org/apache/atlas/repository/graphdb/janus/AtlasJanusGraph.java +++ b/graphdb/janus/src/main/java/org/apache/atlas/repository/graphdb/janus/AtlasJanusGraph.java @@ -23,6 +23,7 @@ import com.google.common.collect.Lists; import com.google.common.collect.Maps; import org.apache.atlas.type.AtlasType; import org.janusgraph.core.Cardinality; +import org.janusgraph.core.JanusGraphFactory; import org.janusgraph.core.PropertyKey; import org.janusgraph.core.SchemaViolationException; import org.janusgraph.core.JanusGraph; @@ -55,6 +56,7 @@ import org.apache.tinkerpop.gremlin.structure.Vertex; import org.apache.tinkerpop.gremlin.structure.io.IoCore; import org.apache.tinkerpop.gremlin.structure.io.graphson.GraphSONMapper; import org.apache.tinkerpop.gremlin.structure.io.graphson.GraphSONWriter; +import org.janusgraph.diskstorage.BackendException; import javax.script.Bindings; import javax.script.ScriptEngine; @@ -277,7 +279,10 @@ public class AtlasJanusGraph implements AtlasGraph<AtlasJanusVertex, AtlasJanusE // only a shut down graph can be cleared graph.close(); } - JanusGraphCleanup.clear(graph); + + try { + JanusGraphFactory.drop(graph); + } catch (BackendException ignoreEx) {} } private JanusGraph getGraph() { http://git-wip-us.apache.org/repos/asf/atlas/blob/2bc6f907/graphdb/janus/src/main/java/org/apache/atlas/repository/graphdb/janus/AtlasJanusGraphDatabase.java ---------------------------------------------------------------------- diff --git a/graphdb/janus/src/main/java/org/apache/atlas/repository/graphdb/janus/AtlasJanusGraphDatabase.java b/graphdb/janus/src/main/java/org/apache/atlas/repository/graphdb/janus/AtlasJanusGraphDatabase.java index 1fda689..e507a8a 100644 --- a/graphdb/janus/src/main/java/org/apache/atlas/repository/graphdb/janus/AtlasJanusGraphDatabase.java +++ b/graphdb/janus/src/main/java/org/apache/atlas/repository/graphdb/janus/AtlasJanusGraphDatabase.java @@ -161,7 +161,7 @@ public class AtlasJanusGraphDatabase implements GraphDatabase<AtlasJanusVertex, } try { - JanusGraphCleanup.clear(getGraphInstance()); + JanusGraphFactory.drop(getGraphInstance()); } catch (Throwable t) { LOG.warn("Could not clear test JanusGraph", t); t.printStackTrace(); http://git-wip-us.apache.org/repos/asf/atlas/blob/2bc6f907/graphdb/janus/src/test/java/org/apache/atlas/repository/graphdb/janus/AbstractGraphDatabaseTest.java ---------------------------------------------------------------------- diff --git a/graphdb/janus/src/test/java/org/apache/atlas/repository/graphdb/janus/AbstractGraphDatabaseTest.java b/graphdb/janus/src/test/java/org/apache/atlas/repository/graphdb/janus/AbstractGraphDatabaseTest.java index 5574a4c..d764da4 100644 --- a/graphdb/janus/src/test/java/org/apache/atlas/repository/graphdb/janus/AbstractGraphDatabaseTest.java +++ b/graphdb/janus/src/test/java/org/apache/atlas/repository/graphdb/janus/AbstractGraphDatabaseTest.java @@ -25,6 +25,7 @@ import org.apache.atlas.repository.graphdb.AtlasGraph; import org.apache.atlas.repository.graphdb.AtlasGraphManagement; import org.apache.atlas.repository.graphdb.AtlasPropertyKey; import org.apache.atlas.repository.graphdb.AtlasVertex; +import org.apache.atlas.runner.LocalSolrRunner; import org.testng.annotations.AfterClass; import org.testng.annotations.AfterMethod; import org.testng.annotations.BeforeClass; @@ -33,6 +34,8 @@ import java.util.ArrayList; import java.util.Collections; import java.util.List; +import static org.apache.atlas.graph.GraphSandboxUtil.useLocalSolr; + /** * */ @@ -48,7 +51,11 @@ public abstract class AbstractGraphDatabaseTest { private AtlasGraph<?, ?> graph = null; @BeforeClass - public static void createIndices() { + public static void createIndices() throws Exception { + if (useLocalSolr()) { + LocalSolrRunner.start(); + } + GraphSandboxUtil.create(); AtlasJanusGraphDatabase db = new AtlasJanusGraphDatabase(); @@ -79,10 +86,13 @@ public abstract class AbstractGraphDatabaseTest { } @AfterClass - public static void cleanUp() { + public static void cleanUp() throws Exception { AtlasJanusGraph graph = new AtlasJanusGraph(); graph.clear(); + if (useLocalSolr()) { + LocalSolrRunner.stop(); + } } protected <V, E> void pushChangesAndFlushCache() { http://git-wip-us.apache.org/repos/asf/atlas/blob/2bc6f907/graphdb/janus/src/test/java/org/apache/atlas/repository/graphdb/janus/AtlasJanusDatabaseTest.java ---------------------------------------------------------------------- diff --git a/graphdb/janus/src/test/java/org/apache/atlas/repository/graphdb/janus/AtlasJanusDatabaseTest.java b/graphdb/janus/src/test/java/org/apache/atlas/repository/graphdb/janus/AtlasJanusDatabaseTest.java index 4919de2..7c33f10 100644 --- a/graphdb/janus/src/test/java/org/apache/atlas/repository/graphdb/janus/AtlasJanusDatabaseTest.java +++ b/graphdb/janus/src/test/java/org/apache/atlas/repository/graphdb/janus/AtlasJanusDatabaseTest.java @@ -30,8 +30,10 @@ import org.apache.atlas.repository.graphdb.AtlasGraphQuery; import org.apache.atlas.repository.graphdb.AtlasGraphQuery.ComparisionOperator; import org.apache.atlas.repository.graphdb.AtlasPropertyKey; import org.apache.atlas.repository.graphdb.AtlasVertex; +import org.apache.atlas.runner.LocalSolrRunner; import org.apache.atlas.typesystem.types.DataTypes.TypeCategory; import org.testng.annotations.AfterClass; +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; import java.math.BigDecimal; @@ -41,6 +43,7 @@ import java.util.Collection; import java.util.Collections; import java.util.List; +import static org.apache.atlas.graph.GraphSandboxUtil.useLocalSolr; import static org.testng.Assert.*; /** @@ -72,12 +75,23 @@ public class AtlasJanusDatabaseTest { return (AtlasGraph<V, E>) atlasGraph; } + @BeforeClass + public void start() throws Exception { + if (useLocalSolr()) { + LocalSolrRunner.start(); + } + } + @AfterClass - public void cleanup() { + public void cleanup() throws Exception { if (atlasGraph != null) { atlasGraph.clear(); atlasGraph = null; } + + if (useLocalSolr()) { + LocalSolrRunner.stop(); + } } @Test http://git-wip-us.apache.org/repos/asf/atlas/blob/2bc6f907/graphdb/janus/src/test/java/org/apache/atlas/repository/graphdb/janus/JanusGraphProviderTest.java ---------------------------------------------------------------------- diff --git a/graphdb/janus/src/test/java/org/apache/atlas/repository/graphdb/janus/JanusGraphProviderTest.java b/graphdb/janus/src/test/java/org/apache/atlas/repository/graphdb/janus/JanusGraphProviderTest.java index 7c1dda7..fd06256 100644 --- a/graphdb/janus/src/test/java/org/apache/atlas/repository/graphdb/janus/JanusGraphProviderTest.java +++ b/graphdb/janus/src/test/java/org/apache/atlas/repository/graphdb/janus/JanusGraphProviderTest.java @@ -21,12 +21,15 @@ import org.apache.atlas.ApplicationProperties; import org.apache.atlas.AtlasException; import org.apache.atlas.graph.GraphSandboxUtil; import org.apache.atlas.repository.graphdb.AtlasGraph; +import org.apache.atlas.runner.LocalSolrRunner; import org.apache.commons.configuration.Configuration; import org.testng.Assert; import org.testng.annotations.AfterClass; import org.testng.annotations.BeforeTest; import org.testng.annotations.Test; +import static org.apache.atlas.graph.GraphSandboxUtil.useLocalSolr; + @Test public class JanusGraphProviderTest { @@ -34,13 +37,16 @@ public class JanusGraphProviderTest { private AtlasGraph<?, ?> graph; @BeforeTest - public void setUp() throws AtlasException { + public void setUp() throws Exception { + if (useLocalSolr()) { + LocalSolrRunner.start(); + } + GraphSandboxUtil.create(); //First get Instance - graph = new AtlasJanusGraph(); - configuration = ApplicationProperties.getSubsetConfiguration(ApplicationProperties.get(), - AtlasJanusGraphDatabase.GRAPH_PREFIX); + graph = new AtlasJanusGraph(); + configuration = ApplicationProperties.getSubsetConfiguration(ApplicationProperties.get(), AtlasJanusGraphDatabase.GRAPH_PREFIX); } @AfterClass @@ -56,6 +62,10 @@ public class JanusGraphProviderTest { } catch (Exception e) { e.printStackTrace(); } + + if (useLocalSolr()) { + LocalSolrRunner.stop(); + } } @Test @@ -74,7 +84,7 @@ public class JanusGraphProviderTest { } catch (Exception e) { Assert.assertEquals(e.getMessage(), "Configured Index Backend lucene differs from earlier configured " - + "Index Backend elasticsearch. Aborting!"); + + "Index Backend solr. Aborting!"); } } } http://git-wip-us.apache.org/repos/asf/atlas/blob/2bc6f907/graphdb/janus/src/test/resources/atlas-application.properties ---------------------------------------------------------------------- diff --git a/graphdb/janus/src/test/resources/atlas-application.properties b/graphdb/janus/src/test/resources/atlas-application.properties index a66e865..ebc74ff 100644 --- a/graphdb/janus/src/test/resources/atlas-application.properties +++ b/graphdb/janus/src/test/resources/atlas-application.properties @@ -50,7 +50,7 @@ atlas.graph.index.search.elasticsearch.create.sleep=2000 # Solr cloud mode properties atlas.graph.index.search.solr.mode=cloud atlas.graph.index.search.solr.zookeeper-url=${solr.zk.address} - +atlas.graph.index.search.solr.embedded=${solr.embedded} ######### Hive Lineage Configs ######### # This models reflects the base super types for Data and Process http://git-wip-us.apache.org/repos/asf/atlas/blob/2bc6f907/graphdb/titan0/pom.xml ---------------------------------------------------------------------- diff --git a/graphdb/titan0/pom.xml b/graphdb/titan0/pom.xml index 2eec260..ab83fe6 100644 --- a/graphdb/titan0/pom.xml +++ b/graphdb/titan0/pom.xml @@ -160,6 +160,10 @@ <groupId>javax.servlet</groupId> <artifactId>servlet-api</artifactId> </exclusion> + <exclusion> + <groupId>org.apache.solr</groupId> + <artifactId>solr-core</artifactId> + </exclusion> </exclusions> </dependency> @@ -193,6 +197,38 @@ <version>${solr.version}</version> </dependency> + <dependency> + <groupId>org.apache.solr</groupId> + <artifactId>solr-core</artifactId> + <version>${solr.version}</version> + <exclusions> + <exclusion> + <artifactId>*</artifactId> + <groupId>org.eclipse.jetty</groupId> + </exclusion> + <exclusion> + <artifactId>*</artifactId> + <groupId>org.eclipse.jetty.orbit</groupId> + </exclusion> + <exclusion> + <artifactId>*</artifactId> + <groupId>org.restlet.jee</groupId> + </exclusion> + <exclusion> + <artifactId>*</artifactId> + <groupId>org.ow2.asm</groupId> + </exclusion> + <exclusion> + <artifactId>*</artifactId> + <groupId>org.apache.lucene</groupId> + </exclusion> + <exclusion> + <artifactId>*</artifactId> + <groupId>org.apache.hadoop</groupId> + </exclusion> + </exclusions> + </dependency> + </dependencies> <build> @@ -217,6 +253,10 @@ <excludes> <!-- these are bundled with Atlas --> <exclude>org.slf4j:*</exclude> + <exclude>com.fasterxml.jackson.core:*</exclude> + <exclude>com.fasterxml.jackson.dataformat:*</exclude> + <exclude>com.fasterxml.jackson.databind:*</exclude> + <exclude>com.fasterxml.jackson.datatype:*</exclude> </excludes> </artifactSet> <filters> @@ -265,9 +305,9 @@ <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> - <version>2.18.1</version> + <version>${surefire.version}</version> <configuration> - <skip>${skipUTs}</skip> + <skip>true</skip> </configuration> </plugin> http://git-wip-us.apache.org/repos/asf/atlas/blob/2bc6f907/graphdb/titan1/pom.xml ---------------------------------------------------------------------- diff --git a/graphdb/titan1/pom.xml b/graphdb/titan1/pom.xml index c729caa..b9483ba 100644 --- a/graphdb/titan1/pom.xml +++ b/graphdb/titan1/pom.xml @@ -107,6 +107,10 @@ <groupId>javax.servlet</groupId> <artifactId>servlet-api</artifactId> </exclusion> + <exclusion> + <groupId>org.apache.solr</groupId> + <artifactId>solr-core</artifactId> + </exclusion> </exclusions> </dependency> @@ -150,6 +154,38 @@ </dependency> <dependency> + <groupId>org.apache.solr</groupId> + <artifactId>solr-core</artifactId> + <version>${solr.version}</version> + <exclusions> + <exclusion> + <artifactId>*</artifactId> + <groupId>org.eclipse.jetty</groupId> + </exclusion> + <exclusion> + <artifactId>*</artifactId> + <groupId>org.eclipse.jetty.orbit</groupId> + </exclusion> + <exclusion> + <artifactId>*</artifactId> + <groupId>org.restlet.jee</groupId> + </exclusion> + <exclusion> + <artifactId>*</artifactId> + <groupId>org.ow2.asm</groupId> + </exclusion> + <exclusion> + <artifactId>*</artifactId> + <groupId>org.apache.lucene</groupId> + </exclusion> + <exclusion> + <artifactId>*</artifactId> + <groupId>org.apache.hadoop</groupId> + </exclusion> + </exclusions> + </dependency> + + <dependency> <groupId>org.testng</groupId> <artifactId>testng</artifactId> </dependency> @@ -221,9 +257,9 @@ <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> - <version>2.18.1</version> + <version>${surefire.version}</version> <configuration> - <skip>${skipUTs}</skip> + <skip>true</skip> </configuration> </plugin> http://git-wip-us.apache.org/repos/asf/atlas/blob/2bc6f907/intg/pom.xml ---------------------------------------------------------------------- diff --git a/intg/pom.xml b/intg/pom.xml index 22895df..5f3bdcf 100644 --- a/intg/pom.xml +++ b/intg/pom.xml @@ -38,6 +38,12 @@ <dependency> <groupId>org.apache.hadoop</groupId> <artifactId>hadoop-common</artifactId> + <exclusions> + <exclusion> + <groupId>javax.servlet</groupId> + <artifactId>servlet-api</artifactId> + </exclusion> + </exclusions> </dependency> <dependency> http://git-wip-us.apache.org/repos/asf/atlas/blob/2bc6f907/intg/src/main/resources/atlas-log4j.xml ---------------------------------------------------------------------- diff --git a/intg/src/main/resources/atlas-log4j.xml b/intg/src/main/resources/atlas-log4j.xml new file mode 100755 index 0000000..510e2cf --- /dev/null +++ b/intg/src/main/resources/atlas-log4j.xml @@ -0,0 +1,105 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!-- + ~ Licensed to the Apache Software Foundation (ASF) under one + ~ or more contributor license agreements. See the NOTICE file + ~ distributed with this work for additional information + ~ regarding copyright ownership. The ASF licenses this file + ~ 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 + ~ + ~ 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. + ~ See the License for the specific language governing permissions and + ~ limitations under the License. + --> + +<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> + +<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"> + <appender name="console" class="org.apache.log4j.ConsoleAppender"> + <param name="Target" value="System.out"/> + <layout class="org.apache.log4j.PatternLayout"> + <param name="ConversionPattern" value="%d %-5p - [%t:%x] ~ %m (%C{1}:%L)%n"/> + </layout> + </appender> + + <appender name="AUDIT" class="org.apache.log4j.RollingFileAppender"> + <param name="File" value="${atlas.log.dir}/audit.log"/> + <param name="Append" value="true"/> + <param name="Threshold" value="debug"/> + <layout class="org.apache.log4j.PatternLayout"> + <param name="ConversionPattern" value="%d %x %m%n"/> + <param name="maxFileSize" value="100MB" /> + <param name="maxBackupIndex" value="20" /> + </layout> + </appender> + + <logger name="org.apache.atlas" additivity="false"> + <level value="debug"/> + <appender-ref ref="console"/> + </logger> + + <!-- uncomment this block to generate performance traces + <appender name="perf_appender" class="org.apache.log4j.DailyRollingFileAppender"> + <param name="file" value="${atlas.log.dir}/atlas_perf.log" /> + <param name="datePattern" value="'.'yyyy-MM-dd" /> + <param name="append" value="true" /> + <layout class="org.apache.log4j.PatternLayout"> + <param name="ConversionPattern" value="%d|%t|%m%n" /> + </layout> + </appender> + + <logger name="org.apache.atlas.perf" additivity="false"> + <level value="debug" /> + <appender-ref ref="perf_appender" /> + </logger> + --> + + <appender name="FAILED" class="org.apache.log4j.DailyRollingFileAppender"> + <param name="File" value="${atlas.log.dir}/failed.log"/> + <param name="Append" value="true"/> + <layout class="org.apache.log4j.PatternLayout"> + <param name="ConversionPattern" value="%d %m"/> + </layout> + </appender> + + <logger name="FAILED" additivity="false"> + <level value="info"/> + <appender-ref ref="AUDIT"/> + </logger> + + <logger name="com.thinkaurelius.titan" additivity="false"> + <level value="warn"/> + <appender-ref ref="console"/> + </logger> + + <logger name="org.springframework" additivity="false"> + <level value="warn"/> + <appender-ref ref="console"/> + </logger> + + <logger name="org.eclipse" additivity="false"> + <level value="warn"/> + <appender-ref ref="console"/> + </logger> + + <logger name="com.sun.jersey" additivity="false"> + <level value="warn"/> + <appender-ref ref="console"/> + </logger> + + <logger name="AUDIT" additivity="false"> + <level value="info"/> + <appender-ref ref="console"/> + </logger> + + <root> + <priority value="warn"/> + <appender-ref ref="console"/> + </root> + +</log4j:configuration> http://git-wip-us.apache.org/repos/asf/atlas/blob/2bc6f907/intg/src/test/resources/atlas-application.properties ---------------------------------------------------------------------- diff --git a/intg/src/test/resources/atlas-application.properties b/intg/src/test/resources/atlas-application.properties index b937c33..ce9351a 100644 --- a/intg/src/test/resources/atlas-application.properties +++ b/intg/src/test/resources/atlas-application.properties @@ -72,6 +72,7 @@ atlas.graph.index.search.elasticsearch.create.sleep=2000 # Solr cloud mode properties atlas.graph.index.search.solr.mode=cloud atlas.graph.index.search.solr.zookeeper-url=${solr.zk.address} +atlas.graph.index.search.solr.embedded=${solr.embedded} atlas.graph.index.search.max-result-set-size=150 ######### Hive Lineage Configs ######### http://git-wip-us.apache.org/repos/asf/atlas/blob/2bc6f907/pom.xml ---------------------------------------------------------------------- diff --git a/pom.xml b/pom.xml index cbf9e2a..d47421e 100644 --- a/pom.xml +++ b/pom.xml @@ -527,7 +527,7 @@ <node.version>v0.10.30</node.version> <node-for-v2.version>v4.4.2</node-for-v2.version> <slf4j.version>1.7.21</slf4j.version> - <jetty.version>9.4.0.v20161208</jetty.version> + <jetty.version>9.3.14.v20161028</jetty.version> <jetty.jsp.version>9.2.12.v20150709</jetty.jsp.version> <jersey.version>1.19</jersey.version> @@ -582,13 +582,13 @@ resources in intg and each of the graph profiles. They do not affect packaging which is handled by defaults and profiles set in atlas-distro POM --> <graph.storage.backend>berkeleyje</graph.storage.backend> - <graph.index.backend>elasticsearch</graph.index.backend> + <graph.index.backend>solr</graph.index.backend> <entity.repository.impl>org.apache.atlas.repository.audit.InMemoryEntityAuditRepository</entity.repository.impl> - <surefire.version>2.18.1</surefire.version> + <surefire.version>2.20.1</surefire.version> <surefire.forkCount>2C</surefire.forkCount> - <failsafe.version>2.18.1</failsafe.version> + <failsafe.version>2.20.1</failsafe.version> <atlas.surefire.options></atlas.surefire.options> <aspectj.runtime.version>1.8.7</aspectj.runtime.version> @@ -652,6 +652,8 @@ <graphArtifact>atlas-graphdb-janus</graphArtifact> <skipDocs>false</skipDocs> <graphdb.backend.impl>org.apache.atlas.repository.graphdb.janus.AtlasJanusGraphDatabase</graphdb.backend.impl> + <graph.index.backend>solr</graph.index.backend> + <solr.embedded>true</solr.embedded> </properties> </profile> @@ -670,6 +672,8 @@ <graphArtifact>atlas-graphdb-titan0</graphArtifact> <skipDocs>false</skipDocs> <graphdb.backend.impl>org.apache.atlas.repository.graphdb.titan0.Titan0GraphDatabase</graphdb.backend.impl> + <graph.index.backend>elasticsearch</graph.index.backend> + <solr.embedded>false</solr.embedded> </properties> </profile> @@ -688,6 +692,8 @@ <graphArtifact>atlas-graphdb-titan1</graphArtifact> <skipDocs>false</skipDocs> <graphdb.backend.impl>org.apache.atlas.repository.graphdb.titan1.Titan1GraphDatabase</graphdb.backend.impl> + <graph.index.backend>elasticsearch</graph.index.backend> + <solr.embedded>false</solr.embedded> </properties> </profile> @@ -706,6 +712,8 @@ <graphArtifact>atlas-graphdb-janus</graphArtifact> <skipDocs>false</skipDocs> <graphdb.backend.impl>org.apache.atlas.repository.graphdb.janus.AtlasJanusGraphDatabase</graphdb.backend.impl> + <graph.index.backend>solr</graph.index.backend> + <solr.embedded>true</solr.embedded> </properties> </profile> @@ -1216,38 +1224,6 @@ </dependency> <dependency> - <groupId>org.apache.solr</groupId> - <artifactId>solr-core</artifactId> - <version>${solr.version}</version> - <exclusions> - <exclusion> - <artifactId>*</artifactId> - <groupId>org.eclipse.jetty</groupId> - </exclusion> - <exclusion> - <artifactId>*</artifactId> - <groupId>org.eclipse.jetty.orbit</groupId> - </exclusion> - <exclusion> - <artifactId>*</artifactId> - <groupId>org.restlet.jee</groupId> - </exclusion> - <exclusion> - <artifactId>*</artifactId> - <groupId>org.ow2.asm</groupId> - </exclusion> - <exclusion> - <artifactId>*</artifactId> - <groupId>org.apache.lucene</groupId> - </exclusion> - <exclusion> - <artifactId>*</artifactId> - <groupId>org.apache.hadoop</groupId> - </exclusion> - </exclusions> - </dependency> - - <dependency> <groupId>javax.servlet</groupId> <artifactId>javax.servlet-api</artifactId> <version>${javax.servlet.version}</version> @@ -1931,7 +1907,7 @@ <exclude>**/.cache-main</exclude> <exclude>**/.cache-tests</exclude> <exclude>**/.checkstyle</exclude> - <exclude>*.txt</exclude> + <exclude>**/*.txt</exclude> <exclude>**/*.json</exclude> <exclude>.pc/**</exclude> <exclude>debian/**</exclude> http://git-wip-us.apache.org/repos/asf/atlas/blob/2bc6f907/repository/pom.xml ---------------------------------------------------------------------- diff --git a/repository/pom.xml b/repository/pom.xml index 51ddb76..f31cf16 100755 --- a/repository/pom.xml +++ b/repository/pom.xml @@ -35,6 +35,12 @@ <dependency> <groupId>org.apache.atlas</groupId> <artifactId>atlas-intg</artifactId> + <exclusions> + <exclusion> + <groupId>javax.servlet</groupId> + <artifactId>servlet-api</artifactId> + </exclusion> + </exclusions> </dependency> <dependency> @@ -111,6 +117,16 @@ <groupId>org.apache.atlas</groupId> <artifactId>atlas-hbase-server-shaded</artifactId> <scope>test</scope> + <exclusions> + <exclusion> + <groupId>javax.servlet</groupId> + <artifactId>servlet-api</artifactId> + </exclusion> + <exclusion> + <groupId>org.mortbay.jetty</groupId> + <artifactId>servlet-api-2.5</artifactId> + </exclusion> + </exclusions> </dependency> <dependency> @@ -132,6 +148,95 @@ </dependencies> + <profiles> + <profile> + <id>graph-provider-default</id> + <activation> + <property> + <name>!GRAPH-PROVIDER</name> + </property> + </activation> + <dependencies> + <dependency> + <groupId>org.apache.atlas</groupId> + <artifactId>atlas-common</artifactId> + <type>test-jar</type> + <version>${project.version}</version> + <scope>test</scope> + </dependency> + </dependencies> + </profile> + + <profile> + <id>graph-provider-janus</id> + <activation> + <property> + <name>GRAPH-PROVIDER</name> + <value>janus</value> + </property> + </activation> + <dependencies> + <dependency> + <groupId>org.apache.atlas</groupId> + <artifactId>atlas-common</artifactId> + <type>test-jar</type> + <version>${project.version}</version> + <scope>test</scope> + </dependency> + </dependencies> + </profile> + + <profile> + <id>graph-provider-titan0</id> + <activation> + <property> + <name>GRAPH-PROVIDER</name> + <value>titan0</value> + </property> + </activation> + <dependencies> + <dependency> + <groupId>org.apache.atlas</groupId> + <artifactId>atlas-common</artifactId> + <type>test-jar</type> + <version>${project.version}</version> + <scope>test</scope> + <exclusions> + <exclusion> + <groupId>org.apache.lucene</groupId> + <artifactId>*</artifactId> + </exclusion> + </exclusions> + </dependency> + </dependencies> + </profile> + + <profile> + <id>graph-provider-titan1</id> + <activation> + <property> + <name>GRAPH-PROVIDER</name> + <value>titan1</value> + </property> + </activation> + <dependencies> + <dependency> + <groupId>org.apache.atlas</groupId> + <artifactId>atlas-common</artifactId> + <type>test-jar</type> + <version>${project.version}</version> + <scope>test</scope> + <exclusions> + <exclusion> + <groupId>org.apache.lucene</groupId> + <artifactId>*</artifactId> + </exclusion> + </exclusions> + </dependency> + </dependencies> + </profile> + </profiles> + <build> <plugins> <plugin> @@ -149,7 +254,7 @@ <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> - <version>2.18.1</version> + <version>${surefire.version}</version> <configuration combine.children="override"> <properties> <property> @@ -159,6 +264,31 @@ </properties> </configuration> </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-dependency-plugin</artifactId> + <executions> + <execution> + <id>unpack</id> + <phase>compile</phase> + <goals> + <goal>unpack</goal> + </goals> + <configuration> + <artifactItems> + <artifactItem> + <groupId>org.apache.atlas</groupId> + <artifactId>atlas-common</artifactId> + <type>test-jar</type> + <version>${project.version}</version> + <excludes>org/**, META-INF/**</excludes> + <outputDirectory>${project.build.directory}/local_solr</outputDirectory> + </artifactItem> + </artifactItems> + </configuration> + </execution> + </executions> + </plugin> </plugins> </build> </project> http://git-wip-us.apache.org/repos/asf/atlas/blob/2bc6f907/repository/src/test/java/org/apache/atlas/TestModules.java ---------------------------------------------------------------------- diff --git a/repository/src/test/java/org/apache/atlas/TestModules.java b/repository/src/test/java/org/apache/atlas/TestModules.java index 5c9e60f..df299ce 100644 --- a/repository/src/test/java/org/apache/atlas/TestModules.java +++ b/repository/src/test/java/org/apache/atlas/TestModules.java @@ -48,6 +48,7 @@ import org.apache.atlas.repository.store.graph.v1.DeleteHandlerV1; import org.apache.atlas.repository.store.graph.v1.EntityGraphMapper; import org.apache.atlas.repository.store.graph.v1.HardDeleteHandlerV1; import org.apache.atlas.repository.store.graph.v1.SoftDeleteHandlerV1; +import org.apache.atlas.runner.LocalSolrRunner; import org.apache.atlas.service.Service; import org.apache.atlas.store.AtlasTypeDefStore; import org.apache.atlas.type.AtlasTypeRegistry; @@ -58,6 +59,8 @@ import org.mockito.Mockito; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import static org.apache.atlas.graph.GraphSandboxUtil.useLocalSolr; + public class TestModules { static class MockNotifier implements Provider<AtlasEntityChangeNotifier> { @@ -93,6 +96,13 @@ public class TestModules { @Override protected void configure() { + if (useLocalSolr()) { + try { + LocalSolrRunner.start(); + } catch (Exception e) { + //ignore + } + } GraphSandboxUtil.create(); http://git-wip-us.apache.org/repos/asf/atlas/blob/2bc6f907/repository/src/test/java/org/apache/atlas/repository/audit/AuditRepositoryTestBase.java ---------------------------------------------------------------------- diff --git a/repository/src/test/java/org/apache/atlas/repository/audit/AuditRepositoryTestBase.java b/repository/src/test/java/org/apache/atlas/repository/audit/AuditRepositoryTestBase.java index 47fd9cf..47a61ee 100644 --- a/repository/src/test/java/org/apache/atlas/repository/audit/AuditRepositoryTestBase.java +++ b/repository/src/test/java/org/apache/atlas/repository/audit/AuditRepositoryTestBase.java @@ -29,7 +29,6 @@ import java.util.List; import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertNotNull; - public class AuditRepositoryTestBase { protected EntityAuditRepository eventRepository; http://git-wip-us.apache.org/repos/asf/atlas/blob/2bc6f907/repository/src/test/java/org/apache/atlas/repository/impexp/ExportServiceTest.java ---------------------------------------------------------------------- diff --git a/repository/src/test/java/org/apache/atlas/repository/impexp/ExportServiceTest.java b/repository/src/test/java/org/apache/atlas/repository/impexp/ExportServiceTest.java index 2a8bdfa..07524d0 100644 --- a/repository/src/test/java/org/apache/atlas/repository/impexp/ExportServiceTest.java +++ b/repository/src/test/java/org/apache/atlas/repository/impexp/ExportServiceTest.java @@ -35,6 +35,7 @@ import org.apache.atlas.repository.store.graph.v1.AtlasEntityStream; import org.apache.atlas.repository.store.graph.v1.DeleteHandlerV1; import org.apache.atlas.repository.store.graph.v1.EntityGraphMapper; import org.apache.atlas.repository.store.graph.v1.SoftDeleteHandlerV1; +import org.apache.atlas.runner.LocalSolrRunner; import org.apache.atlas.store.AtlasTypeDefStore; import org.apache.atlas.type.AtlasTypeRegistry; import org.slf4j.Logger; @@ -57,6 +58,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import static org.apache.atlas.graph.GraphSandboxUtil.useLocalSolr; import static org.mockito.Mockito.mock; import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertNotNull; @@ -105,8 +107,12 @@ public class ExportServiceTest { } @AfterClass - public void clear() { + public void clear() throws Exception { AtlasGraphProvider.cleanup(); + + if (useLocalSolr()) { + LocalSolrRunner.stop(); + } } private AtlasExportRequest getRequestForFullFetch() { http://git-wip-us.apache.org/repos/asf/atlas/blob/2bc6f907/repository/src/test/java/org/apache/atlas/repository/impexp/ImportServiceTest.java ---------------------------------------------------------------------- diff --git a/repository/src/test/java/org/apache/atlas/repository/impexp/ImportServiceTest.java b/repository/src/test/java/org/apache/atlas/repository/impexp/ImportServiceTest.java index b24774d..ab25faa 100644 --- a/repository/src/test/java/org/apache/atlas/repository/impexp/ImportServiceTest.java +++ b/repository/src/test/java/org/apache/atlas/repository/impexp/ImportServiceTest.java @@ -24,6 +24,8 @@ import org.apache.atlas.TestModules; import org.apache.atlas.TestUtilsV2; import org.apache.atlas.exception.AtlasBaseException; import org.apache.atlas.model.impexp.AtlasImportRequest; +import org.apache.atlas.repository.graph.AtlasGraphProvider; +import org.apache.atlas.runner.LocalSolrRunner; import org.apache.atlas.store.AtlasTypeDefStore; import org.apache.atlas.type.AtlasClassificationType; import org.apache.atlas.type.AtlasTypeRegistry; @@ -32,6 +34,7 @@ import org.mockito.stubbing.Answer; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.testng.ITestContext; +import org.testng.annotations.AfterClass; import org.testng.annotations.BeforeTest; import org.testng.annotations.DataProvider; import org.testng.annotations.Guice; @@ -41,6 +44,7 @@ import java.io.IOException; import java.util.HashMap; import java.util.Map; +import static org.apache.atlas.graph.GraphSandboxUtil.useLocalSolr; import static org.apache.atlas.repository.impexp.ZipFileResourceTestUtils.*; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; @@ -69,6 +73,15 @@ public class ImportServiceTest { RequestContextV1.get().setUser(TestUtilsV2.TEST_USER); } + @AfterClass + public void clear() throws Exception { + AtlasGraphProvider.cleanup(); + + if (useLocalSolr()) { + LocalSolrRunner.stop(); + } + } + @DataProvider(name = "sales") public static Object[][] getDataFromQuickStart_v1_Sales(ITestContext context) throws IOException { return getZipSource("sales-v1-full.zip"); http://git-wip-us.apache.org/repos/asf/atlas/blob/2bc6f907/repository/src/test/java/org/apache/atlas/repository/impexp/LocalSolrTest.java ---------------------------------------------------------------------- diff --git a/repository/src/test/java/org/apache/atlas/repository/impexp/LocalSolrTest.java b/repository/src/test/java/org/apache/atlas/repository/impexp/LocalSolrTest.java new file mode 100644 index 0000000..1fbca80 --- /dev/null +++ b/repository/src/test/java/org/apache/atlas/repository/impexp/LocalSolrTest.java @@ -0,0 +1,67 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * 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 + * <p> + * http://www.apache.org/licenses/LICENSE-2.0 + * <p> + * 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. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.atlas.repository.impexp; + +import org.apache.atlas.ApplicationProperties; +import org.apache.atlas.repository.graph.GraphBackedSearchIndexer; +import org.apache.atlas.runner.LocalSolrRunner; +import org.apache.atlas.type.AtlasTypeRegistry; +import org.apache.commons.configuration.Configuration; +import org.junit.Assert; +import org.testng.annotations.AfterTest; +import org.testng.annotations.BeforeTest; +import org.testng.annotations.Test; + +import javax.inject.Inject; + +import static org.apache.atlas.graph.GraphSandboxUtil.useLocalSolr; + +public class LocalSolrTest { + @Inject + AtlasTypeRegistry typeRegistry; + + @BeforeTest + public void setUp() throws Exception { + if (useLocalSolr()) { + try { + LocalSolrRunner.start(); + + Configuration configuration = ApplicationProperties.get(); + configuration.setProperty("atlas.graph.index.search.solr.zookeeper-url", LocalSolrRunner.getZookeeperUrls()); + } catch (Exception e) { + //ignore + } + } + + new GraphBackedSearchIndexer(typeRegistry); + } + + @Test + public void testLocalSolr() { + String zookeeperUrls = LocalSolrRunner.getZookeeperUrls(); + System.out.println("Started Local Solr at: " + zookeeperUrls); + + Assert.assertNotNull(zookeeperUrls); + } + + @AfterTest + public void tearDown() throws Exception { + System.out.println("Stopping Local Solr..."); + LocalSolrRunner.stop(); + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/atlas/blob/2bc6f907/repository/src/test/java/org/apache/atlas/repository/store/graph/AtlasTypeDefGraphStoreTest.java ---------------------------------------------------------------------- diff --git a/repository/src/test/java/org/apache/atlas/repository/store/graph/AtlasTypeDefGraphStoreTest.java b/repository/src/test/java/org/apache/atlas/repository/store/graph/AtlasTypeDefGraphStoreTest.java index 9088470..e104722 100644 --- a/repository/src/test/java/org/apache/atlas/repository/store/graph/AtlasTypeDefGraphStoreTest.java +++ b/repository/src/test/java/org/apache/atlas/repository/store/graph/AtlasTypeDefGraphStoreTest.java @@ -25,11 +25,13 @@ import org.apache.atlas.exception.AtlasBaseException; import org.apache.atlas.model.SearchFilter; import org.apache.atlas.model.typedef.*; import org.apache.atlas.model.typedef.AtlasStructDef.AtlasAttributeDef; +import org.apache.atlas.runner.LocalSolrRunner; import org.apache.atlas.store.AtlasTypeDefStore; import org.apache.atlas.type.AtlasType; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.testng.Assert; +import org.testng.annotations.AfterClass; import org.testng.annotations.BeforeTest; import org.testng.annotations.DataProvider; import org.testng.annotations.Guice; @@ -41,6 +43,7 @@ import java.util.HashSet; import java.util.Arrays; import java.util.Date; +import static org.apache.atlas.graph.GraphSandboxUtil.useLocalSolr; import static org.testng.Assert.*; @Guice(modules = TestModules.TestOnlyModule.class) @@ -57,6 +60,13 @@ public class AtlasTypeDefGraphStoreTest { RequestContextV1.get().setUser(TestUtilsV2.TEST_USER); } + @AfterClass + public void cleanup() throws Exception { + if (useLocalSolr()) { + LocalSolrRunner.stop(); + } + } + @Test public void testGet() { try { http://git-wip-us.apache.org/repos/asf/atlas/blob/2bc6f907/repository/src/test/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityDefStoreV1Test.java ---------------------------------------------------------------------- diff --git a/repository/src/test/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityDefStoreV1Test.java b/repository/src/test/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityDefStoreV1Test.java index 1198283..54f7f78 100644 --- a/repository/src/test/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityDefStoreV1Test.java +++ b/repository/src/test/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityDefStoreV1Test.java @@ -25,6 +25,7 @@ import org.apache.atlas.TestModules; import org.apache.atlas.exception.AtlasBaseException; import org.apache.atlas.model.typedef.AtlasEntityDef; import org.apache.atlas.repository.graph.AtlasGraphProvider; +import org.apache.atlas.runner.LocalSolrRunner; import org.apache.atlas.type.AtlasTypeUtil; import org.testng.Assert; import org.testng.annotations.AfterClass; @@ -34,6 +35,8 @@ import org.testng.annotations.Test; import java.util.Collections; +import static org.apache.atlas.graph.GraphSandboxUtil.useLocalSolr; + /** * Tests for AtlasEntityStoreV1 */ @@ -67,7 +70,11 @@ public class AtlasEntityDefStoreV1Test { } @AfterClass - public void clear(){ + public void clear() throws Exception { AtlasGraphProvider.cleanup(); + + if (useLocalSolr()) { + LocalSolrRunner.stop(); + } } } http://git-wip-us.apache.org/repos/asf/atlas/blob/2bc6f907/repository/src/test/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityStoreV1Test.java ---------------------------------------------------------------------- diff --git a/repository/src/test/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityStoreV1Test.java b/repository/src/test/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityStoreV1Test.java index fd1b6db..1f8b9fd 100644 --- a/repository/src/test/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityStoreV1Test.java +++ b/repository/src/test/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityStoreV1Test.java @@ -44,6 +44,7 @@ import org.apache.atlas.repository.graph.AtlasGraphProvider; import org.apache.atlas.repository.graph.GraphBackedSearchIndexer; import org.apache.atlas.repository.store.bootstrap.AtlasTypeDefStoreInitializer; import org.apache.atlas.repository.store.graph.AtlasEntityStore; +import org.apache.atlas.runner.LocalSolrRunner; import org.apache.atlas.store.AtlasTypeDefStore; import org.apache.atlas.type.AtlasArrayType; import org.apache.atlas.type.AtlasMapType; @@ -74,8 +75,8 @@ import static org.apache.atlas.TestUtilsV2.COLUMNS_ATTR_NAME; import static org.apache.atlas.TestUtilsV2.COLUMN_TYPE; import static org.apache.atlas.TestUtilsV2.NAME; import static org.apache.atlas.TestUtilsV2.randomString; -import static org.apache.atlas.TestUtilsV2.STORAGE_DESC_TYPE; import static org.apache.atlas.TestUtilsV2.TABLE_TYPE; +import static org.apache.atlas.graph.GraphSandboxUtil.useLocalSolr; import static org.mockito.Mockito.mock; import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertTrue; @@ -139,8 +140,12 @@ public class AtlasEntityStoreV1Test { } @AfterClass - public void clear() { + public void clear() throws Exception { AtlasGraphProvider.cleanup(); + + if (useLocalSolr()) { + LocalSolrRunner.stop(); + } } @BeforeTest http://git-wip-us.apache.org/repos/asf/atlas/blob/2bc6f907/repository/src/test/java/org/apache/atlas/repository/store/graph/v1/AtlasRelationshipDefStoreV1Test.java ---------------------------------------------------------------------- diff --git a/repository/src/test/java/org/apache/atlas/repository/store/graph/v1/AtlasRelationshipDefStoreV1Test.java b/repository/src/test/java/org/apache/atlas/repository/store/graph/v1/AtlasRelationshipDefStoreV1Test.java index 59bedd1..df010bf 100644 --- a/repository/src/test/java/org/apache/atlas/repository/store/graph/v1/AtlasRelationshipDefStoreV1Test.java +++ b/repository/src/test/java/org/apache/atlas/repository/store/graph/v1/AtlasRelationshipDefStoreV1Test.java @@ -27,6 +27,7 @@ import org.apache.atlas.model.typedef.AtlasRelationshipDef; import org.apache.atlas.model.typedef.AtlasRelationshipEndDef; import org.apache.atlas.model.typedef.AtlasStructDef; import org.apache.atlas.repository.graph.AtlasGraphProvider; +import org.apache.atlas.runner.LocalSolrRunner; import org.apache.atlas.type.AtlasTypeUtil; import org.testng.Assert; import org.testng.annotations.AfterClass; @@ -34,6 +35,7 @@ import org.testng.annotations.DataProvider; import org.testng.annotations.Guice; import org.testng.annotations.Test; +import static org.apache.atlas.graph.GraphSandboxUtil.useLocalSolr; import static org.testng.AssertJUnit.fail; /** @@ -324,7 +326,11 @@ public class AtlasRelationshipDefStoreV1Test { } } @AfterClass - public void clear(){ + public void clear() throws Exception { AtlasGraphProvider.cleanup(); + + if (useLocalSolr()) { + LocalSolrRunner.stop(); + } } } http://git-wip-us.apache.org/repos/asf/atlas/blob/2bc6f907/repository/src/test/java/org/apache/atlas/repository/store/graph/v1/AtlasRelationshipStoreV1Test.java ---------------------------------------------------------------------- diff --git a/repository/src/test/java/org/apache/atlas/repository/store/graph/v1/AtlasRelationshipStoreV1Test.java b/repository/src/test/java/org/apache/atlas/repository/store/graph/v1/AtlasRelationshipStoreV1Test.java index d207a69..b418fef 100644 --- a/repository/src/test/java/org/apache/atlas/repository/store/graph/v1/AtlasRelationshipStoreV1Test.java +++ b/repository/src/test/java/org/apache/atlas/repository/store/graph/v1/AtlasRelationshipStoreV1Test.java @@ -35,6 +35,7 @@ import org.apache.atlas.repository.graph.GraphBackedSearchIndexer; import org.apache.atlas.repository.store.bootstrap.AtlasTypeDefStoreInitializer; import org.apache.atlas.repository.store.graph.AtlasEntityStore; import org.apache.atlas.repository.store.graph.AtlasRelationshipStore; +import org.apache.atlas.runner.LocalSolrRunner; import org.apache.atlas.store.AtlasTypeDefStore; import org.apache.atlas.type.AtlasEntityType; import org.apache.atlas.type.AtlasTypeRegistry; @@ -57,6 +58,7 @@ import static org.apache.atlas.TestRelationshipUtilsV2.getDepartmentEmployeeInst import static org.apache.atlas.TestRelationshipUtilsV2.getDepartmentEmployeeTypes; import static org.apache.atlas.TestRelationshipUtilsV2.getInverseReferenceTestTypes; import static org.apache.atlas.TestUtilsV2.NAME; +import static org.apache.atlas.graph.GraphSandboxUtil.useLocalSolr; import static org.apache.atlas.type.AtlasTypeUtil.getAtlasObjectId; import static org.mockito.Mockito.mock; import static org.testng.Assert.assertEquals; @@ -120,8 +122,12 @@ public abstract class AtlasRelationshipStoreV1Test { } @AfterClass - public void clear() { + public void clear() throws Exception { AtlasGraphProvider.cleanup(); + + if (useLocalSolr()) { + LocalSolrRunner.stop(); + } } @Test http://git-wip-us.apache.org/repos/asf/atlas/blob/2bc6f907/repository/src/test/java/org/apache/atlas/repository/store/graph/v1/InverseReferenceUpdateV1Test.java ---------------------------------------------------------------------- diff --git a/repository/src/test/java/org/apache/atlas/repository/store/graph/v1/InverseReferenceUpdateV1Test.java b/repository/src/test/java/org/apache/atlas/repository/store/graph/v1/InverseReferenceUpdateV1Test.java index 2c21638..6e4689d 100644 --- a/repository/src/test/java/org/apache/atlas/repository/store/graph/v1/InverseReferenceUpdateV1Test.java +++ b/repository/src/test/java/org/apache/atlas/repository/store/graph/v1/InverseReferenceUpdateV1Test.java @@ -31,6 +31,7 @@ import org.apache.atlas.model.typedef.AtlasTypesDef; import org.apache.atlas.repository.graph.AtlasGraphProvider; import org.apache.atlas.repository.store.bootstrap.AtlasTypeDefStoreInitializer; import org.apache.atlas.repository.store.graph.AtlasEntityStore; +import org.apache.atlas.runner.LocalSolrRunner; import org.apache.atlas.store.AtlasTypeDefStore; import org.apache.atlas.type.AtlasEntityType; import org.apache.atlas.type.AtlasTypeRegistry; @@ -46,6 +47,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import static org.apache.atlas.graph.GraphSandboxUtil.useLocalSolr; import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertNull; import static org.testng.Assert.assertTrue; @@ -96,8 +98,12 @@ public abstract class InverseReferenceUpdateV1Test { } @AfterClass - public void clear() { + public void clear() throws Exception { AtlasGraphProvider.cleanup(); + + if (useLocalSolr()) { + LocalSolrRunner.stop(); + } } @BeforeMethod http://git-wip-us.apache.org/repos/asf/atlas/blob/2bc6f907/repository/src/test/java/org/apache/atlas/repository/userprofile/UserProfileServiceTest.java ---------------------------------------------------------------------- diff --git a/repository/src/test/java/org/apache/atlas/repository/userprofile/UserProfileServiceTest.java b/repository/src/test/java/org/apache/atlas/repository/userprofile/UserProfileServiceTest.java index 0532f16..59561f5 100644 --- a/repository/src/test/java/org/apache/atlas/repository/userprofile/UserProfileServiceTest.java +++ b/repository/src/test/java/org/apache/atlas/repository/userprofile/UserProfileServiceTest.java @@ -25,10 +25,13 @@ import org.apache.atlas.model.discovery.SearchParameters; import org.apache.atlas.model.profile.AtlasUserProfile; import org.apache.atlas.model.profile.AtlasUserSavedSearch; import org.apache.atlas.model.typedef.AtlasTypesDef; +import org.apache.atlas.repository.graph.AtlasGraphProvider; import org.apache.atlas.repository.util.FilterUtil; +import org.apache.atlas.runner.LocalSolrRunner; import org.apache.atlas.store.AtlasTypeDefStore; import org.apache.atlas.type.AtlasType; import org.apache.atlas.type.AtlasTypeRegistry; +import org.testng.annotations.AfterClass; import org.testng.annotations.Guice; import org.testng.annotations.Test; @@ -37,6 +40,7 @@ import java.io.IOException; import java.util.ArrayList; import java.util.List; +import static org.apache.atlas.graph.GraphSandboxUtil.useLocalSolr; import static org.apache.atlas.model.profile.AtlasUserSavedSearch.SavedSearchType.BASIC; import static org.apache.atlas.repository.impexp.ZipFileResourceTestUtils.loadModelFromJson; import static org.testng.Assert.*; @@ -57,6 +61,15 @@ public class UserProfileServiceTest { loadModelFromJson("0010-base_model.json", typeDefStore, typeRegistry); } + @AfterClass + public void clear() throws Exception { + AtlasGraphProvider.cleanup(); + + if (useLocalSolr()) { + LocalSolrRunner.stop(); + } + } + @Test public void filterInternalType() throws AtlasBaseException { SearchFilter searchFilter = new SearchFilter();