Search in sources :

Example 6 with FluoDetails

use of org.apache.rya.api.instance.RyaDetails.PCJIndexDetails.FluoDetails in project incubator-rya by apache.

the class MongoRyaDetailsRepositoryIT method isInitialized_true.

@Test
public void isInitialized_true() throws AlreadyInitializedException, RyaDetailsRepositoryException {
    final String instanceName = "testInstance";
    // Create the metadata object the repository will be initialized with.
    final RyaDetails details = RyaDetails.builder().setRyaInstanceName(instanceName).setRyaVersion("1.2.3.4").setEntityCentricIndexDetails(new EntityCentricIndexDetails(true)).setTemporalIndexDetails(new TemporalIndexDetails(true)).setFreeTextDetails(new FreeTextIndexDetails(true)).setPCJIndexDetails(PCJIndexDetails.builder().setEnabled(true).setFluoDetails(new FluoDetails("test_instance_rya_pcj_updater")).addPCJDetails(PCJDetails.builder().setId("pcj 1").setUpdateStrategy(PCJUpdateStrategy.BATCH).setLastUpdateTime(new Date())).addPCJDetails(PCJDetails.builder().setId("pcj 2"))).setProspectorDetails(new ProspectorDetails(Optional.of(new Date()))).setJoinSelectivityDetails(new JoinSelectivityDetails(Optional.of(new Date()))).build();
    // Setup the repository that will be tested using a mock instance of MongoDB.
    final RyaDetailsRepository repo = new MongoRyaInstanceDetailsRepository(client, "testInstance");
    // Initialize the repository
    repo.initialize(details);
    // Ensure the repository reports that it has been initialized.
    assertTrue(repo.isInitialized());
}
Also used : ProspectorDetails(org.apache.rya.api.instance.RyaDetails.ProspectorDetails) EntityCentricIndexDetails(org.apache.rya.api.instance.RyaDetails.EntityCentricIndexDetails) TemporalIndexDetails(org.apache.rya.api.instance.RyaDetails.TemporalIndexDetails) FreeTextIndexDetails(org.apache.rya.api.instance.RyaDetails.FreeTextIndexDetails) RyaDetailsRepository(org.apache.rya.api.instance.RyaDetailsRepository) RyaDetails(org.apache.rya.api.instance.RyaDetails) FluoDetails(org.apache.rya.api.instance.RyaDetails.PCJIndexDetails.FluoDetails) Date(java.util.Date) JoinSelectivityDetails(org.apache.rya.api.instance.RyaDetails.JoinSelectivityDetails) Test(org.junit.Test)

Example 7 with FluoDetails

use of org.apache.rya.api.instance.RyaDetails.PCJIndexDetails.FluoDetails in project incubator-rya by apache.

the class RyaDetailsTest method constructor.

@Test
public void constructor() {
    final RyaDetails originalDetails = RyaDetails.builder().setRyaInstanceName("test_instance").setRyaVersion("1.2.3.4").setEntityCentricIndexDetails(new EntityCentricIndexDetails(true)).setTemporalIndexDetails(new TemporalIndexDetails(true)).setFreeTextDetails(new FreeTextIndexDetails(true)).setPCJIndexDetails(PCJIndexDetails.builder().setEnabled(true).setFluoDetails(new FluoDetails("test_instance_rya_pcj_updater")).addPCJDetails(PCJDetails.builder().setId("pcj 1").setUpdateStrategy(PCJUpdateStrategy.BATCH).setLastUpdateTime(new Date())).addPCJDetails(PCJDetails.builder().setId("pcj 2").setUpdateStrategy(PCJUpdateStrategy.INCREMENTAL))).setProspectorDetails(new ProspectorDetails(Optional.of(new Date()))).setJoinSelectivityDetails(new JoinSelectivityDetails(Optional.of(new Date()))).setRyaStreamsDetails(new RyaStreamsDetails("localhost", 5)).build();
    // Create a new Builder using another RyaDetails object.
    final RyaDetails.Builder builder = new RyaDetails.Builder(originalDetails);
    // Show it builds the object that was passed into it.
    assertEquals(originalDetails, builder.build());
}
Also used : ProspectorDetails(org.apache.rya.api.instance.RyaDetails.ProspectorDetails) EntityCentricIndexDetails(org.apache.rya.api.instance.RyaDetails.EntityCentricIndexDetails) RyaStreamsDetails(org.apache.rya.api.instance.RyaDetails.RyaStreamsDetails) TemporalIndexDetails(org.apache.rya.api.instance.RyaDetails.TemporalIndexDetails) FreeTextIndexDetails(org.apache.rya.api.instance.RyaDetails.FreeTextIndexDetails) FluoDetails(org.apache.rya.api.instance.RyaDetails.PCJIndexDetails.FluoDetails) Date(java.util.Date) JoinSelectivityDetails(org.apache.rya.api.instance.RyaDetails.JoinSelectivityDetails) Test(org.junit.Test)

Example 8 with FluoDetails

use of org.apache.rya.api.instance.RyaDetails.PCJIndexDetails.FluoDetails in project incubator-rya by apache.

the class RyaDetailsTest method equals.

@Test
public void equals() {
    final RyaDetails.Builder builder = RyaDetails.builder();
    builder.setRyaInstanceName("test_instance").setRyaVersion("1.2.3.4").setEntityCentricIndexDetails(new EntityCentricIndexDetails(true)).setTemporalIndexDetails(new TemporalIndexDetails(true)).setFreeTextDetails(new FreeTextIndexDetails(true)).setPCJIndexDetails(PCJIndexDetails.builder().setEnabled(true).setFluoDetails(new FluoDetails("test_instance_rya_pcj_updater")).addPCJDetails(PCJDetails.builder().setId("pcj 1").setUpdateStrategy(PCJUpdateStrategy.BATCH).setLastUpdateTime(new Date())).addPCJDetails(PCJDetails.builder().setId("pcj 2").setUpdateStrategy(PCJUpdateStrategy.INCREMENTAL))).setProspectorDetails(new ProspectorDetails(Optional.of(new Date()))).setJoinSelectivityDetails(new JoinSelectivityDetails(Optional.of(new Date()))).setRyaStreamsDetails(new RyaStreamsDetails("localhost", 5));
    final RyaDetails details1 = builder.build();
    final RyaDetails details2 = builder.build();
    assertEquals(details1, details2);
}
Also used : ProspectorDetails(org.apache.rya.api.instance.RyaDetails.ProspectorDetails) EntityCentricIndexDetails(org.apache.rya.api.instance.RyaDetails.EntityCentricIndexDetails) RyaStreamsDetails(org.apache.rya.api.instance.RyaDetails.RyaStreamsDetails) TemporalIndexDetails(org.apache.rya.api.instance.RyaDetails.TemporalIndexDetails) FreeTextIndexDetails(org.apache.rya.api.instance.RyaDetails.FreeTextIndexDetails) FluoDetails(org.apache.rya.api.instance.RyaDetails.PCJIndexDetails.FluoDetails) Date(java.util.Date) JoinSelectivityDetails(org.apache.rya.api.instance.RyaDetails.JoinSelectivityDetails) Test(org.junit.Test)

Example 9 with FluoDetails

use of org.apache.rya.api.instance.RyaDetails.PCJIndexDetails.FluoDetails in project incubator-rya by apache.

the class AccumuloRyaDetailsRepositoryIT method update_outOfDate.

@Test(expected = ConcurrentUpdateException.class)
public void update_outOfDate() throws AccumuloException, AccumuloSecurityException, AlreadyInitializedException, RyaDetailsRepositoryException {
    final String instanceName = getRyaInstanceName();
    // Create the metadata object the repository will be initialized with.
    final RyaDetails details = RyaDetails.builder().setRyaInstanceName(instanceName).setRyaVersion("1.2.3.4").setEntityCentricIndexDetails(new EntityCentricIndexDetails(true)).setTemporalIndexDetails(new TemporalIndexDetails(true)).setFreeTextDetails(new FreeTextIndexDetails(true)).setPCJIndexDetails(PCJIndexDetails.builder().setEnabled(true).setFluoDetails(new FluoDetails("test_instance_rya_pcj_updater")).addPCJDetails(PCJDetails.builder().setId("pcj 1").setUpdateStrategy(PCJUpdateStrategy.BATCH).setLastUpdateTime(new Date())).addPCJDetails(PCJDetails.builder().setId("pcj 2"))).setProspectorDetails(new ProspectorDetails(Optional.of(new Date()))).setJoinSelectivityDetails(new JoinSelectivityDetails(Optional.of(new Date()))).build();
    // Setup the repository that will be tested using a mini instance of Accumulo.
    final Connector connector = getClusterInstance().getConnector();
    final RyaDetailsRepository repo = new AccumuloRyaInstanceDetailsRepository(connector, instanceName);
    // Initialize the repository
    repo.initialize(details);
    // Create a new state for the details.
    final RyaDetails updated = new RyaDetails.Builder(details).setEntityCentricIndexDetails(new EntityCentricIndexDetails(false)).build();
    // Try to execute the update where the old state is not the currently stored state.
    repo.update(updated, updated);
}
Also used : ProspectorDetails(org.apache.rya.api.instance.RyaDetails.ProspectorDetails) Connector(org.apache.accumulo.core.client.Connector) RyaDetails(org.apache.rya.api.instance.RyaDetails) Date(java.util.Date) JoinSelectivityDetails(org.apache.rya.api.instance.RyaDetails.JoinSelectivityDetails) EntityCentricIndexDetails(org.apache.rya.api.instance.RyaDetails.EntityCentricIndexDetails) TemporalIndexDetails(org.apache.rya.api.instance.RyaDetails.TemporalIndexDetails) FreeTextIndexDetails(org.apache.rya.api.instance.RyaDetails.FreeTextIndexDetails) RyaDetailsRepository(org.apache.rya.api.instance.RyaDetailsRepository) FluoDetails(org.apache.rya.api.instance.RyaDetails.PCJIndexDetails.FluoDetails) Test(org.junit.Test)

Example 10 with FluoDetails

use of org.apache.rya.api.instance.RyaDetails.PCJIndexDetails.FluoDetails in project incubator-rya by apache.

the class AccumuloRyaDetailsRepositoryIT method initialize_alreadyInitialized.

@Test(expected = AlreadyInitializedException.class)
public void initialize_alreadyInitialized() throws AlreadyInitializedException, RyaDetailsRepositoryException, AccumuloException, AccumuloSecurityException {
    final String instanceName = getRyaInstanceName();
    // Create the metadata object the repository will be initialized with.
    final RyaDetails details = RyaDetails.builder().setRyaInstanceName(instanceName).setRyaVersion("1.2.3.4").setEntityCentricIndexDetails(new EntityCentricIndexDetails(true)).setTemporalIndexDetails(new TemporalIndexDetails(true)).setFreeTextDetails(new FreeTextIndexDetails(true)).setPCJIndexDetails(PCJIndexDetails.builder().setEnabled(true).setFluoDetails(new FluoDetails("test_instance_rya_pcj_updater")).addPCJDetails(PCJDetails.builder().setId("pcj 1").setUpdateStrategy(PCJUpdateStrategy.BATCH).setLastUpdateTime(new Date())).addPCJDetails(PCJDetails.builder().setId("pcj 2"))).setProspectorDetails(new ProspectorDetails(Optional.of(new Date()))).setJoinSelectivityDetails(new JoinSelectivityDetails(Optional.of(new Date()))).build();
    // Setup the repository that will be tested using a mini instance of Accumulo.
    final Connector connector = getClusterInstance().getConnector();
    final RyaDetailsRepository repo = new AccumuloRyaInstanceDetailsRepository(connector, instanceName);
    // Initialize the repository
    repo.initialize(details);
    // Initialize it again.
    repo.initialize(details);
}
Also used : ProspectorDetails(org.apache.rya.api.instance.RyaDetails.ProspectorDetails) EntityCentricIndexDetails(org.apache.rya.api.instance.RyaDetails.EntityCentricIndexDetails) Connector(org.apache.accumulo.core.client.Connector) TemporalIndexDetails(org.apache.rya.api.instance.RyaDetails.TemporalIndexDetails) FreeTextIndexDetails(org.apache.rya.api.instance.RyaDetails.FreeTextIndexDetails) RyaDetailsRepository(org.apache.rya.api.instance.RyaDetailsRepository) RyaDetails(org.apache.rya.api.instance.RyaDetails) FluoDetails(org.apache.rya.api.instance.RyaDetails.PCJIndexDetails.FluoDetails) Date(java.util.Date) JoinSelectivityDetails(org.apache.rya.api.instance.RyaDetails.JoinSelectivityDetails) Test(org.junit.Test)

Aggregations

FluoDetails (org.apache.rya.api.instance.RyaDetails.PCJIndexDetails.FluoDetails)23 RyaDetails (org.apache.rya.api.instance.RyaDetails)18 Date (java.util.Date)17 EntityCentricIndexDetails (org.apache.rya.api.instance.RyaDetails.EntityCentricIndexDetails)17 FreeTextIndexDetails (org.apache.rya.api.instance.RyaDetails.FreeTextIndexDetails)17 JoinSelectivityDetails (org.apache.rya.api.instance.RyaDetails.JoinSelectivityDetails)17 ProspectorDetails (org.apache.rya.api.instance.RyaDetails.ProspectorDetails)17 TemporalIndexDetails (org.apache.rya.api.instance.RyaDetails.TemporalIndexDetails)17 Test (org.junit.Test)16 RyaDetailsRepository (org.apache.rya.api.instance.RyaDetailsRepository)10 PCJIndexDetails (org.apache.rya.api.instance.RyaDetails.PCJIndexDetails)6 Connector (org.apache.accumulo.core.client.Connector)5 InstanceDoesNotExistException (org.apache.rya.api.client.InstanceDoesNotExistException)5 RyaClientException (org.apache.rya.api.client.RyaClientException)5 RyaStreamsDetails (org.apache.rya.api.instance.RyaDetails.RyaStreamsDetails)4 UnsupportedQueryException (org.apache.rya.indexing.pcj.fluo.app.query.UnsupportedQueryException)3 MalformedQueryException (org.openrdf.query.MalformedQueryException)3 BasicDBObject (com.mongodb.BasicDBObject)2 DBObject (com.mongodb.DBObject)2 AccumuloRyaInstanceDetailsRepository (org.apache.rya.accumulo.instance.AccumuloRyaInstanceDetailsRepository)2