From 33c619d94c7a0a20a307a11deef30c43dd792f95 Mon Sep 17 00:00:00 2001 From: Brad Rushworth <67445484+brushworth@users.noreply.github.com> Date: Wed, 29 Jul 2020 15:21:10 +1000 Subject: [PATCH] RYA-70 web.rya spring xml files don't pull in environment properties consistently to a well-defined standard. This commit begins to tidy the Accumulo config (MongoDB to come) but more work is required. --- .../AccumuloRdfConfigurationBuilder.java | 32 ++--- .../AccumuloRdfConfigurationTest.java | 16 +-- .../test/resources/properties/rya.properties | 26 ++-- .../MongoDBRdfConfigurationBuilder.java | 30 ++-- .../src/test/resources/rya.properties | 23 ++-- .../AccumuloIndexingConfiguration.java | 64 ++++----- .../mongodb/MongoIndexingConfiguration.java | 42 +++--- .../AccumuloIndexingConfigurationTest.java | 12 +- .../accumulo_rya_indexing.properties | 46 +++---- .../resources/mongo_rya_indexing.properties | 32 ++--- .../WEB-INF/classes/accumulo.properties | 43 ++++++ .../WEB-INF/classes/extensions.properties | 77 +++++++++++ .../webapp/WEB-INF/classes/log4j.properties | 45 ++++++ .../webapp/WEB-INF/spring/spring-accumulo.xml | 26 ++-- .../WEB-INF/spring/spring-mongodb-geo.xml | 12 +- .../webapp/WEB-INF/spring/spring-mongodb.xml | 17 +-- .../WEB-INF/spring/spring-root-accumulo.xml | 34 ++--- .../WEB-INF/spring/spring-root-extensions.xml | 129 ++++++++++-------- .../spring/spring-root-mongodb-geo.xml | 10 +- .../WEB-INF/spring/spring-root-mongodb.xml | 10 +- .../webapp/WEB-INF/spring/spring-security.xml | 10 +- 21 files changed, 430 insertions(+), 306 deletions(-) create mode 100644 web/web.rya/src/main/webapp/WEB-INF/classes/accumulo.properties create mode 100644 web/web.rya/src/main/webapp/WEB-INF/classes/extensions.properties create mode 100644 web/web.rya/src/main/webapp/WEB-INF/classes/log4j.properties diff --git a/dao/accumulo.rya/src/main/java/org/apache/rya/accumulo/AccumuloRdfConfigurationBuilder.java b/dao/accumulo.rya/src/main/java/org/apache/rya/accumulo/AccumuloRdfConfigurationBuilder.java index 0640f6531..6ee4f3979 100644 --- a/dao/accumulo.rya/src/main/java/org/apache/rya/accumulo/AccumuloRdfConfigurationBuilder.java +++ b/dao/accumulo.rya/src/main/java/org/apache/rya/accumulo/AccumuloRdfConfigurationBuilder.java @@ -69,26 +69,20 @@ public class AccumuloRdfConfigurationBuilder * @return AccumumuloRdfConfiguration with properties set */ public static AccumuloRdfConfigurationBuilder fromProperties(Properties props) { - AccumuloRdfConfigurationBuilder builder = new AccumuloRdfConfigurationBuilder() // - .setAuths(props.getProperty(AbstractAccumuloRdfConfigurationBuilder.ACCUMULO_AUTHS, "")) // - .setRyaPrefix(props.getProperty(AbstractAccumuloRdfConfigurationBuilder.ACCUMULO_RYA_PREFIX, "rya_"))// + AccumuloRdfConfigurationBuilder builder = new AccumuloRdfConfigurationBuilder() + .setUseMockAccumulo(getBoolean(props.getProperty(AbstractAccumuloRdfConfigurationBuilder.USE_MOCK_ACCUMULO, "false"))) + .setAccumuloInstance(props.getProperty(AbstractAccumuloRdfConfigurationBuilder.ACCUMULO_INSTANCE)) + .setAccumuloZooKeepers(props.getProperty(AbstractAccumuloRdfConfigurationBuilder.ACCUMULO_ZOOKEEPERS)) + .setAccumuloUser(props.getProperty(AbstractAccumuloRdfConfigurationBuilder.ACCUMULO_USER)) + .setAccumuloPassword(props.getProperty(AbstractAccumuloRdfConfigurationBuilder.ACCUMULO_PASSWORD)) + .setRyaPrefix(props.getProperty(AbstractAccumuloRdfConfigurationBuilder.ACCUMULO_RYA_PREFIX, "rya_")) + .setAuths(props.getProperty(AbstractAccumuloRdfConfigurationBuilder.ACCUMULO_AUTHS, "")) .setVisibilities(props.getProperty(AbstractAccumuloRdfConfigurationBuilder.ACCUMULO_VISIBILITIES, "")) - .setUseInference( - getBoolean(props.getProperty(AbstractAccumuloRdfConfigurationBuilder.USE_INFERENCE, "false")))// - .setDisplayQueryPlan(getBoolean( - props.getProperty(AbstractAccumuloRdfConfigurationBuilder.USE_DISPLAY_QUERY_PLAN, "true")))// - .setAccumuloUser(props.getProperty(AbstractAccumuloRdfConfigurationBuilder.ACCUMULO_USER)) // - .setAccumuloInstance(props.getProperty(AbstractAccumuloRdfConfigurationBuilder.ACCUMULO_INSTANCE))// - .setAccumuloZooKeepers(props.getProperty(AbstractAccumuloRdfConfigurationBuilder.ACCUMULO_ZOOKEEPERS))// - .setAccumuloPassword(props.getProperty(AbstractAccumuloRdfConfigurationBuilder.ACCUMULO_PASSWORD))// - .setUseMockAccumulo(getBoolean( - props.getProperty(AbstractAccumuloRdfConfigurationBuilder.USE_MOCK_ACCUMULO, "false")))// - .setUseAccumuloPrefixHashing(getBoolean( - props.getProperty(AbstractAccumuloRdfConfigurationBuilder.USE_PREFIX_HASHING, "false")))// - .setUseCompositeCardinality( - getBoolean(props.getProperty(AbstractAccumuloRdfConfigurationBuilder.USE_COUNT_STATS, "false")))// - .setUseJoinSelectivity(getBoolean( - props.getProperty(AbstractAccumuloRdfConfigurationBuilder.USE_JOIN_SELECTIVITY, "false"))); + .setUseAccumuloPrefixHashing(getBoolean(props.getProperty(AbstractAccumuloRdfConfigurationBuilder.USE_PREFIX_HASHING, "false"))) + .setUseInference(getBoolean(props.getProperty(AbstractAccumuloRdfConfigurationBuilder.USE_INFERENCE, "false"))) + .setDisplayQueryPlan(getBoolean(props.getProperty(AbstractAccumuloRdfConfigurationBuilder.USE_DISPLAY_QUERY_PLAN, "true"))) + .setUseCompositeCardinality(getBoolean(props.getProperty(AbstractAccumuloRdfConfigurationBuilder.USE_COUNT_STATS, "false"))) + .setUseJoinSelectivity(getBoolean(props.getProperty(AbstractAccumuloRdfConfigurationBuilder.USE_JOIN_SELECTIVITY, "false"))); return builder; } diff --git a/dao/accumulo.rya/src/test/java/org/apache/rya/accumulo/AccumuloRdfConfigurationTest.java b/dao/accumulo.rya/src/test/java/org/apache/rya/accumulo/AccumuloRdfConfigurationTest.java index 02311b39b..6f0ead7ca 100644 --- a/dao/accumulo.rya/src/test/java/org/apache/rya/accumulo/AccumuloRdfConfigurationTest.java +++ b/dao/accumulo.rya/src/test/java/org/apache/rya/accumulo/AccumuloRdfConfigurationTest.java @@ -19,8 +19,11 @@ * under the License. */ -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; +import org.apache.accumulo.core.client.IteratorSetting; +import org.apache.accumulo.core.security.Authorizations; +import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import java.io.FileInputStream; import java.io.FileNotFoundException; @@ -30,11 +33,8 @@ import java.util.Map; import java.util.Properties; -import org.apache.accumulo.core.client.IteratorSetting; -import org.apache.accumulo.core.security.Authorizations; -import org.junit.Test; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; public class AccumuloRdfConfigurationTest { private static final Logger logger = LoggerFactory.getLogger(AccumuloRdfConfigurationTest.class); @@ -122,7 +122,7 @@ public void testBuilder() { @Test public void testBuilderFromProperties() throws FileNotFoundException, IOException { - String prefix = "rya_"; + String prefix = "ryatest_"; String auth = "U"; String visibility = "U"; String user = "user"; diff --git a/dao/accumulo.rya/src/test/resources/properties/rya.properties b/dao/accumulo.rya/src/test/resources/properties/rya.properties index 79a5cb4e2..187345e30 100644 --- a/dao/accumulo.rya/src/test/resources/properties/rya.properties +++ b/dao/accumulo.rya/src/test/resources/properties/rya.properties @@ -15,16 +15,16 @@ # specific language governing permissions and limitations # under the License -use.prefix.hashing true -use.count.stats true -use.join.selectivity true -use.mock false -use.display.plan false -use.inference true -accumulo.user user -accumulo.password password -accumulo.instance instance -accumulo.zookeepers zookeeper -accumulo.auths U -accumulo.visibilities U -accumuo.rya.prefix rya_ +use.prefix.hashing=true +use.count.stats=true +use.join.selectivity=true +use.mock=false +use.display.plan=false +use.inference=true +accumulo.user=user +accumulo.password=password +accumulo.instance=instance +accumulo.zookeepers=zookeeper +accumulo.auths=U +accumulo.visibilities=U +accumulo.rya.prefix=ryatest_ diff --git a/dao/mongodb.rya/src/main/java/org/apache/rya/mongodb/MongoDBRdfConfigurationBuilder.java b/dao/mongodb.rya/src/main/java/org/apache/rya/mongodb/MongoDBRdfConfigurationBuilder.java index cbe8f455f..9c97635d6 100644 --- a/dao/mongodb.rya/src/main/java/org/apache/rya/mongodb/MongoDBRdfConfigurationBuilder.java +++ b/dao/mongodb.rya/src/main/java/org/apache/rya/mongodb/MongoDBRdfConfigurationBuilder.java @@ -68,25 +68,19 @@ public class MongoDBRdfConfigurationBuilder public static MongoDBRdfConfiguration fromProperties(Properties props) { try { - MongoDBRdfConfigurationBuilder builder = new MongoDBRdfConfigurationBuilder() // - .setAuths(props.getProperty(AbstractMongoDBRdfConfigurationBuilder.MONGO_AUTHS, "")) // - .setRyaPrefix(props.getProperty(AbstractMongoDBRdfConfigurationBuilder.MONGO_RYA_PREFIX, "rya_"))// + MongoDBRdfConfigurationBuilder builder = new MongoDBRdfConfigurationBuilder() + .setRyaPrefix(props.getProperty(AbstractMongoDBRdfConfigurationBuilder.MONGO_RYA_PREFIX, "rya_")) + .setAuths(props.getProperty(AbstractMongoDBRdfConfigurationBuilder.MONGO_AUTHS, "")) .setVisibilities(props.getProperty(AbstractMongoDBRdfConfigurationBuilder.MONGO_VISIBILITIES, "")) - .setUseInference(getBoolean( - props.getProperty(AbstractMongoDBRdfConfigurationBuilder.USE_INFERENCE, "false")))// - .setDisplayQueryPlan(getBoolean( - props.getProperty(AbstractMongoDBRdfConfigurationBuilder.USE_DISPLAY_QUERY_PLAN, "true")))// - .setMongoUser(props.getProperty(AbstractMongoDBRdfConfigurationBuilder.MONGO_USER)) // - .setMongoPassword(props.getProperty(AbstractMongoDBRdfConfigurationBuilder.MONGO_PASSWORD))// - .setMongoCollectionPrefix( - props.getProperty(AbstractMongoDBRdfConfigurationBuilder.MONGO_COLLECTION_PREFIX, "rya_"))// - .setMongoDBName( - props.getProperty(AbstractMongoDBRdfConfigurationBuilder.MONGO_DB_NAME, "rya_triples"))// - .setMongoHost(props.getProperty(AbstractMongoDBRdfConfigurationBuilder.MONGO_HOST, "localhost"))// - .setMongoPort(props.getProperty(AbstractMongoDBRdfConfigurationBuilder.MONGO_PORT, - AbstractMongoDBRdfConfigurationBuilder.DEFAULT_MONGO_PORT))// - .setUseMockMongo(getBoolean( - props.getProperty(AbstractMongoDBRdfConfigurationBuilder.USE_MOCK_MONGO, "false"))); + .setUseInference(getBoolean(props.getProperty(AbstractMongoDBRdfConfigurationBuilder.USE_INFERENCE, "false"))) + .setDisplayQueryPlan(getBoolean(props.getProperty(AbstractMongoDBRdfConfigurationBuilder.USE_DISPLAY_QUERY_PLAN, "true"))) + .setMongoUser(props.getProperty(AbstractMongoDBRdfConfigurationBuilder.MONGO_USER)) + .setMongoPassword(props.getProperty(AbstractMongoDBRdfConfigurationBuilder.MONGO_PASSWORD)) + .setMongoCollectionPrefix(props.getProperty(AbstractMongoDBRdfConfigurationBuilder.MONGO_COLLECTION_PREFIX, "rya_")) + .setMongoDBName(props.getProperty(AbstractMongoDBRdfConfigurationBuilder.MONGO_DB_NAME, "rya_triples")) + .setMongoHost(props.getProperty(AbstractMongoDBRdfConfigurationBuilder.MONGO_HOST, "localhost")) + .setMongoPort(props.getProperty(AbstractMongoDBRdfConfigurationBuilder.MONGO_PORT, AbstractMongoDBRdfConfigurationBuilder.DEFAULT_MONGO_PORT)) + .setUseMockMongo(getBoolean(props.getProperty(AbstractMongoDBRdfConfigurationBuilder.USE_MOCK_MONGO, "false"))); return builder.build(); } catch (Exception e) { diff --git a/dao/mongodb.rya/src/test/resources/rya.properties b/dao/mongodb.rya/src/test/resources/rya.properties index 8c37dc3f8..ac63c38c0 100644 --- a/dao/mongodb.rya/src/test/resources/rya.properties +++ b/dao/mongodb.rya/src/test/resources/rya.properties @@ -15,15 +15,14 @@ # specific language governing permissions and limitations # under the License -use.mock true -use.display.plan false -use.inference true -mongo.user user -mongo.password password -mongo.host host -mongo.port 1000 -mongo.auths U -mongo.visibilities U -mongo.db.name dbname -mongo.collection.prefix prefix_ - +use.mock=true +use.display.plan=false +use.inference=true +mongo.user=user +mongo.password=password +mongo.host=host +mongo.port=1000 +mongo.auths=U +mongo.visibilities=U +mongo.db.name=dbname +mongo.collection.prefix=prefix_ diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/accumulo/AccumuloIndexingConfiguration.java b/extras/indexing/src/main/java/org/apache/rya/indexing/accumulo/AccumuloIndexingConfiguration.java index 4b703ebb7..8352e4220 100644 --- a/extras/indexing/src/main/java/org/apache/rya/indexing/accumulo/AccumuloIndexingConfiguration.java +++ b/extras/indexing/src/main/java/org/apache/rya/indexing/accumulo/AccumuloIndexingConfiguration.java @@ -18,10 +18,8 @@ */ package org.apache.rya.indexing.accumulo; -import java.util.HashSet; -import java.util.Properties; -import java.util.Set; - +import com.google.common.base.Preconditions; +import com.google.common.collect.Lists; import org.apache.commons.lang3.StringUtils; import org.apache.hadoop.conf.Configuration; import org.apache.rya.accumulo.AbstractAccumuloRdfConfigurationBuilder; @@ -35,8 +33,9 @@ import org.apache.rya.indexing.statement.metadata.matching.StatementMetadataOptimizer; import org.eclipse.rdf4j.sail.Sail; -import com.google.common.base.Preconditions; -import com.google.common.collect.Lists; +import java.util.HashSet; +import java.util.Properties; +import java.util.Set; /** * This class is an extension of the AccumuloRdfConfiguration object used to to @@ -399,38 +398,27 @@ public static AccumuloIndexingConfiguration fromProperties(final Properties prop Preconditions.checkNotNull(props); try { final AccumuloIndexingConfigBuilder builder = new AccumuloIndexingConfigBuilder() // - .setAuths(props.getProperty(AbstractAccumuloRdfConfigurationBuilder.ACCUMULO_AUTHS, "")) // - .setRyaPrefix( - props.getProperty(AbstractAccumuloRdfConfigurationBuilder.ACCUMULO_RYA_PREFIX, "rya_"))// - .setVisibilities( - props.getProperty(AbstractAccumuloRdfConfigurationBuilder.ACCUMULO_VISIBILITIES, "")) - .setUseInference(getBoolean( - props.getProperty(AbstractAccumuloRdfConfigurationBuilder.USE_INFERENCE, "false")))// - .setDisplayQueryPlan(getBoolean(props - .getProperty(AbstractAccumuloRdfConfigurationBuilder.USE_DISPLAY_QUERY_PLAN, "true")))// - .setAccumuloUser(props.getProperty(AbstractAccumuloRdfConfigurationBuilder.ACCUMULO_USER)) // - .setAccumuloInstance( - props.getProperty(AbstractAccumuloRdfConfigurationBuilder.ACCUMULO_INSTANCE))// - .setAccumuloZooKeepers( - props.getProperty(AbstractAccumuloRdfConfigurationBuilder.ACCUMULO_ZOOKEEPERS))// - .setAccumuloPassword( - props.getProperty(AbstractAccumuloRdfConfigurationBuilder.ACCUMULO_PASSWORD))// - .setUseMockAccumulo(getBoolean( - props.getProperty(AbstractAccumuloRdfConfigurationBuilder.USE_MOCK_ACCUMULO, "false")))// - .setUseAccumuloPrefixHashing(getBoolean( - props.getProperty(AbstractAccumuloRdfConfigurationBuilder.USE_PREFIX_HASHING, "false")))// - .setUseCompositeCardinality(getBoolean( - props.getProperty(AbstractAccumuloRdfConfigurationBuilder.USE_COUNT_STATS, "false")))// - .setUseJoinSelectivity(getBoolean(props - .getProperty(AbstractAccumuloRdfConfigurationBuilder.USE_JOIN_SELECTIVITY, "false")))// - .setUseAccumuloFreetextIndex(getBoolean(props.getProperty(USE_FREETEXT, "false")))// - .setUseAccumuloTemporalIndex(getBoolean(props.getProperty(USE_TEMPORAL, "false")))// - .setUseAccumuloEntityIndex(getBoolean(props.getProperty(USE_ENTITY, "false")))// - .setAccumuloFreeTextPredicates(StringUtils.split(props.getProperty(FREETEXT_PREDICATES), ","))// - .setAccumuloTemporalPredicates(StringUtils.split(props.getProperty(TEMPORAL_PREDICATES), ","))// - .setUsePcj(getBoolean(props.getProperty(USE_PCJ, "false")))// - .setUseOptimalPcj(getBoolean(props.getProperty(USE_OPTIMAL_PCJ, "false")))// - .setPcjTables(StringUtils.split(props.getProperty(PCJ_TABLES), ","))// + .setUseMockAccumulo(getBoolean(props.getProperty(AbstractAccumuloRdfConfigurationBuilder.USE_MOCK_ACCUMULO, "false"))) + .setRyaPrefix(props.getProperty(AbstractAccumuloRdfConfigurationBuilder.ACCUMULO_RYA_PREFIX, "rya_")) + .setAuths(props.getProperty(AbstractAccumuloRdfConfigurationBuilder.ACCUMULO_AUTHS, "")) + .setVisibilities(props.getProperty(AbstractAccumuloRdfConfigurationBuilder.ACCUMULO_VISIBILITIES, "")) + .setUseInference(getBoolean(props.getProperty(AbstractAccumuloRdfConfigurationBuilder.USE_INFERENCE, "false"))) + .setDisplayQueryPlan(getBoolean(props.getProperty(AbstractAccumuloRdfConfigurationBuilder.USE_DISPLAY_QUERY_PLAN, "true"))) + .setAccumuloUser(props.getProperty(AbstractAccumuloRdfConfigurationBuilder.ACCUMULO_USER)) + .setAccumuloInstance(props.getProperty(AbstractAccumuloRdfConfigurationBuilder.ACCUMULO_INSTANCE)) + .setAccumuloZooKeepers(props.getProperty(AbstractAccumuloRdfConfigurationBuilder.ACCUMULO_ZOOKEEPERS)) + .setAccumuloPassword(props.getProperty(AbstractAccumuloRdfConfigurationBuilder.ACCUMULO_PASSWORD)) + .setUseAccumuloPrefixHashing(getBoolean(props.getProperty(AbstractAccumuloRdfConfigurationBuilder.USE_PREFIX_HASHING, "false"))) + .setUseCompositeCardinality(getBoolean(props.getProperty(AbstractAccumuloRdfConfigurationBuilder.USE_COUNT_STATS, "false"))) + .setUseJoinSelectivity(getBoolean(props.getProperty(AbstractAccumuloRdfConfigurationBuilder.USE_JOIN_SELECTIVITY, "false"))) + .setUseAccumuloFreetextIndex(getBoolean(props.getProperty(USE_FREETEXT, "false"))) + .setUseAccumuloTemporalIndex(getBoolean(props.getProperty(USE_TEMPORAL, "false"))) + .setUseAccumuloEntityIndex(getBoolean(props.getProperty(USE_ENTITY, "false"))) + .setAccumuloFreeTextPredicates(StringUtils.split(props.getProperty(FREETEXT_PREDICATES), ",")) + .setAccumuloTemporalPredicates(StringUtils.split(props.getProperty(TEMPORAL_PREDICATES), ",")) + .setUsePcj(getBoolean(props.getProperty(USE_PCJ, "false"))) + .setUseOptimalPcj(getBoolean(props.getProperty(USE_OPTIMAL_PCJ, "false"))) + .setPcjTables(StringUtils.split(props.getProperty(PCJ_TABLES), ",")) .setPcjUpdaterFluoAppName(props.getProperty(FLUO_APP_NAME)) .setUseStatementMetadata(getBoolean(props.getProperty(USE_STATEMENT_METADATA))) .setStatementMetadataProperties(getPropURIFromStrings(StringUtils.split(props.getProperty(STATEMENT_METADATA_PROPERTIES), ","))); diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/mongodb/MongoIndexingConfiguration.java b/extras/indexing/src/main/java/org/apache/rya/indexing/mongodb/MongoIndexingConfiguration.java index 25bb0b859..a24d9f1d9 100644 --- a/extras/indexing/src/main/java/org/apache/rya/indexing/mongodb/MongoIndexingConfiguration.java +++ b/extras/indexing/src/main/java/org/apache/rya/indexing/mongodb/MongoIndexingConfiguration.java @@ -18,8 +18,7 @@ */ package org.apache.rya.indexing.mongodb; -import java.util.Properties; - +import com.google.common.base.Preconditions; import org.apache.commons.lang3.StringUtils; import org.apache.hadoop.conf.Configuration; import org.apache.rya.indexing.accumulo.ConfigUtils; @@ -31,7 +30,7 @@ import org.apache.rya.mongodb.MongoDBRdfConfigurationBuilder; import org.eclipse.rdf4j.sail.Sail; -import com.google.common.base.Preconditions; +import java.util.Properties; /** * This class is an extension of the MongoDBRdfConfiguration object used to to @@ -269,29 +268,22 @@ public static class MongoDBIndexingConfigBuilder public static MongoIndexingConfiguration fromProperties(final Properties props) { try { final MongoDBIndexingConfigBuilder builder = new MongoDBIndexingConfigBuilder() // - .setAuths(props.getProperty(AbstractMongoDBRdfConfigurationBuilder.MONGO_AUTHS, "")) // - .setRyaPrefix( - props.getProperty(AbstractMongoDBRdfConfigurationBuilder.MONGO_RYA_PREFIX, "rya_"))// + .setUseMockMongo(getBoolean(props.getProperty(AbstractMongoDBRdfConfigurationBuilder.USE_MOCK_MONGO, "false"))) + .setRyaPrefix(props.getProperty(AbstractMongoDBRdfConfigurationBuilder.MONGO_RYA_PREFIX, "rya_")) + .setAuths(props.getProperty(AbstractMongoDBRdfConfigurationBuilder.MONGO_AUTHS, "")) .setVisibilities(props.getProperty(AbstractMongoDBRdfConfigurationBuilder.MONGO_VISIBILITIES, "")) - .setUseInference(getBoolean( - props.getProperty(AbstractMongoDBRdfConfigurationBuilder.USE_INFERENCE, "false")))// - .setDisplayQueryPlan(getBoolean(props - .getProperty(AbstractMongoDBRdfConfigurationBuilder.USE_DISPLAY_QUERY_PLAN, "true")))// - .setMongoUser(props.getProperty(AbstractMongoDBRdfConfigurationBuilder.MONGO_USER)) // - .setMongoPassword(props.getProperty(AbstractMongoDBRdfConfigurationBuilder.MONGO_PASSWORD))// - .setMongoCollectionPrefix(props - .getProperty(AbstractMongoDBRdfConfigurationBuilder.MONGO_COLLECTION_PREFIX, "rya_"))// - .setMongoDBName( - props.getProperty(AbstractMongoDBRdfConfigurationBuilder.MONGO_DB_NAME, "rya_triples"))// - .setMongoHost(props.getProperty(AbstractMongoDBRdfConfigurationBuilder.MONGO_HOST, "localhost"))// - .setMongoPort(props.getProperty(AbstractMongoDBRdfConfigurationBuilder.MONGO_PORT, - AbstractMongoDBRdfConfigurationBuilder.DEFAULT_MONGO_PORT))// - .setUseMockMongo(getBoolean( - props.getProperty(AbstractMongoDBRdfConfigurationBuilder.USE_MOCK_MONGO, "false")))// - .setUseMongoFreetextIndex(getBoolean(props.getProperty(USE_FREETEXT, "false")))// - .setUseMongoTemporalIndex(getBoolean(props.getProperty(USE_TEMPORAL, "false")))// - .setUseMongoEntityIndex(getBoolean(props.getProperty(USE_ENTITY, "false")))// - .setMongoFreeTextPredicates(StringUtils.split(props.getProperty(FREETEXT_PREDICATES), ","))// + .setUseInference(getBoolean(props.getProperty(AbstractMongoDBRdfConfigurationBuilder.USE_INFERENCE, "false"))) + .setDisplayQueryPlan(getBoolean(props.getProperty(AbstractMongoDBRdfConfigurationBuilder.USE_DISPLAY_QUERY_PLAN, "true"))) + .setMongoUser(props.getProperty(AbstractMongoDBRdfConfigurationBuilder.MONGO_USER)) + .setMongoPassword(props.getProperty(AbstractMongoDBRdfConfigurationBuilder.MONGO_PASSWORD)) + .setMongoCollectionPrefix(props.getProperty(AbstractMongoDBRdfConfigurationBuilder.MONGO_COLLECTION_PREFIX, "rya_")) + .setMongoDBName(props.getProperty(AbstractMongoDBRdfConfigurationBuilder.MONGO_DB_NAME, "rya_triples")) + .setMongoHost(props.getProperty(AbstractMongoDBRdfConfigurationBuilder.MONGO_HOST, "localhost")) + .setMongoPort(props.getProperty(AbstractMongoDBRdfConfigurationBuilder.MONGO_PORT, AbstractMongoDBRdfConfigurationBuilder.DEFAULT_MONGO_PORT)) + .setUseMongoFreetextIndex(getBoolean(props.getProperty(USE_FREETEXT, "false"))) + .setUseMongoTemporalIndex(getBoolean(props.getProperty(USE_TEMPORAL, "false"))) + .setUseMongoEntityIndex(getBoolean(props.getProperty(USE_ENTITY, "false"))) + .setMongoFreeTextPredicates(StringUtils.split(props.getProperty(FREETEXT_PREDICATES), ",")) .setMongoTemporalPredicates(StringUtils.split(props.getProperty(TEMPORAL_PREDICATES), ",")); return builder.build(); diff --git a/extras/indexing/src/test/java/org/apache/rya/indexing/accumulo/AccumuloIndexingConfigurationTest.java b/extras/indexing/src/test/java/org/apache/rya/indexing/accumulo/AccumuloIndexingConfigurationTest.java index d605fcd0c..075e6f3b0 100644 --- a/extras/indexing/src/test/java/org/apache/rya/indexing/accumulo/AccumuloIndexingConfigurationTest.java +++ b/extras/indexing/src/test/java/org/apache/rya/indexing/accumulo/AccumuloIndexingConfigurationTest.java @@ -18,8 +18,9 @@ */ package org.apache.rya.indexing.accumulo; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; +import org.apache.accumulo.core.security.Authorizations; +import org.apache.rya.api.domain.RyaIRI; +import org.junit.Test; import java.io.FileInputStream; import java.io.FileNotFoundException; @@ -29,9 +30,8 @@ import java.util.Properties; import java.util.Set; -import org.apache.accumulo.core.security.Authorizations; -import org.apache.rya.api.domain.RyaIRI; -import org.junit.Test; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; public class AccumuloIndexingConfigurationTest { @@ -101,7 +101,7 @@ public void testBuilder() { @Test public void testBuilderFromProperties() throws FileNotFoundException, IOException { - String prefix = "rya_"; + String prefix = "ryatest_"; String auth = "U"; String visibility = "U"; String user = "user"; diff --git a/extras/indexing/src/test/resources/accumulo_rya_indexing.properties b/extras/indexing/src/test/resources/accumulo_rya_indexing.properties index 9b4dd3d69..ef32b065b 100644 --- a/extras/indexing/src/test/resources/accumulo_rya_indexing.properties +++ b/extras/indexing/src/test/resources/accumulo_rya_indexing.properties @@ -15,26 +15,26 @@ # specific language governing permissions and limitations # under the License -use.prefix.hashing true -use.count.stats true -use.join.selectivity true -use.mock false -use.display.plan false -use.inference true -accumulo.user user -accumulo.password password -accumulo.instance instance -accumulo.zookeepers zookeeper -accumulo.auths U -accumulo.visibilities U -accumuo.rya.prefix rya_ -use.freetext true -use.entity true -use.temporal true -use.optimal.pcj true -freetext.predicates http://pred1,http://pred2 -temporal.predicates http://pred3,http://pred4 -pcj.tables table1,table2 -fluo.app.name fluo -use.metadata true -metadata.properties urn:123,urn:456 \ No newline at end of file +use.prefix.hashing=true +use.count.stats=true +use.join.selectivity=true +use.mock=false +use.display.plan=false +use.inference=true +accumulo.user=user +accumulo.password=password +accumulo.instance=instance +accumulo.zookeepers=zookeeper +accumulo.auths=U +accumulo.visibilities=U +accumulo.rya.prefix=ryatest_ +use.freetext=true +use.entity=true +use.temporal=true +use.optimal.pcj=true +freetext.predicates=http://pred1,http://pred2 +temporal.predicates=http://pred3,http://pred4 +pcj.tables=table1,table2 +fluo.app.name=fluo +use.metadata=true +metadata.properties=urn:123,urn:456 diff --git a/extras/indexing/src/test/resources/mongo_rya_indexing.properties b/extras/indexing/src/test/resources/mongo_rya_indexing.properties index a1f7e5e94..adf326d1d 100644 --- a/extras/indexing/src/test/resources/mongo_rya_indexing.properties +++ b/extras/indexing/src/test/resources/mongo_rya_indexing.properties @@ -15,19 +15,19 @@ # specific language governing permissions and limitations # under the License. -use.mock true -use.display.plan false -use.inference true -mongo.user user -mongo.password password -mongo.host host -mongo.port 1000 -mongo.auths U -mongo.visibilities U -mongo.db.name dbname -mongo.collection.prefix prefix_ -use.freetext true -use.temporal true -use.entity true -freetext.predicates http://pred1,http://pred2 -temporal.predicates http://pred3,http://pred4 +use.mock=true +use.display.plan=false +use.inference=true +mongo.user=user +mongo.password=password +mongo.host=host +mongo.port=1000 +mongo.auths=U +mongo.visibilities=U +mongo.db.name=dbname +mongo.collection.prefix=prefix_ +use.freetext=true +use.temporal=true +use.entity=true +freetext.predicates=http://pred1,http://pred2 +temporal.predicates=http://pred3,http://pred4 diff --git a/web/web.rya/src/main/webapp/WEB-INF/classes/accumulo.properties b/web/web.rya/src/main/webapp/WEB-INF/classes/accumulo.properties new file mode 100644 index 000000000..518c5d97c --- /dev/null +++ b/web/web.rya/src/main/webapp/WEB-INF/classes/accumulo.properties @@ -0,0 +1,43 @@ +# +# 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. +# + +use.mock=false +accumulo.instance=muchos +accumulo.zookeepers=leader1:2181 +accumulo.user=root +accumulo.password=secret +accumulo.rya.prefix=rya_ +#accumulo.rya.prefix=lubm_ +accumulo.auths=U +accumulo.visibilities=U + +instance.name=muchos +instance.zk=leader1:2181 +instance.username=root +instance.password=secret + +rya.tableprefix=rya_ +#rya.tableprefix=lubm_ +rya.displayqueryplan=true +rya.usestats=true +rya.useselectivity=false +rya.usestatementmetadata=false +rya.querythreads=200 +rya.querythreadsperserver=10 +rya.batchsize=1000 diff --git a/web/web.rya/src/main/webapp/WEB-INF/classes/extensions.properties b/web/web.rya/src/main/webapp/WEB-INF/classes/extensions.properties new file mode 100644 index 000000000..31c73dbb5 --- /dev/null +++ b/web/web.rya/src/main/webapp/WEB-INF/classes/extensions.properties @@ -0,0 +1,77 @@ +# 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 + +use.mock=false +accumulo.instance=muchos +accumulo.zookeepers=leader1:2181 +accumulo.user=root +accumulo.password=secret +accumulo.rya.prefix=rya_ +#accumulo.rya.prefix=lubm_ +accumulo.auths=U +accumulo.visibilities=U +use.prefix.hashing=false +use.inference=true +use.display.plan=true +use.count.stats=true +use.join.selectivity=true +use.freetext=true +use.entity=true +use.temporal=true +use.optimal.pcj=true +freetext.predicates=http://pred1,http://pred2 +temporal.predicates=http://pred3,http://pred4 +pcj.tables=table1,table2 +fluo.app.name=fluo +use.metadata=false +metadata.properties=urn:123,urn:456 + +instance.name=muchos +instance.zk=leader1:2181 +instance.username=root +instance.password=secret +rya.tableprefix=rya_ +#rya.tableprefix=lubm_ +rya.displayqueryplan=true +rya.usestats=true +rya.useselectivity=true +rya.usestatementmetadata=false +rya.querythreads=2000 +rya.querythreadsperserver=100 +rya.batchsize=10000 +rya.datawaveedge=true + +sc.cloudbase.instancename=muchos +sc.cloudbase.zookeepers=leader1:2181 +sc.cloudbase.username=root +sc.cloudbase.password=secret +query.tblprefix=rya_ + +sc.use_entity=true +sc.use.indexing.sail=true +sc.use_freetext=true +sc.freetext.doctable=rya_freetext +sc.freetext.termtable=rya_freetext_term +sc.use_geo=false +sc.geo.table=rya_geo +sc.cloudbase.numPartitions=3 +sc.geo.numPartitions=3 +sc.use_temporal=true +sc.temporal.index=rya_temporal +sc.geo.predicates=http://www.opengis.net/ont/geosparql#asWKT,http://www.opengis.net/ont/geosparql#asGML +sc.freetext.predicates=TODO,predicate-url's,that,are,comma,delimited +sc.temporal.predicates=TODO,can't be blank, but missing is fine. diff --git a/web/web.rya/src/main/webapp/WEB-INF/classes/log4j.properties b/web/web.rya/src/main/webapp/WEB-INF/classes/log4j.properties new file mode 100644 index 000000000..f71c3ff57 --- /dev/null +++ b/web/web.rya/src/main/webapp/WEB-INF/classes/log4j.properties @@ -0,0 +1,45 @@ +# +# 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. +# + +# Valid levels: +# TRACE, DEBUG, INFO, WARN, ERROR and FATAL +log4j.rootLogger=INFO, R + +log4j.appender.R=org.apache.log4j.DailyRollingFileAppender +log4j.appender.R.File=${catalina.home}/logs/rya.log +log4j.appender.R.DatePattern='.'yyyy-MM-dd + +log4j.appender.R.layout=org.apache.log4j.PatternLayout +log4j.appender.R.layout.ConversionPattern=%d [%t] %-5p %c - %m%n + +log4j.logger.org.apache.catalina=INFO, R +log4j.logger.org.apache.catalina.core.ContainerBase.[Catalina].[localhost]=INFO, R +log4j.logger.org.apache.catalina.core=INFO, R +log4j.logger.org.apache.catalina.session=INFO, R + +log4j.logger.org.apache.zookeeper=INFO, R + +log4j.logger.org.apache.rya=INFO, R +log4j.additivity.org.apache.rya=false + +log4j.logger.org.apache.rya.accumulo.query=INFO, R +log4j.additivity.org.apache.rya.accumulo.query=false + +log4j.logger.org.apache.rya.rdftriplestore.evaluation=INFO, R +log4j.additivity.org.apache.rya.rdftriplestore.evaluation=false diff --git a/web/web.rya/src/main/webapp/WEB-INF/spring/spring-accumulo.xml b/web/web.rya/src/main/webapp/WEB-INF/spring/spring-accumulo.xml index 2671fd02e..632fb6f45 100644 --- a/web/web.rya/src/main/webapp/WEB-INF/spring/spring-accumulo.xml +++ b/web/web.rya/src/main/webapp/WEB-INF/spring/spring-accumulo.xml @@ -20,32 +20,26 @@ under the License. --> - - + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd"> + + - + - - - - + + - - + + + diff --git a/web/web.rya/src/main/webapp/WEB-INF/spring/spring-mongodb-geo.xml b/web/web.rya/src/main/webapp/WEB-INF/spring/spring-mongodb-geo.xml index ba124fb75..86b91b0e9 100644 --- a/web/web.rya/src/main/webapp/WEB-INF/spring/spring-mongodb-geo.xml +++ b/web/web.rya/src/main/webapp/WEB-INF/spring/spring-mongodb-geo.xml @@ -20,13 +20,11 @@ under the License. --> diff --git a/web/web.rya/src/main/webapp/WEB-INF/spring/spring-mongodb.xml b/web/web.rya/src/main/webapp/WEB-INF/spring/spring-mongodb.xml index ba124fb75..3f83ee2c4 100644 --- a/web/web.rya/src/main/webapp/WEB-INF/spring/spring-mongodb.xml +++ b/web/web.rya/src/main/webapp/WEB-INF/spring/spring-mongodb.xml @@ -20,19 +20,14 @@ under the License. --> - - + sc.useMongo=true - + @@ -44,7 +39,7 @@ under the License. - + diff --git a/web/web.rya/src/main/webapp/WEB-INF/spring/spring-root-accumulo.xml b/web/web.rya/src/main/webapp/WEB-INF/spring/spring-root-accumulo.xml index 126df0e67..a9f1c3582 100644 --- a/web/web.rya/src/main/webapp/WEB-INF/spring/spring-root-accumulo.xml +++ b/web/web.rya/src/main/webapp/WEB-INF/spring/spring-root-accumulo.xml @@ -20,21 +20,20 @@ under the License. --> + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:context="http://www.springframework.org/schema/context" + xmlns:util="http://www.springframework.org/schema/util" + xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd + http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.2.xsd + http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.2.xsd"> - - - + + - + - - + + @@ -55,14 +54,15 @@ under the License. - + + - - - + + - + + diff --git a/web/web.rya/src/main/webapp/WEB-INF/spring/spring-root-extensions.xml b/web/web.rya/src/main/webapp/WEB-INF/spring/spring-root-extensions.xml index ba9a94566..3238bf5ae 100644 --- a/web/web.rya/src/main/webapp/WEB-INF/spring/spring-root-extensions.xml +++ b/web/web.rya/src/main/webapp/WEB-INF/spring/spring-root-extensions.xml @@ -20,86 +20,97 @@ under the License. --> - - + + + + + + + + + + + + + - - - - - - - sc.cloudbase.instancename=${instance.name} - sc.cloudbase.zookeepers=${instance.zk} - sc.cloudbase.username=${instance.username} - sc.cloudbase.password=${instance.password} - - query.printqueryplan=${rya.displayqueryplan} - - sc.freetext.doctable=${sc.freetext.doctable} - sc.freetext.termtable=${sc.freetext.termtable} - sc.geo.table=${sc.geo.table} - sc.geo.predicates=${sc.geo.predicates} - sc.geo.numPartitions=${sc.geo.numPartitions} - sc.temporal.index=${sc.temporal.index} - - query.usestats=false - query.useselectivity=false - query.usecompositecard=false - - - - - - + + + + + + + + + - - - - - - + + - - - + + + + + + + diff --git a/web/web.rya/src/main/webapp/WEB-INF/spring/spring-root-mongodb-geo.xml b/web/web.rya/src/main/webapp/WEB-INF/spring/spring-root-mongodb-geo.xml index 92b3692d7..2a637025c 100644 --- a/web/web.rya/src/main/webapp/WEB-INF/spring/spring-root-mongodb-geo.xml +++ b/web/web.rya/src/main/webapp/WEB-INF/spring/spring-root-mongodb-geo.xml @@ -20,12 +20,10 @@ under the License. --> + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:context="http://www.springframework.org/schema/context" + xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd + http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd"> diff --git a/web/web.rya/src/main/webapp/WEB-INF/spring/spring-root-mongodb.xml b/web/web.rya/src/main/webapp/WEB-INF/spring/spring-root-mongodb.xml index 9f94aa312..bddc354fb 100644 --- a/web/web.rya/src/main/webapp/WEB-INF/spring/spring-root-mongodb.xml +++ b/web/web.rya/src/main/webapp/WEB-INF/spring/spring-root-mongodb.xml @@ -20,12 +20,10 @@ under the License. --> + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:context="http://www.springframework.org/schema/context" + xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd + http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd"> diff --git a/web/web.rya/src/main/webapp/WEB-INF/spring/spring-security.xml b/web/web.rya/src/main/webapp/WEB-INF/spring/spring-security.xml index 4f4d5bf0b..a7496a9fe 100644 --- a/web/web.rya/src/main/webapp/WEB-INF/spring/spring-security.xml +++ b/web/web.rya/src/main/webapp/WEB-INF/spring/spring-security.xml @@ -20,12 +20,10 @@ under the License. --> + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:context="http://www.springframework.org/schema/context" + xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd + http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd">