如何知道Cosmos中的天鹅座通知表名称? [英] How to know the Cygnus notifications table name in 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:
- 使用您的SSH凭据登录Cosmos头节点.
- 通过键入
hive
调用Hive CLI
- 添加以下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>/';
- 请注意所有实体数据都存储在相同且唯一的Hive表中.这是可能的,因为HDFS文件/配置单元表中的所有行/行都引用属于实体标识符或某种类型的某种类型的属性.
- Log into the Cosmos Head Node using your SSH credentials.
- Invoke the Hive CLI by typing
hive
- 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>/';
- 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.
<myusername>_<mydataset>
.与Cygnus 0.1一样,所有实体数据都存储在相同且唯一的Hive表中.
<myusername>_<mydataset>
. As in Cygnus 0.1, all the entities data is stores within the same and unique Hive table.这篇关于如何知道Cosmos中的天鹅座通知表名称?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!