http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/07643eb7/extras/indexing/src/test/java/org/apache/rya/indexing/entity/storage/mongo/MongoITBase.java ---------------------------------------------------------------------- diff --git a/extras/indexing/src/test/java/org/apache/rya/indexing/entity/storage/mongo/MongoITBase.java b/extras/indexing/src/test/java/org/apache/rya/indexing/entity/storage/mongo/MongoITBase.java new file mode 100644 index 0000000..9894ee5 --- /dev/null +++ b/extras/indexing/src/test/java/org/apache/rya/indexing/entity/storage/mongo/MongoITBase.java @@ -0,0 +1,81 @@ +/** + * 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. + */ +package org.apache.rya.indexing.entity.storage.mongo; + +import java.net.UnknownHostException; +import java.util.HashSet; +import java.util.Set; + +import org.apache.hadoop.conf.Configuration; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Before; + +import com.mongodb.MongoClient; +import com.mongodb.MongoException; + +import mvm.rya.mongodb.MongoConnectorFactory; +import mvm.rya.mongodb.MongoDBRdfConfiguration; + +/** + * A base class that may be used when implementing Mongo DB integration tests that + * use the JUnit framework. + */ +public class MongoITBase { + + private MongoClient mongoClient = null; + private Set<String> originalDbNames = null; + + @Before + public void setupTest() throws UnknownHostException, MongoException { + final MongoDBRdfConfiguration conf = new MongoDBRdfConfiguration( new Configuration() ); + conf.setUseTestMongo(true); + conf.setMongoDBName("testDB"); + + mongoClient = MongoConnectorFactory.getMongoClient(conf); + + // Store the names of the DBs that are present before running the test. + originalDbNames = new HashSet<>(); + for(final String name : mongoClient.listDatabaseNames()) { + originalDbNames.add(name); + } + } + + @After + public void cleanupTest() { + // Remove any DBs that were created by the test. + for(final String dbName : mongoClient.listDatabaseNames()) { + if(!originalDbNames.contains(dbName)) { + mongoClient.dropDatabase(dbName); + } + } + } + + @AfterClass + public static void shutdown() { + MongoConnectorFactory.shutdown(); + } + + /** + * @return A {@link MongoClient} that is connected to the embedded instance of Mongo DB. + */ + public MongoClient getMongoClient() { + return mongoClient; + } +} \ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/07643eb7/extras/indexing/src/test/java/org/apache/rya/indexing/entity/storage/mongo/MongoTypeStorageIT.java ---------------------------------------------------------------------- diff --git a/extras/indexing/src/test/java/org/apache/rya/indexing/entity/storage/mongo/MongoTypeStorageIT.java b/extras/indexing/src/test/java/org/apache/rya/indexing/entity/storage/mongo/MongoTypeStorageIT.java new file mode 100644 index 0000000..2b4c849 --- /dev/null +++ b/extras/indexing/src/test/java/org/apache/rya/indexing/entity/storage/mongo/MongoTypeStorageIT.java @@ -0,0 +1,175 @@ +/** + * 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. + */ +package org.apache.rya.indexing.entity.storage.mongo; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; + +import java.util.HashSet; +import java.util.Set; + +import org.apache.rya.indexing.entity.model.Type; +import org.apache.rya.indexing.entity.storage.CloseableIterator; +import org.apache.rya.indexing.entity.storage.TypeStorage; +import org.apache.rya.indexing.entity.storage.TypeStorage.TypeStorageException; +import org.apache.rya.indexing.entity.storage.mongo.MongoTypeStorage; +import org.junit.Test; + +import com.google.common.base.Optional; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Sets; + +import mvm.rya.api.domain.RyaURI; + +/** + * Integration tests the methods of {@link MongoTypeStorage}. + */ +public class MongoTypeStorageIT extends MongoITBase { + + private static final String RYA_INSTANCE_NAME = "testInstance"; + + @Test + public void create_and_get() throws TypeStorageException { + // A Type that will be stored. + final Type type = new Type(new RyaURI("urn:icecream"), + ImmutableSet.<RyaURI>builder() + .add(new RyaURI("urn:brand")) + .add(new RyaURI("urn:flavor")) + .add(new RyaURI("urn:cost")) + .build()); + + // Create it. + final TypeStorage storage = new MongoTypeStorage(super.getMongoClient(), RYA_INSTANCE_NAME); + storage.create(type); + + // Get it. + final Optional<Type> storedType = storage.get(new RyaURI("urn:icecream")); + + // Verify the correct value was returned. + assertEquals(type, storedType.get()); + } + + @Test + public void can_not_create_with_same_id() throws TypeStorageException { + // A Type that will be stored. + final Type type = new Type(new RyaURI("urn:icecream"), + ImmutableSet.<RyaURI>builder() + .add(new RyaURI("urn:brand")) + .add(new RyaURI("urn:flavor")) + .add(new RyaURI("urn:cost")) + .build()); + + // Create it. + final TypeStorage storage = new MongoTypeStorage(super.getMongoClient(), RYA_INSTANCE_NAME); + storage.create(type); + + // Try to create it again. This will fail. + boolean failed = false; + try { + storage.create(type); + } catch(final TypeStorageException e) { + failed = true; + } + assertTrue(failed); + } + + @Test + public void get_nonexisting() throws TypeStorageException { + // Get a Type that hasn't been created. + final TypeStorage storage = new MongoTypeStorage(super.getMongoClient(), RYA_INSTANCE_NAME); + final Optional<Type> storedType = storage.get(new RyaURI("urn:icecream")); + + // Verify nothing was returned. + assertFalse(storedType.isPresent()); + } + + @Test + public void delete() throws TypeStorageException { + // An Type that will be stored. + final Type type = new Type(new RyaURI("urn:icecream"), + ImmutableSet.<RyaURI>builder() + .add(new RyaURI("urn:brand")) + .add(new RyaURI("urn:flavor")) + .add(new RyaURI("urn:cost")) + .build()); + + // Create it. + final TypeStorage storage = new MongoTypeStorage(super.getMongoClient(), RYA_INSTANCE_NAME); + storage.create(type); + + // Delete it. + final boolean deleted = storage.delete( new RyaURI("urn:icecream") ); + + // Verify a document was deleted. + assertTrue( deleted ); + } + + @Test + public void delete_nonexisting() throws TypeStorageException { + // Delete an Type that has not been created. + final TypeStorage storage = new MongoTypeStorage(super.getMongoClient(), RYA_INSTANCE_NAME); + final boolean deleted = storage.delete( new RyaURI("urn:icecream") ); + + // Verify no document was deleted. + assertFalse( deleted ); + } + + @Test + public void search() throws Exception { + // Add some Types to the storage. + final Type cat = new Type(new RyaURI("urn:cat"), + ImmutableSet.<RyaURI>builder() + .add(new RyaURI("urn:numLegs")) + .add(new RyaURI("urn:eye")) + .add(new RyaURI("urn:species")) + .build()); + + final Type dog = new Type(new RyaURI("urn:dog"), + ImmutableSet.<RyaURI>builder() + .add(new RyaURI("urn:numLegs")) + .add(new RyaURI("urn:eye")) + .add(new RyaURI("urn:species")) + .build()); + + final Type icecream = new Type(new RyaURI("urn:icecream"), + ImmutableSet.<RyaURI>builder() + .add(new RyaURI("urn:brand")) + .add(new RyaURI("urn:flavor")) + .add(new RyaURI("urn:cost")) + .build()); + + final TypeStorage storage = new MongoTypeStorage(super.getMongoClient(), RYA_INSTANCE_NAME); + storage.create(cat); + storage.create(dog); + storage.create(icecream); + + // Search for all Types that have the 'urn:eye' property. + final CloseableIterator<Type> typeIt = storage.search(new RyaURI("urn:eye")); + + final Set<Type> types = new HashSet<>(); + while(typeIt.hasNext()) { + types.add( typeIt.next() ); + } + + // Verify the correct types were returned. + final Set<Type> expected = Sets.newHashSet(cat, dog); + assertEquals(expected, types); + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/07643eb7/extras/indexing/src/test/java/org/apache/rya/indexing/entity/storage/mongo/RyaTypeDocumentConverterTest.java ---------------------------------------------------------------------- diff --git a/extras/indexing/src/test/java/org/apache/rya/indexing/entity/storage/mongo/RyaTypeDocumentConverterTest.java b/extras/indexing/src/test/java/org/apache/rya/indexing/entity/storage/mongo/RyaTypeDocumentConverterTest.java new file mode 100644 index 0000000..35c7968 --- /dev/null +++ b/extras/indexing/src/test/java/org/apache/rya/indexing/entity/storage/mongo/RyaTypeDocumentConverterTest.java @@ -0,0 +1,83 @@ +/** + * 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. + */ +package org.apache.rya.indexing.entity.storage.mongo; + +import static org.junit.Assert.assertEquals; + +import org.apache.rya.indexing.entity.storage.mongo.RyaTypeDocumentConverter; +import org.apache.rya.indexing.entity.storage.mongo.DocumentConverter.DocumentConverterException; +import org.bson.Document; +import org.junit.Test; +import org.openrdf.model.impl.ValueFactoryImpl; +import org.openrdf.model.vocabulary.XMLSchema; + +import mvm.rya.api.domain.RyaType; +import mvm.rya.api.resolver.RdfToRyaConversions; + +/** + * Tests the methods of {@link RyaTypeDocumentConverter}. + */ +public class RyaTypeDocumentConverterTest { + + @Test + public void toDocument() { + // Convert the RyaType into a Document. + final RyaType ryaType = RdfToRyaConversions.convertLiteral( new ValueFactoryImpl().createLiteral( 4.5 ) ); + final Document document = new RyaTypeDocumentConverter().toDocument( ryaType ); + + // Show the document has the correct structure. + final Document expected = new Document() + .append(RyaTypeDocumentConverter.DATA_TYPE, XMLSchema.DOUBLE.toString()) + .append(RyaTypeDocumentConverter.VALUE, "4.5"); + assertEquals(expected, document); + } + + @Test + public void fromDocument() throws DocumentConverterException { + // Convert a document into a RyaType + final Document document = new Document() + .append(RyaTypeDocumentConverter.DATA_TYPE, XMLSchema.DOUBLE.toString()) + .append(RyaTypeDocumentConverter.VALUE, "4.5"); + final RyaType ryaType = new RyaTypeDocumentConverter().fromDocument( document ); + + // Show the converted value has the expected structure. + final RyaType expected = RdfToRyaConversions.convertLiteral( new ValueFactoryImpl().createLiteral( 4.5 ) ); + assertEquals(expected, ryaType); + } + + @Test(expected = DocumentConverterException.class) + public void fromDocument_noDataType() throws DocumentConverterException { + // A document that does not have a data type. + final Document document = new Document() + .append(RyaTypeDocumentConverter.VALUE, "4.5"); + + // The conversion will fail. + new RyaTypeDocumentConverter().fromDocument(document); + } + + @Test(expected = DocumentConverterException.class) + public void fromDocument_noValue() throws DocumentConverterException { + // A document that does not have a value. + final Document document = new Document() + .append(RyaTypeDocumentConverter.DATA_TYPE, XMLSchema.DOUBLE.toString()); + + // The conversion will fail. + new RyaTypeDocumentConverter().fromDocument(document); + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/07643eb7/extras/indexing/src/test/java/org/apache/rya/indexing/entity/storage/mongo/TypeDocumentConverterTest.java ---------------------------------------------------------------------- diff --git a/extras/indexing/src/test/java/org/apache/rya/indexing/entity/storage/mongo/TypeDocumentConverterTest.java b/extras/indexing/src/test/java/org/apache/rya/indexing/entity/storage/mongo/TypeDocumentConverterTest.java new file mode 100644 index 0000000..9d854cf --- /dev/null +++ b/extras/indexing/src/test/java/org/apache/rya/indexing/entity/storage/mongo/TypeDocumentConverterTest.java @@ -0,0 +1,94 @@ +/** + * 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. + */ +package org.apache.rya.indexing.entity.storage.mongo; + +import static org.junit.Assert.assertEquals; + +import org.apache.rya.indexing.entity.model.Type; +import org.apache.rya.indexing.entity.storage.mongo.TypeDocumentConverter; +import org.apache.rya.indexing.entity.storage.mongo.DocumentConverter.DocumentConverterException; +import org.bson.Document; +import org.junit.Test; + +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; + +import mvm.rya.api.domain.RyaURI; + +/** + * Tests the methods of {@link TypeDocumentConverter}. + */ +public class TypeDocumentConverterTest { + + @Test + public void toDocument() { + // Convert a Type into a Document. + final Type type = new Type(new RyaURI("urn:icecream"), + ImmutableSet.<RyaURI>builder() + .add(new RyaURI("urn:brand")) + .add(new RyaURI("urn:flavor")) + .add(new RyaURI("urn:cost")) + .build()); + final Document document = new TypeDocumentConverter().toDocument(type); + + // Show the document has the correct values. + final Document expected = new Document() + .append(TypeDocumentConverter.ID, "urn:icecream") + .append(TypeDocumentConverter.PROPERTY_NAMES, Lists.newArrayList("urn:brand", "urn:flavor", "urn:cost")); + assertEquals(expected, document); + } + + @Test + public void fromDocument() throws DocumentConverterException { + // Convert a Document into a Type. + final Document document = new Document() + .append(TypeDocumentConverter.ID, "urn:icecream") + .append(TypeDocumentConverter.PROPERTY_NAMES, Lists.newArrayList("urn:brand", "urn:flavor", "urn:cost")); + final Type type = new TypeDocumentConverter().fromDocument(document); + + // Show the converted value has the expected structure. + final Type expected = new Type(new RyaURI("urn:icecream"), + ImmutableSet.<RyaURI>builder() + .add(new RyaURI("urn:brand")) + .add(new RyaURI("urn:flavor")) + .add(new RyaURI("urn:cost")) + .build()); + assertEquals(expected, type); + } + + @Test(expected = DocumentConverterException.class) + public void fromDocument_noId() throws DocumentConverterException { + // A document that does not have a Data Type ID. + final Document document = new Document() + .append(TypeDocumentConverter.PROPERTY_NAMES, Lists.newArrayList("urn:brand", "urn:flavor", "urn:cost")); + + // The conversion will fail. + new TypeDocumentConverter().fromDocument(document); + } + + @Test(expected = DocumentConverterException.class) + public void fromDocument_noOptionalFieldNames() throws DocumentConverterException { + // A document that does not have an Optional Field Names. + final Document document = new Document() + .append(TypeDocumentConverter.ID, "urn:icecream"); + + // The conversion will fail. + new TypeDocumentConverter().fromDocument(document); + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/07643eb7/extras/indexing/src/test/java/org/apache/rya/indexing/entity/update/mongo/MongoEntityIndexerIT.java ---------------------------------------------------------------------- diff --git a/extras/indexing/src/test/java/org/apache/rya/indexing/entity/update/mongo/MongoEntityIndexerIT.java b/extras/indexing/src/test/java/org/apache/rya/indexing/entity/update/mongo/MongoEntityIndexerIT.java new file mode 100644 index 0000000..1fc3f72 --- /dev/null +++ b/extras/indexing/src/test/java/org/apache/rya/indexing/entity/update/mongo/MongoEntityIndexerIT.java @@ -0,0 +1,286 @@ +/** + * 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. + */ +package org.apache.rya.indexing.entity.update.mongo; + +import static org.junit.Assert.assertEquals; + +import java.util.Set; + +import org.apache.hadoop.conf.Configuration; +import org.apache.rya.indexing.entity.model.Entity; +import org.apache.rya.indexing.entity.model.Property; +import org.apache.rya.indexing.entity.model.Type; +import org.apache.rya.indexing.entity.storage.EntityStorage; +import org.apache.rya.indexing.entity.storage.TypeStorage; +import org.apache.rya.indexing.entity.storage.mongo.MongoEntityStorage; +import org.apache.rya.indexing.entity.storage.mongo.MongoITBase; +import org.apache.rya.indexing.entity.storage.mongo.MongoTypeStorage; +import org.apache.rya.indexing.entity.update.EntityIndexer; +import org.apache.rya.indexing.entity.update.mongo.MongoEntityIndexer; +import org.junit.Test; +import org.openrdf.model.vocabulary.RDF; +import org.openrdf.model.vocabulary.XMLSchema; + +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Sets; + +import mvm.rya.api.domain.RyaStatement; +import mvm.rya.api.domain.RyaType; +import mvm.rya.api.domain.RyaURI; +import mvm.rya.mongodb.MongoDBRdfConfiguration; + +/** + * Integration tests the methods of {@link MongoEntityIndexer}. + */ +public class MongoEntityIndexerIT extends MongoITBase { + + private static final String RYA_INSTANCE_NAME = "testInstance"; + + private static final Type PERSON_TYPE = + new Type(new RyaURI("urn:person"), + ImmutableSet.<RyaURI>builder() + .add(new RyaURI("urn:name")) + .add(new RyaURI("urn:age")) + .add(new RyaURI("urn:eye")) + .build()); + + private static final Type EMPLOYEE_TYPE = + new Type(new RyaURI("urn:employee"), + ImmutableSet.<RyaURI>builder() + .add(new RyaURI("urn:name")) + .add(new RyaURI("urn:hoursPerWeek")) + .build()); + + @Test + public void addStatement_setsType() throws Exception { + // Load a type into the TypeStorage. + final TypeStorage types = new MongoTypeStorage(getMongoClient(), RYA_INSTANCE_NAME); + types.create(PERSON_TYPE); + + // Index a RyaStatement that will create an Entity with an explicit type. + final EntityIndexer indexer = makeTestIndexer(); + final RyaStatement statement = new RyaStatement(new RyaURI("urn:SSN/111-11-1111"), new RyaURI( RDF.TYPE.toString() ), new RyaType(XMLSchema.ANYURI, "urn:person")); + indexer.storeStatement(statement); + + // Fetch the Entity from storage and ensure it looks correct. + final EntityStorage entities = new MongoEntityStorage(getMongoClient(), RYA_INSTANCE_NAME); + final Entity entity = entities.get(new RyaURI("urn:SSN/111-11-1111")).get(); + + final Entity expected = Entity.builder() + .setSubject(new RyaURI("urn:SSN/111-11-1111")) + .setExplicitType(new RyaURI("urn:person")) + .build(); + + assertEquals(expected, entity); + } + + @Test + public void addStatement_setsProperty() throws Exception { + // Load the types into the TypeStorage. + final TypeStorage types = new MongoTypeStorage(getMongoClient(), RYA_INSTANCE_NAME); + types.create(PERSON_TYPE); + types.create(EMPLOYEE_TYPE); + + // Index a RyaStatement that will create an Entity with two implicit types. + final EntityIndexer indexer = makeTestIndexer(); + final RyaStatement statement = new RyaStatement(new RyaURI("urn:SSN/111-11-1111"), new RyaURI("urn:name"), new RyaType(XMLSchema.STRING, "Alice")); + indexer.storeStatement(statement); + + // Fetch the Entity from storage and ensure it looks correct. + final EntityStorage entities = new MongoEntityStorage(getMongoClient(), RYA_INSTANCE_NAME); + final Entity entity = entities.get(new RyaURI("urn:SSN/111-11-1111")).get(); + + final Entity expected = Entity.builder() + .setSubject(new RyaURI("urn:SSN/111-11-1111")) + .setProperty(new RyaURI("urn:person"), new Property(new RyaURI("urn:name"), new RyaType(XMLSchema.STRING, "Alice"))) + .setProperty(new RyaURI("urn:employee"), new Property(new RyaURI("urn:name"), new RyaType(XMLSchema.STRING, "Alice"))) + .build(); + + assertEquals(expected, entity); + } + + @Test + public void addStatement_manyUpdates() throws Exception { + // Load the types into the TypeStorage. + final TypeStorage types = new MongoTypeStorage(getMongoClient(), RYA_INSTANCE_NAME); + types.create(PERSON_TYPE); + types.create(EMPLOYEE_TYPE); + + // Index a bunch of RyaStatements. + final EntityIndexer indexer = makeTestIndexer(); + + final RyaURI aliceSSN = new RyaURI("urn:SSN/111-11-1111"); + indexer.storeStatement(new RyaStatement(aliceSSN, new RyaURI( RDF.TYPE.toString() ), new RyaType(XMLSchema.ANYURI, "urn:person"))); + indexer.storeStatement(new RyaStatement(aliceSSN, new RyaURI("urn:name"), new RyaType(XMLSchema.STRING, "Alice"))); + indexer.storeStatement(new RyaStatement(aliceSSN, new RyaURI("urn:age"), new RyaType(XMLSchema.INT, "30"))); + indexer.storeStatement(new RyaStatement(aliceSSN, new RyaURI("urn:eye"), new RyaType(XMLSchema.STRING, "blue"))); + + // Fetch the Entity from storage and ensure it looks correct. + final EntityStorage entities = new MongoEntityStorage(getMongoClient(), RYA_INSTANCE_NAME); + final Entity entity = entities.get(new RyaURI("urn:SSN/111-11-1111")).get(); + + final Entity expected = Entity.builder() + .setSubject(aliceSSN) + .setExplicitType(new RyaURI("urn:person")) + .setProperty(new RyaURI("urn:person"), new Property(new RyaURI("urn:name"), new RyaType(XMLSchema.STRING, "Alice"))) + .setProperty(new RyaURI("urn:person"), new Property(new RyaURI("urn:age"), new RyaType(XMLSchema.INT, "30"))) + .setProperty(new RyaURI("urn:person"), new Property(new RyaURI("urn:eye"), new RyaType(XMLSchema.STRING, "blue"))) + .setProperty(new RyaURI("urn:employee"), new Property(new RyaURI("urn:name"), new RyaType(XMLSchema.STRING, "Alice"))) + .setVersion( entity.getVersion() ) + .build(); + + assertEquals(expected, entity); + } + + @Test + public void addStatements() throws Exception { + // Load the types into the TypeStorage. + final TypeStorage types = new MongoTypeStorage(getMongoClient(), RYA_INSTANCE_NAME); + types.create(PERSON_TYPE); + types.create(EMPLOYEE_TYPE); + + // Index a bunch of RyaStatements. + final EntityIndexer indexer = makeTestIndexer(); + + final RyaURI aliceSSN = new RyaURI("urn:SSN/111-11-1111"); + final RyaURI bobSSN = new RyaURI("urn:SSN/222-22-2222"); + + indexer.storeStatements(Sets.newHashSet( + new RyaStatement(aliceSSN, new RyaURI( RDF.TYPE.toString() ), new RyaType(XMLSchema.ANYURI, "urn:person")), + new RyaStatement(aliceSSN, new RyaURI("urn:name"), new RyaType(XMLSchema.STRING, "Alice")), + new RyaStatement(aliceSSN, new RyaURI("urn:age"), new RyaType(XMLSchema.INT, "30")), + new RyaStatement(aliceSSN, new RyaURI("urn:eye"), new RyaType(XMLSchema.STRING, "blue")), + + new RyaStatement(bobSSN, new RyaURI("urn:name"), new RyaType(XMLSchema.STRING, "Bob")), + new RyaStatement(bobSSN, new RyaURI("urn:hoursPerWeek"), new RyaType(XMLSchema.INT, "40")), + new RyaStatement(bobSSN, new RyaURI( RDF.TYPE.toString() ), new RyaType(XMLSchema.ANYURI, "urn:employee")))); + + // Fetch the Entity from storage and ensure it looks correct. + final EntityStorage entities = new MongoEntityStorage(getMongoClient(), RYA_INSTANCE_NAME); + + final Entity alice = entities.get(aliceSSN).get(); + final Entity bob = entities.get(bobSSN).get(); + final Set<Entity> storedEntities = Sets.newHashSet(alice, bob); + + final Entity expectedAlice = Entity.builder() + .setSubject(aliceSSN) + .setExplicitType(new RyaURI("urn:person")) + .setProperty(new RyaURI("urn:person"), new Property(new RyaURI("urn:name"), new RyaType(XMLSchema.STRING, "Alice"))) + .setProperty(new RyaURI("urn:person"), new Property(new RyaURI("urn:age"), new RyaType(XMLSchema.INT, "30"))) + .setProperty(new RyaURI("urn:person"), new Property(new RyaURI("urn:eye"), new RyaType(XMLSchema.STRING, "blue"))) + .setProperty(new RyaURI("urn:employee"), new Property(new RyaURI("urn:name"), new RyaType(XMLSchema.STRING, "Alice"))) + .setVersion( alice.getVersion() ) + .build(); + final Entity expectedBob = Entity.builder() + .setSubject(bobSSN) + .setExplicitType(new RyaURI("urn:employee")) + .setProperty(new RyaURI("urn:employee"), new Property(new RyaURI("urn:name"), new RyaType(XMLSchema.STRING, "Bob"))) + .setProperty(new RyaURI("urn:employee"), new Property(new RyaURI("urn:hoursPerWeek"), new RyaType(XMLSchema.INT, "40"))) + .setProperty(new RyaURI("urn:person"), new Property(new RyaURI("urn:name"), new RyaType(XMLSchema.STRING, "Bob"))) + .setVersion( bob.getVersion() ) + .build(); + final Set<Entity> expected = Sets.newHashSet(expectedAlice, expectedBob); + + assertEquals(expected, storedEntities); + } + + @Test + public void deleteStatement_deletesType() throws Exception { + // Load the type into the TypeStorage. + final TypeStorage types = new MongoTypeStorage(getMongoClient(), RYA_INSTANCE_NAME); + types.create(PERSON_TYPE); + types.create(EMPLOYEE_TYPE); + + // Index a bunch of RyaStatements. + final EntityIndexer indexer = makeTestIndexer(); + + final RyaURI aliceSSN = new RyaURI("urn:SSN/111-11-1111"); + + indexer.storeStatements(Sets.newHashSet( + new RyaStatement(aliceSSN, new RyaURI( RDF.TYPE.toString() ), new RyaType(XMLSchema.ANYURI, "urn:person")), + new RyaStatement(aliceSSN, new RyaURI("urn:name"), new RyaType(XMLSchema.STRING, "Alice")), + new RyaStatement(aliceSSN, new RyaURI("urn:age"), new RyaType(XMLSchema.INT, "30")), + new RyaStatement(aliceSSN, new RyaURI("urn:eye"), new RyaType(XMLSchema.STRING, "blue")))); + + // Remove the explicit type from Alice. + indexer.deleteStatement(new RyaStatement(aliceSSN, new RyaURI( RDF.TYPE.toString() ), new RyaType(XMLSchema.ANYURI, "urn:person"))); + + // Fetch the Entity from storage and ensure it looks correct. + final EntityStorage entities = new MongoEntityStorage(getMongoClient(), RYA_INSTANCE_NAME); + final Entity entity = entities.get(new RyaURI("urn:SSN/111-11-1111")).get(); + + final Entity expected = Entity.builder() + .setSubject(aliceSSN) + .setProperty(new RyaURI("urn:person"), new Property(new RyaURI("urn:name"), new RyaType(XMLSchema.STRING, "Alice"))) + .setProperty(new RyaURI("urn:person"), new Property(new RyaURI("urn:age"), new RyaType(XMLSchema.INT, "30"))) + .setProperty(new RyaURI("urn:person"), new Property(new RyaURI("urn:eye"), new RyaType(XMLSchema.STRING, "blue"))) + .setProperty(new RyaURI("urn:employee"), new Property(new RyaURI("urn:name"), new RyaType(XMLSchema.STRING, "Alice"))) + .setVersion( entity.getVersion() ) + .build(); + + assertEquals(expected, entity); + } + + @Test + public void deleteStatement_deletesProperty() throws Exception { + // Load the type into the TypeStorage. + final TypeStorage types = new MongoTypeStorage(getMongoClient(), RYA_INSTANCE_NAME); + types.create(PERSON_TYPE); + types.create(EMPLOYEE_TYPE); + + // Index a bunch of RyaStatements. + final EntityIndexer indexer = makeTestIndexer(); + + final RyaURI aliceSSN = new RyaURI("urn:SSN/111-11-1111"); + + indexer.storeStatements(Sets.newHashSet( + new RyaStatement(aliceSSN, new RyaURI( RDF.TYPE.toString() ), new RyaType(XMLSchema.ANYURI, "urn:person")), + new RyaStatement(aliceSSN, new RyaURI("urn:name"), new RyaType(XMLSchema.STRING, "Alice")), + new RyaStatement(aliceSSN, new RyaURI("urn:age"), new RyaType(XMLSchema.INT, "30")), + new RyaStatement(aliceSSN, new RyaURI("urn:eye"), new RyaType(XMLSchema.STRING, "blue")))); + + // Remove the name property from Alice. + indexer.deleteStatement(new RyaStatement(aliceSSN, new RyaURI("urn:name"), new RyaType(XMLSchema.STRING, "Alice"))); + + // Fetch the Entity from storage and ensure it looks correct. + final EntityStorage entities = new MongoEntityStorage(getMongoClient(), RYA_INSTANCE_NAME); + final Entity entity = entities.get(new RyaURI("urn:SSN/111-11-1111")).get(); + + final Entity expected = Entity.builder() + .setSubject(aliceSSN) + .setExplicitType(new RyaURI("urn:person")) + .setProperty(new RyaURI("urn:person"), new Property(new RyaURI("urn:age"), new RyaType(XMLSchema.INT, "30"))) + .setProperty(new RyaURI("urn:person"), new Property(new RyaURI("urn:eye"), new RyaType(XMLSchema.STRING, "blue"))) + .setVersion( entity.getVersion() ) + .build(); + + assertEquals(expected, entity); + } + + private static EntityIndexer makeTestIndexer() { + final EntityIndexer indexer = new MongoEntityIndexer(); + + final MongoDBRdfConfiguration conf = new MongoDBRdfConfiguration( new Configuration() ); + conf.setUseTestMongo(true); + conf.setMongoDBName(RYA_INSTANCE_NAME); + + indexer.setConf(conf); + return indexer; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/07643eb7/extras/rya.benchmark/src/main/gen/META-INF/sun-jaxb.episode ---------------------------------------------------------------------- diff --git a/extras/rya.benchmark/src/main/gen/META-INF/sun-jaxb.episode b/extras/rya.benchmark/src/main/gen/META-INF/sun-jaxb.episode new file mode 100644 index 0000000..81fca66 --- /dev/null +++ b/extras/rya.benchmark/src/main/gen/META-INF/sun-jaxb.episode @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<jaxb:bindings version="2.1" xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"> + <!-- + +This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.11 +See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> +Any modifications to this file will be lost upon recompilation of the source schema. +Generated on: 2016.12.16 at 01:22:14 PM PST + + --> + <jaxb:bindings scd="x-schema::"> + <jaxb:schemaBindings map="false"> + <jaxb:package name="org.apache.rya.benchmark.query"/> + </jaxb:schemaBindings> + <jaxb:bindings scd="~Parameters"> + <jaxb:class ref="org.apache.rya.benchmark.query.Parameters"/> + </jaxb:bindings> + <jaxb:bindings scd="~Rya"> + <jaxb:class ref="org.apache.rya.benchmark.query.Rya"/> + </jaxb:bindings> + <jaxb:bindings scd="QueriesBenchmarkConf"> + <jaxb:class ref="org.apache.rya.benchmark.query.QueriesBenchmarkConf"/> + </jaxb:bindings> + </jaxb:bindings> +</jaxb:bindings> + http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/07643eb7/extras/rya.benchmark/src/main/gen/org/apache/rya/benchmark/query/ObjectFactory.java ---------------------------------------------------------------------- diff --git a/extras/rya.benchmark/src/main/gen/org/apache/rya/benchmark/query/ObjectFactory.java b/extras/rya.benchmark/src/main/gen/org/apache/rya/benchmark/query/ObjectFactory.java new file mode 100644 index 0000000..8762e8e --- /dev/null +++ b/extras/rya.benchmark/src/main/gen/org/apache/rya/benchmark/query/ObjectFactory.java @@ -0,0 +1,113 @@ +/** + * 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 file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.11 +// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2016.12.16 at 01:22:14 PM PST +// + + +package org.apache.rya.benchmark.query; + +import javax.xml.bind.annotation.XmlRegistry; + + +/** + * This object contains factory methods for each + * Java content interface and Java element interface + * generated in the org.apache.rya.benchmark.query package. + * <p>An ObjectFactory allows you to programatically + * construct new instances of the Java representation + * for XML content. The Java representation of XML + * content can consist of schema derived interfaces + * and classes representing the binding of schema + * type definitions, element declarations and model + * groups. Factory methods for each of these are + * provided in this class. + * + */ +@XmlRegistry +public class ObjectFactory { + + + /** + * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: org.apache.rya.benchmark.query + * + */ + public ObjectFactory() { + } + + /** + * Create an instance of {@link Parameters } + * + */ + public Parameters createParameters() { + return new Parameters(); + } + + /** + * Create an instance of {@link Rya } + * + */ + public Rya createRya() { + return new Rya(); + } + + /** + * Create an instance of {@link QueriesBenchmarkConf } + * + */ + public QueriesBenchmarkConf createQueriesBenchmarkConf() { + return new QueriesBenchmarkConf(); + } + + /** + * Create an instance of {@link Parameters.NumReadsRuns } + * + */ + public Parameters.NumReadsRuns createParametersNumReadsRuns() { + return new Parameters.NumReadsRuns(); + } + + /** + * Create an instance of {@link Parameters.Queries } + * + */ + public Parameters.Queries createParametersQueries() { + return new Parameters.Queries(); + } + + /** + * Create an instance of {@link Rya.Accumulo } + * + */ + public Rya.Accumulo createRyaAccumulo() { + return new Rya.Accumulo(); + } + + /** + * Create an instance of {@link Rya.SecondaryIndexing } + * + */ + public Rya.SecondaryIndexing createRyaSecondaryIndexing() { + return new Rya.SecondaryIndexing(); + } + +} http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/07643eb7/extras/rya.benchmark/src/main/gen/org/apache/rya/benchmark/query/Parameters.java ---------------------------------------------------------------------- diff --git a/extras/rya.benchmark/src/main/gen/org/apache/rya/benchmark/query/Parameters.java b/extras/rya.benchmark/src/main/gen/org/apache/rya/benchmark/query/Parameters.java new file mode 100644 index 0000000..a5f7181 --- /dev/null +++ b/extras/rya.benchmark/src/main/gen/org/apache/rya/benchmark/query/Parameters.java @@ -0,0 +1,257 @@ +/** + * 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 file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.11 +// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2016.12.16 at 01:22:14 PM PST +// + + +package org.apache.rya.benchmark.query; + +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + + +/** + * <p>Java class for Parameters complex type. + * + * <p>The following schema fragment specifies the expected content contained within this class. + * + * <pre> + * <complexType name="Parameters"> + * <complexContent> + * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> + * <sequence> + * <element name="NumReadsRuns"> + * <complexType> + * <complexContent> + * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> + * <sequence> + * <element name="NumReads" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded"/> + * </sequence> + * </restriction> + * </complexContent> + * </complexType> + * </element> + * <element name="Queries" minOccurs="0"> + * <complexType> + * <complexContent> + * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> + * <sequence> + * <element name="SPARQL" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded"/> + * </sequence> + * </restriction> + * </complexContent> + * </complexType> + * </element> + * </sequence> + * </restriction> + * </complexContent> + * </complexType> + * </pre> + * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "Parameters", propOrder = { + "numReadsRuns", + "queries" +}) +public class Parameters { + + @XmlElement(name = "NumReadsRuns", required = true) + protected Parameters.NumReadsRuns numReadsRuns; + @XmlElement(name = "Queries") + protected Parameters.Queries queries; + + /** + * Gets the value of the numReadsRuns property. + * + * @return + * possible object is + * {@link Parameters.NumReadsRuns } + * + */ + public Parameters.NumReadsRuns getNumReadsRuns() { + return numReadsRuns; + } + + /** + * Sets the value of the numReadsRuns property. + * + * @param value + * allowed object is + * {@link Parameters.NumReadsRuns } + * + */ + public void setNumReadsRuns(Parameters.NumReadsRuns value) { + this.numReadsRuns = value; + } + + /** + * Gets the value of the queries property. + * + * @return + * possible object is + * {@link Parameters.Queries } + * + */ + public Parameters.Queries getQueries() { + return queries; + } + + /** + * Sets the value of the queries property. + * + * @param value + * allowed object is + * {@link Parameters.Queries } + * + */ + public void setQueries(Parameters.Queries value) { + this.queries = value; + } + + + /** + * <p>Java class for anonymous complex type. + * + * <p>The following schema fragment specifies the expected content contained within this class. + * + * <pre> + * <complexType> + * <complexContent> + * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> + * <sequence> + * <element name="NumReads" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded"/> + * </sequence> + * </restriction> + * </complexContent> + * </complexType> + * </pre> + * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "numReads" + }) + public static class NumReadsRuns { + + @XmlElement(name = "NumReads", required = true) + protected List<String> numReads; + + /** + * Gets the value of the numReads property. + * + * <p> + * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a <CODE>set</CODE> method for the numReads property. + * + * <p> + * For example, to add a new item, do as follows: + * <pre> + * getNumReads().add(newItem); + * </pre> + * + * + * <p> + * Objects of the following type(s) are allowed in the list + * {@link String } + * + * + */ + public List<String> getNumReads() { + if (numReads == null) { + numReads = new ArrayList<String>(); + } + return this.numReads; + } + + } + + + /** + * <p>Java class for anonymous complex type. + * + * <p>The following schema fragment specifies the expected content contained within this class. + * + * <pre> + * <complexType> + * <complexContent> + * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> + * <sequence> + * <element name="SPARQL" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded"/> + * </sequence> + * </restriction> + * </complexContent> + * </complexType> + * </pre> + * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "sparql" + }) + public static class Queries { + + @XmlElement(name = "SPARQL", required = true) + protected List<String> sparql; + + /** + * Gets the value of the sparql property. + * + * <p> + * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a <CODE>set</CODE> method for the sparql property. + * + * <p> + * For example, to add a new item, do as follows: + * <pre> + * getSPARQL().add(newItem); + * </pre> + * + * + * <p> + * Objects of the following type(s) are allowed in the list + * {@link String } + * + * + */ + public List<String> getSPARQL() { + if (sparql == null) { + sparql = new ArrayList<String>(); + } + return this.sparql; + } + + } + +} http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/07643eb7/extras/rya.benchmark/src/main/gen/org/apache/rya/benchmark/query/QueriesBenchmarkConf.java ---------------------------------------------------------------------- diff --git a/extras/rya.benchmark/src/main/gen/org/apache/rya/benchmark/query/QueriesBenchmarkConf.java b/extras/rya.benchmark/src/main/gen/org/apache/rya/benchmark/query/QueriesBenchmarkConf.java new file mode 100644 index 0000000..fa5cf08 --- /dev/null +++ b/extras/rya.benchmark/src/main/gen/org/apache/rya/benchmark/query/QueriesBenchmarkConf.java @@ -0,0 +1,117 @@ +/** + * 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 file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.11 +// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2016.12.16 at 01:22:14 PM PST +// + + +package org.apache.rya.benchmark.query; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; + + +/** + * <p>Java class for anonymous complex type. + * + * <p>The following schema fragment specifies the expected content contained within this class. + * + * <pre> + * <complexType> + * <complexContent> + * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> + * <sequence> + * <element name="Rya" type="{}Rya"/> + * <element name="Parameters" type="{}Parameters"/> + * </sequence> + * </restriction> + * </complexContent> + * </complexType> + * </pre> + * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "", propOrder = { + "rya", + "parameters" +}) +@XmlRootElement(name = "QueriesBenchmarkConf") +public class QueriesBenchmarkConf { + + @XmlElement(name = "Rya", required = true) + protected Rya rya; + @XmlElement(name = "Parameters", required = true) + protected Parameters parameters; + + /** + * Gets the value of the rya property. + * + * @return + * possible object is + * {@link Rya } + * + */ + public Rya getRya() { + return rya; + } + + /** + * Sets the value of the rya property. + * + * @param value + * allowed object is + * {@link Rya } + * + */ + public void setRya(Rya value) { + this.rya = value; + } + + /** + * Gets the value of the parameters property. + * + * @return + * possible object is + * {@link Parameters } + * + */ + public Parameters getParameters() { + return parameters; + } + + /** + * Sets the value of the parameters property. + * + * @param value + * allowed object is + * {@link Parameters } + * + */ + public void setParameters(Parameters value) { + this.parameters = value; + } + +} http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/07643eb7/extras/rya.benchmark/src/main/gen/org/apache/rya/benchmark/query/Rya.java ---------------------------------------------------------------------- diff --git a/extras/rya.benchmark/src/main/gen/org/apache/rya/benchmark/query/Rya.java b/extras/rya.benchmark/src/main/gen/org/apache/rya/benchmark/query/Rya.java new file mode 100644 index 0000000..98e3c52 --- /dev/null +++ b/extras/rya.benchmark/src/main/gen/org/apache/rya/benchmark/query/Rya.java @@ -0,0 +1,351 @@ +/** + * 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 file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.11 +// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2016.12.16 at 01:22:14 PM PST +// + + +package org.apache.rya.benchmark.query; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + + +/** + * <p>Java class for Rya complex type. + * + * <p>The following schema fragment specifies the expected content contained within this class. + * + * <pre> + * <complexType name="Rya"> + * <complexContent> + * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> + * <sequence> + * <element name="ryaInstanceName" type="{http://www.w3.org/2001/XMLSchema}string"/> + * <element name="accumulo"> + * <complexType> + * <complexContent> + * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> + * <sequence> + * <element name="username" type="{http://www.w3.org/2001/XMLSchema}string"/> + * <element name="password" type="{http://www.w3.org/2001/XMLSchema}string"/> + * <element name="zookeepers" type="{http://www.w3.org/2001/XMLSchema}string"/> + * <element name="instanceName" type="{http://www.w3.org/2001/XMLSchema}string"/> + * </sequence> + * </restriction> + * </complexContent> + * </complexType> + * </element> + * <element name="secondaryIndexing"> + * <complexType> + * <complexContent> + * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> + * <sequence> + * <element name="usePCJ" type="{http://www.w3.org/2001/XMLSchema}boolean"/> + * </sequence> + * </restriction> + * </complexContent> + * </complexType> + * </element> + * </sequence> + * </restriction> + * </complexContent> + * </complexType> + * </pre> + * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "Rya", propOrder = { + "ryaInstanceName", + "accumulo", + "secondaryIndexing" +}) +public class Rya { + + @XmlElement(required = true) + protected String ryaInstanceName; + @XmlElement(required = true) + protected Rya.Accumulo accumulo; + @XmlElement(required = true) + protected Rya.SecondaryIndexing secondaryIndexing; + + /** + * Gets the value of the ryaInstanceName property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getRyaInstanceName() { + return ryaInstanceName; + } + + /** + * Sets the value of the ryaInstanceName property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setRyaInstanceName(String value) { + this.ryaInstanceName = value; + } + + /** + * Gets the value of the accumulo property. + * + * @return + * possible object is + * {@link Rya.Accumulo } + * + */ + public Rya.Accumulo getAccumulo() { + return accumulo; + } + + /** + * Sets the value of the accumulo property. + * + * @param value + * allowed object is + * {@link Rya.Accumulo } + * + */ + public void setAccumulo(Rya.Accumulo value) { + this.accumulo = value; + } + + /** + * Gets the value of the secondaryIndexing property. + * + * @return + * possible object is + * {@link Rya.SecondaryIndexing } + * + */ + public Rya.SecondaryIndexing getSecondaryIndexing() { + return secondaryIndexing; + } + + /** + * Sets the value of the secondaryIndexing property. + * + * @param value + * allowed object is + * {@link Rya.SecondaryIndexing } + * + */ + public void setSecondaryIndexing(Rya.SecondaryIndexing value) { + this.secondaryIndexing = value; + } + + + /** + * <p>Java class for anonymous complex type. + * + * <p>The following schema fragment specifies the expected content contained within this class. + * + * <pre> + * <complexType> + * <complexContent> + * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> + * <sequence> + * <element name="username" type="{http://www.w3.org/2001/XMLSchema}string"/> + * <element name="password" type="{http://www.w3.org/2001/XMLSchema}string"/> + * <element name="zookeepers" type="{http://www.w3.org/2001/XMLSchema}string"/> + * <element name="instanceName" type="{http://www.w3.org/2001/XMLSchema}string"/> + * </sequence> + * </restriction> + * </complexContent> + * </complexType> + * </pre> + * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "username", + "password", + "zookeepers", + "instanceName" + }) + public static class Accumulo { + + @XmlElement(required = true) + protected String username; + @XmlElement(required = true) + protected String password; + @XmlElement(required = true) + protected String zookeepers; + @XmlElement(required = true) + protected String instanceName; + + /** + * Gets the value of the username property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getUsername() { + return username; + } + + /** + * Sets the value of the username property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setUsername(String value) { + this.username = value; + } + + /** + * Gets the value of the password property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getPassword() { + return password; + } + + /** + * Sets the value of the password property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setPassword(String value) { + this.password = value; + } + + /** + * Gets the value of the zookeepers property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getZookeepers() { + return zookeepers; + } + + /** + * Sets the value of the zookeepers property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setZookeepers(String value) { + this.zookeepers = value; + } + + /** + * Gets the value of the instanceName property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getInstanceName() { + return instanceName; + } + + /** + * Sets the value of the instanceName property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setInstanceName(String value) { + this.instanceName = value; + } + + } + + + /** + * <p>Java class for anonymous complex type. + * + * <p>The following schema fragment specifies the expected content contained within this class. + * + * <pre> + * <complexType> + * <complexContent> + * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> + * <sequence> + * <element name="usePCJ" type="{http://www.w3.org/2001/XMLSchema}boolean"/> + * </sequence> + * </restriction> + * </complexContent> + * </complexType> + * </pre> + * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "usePCJ" + }) + public static class SecondaryIndexing { + + protected boolean usePCJ; + + /** + * Gets the value of the usePCJ property. + * + */ + public boolean isUsePCJ() { + return usePCJ; + } + + /** + * Sets the value of the usePCJ property. + * + */ + public void setUsePCJ(boolean value) { + this.usePCJ = value; + } + + } + +}
