摘要: 列的详细信息 得到某一行所有数据public static void getRow(String tableName, String rowKey) throws IOException{ HTable table = new HTable(conf, tableName); Get get = n 阅读全文
posted @ 2020-12-02 17:17 Bonnie_ξ 阅读(341) 评论(0) 推荐(0) 编辑
摘要: java 文件上传 private static String uploadFile(File file, String url) { CloseableHttpClient httpClient = null; String result = ""; try { httpClient = Http 阅读全文
posted @ 2020-12-02 16:39 Bonnie_ξ 阅读(196) 评论(0) 推荐(0) 编辑
摘要: Caused by: java.lang.RuntimeException: can not run elasticsearch as root ES不允许以root权限运行 useradd liubei chown liubei elasticsearch-6.1.1 -R su liubei . 阅读全文
posted @ 2020-12-02 16:14 Bonnie_ξ 阅读(274) 评论(0) 推荐(0) 编辑
摘要: es 丢失分片重新获取 curl -XPOST 'localhost:9200/_cluster/reroute?retry_failed' 阅读全文
posted @ 2020-12-02 14:33 Bonnie_ξ 阅读(278) 评论(0) 推荐(0) 编辑
摘要: 调整分页查询数据 company_register_base/_settings?preserve_existing=true 提交方式PUT {"max_result_window":"1000000"} 阅读全文
posted @ 2020-12-02 14:31 Bonnie_ξ 阅读(244) 评论(0) 推荐(0) 编辑
摘要: hbase 查询字段开头 public static List<ContentCommodityDto> loadData(int loadSize) { List<ContentCommodityDto> dataList = new ArrayList<>(); Table table = nu 阅读全文
posted @ 2020-12-02 14:23 Bonnie_ξ 阅读(335) 评论(0) 推荐(0) 编辑
摘要: 可运行jar 打包插件 <build> <finalName>project_name</finalName> <resources> <resource> <directory>src/main/resources</directory> <!-- 资源根目录排除各环境的配置,使用单独的资源目录来 阅读全文
posted @ 2020-12-02 11:43 Bonnie_ξ 阅读(377) 评论(0) 推荐(0) 编辑
摘要: 一. 用hbase自带的mapreduce程序来计算如下, /usr/hdp/2.3.0.0-2557/hbase/bin [root@node1 bin]# ./hbase org.apache.hadoop.hbase.mapreduce.RowCounter 'testtable0728' 阅读全文
posted @ 2020-12-02 11:19 Bonnie_ξ 阅读(250) 评论(0) 推荐(0) 编辑
摘要: hbase and or 连用查询空串空字段 private static void loadAllData2IfStatus(String tableName) { try { Table table = HbaseUtil.getTable(tableName); Scan scan = new 阅读全文
posted @ 2020-12-02 11:06 Bonnie_ξ 阅读(452) 评论(0) 推荐(0) 编辑
摘要: 常用的查询方式类比mysql <dependency> <groupId>org.elasticsearch</groupId> <artifactId>elasticsearch</artifactId> <version>5.6.1</version></dependency><dependen 阅读全文
posted @ 2020-12-02 10:28 Bonnie_ξ 阅读(223) 评论(0) 推荐(0) 编辑
摘要: 搜索匹配所有matchAllQuery、全文查询[matchQuery、multiMatchQuery、commonTerms... 匹配所有 最简单的查询,匹配所有文档,给它们一个_score 1.0。 QueryBuilder qb = matchAllQuery(); 匹配查询:用于执行全文查 阅读全文
posted @ 2020-12-02 10:14 Bonnie_ξ 阅读(311) 评论(0) 推荐(0) 编辑
摘要: 多字段分组并求和;实现sql:select field1, field2, sum(field3) from table_name group by field1, field2; 多字段分组并求和;实现sql:select field1, field2, top(field3) from tabl 阅读全文
posted @ 2020-12-02 09:57 Bonnie_ξ 阅读(193) 评论(0) 推荐(0) 编辑
摘要: /** * 多字段分组并求和;实现sql:select field1, field2, sum(field3) from table_name group by field1, field2; */ public static void twiceAggCount(QueryBuilder quer 阅读全文
posted @ 2020-12-02 09:42 Bonnie_ξ 阅读(3590) 评论(0) 推荐(0) 编辑
摘要: /** * 多字段分组并求和;实现sql:select field1, field2, sum(field3) from table_name group by field1, field2; */ public static void twiceAggSum(QueryBuilder query, 阅读全文
posted @ 2020-12-02 09:36 Bonnie_ξ 阅读(3633) 评论(0) 推荐(0) 编辑
摘要: /** * es 游标获取总数 * * @param tableName 表名 * @param query 查询条件 */ public void esScrollDataHelp(String tableName, QueryBuilder query) { TransportClient cl 阅读全文
posted @ 2020-12-02 09:28 Bonnie_ξ 阅读(137) 评论(0) 推荐(0) 编辑
摘要: /** * 滚动查询 */ @Test public void scroll() { SearchResponse response = client.prepareSearch("twitter").setTypes("tweet") .addSort(SortBuilders.fieldSort 阅读全文
posted @ 2020-12-02 09:24 Bonnie_ξ 阅读(411) 评论(0) 推荐(0) 编辑