SpringBoot 项目主机名解析导致启动慢
type
Post
status
Published
date
Jan 2, 2022
slug
summary
错误信息:InetAddress.getLocalHost().getHostName() took 5005 milliseconds to respond
tags
开发工具
category
Bug 记录
icon
password
SpringBoot 版本 2.4.9,macOS 版本 11.2.3
本地启动时速度慢,几秒后才显示 SpringBoot 的 Banner,并在第一行出现 warn 日志
WARN 63469 --- [main] o.s.boot.StartupInfoLogger: InetAddress.getLocalHost().getHostName() took 5003 milliseconds to respond. Please verify your network configuration (macOS machines may need to add entries to /etc/hosts).
大致原因是,获取本机主机地址时,走到了DNS解析,DNS递归解析不到本机域名,耗时5s
[1]刷机基础知识
type
Post
status
Published
date
Dec 16, 2021
slug
summary
tags
category
Android&刷机
icon
password

基本概念

系统相关

权限

Android 系统权限:
Redis/Bitmap类型使用及原理
type
Post
status
Published
date
Dec 12, 2021
slug
summary
介绍 Bitmap 类型基本命令和使用场景
tags
Redis
category
技术分享
icon
password
BitMap 也叫位图
  • 二值统计:集合元素的取值就只有0和1两种,通常用于状态的统计

    原理

    本质是由 0 和 1 两种状态表现组成的二进制位的bit数组,但底层使用 Redis/String 类型实现
    hibernate 接口入参校验
    type
    Post
    status
    Published
    date
    Dec 2, 2021
    slug
    summary
    BO 结合 hibernate 注解来对接口入参进行统一封装校验
    tags
    项目方案
    category
    技术分享
    icon
    password

    介绍

    依赖

    <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-validator</artifactId> <version>5.2.2.Final</version> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-validation</artifactId> </dependency>

    常用注解

    API 统一返回对象的两种定义方式
    type
    Post
    status
    Published
    date
    Nov 22, 2021
    slug
    summary
    介绍 SpringBoot 前后端分离项目中 项目中常用的两种约定 Controller 消息返回结构方式
    tags
    项目方案
    category
    技术分享
    icon
    password
    定义返回 Controller 返回的对象字段和格式,用于统一数据格式,并让 SpringMVC 自动将对象序列化成 JSON 字符串后进行响应

    消息结构固定

    规定消息结构的三个字段:
    • 状态码
    并查集实现
    type
    Post
    status
    Published
    date
    Nov 14, 2021
    slug
    summary
    并查集也叫不相交集合,是一种树状结构,适合解决集合连接等相关问题
    tags
    数据结构
    category
    技术分享
    icon
    password
    并查集也叫不相交集合,适合解决集合连接相关问题

    介绍

    • 并查集解决的问题:
      • 并查集的核心操作:单次调用时时间复杂度 O(1)