Search in sources :

Example 1 with RelationCategory

use of com.thinkaurelius.titan.graphdb.internal.RelationCategory in project titan by thinkaurelius.

the class IDManagementTest method testEdgeTypeWriting.

public void testEdgeTypeWriting(long etid) {
    IDHandler.DirectionID[] dir = IDManager.VertexIDType.EdgeLabel.is(etid) ? new IDHandler.DirectionID[] { IDHandler.DirectionID.EDGE_IN_DIR, IDHandler.DirectionID.EDGE_OUT_DIR } : new IDHandler.DirectionID[] { IDHandler.DirectionID.PROPERTY_DIR };
    RelationCategory relCat = IDManager.VertexIDType.EdgeLabel.is(etid) ? RelationCategory.EDGE : RelationCategory.PROPERTY;
    boolean invisible = IDManager.isSystemRelationTypeId(etid);
    for (IDHandler.DirectionID d : dir) {
        StaticBuffer b = IDHandler.getRelationType(etid, d, invisible);
        IDHandler.RelationTypeParse parse = IDHandler.readRelationType(b.asReadBuffer());
        assertEquals(d, parse.dirID);
        assertEquals(etid, parse.typeId);
    }
}
Also used : RelationCategory(com.thinkaurelius.titan.graphdb.internal.RelationCategory) IDHandler(com.thinkaurelius.titan.graphdb.database.idhandling.IDHandler) StaticBuffer(com.thinkaurelius.titan.diskstorage.StaticBuffer)

Aggregations

StaticBuffer (com.thinkaurelius.titan.diskstorage.StaticBuffer)1 IDHandler (com.thinkaurelius.titan.graphdb.database.idhandling.IDHandler)1 RelationCategory (com.thinkaurelius.titan.graphdb.internal.RelationCategory)1