- 博客(82)
- 收藏
- 关注
原创 【无标题】
<dependency> <groupId>c3p0</groupId> <artifactId>c3p0</artifactId> <version>0.9.1.2</version> </dependency> <!-- https://mvnrepository.com/artifact/mysql...
2022-03-07 22:22:48 2190
原创 flinkScala
package com. gu.networkflow_analysisimport java.sql.Timestampimport java.text.SimpleDateFormatimport org.apache.flink.api.common.functions.AggregateFunctionimport org.apache.flink.api.common.state.{ListState, ListStateDescriptor, MapState, MapStateD
2021-12-08 21:20:51 2863
转载 flink批处理
### 4.1 State#### 4.1.1 state概述**Apache Flink® — Stateful Computations over Data Streams**回顾单词计数的例子~~~java/** * 单词计数 */public class WordCount { public static void main(String[] args) throws Exception { StreamExecutionEnvironment e..
2021-12-08 00:02:37 1413
原创 flink流处理
<?xml version="1.0" encoding="UTF-8"?>-<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0">
2021-12-07 23:44:13 1976
原创 hive优化
1 慎用api count(distinct)2 sum,count,max,min等UDAF,不怕数据倾斜问题,hadoop在map端汇总合并优化3 设置合理的map reduce的task数量mapred.min.split.size: 指的是数据的最小分割单元大小;min的默认值是1Bmapred.max.split.size: max的默认值是256MB通过以下方法来在map执行前合并小文件,减少map数:set mapred.max.split.size=100000000;se
2021-01-22 10:40:15 188
原创 处理魔法值
使用static final 定义常量或使用enum值public static final String DANGERKEY_TRUE ="1"; if(DANGERKEY_TRUE.equals(dangerKey)){ BigDecimal warningValue = new BigDecimal(JedisUtils.get(WARNING_VALUE_KEY)); model.addAttribute("isDanger", true); model.addAttribut
2021-01-21 09:45:09 146
原创 Bug管理
Bug严重程度和优先级bug两个重要属性就是优先级(Priority)和严重性(Severity)。通常Bug管理系统将严重性分为五个等级:Blocker、Critical、Major、Normal、Minor、Trivial。将优先级分为Immediate、Urgent、High、Normal、Low。Bug的严重程度(Severity)1.Blocker:即系统无法执行、崩溃或资源严重不足、应用模块无法启动或异常退出、无法测试、造成系统不稳定。2.Critical:即影响系统功能或操作,主要
2021-01-21 09:41:56 264
原创 分布式锁
@AutowiredTaskRunnableServiceImpl taskRunnableService;@Override@Transactional(rollbackFor = Throwable.class)public void doJourneyTask() { Map<String, Object> sqlParams = Maps.newHashMap(); sqlParams.put("nowDateTime", DateTimeUtils.curren
2021-01-16 15:50:38 110
原创 java实现考勤机信息同步
/*** 更新传感器的用户信息** @param sensorNumber* @param attendanceEmployeeVos*/private synchronized void initializeAdd(String sensorNumber, List attendanceEmployeeVos) {if (attendanceEmployeeVos != null && attendanceEmployeeVos.size() > 0) {String
2020-12-29 09:39:57 535
原创 2020-12-29
public static ArrayList readExcel2(MultipartFile excel, Class clazz) {try {InputStream in = new BufferedInputStream(excel.getInputStream());GeneralExcelListener listener = new GeneralExcelListener<>();ExcelReader excelReader = new ExcelReader(in
2020-12-29 09:36:28 117
原创 mybatis=<>的写法
mybatis=<>的写法第一种写法(1):原符号 < <= > >= & ’ "替换符号 < <= > >= & ’ "例如:sql如下:create_date_time >= #{startTime} and create_date_time <= #{endTime}第二种写法(2):大于等于<![CDATA[ >= ]]>小于等于<![CDATA[ <= ]]&g
2020-11-25 14:15:32 12994
原创 两阶段聚合(局部聚合+全局聚合)
// 第一步,给RDD中的每个key都打上一个随机前缀。JavaPairRDD<String, Long> randomPrefixRdd = rdd.mapToPair( new PairFunction<Tuple2<Long,Long>, String, Long>() { private static final long serialVersionUID = 1L; @Override
2020-11-19 18:54:39 759 1
原创 Async
@Async介绍在Spring中,基于@Async标注的方法,称之为异步方法;这些方法将在执行的时候,将会在独立的线程中被执行,调用者无需等待它的完成,即可继续其他的操作。
2020-11-18 17:45:58 104
原创 根据经纬度显示地图轨迹
后端代码public boolean saveCarGPSData(CarGPSReqVo carGPSReqVo) { Map<String,String> params=new HashMap<>(2); params.put("key",trsConfig.getCarGPS_key()); params.put("coorType",carGPSReqVo.getCoorType()); params.put(
2020-11-07 17:44:26 1611 1
原创 @EnableTransactionManagement
@GetMapping("/saveData") @ApiOperation("传感器数据上云-红外测温及气体") @Transactional(rollbackFor = Exception.class) public WebResult saveData(InfrareDataReqVo infrareDataReqVo){ try { PigHeatEntity pigHeatEntity=new PigHeatEntity();
2020-11-07 16:19:08 517
原创 springboot+事务,多张表的操作事务回滚
第一步,在springboot的启动类上开启事务,注解@EnableTransactionManagement第二步:事务注解,回滚@Transactional(rollbackFor = Exception.class)//@Transactional和try catch捕获异常会让注解失效,所以:第三步:在catch语句块中添加TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();...
2020-11-07 14:58:04 1610
原创 HttpUtil
@Override public boolean saveTrsWenduData(TrsWenduReqVo trsWenduReqVo) { Map<String,String> params=new HashMap<>(2); params.put("fgs",trsWenduReqVo.getFgs()); params.put("access",trsWenduReqVo.getAccess()); p
2020-11-03 11:47:25 73
原创 PageUtil
@Override public PageUtil getTrsWenduList(TrsWenduQueryReqVo trsWenduQueryReqVo) { if (trsWenduQueryReqVo.getPageNum()==null||trsWenduQueryReqVo.getPageSize()==null||trsWenduQueryReqVo.getPageNum()==0||trsWenduQueryReqVo.getPageSize()==0){
2020-11-03 11:46:27 366
原创 PageUtil
@Data@NoArgsConstructorpublic class PageUtil implements Serializable { private static final long serialVersionUID = 1L; /** * 总记录数 */ private int totalCount; /** * 每页记录数 */ private int pageSize; /** * 总页数
2020-11-03 11:45:28 313
原创 2020-09-28
Mybatis中#{}和${}1、#{}将传入的数据都当成一个字符串,会对自动传入的数据加一个引号(单引号?双引号?加了引号就对了)如://传入的值是sexorder by #{column}解析后为order by “sex” //将会出错2、${}将传入的数据直接显示生成在sql中,如://传入的值是sexorder by ${column}解析后为order by sex //正确的3、#{}可以在很大程度上防止sql注入,${}无法防止sql注入4、${}一般用于传入数据库对
2020-09-28 10:01:39 122
原创 2020-09-23
insert into table ads_user_action_convert_dayselect‘2019-02-10’,uv.day_count,ua.order_count,cast(ua.order_count/uv.day_count as decimal(10,2)) visitor2order_convert_ratio,ua.payment_count,cast(ua.payment_count/ua.order_count as decimal(10,2)) orde
2020-09-23 17:25:33 58
原创 2020-09-22
tail:-n 是显示行号;相当于nl命令;例子如下:tail -100f test.log 实时监控100行日志tail -n 10 test.log 查询日志尾部最后10行的日志; tail -n +10 test.log 查询10行之后的所有日志;head: 跟tail是相反的,tail是看后多少行日志;例子如下: head -n 10 test.log 查询日志文件中的头10行日志; hea
2020-09-22 16:24:01 69
原创 2020-09-21
columns has 234 elements while hbase.columns.mapping has 92 elements (counting the key if implicit))根本原因:对于4000个字符,hive Metastore中SERDE_PARAMS表中PARAM_VALUE字段的字符限制是此问题的根本原因。此限制可防止Hive创建具有高列数的表,最终导致desc或select * from失败并出现上述错误。解决方法:通过在hive Metastore中执行以下操
2020-09-21 13:34:45 81
原创 2020-09-21
SELECTsum(to_number(“info”.“collector_count”)) as collector_count,sum(to_number(“info”.“order_count”)) as order_count,sum(to_number(“info”.“order_count”))/sum(to_number(“info”.“collector_count”)) as collect2order_convert_ratio,sum(to_number(“info”.“pay
2020-09-21 11:46:37 60
原创 2020-09-21
经过测试,需要把集群中的hosts配置到本地的hosts,windows的hosts文件在C:\Windows\System32\drivers\etc\hosts192.168.1.110 master192.168.1.111 slave1
2020-09-21 11:17:05 60
原创 华为云maven
<server> <id>huaweicloud</id> <username>anonymous</username> <password>devcloud</password></server><mirror> <id>huaweicloud</id> <mirrorOf>*</mirrorOf>
2020-09-19 16:18:38 323
原创 2020-09-17
selectsum(to_number("info"."collector_count")) as collector_count,sum(to_number("info"."order_count")) as order_count,sum(to_number("info"."collect2order_convert_ratio")) as collect2order_convert_ratio,sum(to_number("info"."payment_count")) as paymen
2020-09-17 17:20:05 47
原创 2020-09-15
drop table if exists ads_meijia_user_portrayal;CREATE TABLE `ads_meijia_user_portrayal`( `userid` string COMMENT '', `sex` string COMMENT '', `birthdaytime` string COMMENT '', `servicearea` string COMMENT '', `shop_industries` string COMMENT '
2020-09-15 14:48:05 51
原创 2020-09-15
drop table if exists ads_meijia_user_portrayal;CREATE TABLE `ads_meijia_user_portrayal`( `userid` string COMMENT '', `sex` string COMMENT '', `birthdaytime` string COMMENT '', `servicearea` string COMMENT '', `shop_industries` string COMMENT '
2020-09-15 10:40:16 69
原创 grouping__id
selectmonth,day,count(distinct cookieid) as uv,GROUPING__IDfrom cookie.cookie5group by month,daygrouping sets (month,day)order by GROUPING__ID;SELECT month,NULL,COUNT(DISTINCT cookieid) AS uv,1 AS GROUPING__ID FROM cookie5 GROUP BY monthUNION ALL
2020-09-09 13:58:47 292
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人