3

我正在尝试使用 Titan Graph DB 对网络拓扑进行建模。我想从 python 应用程序中指定拓扑。

我有一个使用 tinkertop 框架注释的 java 接口文件。下面给出了一个示例结构。

public interface IDeviceObject extends IBaseObject {

          @JsonProperty("mac")
          @Property("dl_addr")
          public String getMACAddress();
          @Property("dl_addr")
          public void setMACAddress(String macaddr);

          @JsonProperty("ipv4")
          @Property("nw_addr")
          public String getIPAddress();
          @Property("nw_addr")
          public void setIPAddress(String ipaddr);

          @JsonIgnore
          @Adjacency(label="host",direction = Direction.IN)
          public Iterable<IPortObject> getAttachedPorts();

          @JsonIgnore
          @Adjacency(label="host",direction=Direction.IN)
          public void setHostPort(final IPortObject port);

          @JsonIgnore
          @Adjacency(label="host",direction=Direction.IN)
          public void removeHostPort(final IPortObject port);

          @JsonIgnore
          @GremlinGroovy("it.in('host').in('on')")
          public Iterable<ISwitchObject> getSwitch();
    }


PYTHON OBJECTS  ----> BULBS ----> REXTER ---> Titan Graph DB ---> Cassandra DB

(1) BULBS 将 python 对象转换为 Graphs (2) Rexter 将 Graphs 转换为 JSON (3) Titan 将 JSON 转换回 Graphs?? (4) 并且还写入 cassandra 存储

看起来我正在以一种非常圆滑的方式做事,而我错过了什么?如果有人能指出上述内容有什么问题,那就太好了?

4

1 回答 1

4

您的图表:

PYTHON OBJECTS  ----> BULBS ----> Rexster ---> Titan Graph DB ---> Cassandra DB

取决于您如何看待所涉及的抽象,看起来或多或少是正确的。您也可以将其定义为:

PYTHON OBJECTS  ----> BULBS ----> Rexster/Titan ---> Cassandra DB

由于 Rexster 基本上嵌入了一个 Titan 实例,它通过 REST 公开以供 Bulbs 使用。这部分不太正确:

  1. BULBS 将 python 对象转换为 Graphs
  2. Rexter 将图形转换为 JSON
  3. Titan 将 JSON 转换回 Graphs?
  4. 并且还写信给 cassandra 商店

我会说:

  1. Titan 是写入 Cassandra的蓝图实现
  2. Rexster 托管 Blueprints 实现并使用 JSON 在 REST上公开该 API(和Gremlin )的元素
  3. Bulbs 是 Rexster 上的 Python 对象映射层。

归根结底,从 Python 到 Titan 没有直接连接。Titan 具有基于 JVM 的蓝图接口,并使用 Rexster 作为非 JVM 语言与其对话的一种方式。

于 2014-04-21T10:56:03.400 回答