Search in sources :

Example 21 with TemporalIndexDetails

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

the class RyaDetailsTest method hashcode.

@Test
public void hashcode() {
    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.hashCode(), details2.hashCode());
}
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 22 with TemporalIndexDetails

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

the class RyaDetailsUpdaterTest method update.

@Test
public void update() throws RyaDetailsRepositoryException, CouldNotApplyMutationException {
    // Setup initial details and mock a repository that returns them.
    final RyaDetails originalDetails = RyaDetails.builder().setRyaInstanceName("instanceName").setRyaVersion("0.0.0.0").setFreeTextDetails(new FreeTextIndexDetails(true)).setEntityCentricIndexDetails(new EntityCentricIndexDetails(true)).setTemporalIndexDetails(new TemporalIndexDetails(true)).setPCJIndexDetails(PCJIndexDetails.builder().setEnabled(true)).setJoinSelectivityDetails(new JoinSelectivityDetails(Optional.<Date>absent())).setProspectorDetails(new ProspectorDetails(Optional.<Date>absent())).build();
    final RyaDetailsRepository detailsRepo = mock(RyaDetailsRepository.class);
    when(detailsRepo.getRyaInstanceDetails()).thenReturn(originalDetails);
    // Use an updater to change the Rya version number.
    new RyaDetailsUpdater(detailsRepo).update(new RyaDetailsMutator() {

        @Override
        public RyaDetails mutate(final RyaDetails old) {
            return RyaDetails.builder(old).setRyaVersion("1.1.1.1").build();
        }
    });
    // Verify the repository was asked to update the details.
    final RyaDetails mutatedDetails = RyaDetails.builder(originalDetails).setRyaVersion("1.1.1.1").build();
    verify(detailsRepo, times(1)).update(eq(originalDetails), eq(mutatedDetails));
}
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) RyaDetailsMutator(org.apache.rya.api.instance.RyaDetailsUpdater.RyaDetailsMutator) FreeTextIndexDetails(org.apache.rya.api.instance.RyaDetails.FreeTextIndexDetails) JoinSelectivityDetails(org.apache.rya.api.instance.RyaDetails.JoinSelectivityDetails) Date(java.util.Date) Test(org.junit.Test)

Example 23 with TemporalIndexDetails

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

the class RyaDetailsToConfigurationTest method populateConfigTest.

@Test
public void populateConfigTest() {
    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(false)).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())));
    final Configuration conf = new Configuration();
    RyaDetailsToConfiguration.addRyaDetailsToConfiguration(builder.build(), conf);
    // defaults are set to cause the assert to fail
    assertTrue(conf.getBoolean(USE_ENTITY, false));
    assertFalse(conf.getBoolean(USE_FREETEXT, true));
    // RYA-215assertTrue(conf.getBoolean(USE_GEO, false));
    assertTrue(conf.getBoolean(USE_TEMPORAL, false));
    assertTrue(conf.getBoolean(USE_PCJ_UPDATER, false));
}
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) Configuration(org.apache.hadoop.conf.Configuration) 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 24 with TemporalIndexDetails

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

the class AccumuloIndexSetColumnVisibilityTest method initRyaDetails.

private static void initRyaDetails() throws AlreadyInitializedException, RyaDetailsRepositoryException {
    // Initialize the Rya Details for the instance.
    final RyaDetailsRepository detailsRepo = new AccumuloRyaInstanceDetailsRepository(accCon, ryaInstanceName);
    final RyaDetails details = RyaDetails.builder().setRyaInstanceName(ryaInstanceName).setRyaVersion("0.0.0.0").setFreeTextDetails(new FreeTextIndexDetails(true)).setEntityCentricIndexDetails(new EntityCentricIndexDetails(true)).setTemporalIndexDetails(new TemporalIndexDetails(true)).setPCJIndexDetails(PCJIndexDetails.builder().setEnabled(true)).setJoinSelectivityDetails(new JoinSelectivityDetails(Optional.<Date>absent())).setProspectorDetails(new ProspectorDetails(Optional.<Date>absent())).build();
    detailsRepo.initialize(details);
}
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) AccumuloRyaInstanceDetailsRepository(org.apache.rya.accumulo.instance.AccumuloRyaInstanceDetailsRepository) JoinSelectivityDetails(org.apache.rya.api.instance.RyaDetails.JoinSelectivityDetails) Date(java.util.Date)

Example 25 with TemporalIndexDetails

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

the class MongoRyaDetailsRepositoryIT method update.

@Test
public void update() 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).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);
    // Create a new state for the details.
    final RyaDetails updated = new RyaDetails.Builder(details).setEntityCentricIndexDetails(new EntityCentricIndexDetails(false)).build();
    // Execute the update.
    repo.update(details, updated);
    // Show the new state that is stored matches the updated state.
    final RyaDetails fetched = repo.getRyaInstanceDetails();
    assertEquals(updated, fetched);
}
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) Date(java.util.Date) JoinSelectivityDetails(org.apache.rya.api.instance.RyaDetails.JoinSelectivityDetails) Test(org.junit.Test)

Aggregations

EntityCentricIndexDetails (org.apache.rya.api.instance.RyaDetails.EntityCentricIndexDetails)38 FreeTextIndexDetails (org.apache.rya.api.instance.RyaDetails.FreeTextIndexDetails)38 JoinSelectivityDetails (org.apache.rya.api.instance.RyaDetails.JoinSelectivityDetails)38 ProspectorDetails (org.apache.rya.api.instance.RyaDetails.ProspectorDetails)38 TemporalIndexDetails (org.apache.rya.api.instance.RyaDetails.TemporalIndexDetails)38 Test (org.junit.Test)32 Date (java.util.Date)29 RyaDetails (org.apache.rya.api.instance.RyaDetails)25 FluoDetails (org.apache.rya.api.instance.RyaDetails.PCJIndexDetails.FluoDetails)17 RyaDetailsRepository (org.apache.rya.api.instance.RyaDetailsRepository)15 MongoRyaInstanceDetailsRepository (org.apache.rya.mongodb.instance.MongoRyaInstanceDetailsRepository)8 PrecomputedJoinStorage (org.apache.rya.indexing.pcj.storage.PrecomputedJoinStorage)7 RyaStreamsDetails (org.apache.rya.api.instance.RyaDetails.RyaStreamsDetails)6 BasicDBObject (com.mongodb.BasicDBObject)5 Connector (org.apache.accumulo.core.client.Connector)5 AccumuloRyaInstanceDetailsRepository (org.apache.rya.accumulo.instance.AccumuloRyaInstanceDetailsRepository)4 HashSet (java.util.HashSet)3 GetInstanceDetails (org.apache.rya.api.client.GetInstanceDetails)3 VisibilityBindingSet (org.apache.rya.api.model.VisibilityBindingSet)3 PcjMetadata (org.apache.rya.indexing.pcj.storage.PcjMetadata)3