如何知道Cosmos中的天鹅座通知表名称? [英] How to know the Cygnus notifications table name in Cosmos?

查看:64
本文介绍了如何知道Cosmos中的天鹅座通知表名称?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Cygnus通过httpfs将Orion Context Broker通知发送到Cosmos.

I'm using Cygnus to send Orion Context Broker notifications to Cosmos via httpfs.

Hive历史记录中发送到Cosmos的数据存储在哪里?存储天鹅座数据的表的名称是什么?

Where are stored the data sent to Cosmos in the Hive history? What's the name of the table where Cygnus data are stored?

推荐答案

Cygnus在Cosmos中保留的Orion上下文数据存储在纯文本HDFS文件中.如果文件结构正确,则可以将其内容加载到Hive表中,可以使用类似SQL的语言HiveQL对其进行查询.

The Orion context data persisted by Cygnus in Cosmos is stored in plain text HDFS files. The content of this files, if properly structured, can be loaded into Hive tables which can be queried by using HiveQL, a SQL-like language.

创建Hive表的方式取决于您使用的Cygnus版本:

The way the Hive tables are created depends on the Cygnus version you are using:

  • Cygnus 0.1 :您必须自己创建Hive外部表.为了做到这一点:
  • Cygnus 0.1: you have to create the Hive external table by yourself. In order to do that:
  1. 使用您的SSH凭据登录Cosmos头节点.
  2. 通过键入hive
  3. 调用Hive CLI
  4. 添加以下HiveQL句子:
    create external table <table_name> (recvTimeTs bigint, recvTime string, entityId string, entityType string, attrName string, attrType string, attrValue string) row format delimited fields terminated by '|' location '/user/<myusername>/<mydataset>/';
  5. 请注意所有实体数据都存储在相同且唯一的Hive表中.这是可能的,因为HDFS文件/配置单元表中的所有行/行都引用属于实体标识符或某种类型的某种类型的属性.
  1. Log into the Cosmos Head Node using your SSH credentials.
  2. Invoke the Hive CLI by typing hive
  3. Add the following HiveQL sentence:
    create external table <table_name> (recvTimeTs bigint, recvTime string, entityId string, entityType string, attrName string, attrType string, attrValue string) row format delimited fields terminated by '|' location '/user/<myusername>/<mydataset>/';
  4. Please observe all the entities data is stored within the same and unique Hive table. This is possible because all the lines/rows within HDFS files/Hive table refer to an attribute of certain type belonging to an entity identifier or certain type.

  • Cygnus 0.2 :上面的Hive外部表是自动创建的.表名称是<myusername>_<mydataset>.与Cygnus 0.1一样,所有实体数据都存储在相同且唯一的Hive表中.
  • Cygnus 0.3或更高版本:在撰写此回复时,尚未发布Cygnus 0.3,但在此版本中,Orion数据将不会通过添加新行/行而专门保留每个属性,并且有望添加包含完整实体属性列表的新行/行.在这种情况下,由于行/行的维数可能不相同,因此会禁止为每个实体创建一个Hive表.
  • Cygnus 0.2: the above Hive external table is automatically created. The table name is <myusername>_<mydataset>. As in Cygnus 0.1, all the entities data is stores within the same and unique Hive table.
  • Cygnus 0.3 or greater: at the moment of writing this response, Cygnus 0.3 has not yet been released, but within such release the Orion data will not be exclusively persisted by adding a new line/row per each attribute, and the possibility to add new lines/rows containing full entity's attribute list is expected. In that case, due to the lines/rows may not have the same dimenssion, it is envioned a Hive table is created per each entity.
  • 这篇关于如何知道Cosmos中的天鹅座通知表名称?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆