Search in sources :

Example 6 with MergeParentMetadata

use of org.apache.rya.export.api.metadata.MergeParentMetadata in project incubator-rya by apache.

the class ParentMetadataRepositoryAdapterTest method deserializeTest.

@Test
public void deserializeTest() {
    final DBObject dbo = BasicDBObjectBuilder.start().add(RYANAME_KEY, TEST_INSTANCE).add(TIMESTAMP_KEY, TEST_TIMESTAMP).add(FILTER_TIMESTAMP_KEY, TEST_FILTER_TIMESTAMP).add(PARENT_TIME_OFFSET_KEY, TEST_TIME_OFFSET).get();
    final MergeParentMetadata expected = new MergeParentMetadata.Builder().setRyaInstanceName(TEST_INSTANCE).setTimestamp(TEST_TIMESTAMP).setFilterTimestmap(TEST_FILTER_TIMESTAMP).setParentTimeOffset(TEST_TIME_OFFSET).build();
    final MergeParentMetadata actual = adapter.deserialize(dbo);
    assertEquals(expected, actual);
}
Also used : MergeParentMetadata(org.apache.rya.export.api.metadata.MergeParentMetadata) DBObject(com.mongodb.DBObject) Test(org.junit.Test)

Example 7 with MergeParentMetadata

use of org.apache.rya.export.api.metadata.MergeParentMetadata in project incubator-rya by apache.

the class ParentMetadataRepositoryAdapterTest method serializeTest.

@Test
public void serializeTest() {
    final MergeParentMetadata merge = new MergeParentMetadata.Builder().setRyaInstanceName(TEST_INSTANCE).setTimestamp(TEST_TIMESTAMP).setFilterTimestmap(TEST_FILTER_TIMESTAMP).setParentTimeOffset(TEST_TIME_OFFSET).build();
    final DBObject expected = BasicDBObjectBuilder.start().add(RYANAME_KEY, TEST_INSTANCE).add(TIMESTAMP_KEY, TEST_TIMESTAMP).add(FILTER_TIMESTAMP_KEY, TEST_FILTER_TIMESTAMP).add(PARENT_TIME_OFFSET_KEY, TEST_TIME_OFFSET).get();
    final DBObject actual = adapter.serialize(merge);
    assertEquals(expected, actual);
}
Also used : MergeParentMetadata(org.apache.rya.export.api.metadata.MergeParentMetadata) DBObject(com.mongodb.DBObject) Test(org.junit.Test)

Aggregations

MergeParentMetadata (org.apache.rya.export.api.metadata.MergeParentMetadata)7 Date (java.util.Date)3 Test (org.junit.Test)3 DBObject (com.mongodb.DBObject)2 ParentMetadataExistsException (org.apache.rya.export.api.metadata.ParentMetadataExistsException)2 AddStatementException (org.apache.rya.export.api.store.AddStatementException)2 Entry (java.util.Map.Entry)1 AccumuloException (org.apache.accumulo.core.client.AccumuloException)1 AccumuloSecurityException (org.apache.accumulo.core.client.AccumuloSecurityException)1 MutationsRejectedException (org.apache.accumulo.core.client.MutationsRejectedException)1 Scanner (org.apache.accumulo.core.client.Scanner)1 TableExistsException (org.apache.accumulo.core.client.TableExistsException)1 TableNotFoundException (org.apache.accumulo.core.client.TableNotFoundException)1 Key (org.apache.accumulo.core.data.Key)1 Value (org.apache.accumulo.core.data.Value)1 Authorizations (org.apache.accumulo.core.security.Authorizations)1 Text (org.apache.hadoop.io.Text)1 RyaStatement (org.apache.rya.api.domain.RyaStatement)1 MergerException (org.apache.rya.export.api.MergerException)1 ParentMetadataDoesNotExistException (org.apache.rya.export.api.metadata.ParentMetadataDoesNotExistException)1