[英]Set up Accumulo table through api
new to Accumulo, and this may sound silly, but I was wondering how to setup a table through the api? Accumulo的新功能,这听起来可能很愚蠢,但是我想知道如何通过api设置表格? The documentation is definitely lacking.
绝对缺少该文档。 I have been able to find
我已经能够找到
conn.tableOperations().createTable("myTable");
as well as like setting up locality groups: 以及设置位置组:
HashSet<Text> metadataColumns = new HashSet<Text>();
metadataColumns.add(new Text("domain"));
metadataColumns.add(new Text("link"));
HashSet<Text> contentColumns = new HashSet<Text>();
contentColumns.add(new Text("body"));
contentColumns.add(new Text("images"));
localityGroups.put("metadata", metadataColumns);
localityGroups.put("content", contentColumns);
conn.tableOperations().setLocalityGroups("mytable", localityGroups);
Map<String, Set<Text>> groups =
conn.tableOperations().getLocalityGroups("mytable");
From the documentation, but I want to know how to take the first approach and build the table. 从文档开始,但是我想知道如何采用第一种方法并构建表。 Then build the columns.
然后建立列。
Thanks in advance! 提前致谢!
There is no inherent schema for a table to set up. 表格没有固有的架构。 Once it is created using the API you found, you can insert whatever key-value pairs you wish in it.
一旦使用找到的API创建了密钥,就可以在其中插入任何想要的键值对。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.