Search in sources :

Example 36 with ProspectorDetails

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

the class AccumuloRyaDetailsRepositoryIT method update.

@Test
public void update() 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);
    // 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) 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 37 with ProspectorDetails

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

the class AccumuloRyaDetailsRepositoryIT method initializeAndGet.

@Test
public void initializeAndGet() 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);
    // Fetch the stored details.
    final RyaDetails stored = repo.getRyaInstanceDetails();
    // Ensure the fetched object is equivalent to what was stored.
    assertEquals(details, stored);
}
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)

Example 38 with ProspectorDetails

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

the class AccumuloRyaDetailsRepositoryIT method isInitialized_true.

@Test
public void isInitialized_true() 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 MiniAccumuloClusterInstance clusterInstance = getClusterInstance();
    final Connector connector = clusterInstance.getConnector();
    final RyaDetailsRepository repo = new AccumuloRyaInstanceDetailsRepository(connector, instanceName);
    // 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) 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) MiniAccumuloClusterInstance(org.apache.rya.accumulo.MiniAccumuloClusterInstance) 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)

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