Package com.thinkaurelius.titan.graphdb.relations

Examples of com.thinkaurelius.titan.graphdb.relations.RelationCache


        this.serializer = serializer;
    }

    public InternalRelation readRelation(final InternalVertex vertex, final Entry data) {
        StandardTitanTx tx = vertex.tx();
        RelationCache relation = readRelation(vertex.getID(), data, true, tx);
        return readRelation(vertex,relation,data,tx);
    }
View Full Code Here


        throw new AssertionError();
    }

    //Used by Faunus - DON'T REMOVE
    public void readRelation(RelationFactory factory, Entry data, StandardTitanTx tx) {
        RelationCache relation = readRelation(factory.getVertexID(), data, false, tx);
        assert relation.hasProperties();

        factory.setDirection(relation.direction);
        TitanType type = tx.getExistingType(relation.typeId);
        factory.setType(type);
        factory.setRelationID(relation.relationId);
        if (type.isPropertyKey()) {
            factory.setValue(relation.getValue());
        } else if (type.isEdgeLabel()) {
            factory.setOtherVertexID(relation.getOtherVertexId());
        } else throw new AssertionError();
        //Add properties
        for (LongObjectCursor<Object> entry : relation) {
            TitanType pt = tx.getExistingType(entry.key);
            if (entry.value != null) {
View Full Code Here

    public RelationCache readRelation(InternalVertex vertex, Entry data, StandardTitanTx tx) {
        return readRelation(vertex.getID(), data, false, tx);
    }

    public RelationCache readRelation(long vertexid, Entry data, boolean parseHeaderOnly, StandardTitanTx tx) {
        RelationCache map = data.getCache();
        if (map == null || !(parseHeaderOnly || map.hasProperties())) {
            map = parseRelation(vertexid, data, parseHeaderOnly, tx);
            data.setCache(map);
        }
        return map;
    }
View Full Code Here

        return map;
    }


    public Direction parseDirection(Entry data) {
        RelationCache map = data.getCache();
        if (map != null) return map.direction;

        long[] typeAndDir = IDHandler.readEdgeType(data.getReadColumn());
        switch ((int) typeAndDir[1]) {
            case PROPERTY_DIR:
View Full Code Here

                Object pvalue = readInline(value, type);
                assert pvalue != null;
                properties.put(type.getID(), pvalue);
            }
        }
        return new RelationCache(dir, typeId, relationId, other, properties);
    }
View Full Code Here

TOP

Related Classes of com.thinkaurelius.titan.graphdb.relations.RelationCache

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.