IndexStore.java 文件源码

java
阅读 17 收藏 0 点赞 0 评论 0

项目:graphflow 作者:
/**
 * Add a vertex to a current index if it matches an index that is currently being stored.
 *
 * @param vertexId The ID of the vertex to potentially add to indices.
 * @param vertexType The type of the vertex specified by `vertexId`.
 * @param vertexProperties The properties of the vertex specified by `vertexId`.
 */
private void indexVertex(int vertexId, Short vertexType,
    Map<Short, Pair<DataType, String>> vertexProperties) {
    for (short propertyKey : vertexProperties.keySet()) {
        if (!isPropertyTypeIndexed(vertexType, propertyKey)) {
            continue;
        }

        Integer indexKey = getTypePropertyIndexKey(vertexType, propertyKey);
        indices.putIfAbsent(indexKey, new HashMap<>());

        Pair<DataType, String> property = vertexProperties.get(propertyKey);
        DataType dataType = property.a;
        String propertyValue = property.b;

        validatePropertyType(propertyKey, dataType);
        updatedIndexWithVertex(vertexId, indexKey, propertyValue, true);
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号