- 博客(29)
- 资源 (1)
- 收藏
- 关注
原创 错误: 找不到或无法加载主类 com.zhaopin.hive.udf.BActiveTimeGetJdOnlineCount
程序加载遇到这个问题,该怎么办?费了九牛二虎之力,终于找到解决方案了,哈哈哈哈哈找到 pom.xml 文件 ,找到<dependency> <groupId>org.apache.hive</groupId> <artifactId>hive-exec</artifactId> <version>${hive.version}</version> <scope>pro...
2021-09-26 15:49:47
271
原创 java操作需要用户名密码验证的elasticsearch
给大家一个小例子,按照这样写,添加上用户名和密码就可以了//es 有用户名和密码RestHighLevelClient esClient = null;//初始化ES操作客户端final CredentialsProvider credentialsProvider = new BasicCredentialsProvider();credentialsProvider.setCredentials(AuthScope.ANY, new UsernamePasswordCred.
2021-08-20 15:55:48
1280
原创 elastic search添加密码验证并且使用postman访问带密码的es
1 使用ES自带的XPACK开启密码校验在es7.0版本以后(之前的版本没怎么用过,不太清楚)安装包默认自带了xpack功能,所以只需要在es包下的config目录修改一下es的默认配置文件elasticsearch.yml即可,在elasticsearch.yml中追加写入以下参数xpack.security.enabled: true## 加密方式xpack.license.self_generated.type: basicxpack.security.transport.ssl.e
2021-08-20 15:51:28
1151
转载 解决elasticsearch配置network.host: 0.0.0.0导致elasticsearch服务启动不成功的问题
解决elasticsearch配置network.host: 0.0.0.0导致elasticsearch服务启动不成功的问题一、问题概述本人在本地的虚拟机linux上安装的elasticsearch。当修改 elasticsearch.yml 文件的 network.host: 0.0.0.0 时,引起了一系列异常,导致服务无法成功启动。network.host: 0.0.0.01引起的问题:elasticsearch服务进程启动一会之后,通过jps命令查看到进程关闭,命令行不提示错误。.
2021-08-18 19:48:11
2109
原创 使用Java Api 查询ElasticSearch 索引 每个字段的个数
import com.alibaba.fastjson.JSONObject;import org.apache.http.HttpHost;import org.elasticsearch.action.search.SearchRequest;import org.elasticsearch.action.search.SearchResponse;import org.elasticsearch.client.RequestOptions;import org.elasticsearch..
2021-08-18 16:06:01
545
原创 使用Java Api 查询ElasticSearch 索引 统计个数
统计索引中某个字段的个数public class ESTest_Doc_Query { public static void main(String[] args) throws Exception { //创建ES客户端 RestHighLevelClient esClient = new RestHighLevelClient( RestClient.builder(new HttpHost("localhost",9200,"...
2021-08-17 15:53:14
1611
原创 使用Java Api 查询ElasticSearch 索引 分组查询
public class ESTest_Doc_Query { public static void main(String[] args) throws Exception { //创建ES客户端 RestHighLevelClient esClient = new RestHighLevelClient( RestClient.builder(new HttpHost("localhost",9200,"http")) ...
2021-08-16 20:41:29
367
原创 使用Java Api 查询ElasticSearch 索引 聚合查询
public class ESTest_Doc_Query { public static void main(String[] args) throws Exception { //创建ES客户端 RestHighLevelClient esClient = new RestHighLevelClient( RestClient.builder(new HttpHost("localhost",9200,"http")) ...
2021-08-16 20:34:29
357
原创 多个word文档合成一个word文档,学会这个,再也不用傻傻的耗费时间去复制粘贴了,一键搞定太棒了!
生活中我们常常遇到要将多个文档合成一个文档,如果复制粘贴,需要花费大量的时间,学会这个代码,不管有多少文件,都能一键搞定,快快来看一看吧!import java.io.File;import java.io.FileInputStream;import java.io.FileOutputStream;import java.io.OutputStream;import java.util.ArrayList;import java.util.HashMap;import java.util
2021-08-16 19:57:37
535
原创 使用Java Api 查询ElasticSearch(ES) 索引 高亮查询
public class ESTest_Doc_Query { public static void main(String[] args) throws Exception { //创建ES客户端 RestHighLevelClient esClient = new RestHighLevelClient( RestClient.builder(new HttpHost("localhost",9200,"http")) ...
2021-08-16 10:43:27
399
原创 Java Api elasticsearch 模糊查询
public class ESTest_Doc_Query { public static void main(String[] args) throws Exception { //创建ES客户端 RestHighLevelClient esClient = new RestHighLevelClient( RestClient.builder(new HttpHost("localhost",9200,"http")) ...
2021-08-13 20:39:02
638
原创 Java Api elasticsearch 范围查询
public class ESTest_Doc_Query { public static void main(String[] args) throws Exception { //创建ES客户端 RestHighLevelClient esClient = new RestHighLevelClient( RestClient.builder(new HttpHost("localhost",9200,"http")) ...
2021-08-13 20:12:54
892
原创 Java Api elasticsearch 组合查询
public class ESTest_Doc_Query { public static void main(String[] args) throws Exception { //创建ES客户端 RestHighLevelClient esClient = new RestHighLevelClient( RestClient.builder(new HttpHost("localhost",9200,"http")) ...
2021-08-13 20:09:54
208
原创 Java Api elasticsearch 过滤查询
public class ESTest_Doc_Query { public static void main(String[] args) throws Exception { //创建ES客户端 RestHighLevelClient esClient = new RestHighLevelClient( RestClient.builder(new HttpHost("localhost",9200,"http")) ...
2021-08-13 20:05:01
298
原创 Java Api elasticsearch 查询排序
这里按照年龄降序排序public class ESTest_Doc_Query { public static void main(String[] args) throws Exception { //创建ES客户端 RestHighLevelClient esClient = new RestHighLevelClient( RestClient.builder(new HttpHost("localhost",9200,"ht...
2021-08-13 20:01:05
531
原创 Elasticsearch--JAVA API 分页查询
查询页码及页码所展示的条数public class ESTest_Doc_Query { public static void main(String[] args) throws Exception { //创建ES客户端 RestHighLevelClient esClient = new RestHighLevelClient( RestClient.builder(new HttpHost("localhost",9200,...
2021-08-13 15:57:25
789
原创 使用Java Api 查询ElasticSearch 索引 条件查询
查询 索引 user 中 年龄 为 30 岁的信息public class ESTest_Doc_Query { public static void main(String[] args) throws Exception { //创建ES客户端 RestHighLevelClient esClient = new RestHighLevelClient( RestClient.builder(new HttpHost("loc...
2021-08-13 10:54:23
674
1
原创 使用Java Api 查询ElasticSearch 索引中的全部数据
public class ESTest_Doc_Query { public static void main(String[] args) throws Exception { //创建ES客户端 RestHighLevelClient esClient = new RestHighLevelClient( RestClient.builder(new HttpHost("localhost",9200,"http")) ...
2021-08-13 10:50:36
9984
2
原创 Java Api 更新ES索引
更新索引 user 下,id:1002 的性别,将“男” 更新为“女”import org.apache.http.HttpHost;import org.elasticsearch.action.update.UpdateRequest;import org.elasticsearch.action.update.UpdateResponse;import org.elasticsearch.client.RequestOptions;import org.elasticsearch.cl.
2021-08-12 15:26:03
725
原创 Java Api删除ES索引
删除一个user 索引:import org.apache.http.HttpHost;import org.elasticsearch.action.admin.indices.delete.DeleteIndexRequest;import org.elasticsearch.action.support.master.AcknowledgedResponse;import org.elasticsearch.client.RequestOptions;import org.elastics.
2021-08-12 14:03:05
1329
原创 Java Api 查询ES索引
import org.apache.http.HttpHost;import org.elasticsearch.client.RequestOptions;import org.elasticsearch.client.RestClient;import org.elasticsearch.client.RestHighLevelClient;import org.elasticsearch.client.indices.GetIndexRequest;import org.elasticse.
2021-08-12 13:59:29
1745
1
原创 java Api 实现创建elasticsearch 索引
创建一个索引名为:user 的ES索引:import org.apache.http.HttpHost;import org.elasticsearch.client.RequestOptions;import org.elasticsearch.client.RestClient;import org.elasticsearch.client.RestHighLevelClient;import org.elasticsearch.client.indices.CreateIndexRequ.
2021-08-12 13:56:20
241
原创 Flink DataStream API详解
Flink API介绍Flink提供了三层API,每层在简洁性和表达性之间进行了不同的权衡。flink-apiProcessFunction是Flink提供的最具表现力的功能接口,它提供了对时间和状态的细粒度控制,能够任意修改状态。所以ProcessFunction能够为许多有事件驱动的应用程序实现复杂的事件处理逻辑。DataStream API为许多通用的流处理操作提供原语,比如window。DataStream API适用于Java和Scala,它基于函数实现,比如map()、redu
2021-08-07 11:59:44
607
原创 Flink 理论--流处理 API Source 从文本读取数据
创建一个实体类public class SensorTemperature { private String id; private Long timesatmp; private Double temperature; public SensorTemperature() { } public SensorTemperature(String id, Long timesatmp, Double temperature) { thi.
2021-08-06 15:40:38
195
原创 flink 用文本文件模拟数据集
import org.apache.flink.api.common.functions.FlatMapFunction;import org.apache.flink.api.java.DataSet;import org.apache.flink.api.java.ExecutionEnvironment;import org.apache.flink.api.java.tuple.Tuple2;import org.apache.flink.util.Collector;public c
2021-08-06 15:29:23
144
原创 使用文本文件模拟Flink数据流
import org.apache.flink.api.common.functions.FlatMapFunction;import org.apache.flink.api.java.tuple.Tuple2;import org.apache.flink.streaming.api.datastream.DataStream;import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;import o
2021-08-06 15:24:02
271
原创 JAVA 中文乱码转换
package com.zhaopin.udf;import org.apache.commons.codec.DecoderException;import org.apache.commons.codec.binary.Hex;import java.io.IOException;public class Test { public static void main(String[] args) throws IOException, DecoderException { .
2021-08-05 15:28:48
7383
原创 如何快速获取目录下所有的文件名?学会这个java程序,轻松搞定,老板都要给你加薪!
import org.apache.commons.lang.StringUtils;import java.io.File;import java.util.ArrayList;//读取文件夹下的所有文件名public class ReadFileName { public static String path="D:\\output"; //需要读取的目录路径 public static void main(String[] args) { ArrayL.
2021-08-05 15:02:50
162
原创 不要傻傻充钱去 PDF转word了!学会这个 100%免费,老公都夸你会过日子!!!
import com.spire.pdf.*;import java.io.File;import java.util.ArrayList;public class ToPdf { public static String input_path = "D:\\pdf转word"; // 输入路径 public static String output_path = "D:\\output"; // 输出路径 public static void main(String[...
2021-08-05 11:31:08
108
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人