Search in sources :

Example 31 with TemporalIndexDetails

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

the class RyaTestInstanceRule method before.

@Override
protected void before() throws Throwable {
    // Get the next Rya instance name.
    ryaInstanceName = "testInstance_" + ryaInstanceNameCounter.getAndIncrement();
    if (install) {
        // Create Rya Details for the instance name.
        final RyaDetailsRepository detailsRepo = new AccumuloRyaInstanceDetailsRepository(cluster.getConnector(), 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.absent())).setProspectorDetails(new ProspectorDetails(Optional.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)

Example 32 with TemporalIndexDetails

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

the class MongoDetailsAdapterTest method absentOptionalToMongoTest.

@Test
public void absentOptionalToMongoTest() {
    // Convert the Details into a Mongo DB OBject.
    final RyaDetails details = RyaDetails.builder().setRyaInstanceName("test").setRyaVersion("1").setEntityCentricIndexDetails(new EntityCentricIndexDetails(true)).setPCJIndexDetails(PCJIndexDetails.builder().setEnabled(true).setFluoDetails(new FluoDetails("fluo"))).setTemporalIndexDetails(new TemporalIndexDetails(false)).setFreeTextDetails(new FreeTextIndexDetails(true)).setProspectorDetails(new ProspectorDetails(Optional.<Date>absent())).setJoinSelectivityDetails(new JoinSelectivityDetails(Optional.<Date>absent())).build();
    final DBObject actual = MongoDetailsAdapter.toDBObject(details);
    // Ensure it matches the expected object.
    final BasicDBObject expected = (BasicDBObject) JSON.parse("{ " + "instanceName : \"test\"," + "version : \"1\"," + "entityCentricDetails : true," + // RYA-215                + "geoDetails : false,"
    "pcjDetails : {" + "enabled : true," + "pcjs : [ ]" + "}," + "temporalDetails : false," + "freeTextDetails : true" + "}");
    assertEquals(expected, actual);
}
Also used : ProspectorDetails(org.apache.rya.api.instance.RyaDetails.ProspectorDetails) EntityCentricIndexDetails(org.apache.rya.api.instance.RyaDetails.EntityCentricIndexDetails) BasicDBObject(com.mongodb.BasicDBObject) TemporalIndexDetails(org.apache.rya.api.instance.RyaDetails.TemporalIndexDetails) FreeTextIndexDetails(org.apache.rya.api.instance.RyaDetails.FreeTextIndexDetails) RyaDetails(org.apache.rya.api.instance.RyaDetails) FluoDetails(org.apache.rya.api.instance.RyaDetails.PCJIndexDetails.FluoDetails) BasicDBObject(com.mongodb.BasicDBObject) DBObject(com.mongodb.DBObject) Date(java.util.Date) JoinSelectivityDetails(org.apache.rya.api.instance.RyaDetails.JoinSelectivityDetails) Test(org.junit.Test)

Example 33 with TemporalIndexDetails

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

the class MongoDetailsAdapterTest method absentOptionalToRyaDetailsTest.

@Test
public void absentOptionalToRyaDetailsTest() throws MalformedRyaDetailsException {
    // Convert the Mongo object into a RyaDetails.
    final BasicDBObject mongo = (BasicDBObject) JSON.parse("{ " + "instanceName : \"test\"," + "version : \"1\"," + "entityCentricDetails : true," + // RYA-215                + "geoDetails : false,"
    "pcjDetails : {" + "enabled : false," + "pcjs : [ " + "{" + "id : \"pcj_1\"," + "}" + "]" + "}," + "temporalDetails : false," + "freeTextDetails : true," + "prospectorDetails : null," + "joinSelectivitiyDetails : null" + "}");
    final RyaDetails actual = MongoDetailsAdapter.toRyaDetails(mongo);
    // Ensure it matches the expected object.
    final RyaDetails expected = RyaDetails.builder().setRyaInstanceName("test").setRyaVersion("1").setEntityCentricIndexDetails(new EntityCentricIndexDetails(true)).setPCJIndexDetails(PCJIndexDetails.builder().setEnabled(false)).setTemporalIndexDetails(new TemporalIndexDetails(false)).setFreeTextDetails(new FreeTextIndexDetails(true)).setProspectorDetails(new ProspectorDetails(Optional.<Date>absent())).setJoinSelectivityDetails(new JoinSelectivityDetails(Optional.<Date>absent())).build();
    assertEquals(expected, actual);
}
Also used : ProspectorDetails(org.apache.rya.api.instance.RyaDetails.ProspectorDetails) BasicDBObject(com.mongodb.BasicDBObject) EntityCentricIndexDetails(org.apache.rya.api.instance.RyaDetails.EntityCentricIndexDetails) TemporalIndexDetails(org.apache.rya.api.instance.RyaDetails.TemporalIndexDetails) FreeTextIndexDetails(org.apache.rya.api.instance.RyaDetails.FreeTextIndexDetails) RyaDetails(org.apache.rya.api.instance.RyaDetails) Date(java.util.Date) JoinSelectivityDetails(org.apache.rya.api.instance.RyaDetails.JoinSelectivityDetails) Test(org.junit.Test)

Example 34 with TemporalIndexDetails

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

the class MongoDetailsAdapterTest method mongoToRyaDetailsTest.

@Test
public void mongoToRyaDetailsTest() throws MalformedRyaDetailsException {
    // Convert the Mongo object into a RyaDetails.
    final BasicDBObject mongo = (BasicDBObject) JSON.parse("{ " + "instanceName : \"test\"," + "version : \"1\"," + "entityCentricDetails : true," + // RYA-215            + "geoDetails : true,"
    "pcjDetails : {" + "enabled : true ," + "fluoName : \"fluo\"," + "pcjs : [ " + "{" + "id : \"pcj_0\"," + "updateStrategy : \"BATCH\"," + "lastUpdate : { $date : \"1970-01-01T00:00:00.000Z\"}" + "}," + "{" + "id : \"pcj_1\"," + "updateStrategy : \"BATCH\"," + "lastUpdate : { $date : \"1970-01-01T00:00:00.001Z\"}" + "}]" + "}," + "temporalDetails : true," + "freeTextDetails : true," + "prospectorDetails : { $date : \"1970-01-01T00:00:00.000Z\"}," + "joinSelectivitiyDetails : { $date : \"1970-01-01T00:00:00.001Z\"}," + "ryaStreamsDetails : { hostname : \"localhost\" , port : 6}" + "}");
    final RyaDetails actual = MongoDetailsAdapter.toRyaDetails(mongo);
    // Ensure it matches the expected object.
    final RyaDetails expected = RyaDetails.builder().setRyaInstanceName("test").setRyaVersion("1").setEntityCentricIndexDetails(new EntityCentricIndexDetails(true)).setPCJIndexDetails(PCJIndexDetails.builder().setEnabled(true).addPCJDetails(PCJDetails.builder().setId("pcj_0").setUpdateStrategy(PCJUpdateStrategy.BATCH).setLastUpdateTime(new Date(0L))).addPCJDetails(PCJDetails.builder().setId("pcj_1").setUpdateStrategy(PCJUpdateStrategy.BATCH).setLastUpdateTime(new Date(1L)))).setTemporalIndexDetails(new TemporalIndexDetails(true)).setFreeTextDetails(new FreeTextIndexDetails(true)).setProspectorDetails(new ProspectorDetails(Optional.<Date>fromNullable(new Date(0L)))).setJoinSelectivityDetails(new JoinSelectivityDetails(Optional.<Date>fromNullable(new Date(1L)))).setRyaStreamsDetails(new RyaStreamsDetails("localhost", 6)).build();
    assertEquals(expected, actual);
}
Also used : ProspectorDetails(org.apache.rya.api.instance.RyaDetails.ProspectorDetails) BasicDBObject(com.mongodb.BasicDBObject) 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) RyaDetails(org.apache.rya.api.instance.RyaDetails) Date(java.util.Date) JoinSelectivityDetails(org.apache.rya.api.instance.RyaDetails.JoinSelectivityDetails) Test(org.junit.Test)

Example 35 with TemporalIndexDetails

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

the class MongoDetailsAdapterTest method ryaDetailsToMongoTest.

@Test
public void ryaDetailsToMongoTest() {
    // Convert the Details into a Mongo DB OBject.
    final RyaDetails details = RyaDetails.builder().setRyaInstanceName("test").setRyaVersion("1").setEntityCentricIndexDetails(new EntityCentricIndexDetails(true)).setPCJIndexDetails(PCJIndexDetails.builder().setEnabled(true).setFluoDetails(new FluoDetails("fluo")).addPCJDetails(PCJDetails.builder().setId("pcj_0").setUpdateStrategy(PCJUpdateStrategy.BATCH).setLastUpdateTime(new Date(0L))).addPCJDetails(PCJDetails.builder().setId("pcj_1").setUpdateStrategy(PCJUpdateStrategy.BATCH).setLastUpdateTime(new Date(1L)))).setTemporalIndexDetails(new TemporalIndexDetails(true)).setFreeTextDetails(new FreeTextIndexDetails(true)).setProspectorDetails(new ProspectorDetails(Optional.fromNullable(new Date(0L)))).setJoinSelectivityDetails(new JoinSelectivityDetails(Optional.fromNullable(new Date(1L)))).setRyaStreamsDetails(new RyaStreamsDetails("localhost", 6)).build();
    final BasicDBObject actual = MongoDetailsAdapter.toDBObject(details);
    // Ensure it matches the expected object.
    final DBObject expected = (DBObject) JSON.parse("{ " + "instanceName : \"test\"," + "version : \"1\"," + "entityCentricDetails : true," + // RYA-215            + "geoDetails : true,"
    "pcjDetails : {" + "enabled : true ," + "pcjs : [ " + "{" + "id : \"pcj_0\"," + "updateStrategy : \"BATCH\"," + "lastUpdate : { $date : \"1970-01-01T00:00:00.000Z\"}" + "}," + "{" + "id : \"pcj_1\"," + "updateStrategy : \"BATCH\"," + "lastUpdate : { $date : \"1970-01-01T00:00:00.001Z\"}" + "}]" + "}," + "temporalDetails : true," + "freeTextDetails : true," + "prospectorDetails : { $date : \"1970-01-01T00:00:00.000Z\"}," + "joinSelectivitiyDetails : { $date : \"1970-01-01T00:00:00.001Z\"}," + "ryaStreamsDetails : { hostname : \"localhost\" , port : 6}" + "}");
    assertEquals(expected.toString(), actual.toString());
}
Also used : ProspectorDetails(org.apache.rya.api.instance.RyaDetails.ProspectorDetails) EntityCentricIndexDetails(org.apache.rya.api.instance.RyaDetails.EntityCentricIndexDetails) BasicDBObject(com.mongodb.BasicDBObject) RyaStreamsDetails(org.apache.rya.api.instance.RyaDetails.RyaStreamsDetails) TemporalIndexDetails(org.apache.rya.api.instance.RyaDetails.TemporalIndexDetails) FreeTextIndexDetails(org.apache.rya.api.instance.RyaDetails.FreeTextIndexDetails) RyaDetails(org.apache.rya.api.instance.RyaDetails) FluoDetails(org.apache.rya.api.instance.RyaDetails.PCJIndexDetails.FluoDetails) BasicDBObject(com.mongodb.BasicDBObject) DBObject(com.mongodb.DBObject) 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