自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

UckyK的专栏

一个现学现卖的程序员

  • 博客(114)
  • 资源 (1)
  • 收藏
  • 关注

原创 zuul1网关zuulFallBackProvider无效问题

这种方式只适用于eureka,不适用于url方式

2020-08-03 17:35:55 942

原创 为什么同一服务有的机器内存使用率高,有的内存使用率较低?读kafka

背景:一个服务6台实例,4台内存使用率较低,另外2台使用率较高,导致出现一些问题, 该服务为zipkin-server服务,收集从kafka传入的数据,并进行处理。内存使用率如图,2台明显内存利用率较高,另外4台内存利用率则很低,最后问题定位到,kafka的topic的partion上,查阅相关资料总结topic 为逻辑概念,生产者只需要确定讲生...

2020-03-24 11:31:32 555

原创 【Zipkin】zipkin-dependencies计算 - 源码解析

zipkin-dependencies离线计算拓扑图依赖本文分析mysql存储(后续准备接入Doris直接计算依赖关系,所以分析不关注存储)查找main方法 ZipkinDependenciesJobcase "mysql": MySQLDependenciesJob.builder() .logInitializer(logInitializer...

2020-01-17 16:36:10 582

原创 【Git】git package时失败 Some files do not have the expected license header

背景:从github下载的代码,git package时失败报错错误如下:[INFO] ------------------------------------------------------------------------[INFO] BUILD FAILURE[INFO] --------------------------------------------------...

2020-01-09 11:00:45 1745

原创 【Git】git reabse 实战演练

背景:新分支dev,然后其他同事上传master代码,多以master领先dev一个版本,使用merge会污染commit记录,想要保持一份干净的commit,git rebase就派上用场了如图,我们在主干master上拉去新的dev分支开发,另外一个团队在主干上修复新的BUG存在问题:dev分支是有bug的,直接merge会污染commit(两条线)解决...

2020-01-08 22:35:02 306 2

原创 【zipkin】kafka对接zipkin(kafka)

环境准备以kafka的方式导入property配置# kafka集群地址spring.kafka.bootstrap-servers=你的kafka地址# kafka的topic,默认则为zipkinspring.zipkin.kafka.topic=zzzzipkin# 不配置则使用httpspring.zipkin.sender.type=kafkapom配置...

2019-12-31 18:16:20 2045

原创 四种常见线程池的详解

四种常用线程池介绍与使用场景1、FixedThreadPool2、CachedThreadPool3、SingleThreadExecutor4、ScheduledThreadPoolExecutor一、FixedThreadPoolpublic static ExecutorService newFixedThreadPool(int nThreads){ ...

2019-12-02 19:07:55 453

原创 ReenTrantLock源码详细分析

前一部分详细分析了AQS的源码,这一章节来梳理分析ReenTrantLock源码(可重入独占锁,可重入互斥锁)public class ReentrantLock implements Lock, java.io.Serializable {}ReentrantLock实现Lock接口,以及Serializable可序列化接口。可重入独占锁的意思是:1、同一时间只能有一个线程持...

2019-12-02 16:17:47 177

原创 LockSupport源码详细分析

一. LockSupport类介绍前面分析中,阻塞和唤醒线程都会使用到LockSupport工具来完成相应工作,LockSupport定义了一组公共静态方法,这些方法提供了最基本的线程阻塞和唤醒公共,而LockSupport也成为构建同步组件的基础工具。LockSupport定义了一组以park开头的方法用来阻塞当前线程,以及upark方法用来唤醒线程。这些方法如下所示:方法名称...

2019-12-02 15:29:34 248

原创 AbstractQueuedSynchronizer源码详细分析【Condition条件】

AQS是JUC锁框架中最重要的类,通过它来实现独占锁和共享锁的。本章是对AbstractQueuedSynchronizer源码的完全解析,分为四个部分介绍:CLH队列即同步队列:储存着所有等待锁的线程 独占锁 共享锁 Condition条件注: 还有一个AbstractQueuedLongSynchronizer类,它与AQS功能和实现几乎一样,唯一不同的是AQLS中代表...

2019-12-01 18:29:24 247

原创 AbstractQueuedSynchronizer源码详细分析【共享锁】

AQS是JUC锁框架中最重要的类,通过它来实现独占锁和共享锁的。本章是对AbstractQueuedSynchronizer源码的完全解析,分为四个部分介绍:CLH队列即同步队列:储存着所有等待锁的线程 独占锁 共享锁 Condition条件注: 还有一个AbstractQueuedLongSynchronizer类,它与AQS功能和实现几乎一样,唯一不同的是AQLS中代表...

2019-12-01 16:25:47 142

原创 AbstractQueuedSynchronizer源码详细分析【独占锁】

AQS是JUC锁框架中最重要的类,通过它来实现独占锁和共享锁的。本章是对AbstractQueuedSynchronizer源码的完全解析,分为四个部分介绍:CLH队列即同步队列:储存着所有等待锁的线程 独占锁 共享锁 Condition条件注: 还有一个AbstractQueuedLongSynchronizer类,它与AQS功能和实现几乎一样,唯一不同的是AQLS中代表...

2019-11-30 20:09:25 186

原创 AbstractQueuedSynchronizer源码详细分析【CLH队列】

AQS是JUC锁框架中最重要的类,通过它来实现独占锁和共享锁的。本章是对AbstractQueuedSynchronizer源码的完全解析,分为四个部分介绍:CLH队列即同步队列:储存着所有等待锁的线程 独占锁 共享锁 Condition条件注: 还有一个AbstractQueuedLongSynchronizer类,它与AQS功能和实现几乎一样,唯一不同的是AQLS中代表...

2019-11-29 17:52:02 390 2

原创 责任链模式应用 - 简易DEMO

开篇:有一阵子没接触代码了,最近在找工作在疯狂复习,复习了一下设计模式,因为项目以前用到责任链模式(当时不是我写的),所以这次复习就特意看了一下,然后看到了一道题问题:从字典里面选出符合以下三个条件的字符串,(1)包含a或者b或者cd (2)以end结尾 (3)长度大于正常情况3个if判断搞定的超级简单问题吧如果(1)(2)(3)是非常复杂的判断 如果字段一些字符串要匹配...

2019-10-11 15:50:40 409

转载 计算字符串相似度算法——Levenshtein

原文地址 :https://blog.csdn.net/wdhdmx/article/details/841280770.这个算法实现起来很简单1.百度百科介绍:Levenshtein 距离,又称编辑距离,指的是两个字符串之间,由一个转换成另一个所需的最少编辑操作次数。许可的编辑操作包括将一个字符替换成另一个字符,插入一个字符,删除一个字符。编辑距离的算法是首先由俄国...

2019-10-10 11:44:33 392

转载 【分库分表】sharding-jdbc—分片策略

一、分片策略Sharding-JDBC认为对于分片策略存有两种维度:数据源分片策略(DatabaseShardingStrategy):数据被分配的目标数据源 表分片策略(TableShardingStrategy):数据被分配的目标表两种分片策略API完全相同,但是表分片策略是依赖于数据源分片策略的(即:先分库然后才有分表)二、分片算法Sharding分片策略继承自Sha...

2019-04-08 16:05:14 1166

原创 分页查询多类数据且不同排序规则(解决方案)

开篇:最近做了一个需求分享一下思路,加急数据按照时间降序排列并且置顶,非加急的按照升序排列,属于讲两类数据按照不同排序规则进行分页查询问题,具体需求如图所示;刚接触需求的时候感觉也就那么回事吧!还行,不难!就是一个分页呗!进入详细设计的我眉头一皱!发现问题没这么简单,最开始考虑无非就是把数据按照查出来再重排序呗,后来经过反复推敲不行,分页是个问题,在数据量小的时候我...

2019-03-27 01:33:47 1061

原创 Spring AOP实现原理(JAVA动态代理)

开篇:最近重新学习Spring,看到书中提到 "因为Spring基于动态代理,所以Spring只支持方法连接点。",动态代理熟悉而又陌生的词,还记得大学时候,还花了好打的功夫去了解这个东西,工作快2年了,这方面的东西也基本都快忘没了(真的用不到啊),但是为了更好的去学习Spring,不单单是学会怎么用,也要了解其原理到底如何(面试时候可能问吧?谁知道呢!),也查了好多资料,自己简单的整理一份。...

2019-03-24 01:54:59 284

原创 JAVA自定义注解实现SQL语句自动生成DEMO(2)

上一篇:http://blog.csdn.net/uckyk/article/details/76619013SqlUtil增添了一个新功能,就是自动生成sql时候,传入已经定义好的对象,即可获得inser语句(带值)上代码!package com.ucky.annotation.hibernate;import java.lang.reflect.Field;impor

2017-08-03 19:58:24 1506

原创 JAVA自定义注解实现SQL语句自动生成DEMO

缘起:好久没写博客了,最近工作写了一些,服务的接口,自己写白盒测试进行测试,全部通过, 但是部署到线上会导致一些服务调不通追下问题,发现是自己粗心忘记加了一些注解, 最后把注解加上了,BUG消除,仔细思考一下,自己对注解知知甚少。Java注解:     1、@Target     2、@Retention     3、@Documente

2017-08-03 15:03:59 2029

转载 一个例子让你了解Java反射机制

Java反射机制:通俗地说,反射机制就是可以把一个类、类的成员(函数、属性),当成一个对象来操作,希望读者能理解,也就是说,类、类的成员,我们在运行的时候还可以动态地去操作他们.理论的东东太多也没用,下面我们看看实践 Demo ~package demo.reflect;import java.lang.reflect.*;public class ReflectDemo {

2016-10-24 14:01:09 444

转载 Java对象池技术的原理及其实现

摘 要 本文在分析对象池技术基本原理的基础上,给出了对象池技术的两种实现方式。还指出了使用对象池技术时所应注意的问题。  关键词 对象池;对象池技术;Java 对象;性能  Java对象的生命周期分析  Java对象的生命周期大致包括三个阶段:对象的创建,对象的使用,对象的清除。因此,对象的生命周期长度可用如下的表达式表示:T = T1 + T2 +T3.其中T1表示对象的

2016-09-26 14:46:33 601

原创 LeetCode 175 -Combine Two Tables ( MYSQL )

Table: Person+-------------+---------+| Column Name | Type |+-------------+---------+| PersonId | int || FirstName | varchar || LastName | varchar |+-------------+---------+Per

2016-04-16 10:45:07 1154 3

原创 LeetCode 182 -Duplicate Emails ( MYSQL )

Write a SQL query to find all duplicate emails in a table named Person.+----+---------+| Id | Email |+----+---------+| 1 | [email protected] || 2 | [email protected] || 3 | [email protected] |+----+---------+For

2016-04-16 10:21:47 585

原创 LeetCode 181 -Employees Earning More Than Their Managers ( MYSQL )

The Employee table holds all employees including their managers. Every employee has an Id, and there is also a column for the manager Id.+----+-------+--------+-----------+| Id | Name | Salary |

2016-04-16 09:59:02 697

原创 LeetCode 83 -Remove Duplicates from Sorted List ( JAVA )

Given a sorted linked list, delete all duplicates such that each element appear only once.For example,Given 1->1->2, return 1->2.Given 1->1->2->3->3, return 1->2->3./** * Definition f

2016-04-15 16:57:35 571

原创 LeetCode 22 -Generate Parentheses ( JAVA )

Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.For example, given n = 3, a solution set is:"((()))", "(()())", "(())()", "()(())", "()()

2016-04-15 16:18:56 673

原创 LeetCode 141 -Linked List Cycle ( JAVA )

Given a linked list, determine if it has a cycle in it.Follow up:Can you solve it without using extra space?/** * Definition for singly-linked list. * class ListNode { * int val

2016-04-14 13:45:44 768

原创 LeetCode 35 -Search Insert Position ( JAVA )

Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order.You may assume no duplicates in the array.

2016-04-12 14:30:07 907

原创 LeetCode 338 -Counting Bits ( JAVA )

Given a non negative integer number num. For every numbers i in the range 0 ≤ i ≤ num calculate the number of 1's in their binary representation and return them as an array.Example:For num = 5

2016-04-11 17:50:48 1204

原创 LeetCode 230 -Kth Smallest Element in a BST ( JAVA )

Given a binary search tree, write a function kthSmallest to find the kth smallest element in it.Note: You may assume k is always valid, 1 ≤ k ≤ BST's total elements.Follow up:What if the

2016-04-11 17:33:01 924

原创 LeetCode 137 -Single Number II ( JAVA )

Given an array of integers, every element appears three times except for one. Find that single one.Note:Your algorithm should have a linear runtime complexity. Could you implement it without u

2016-04-11 15:54:35 832

原创 LeetCode 328 -Odd Even Linked List ( JAVA )

Given a singly linked list, group all odd nodes together followed by the even nodes. Please note here we are talking about the node number and not the value in the nodes.You should try to do it in

2016-04-11 15:41:01 606

原创 LeetCode 191 -Number of 1 Bits ( JAVA )

Write a function that takes an unsigned integer and returns the number of ’1' bits it has (also known as the Hamming weight).For example, the 32-bit integer ’11' has binary representation 000000

2016-04-11 12:50:50 1328 2

原创 LeetCode 235 -Lowest Common Ancestor of a Binary Search Tree ( JAVA )

Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BST.According to the definition of LCA on Wikipedia: “The lowest common ancestor is defined betw

2016-04-11 11:54:10 544

原创 LeetCode 287 -Find the Duplicate Number ( JAVA )

Given an array nums containing n + 1 integers where each integer is between 1 and n (inclusive), prove that at least one duplicate number must exist. Assume that there is only one duplicate number,

2016-04-11 11:05:09 862

原创 LeetCode 12 -Integer to Roman ( JAVA )

Given an integer, convert it to a roman numeral.Input is guaranteed to be within the range from 1 to 3999.public class Solution { public String intToRoman(int num) { String s

2016-04-10 20:20:20 1002

原创 LeetCode 13 -Roman to Integer ( JAVA )

Given a roman numeral, convert it to an integer.Input is guaranteed to be within the range from 1 to 3999.public class Solution { public int romanToInt(String s) { HashMap ma

2016-04-10 19:45:23 755

原创 LeetCode 206 -Reverse Linked List 单链表翻转问题 ( JAVA )

Reverse a singly linked list.click to show more hints.Subscribeto see which companies asked this question/** * Definition for singly-linked list. * public class ListNode { * int v...

2016-04-10 17:15:03 547

原创 LeetCode 154 -Binary Tree Postorder Traversal ( JAVA )

Given a binary tree, return the postorder traversal of its nodes' values.For example:Given binary tree {1,#,2,3}, 1 \ 2 / 3return [3,2,1]./** * Definiti

2016-04-10 14:44:52 443

利用JAVA注解与反射 - 实现SQL语句自动生成

利用JAVA注解实现SQL语句自动生成 编写对应Entity添加相关注解,并通过SqlUtil工具,传入相关参数生成SQL语句 例如:要生成对应数据库Person的SQL增删改查 SqlUtil.create(Person.class) SqlUtil.insert(Person.class) SqlUtil.insert(Person.class,person) SqlUtil.updateById(Person.class,person) SqlUtil.deleteById(Person.class,person) 开发工具IDEA,MAVEN项目

2017-08-04

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除