add file
This commit is contained in:
22
.obsidian/workspace.json
vendored
22
.obsidian/workspace.json
vendored
@@ -34,6 +34,7 @@
|
||||
}
|
||||
}
|
||||
],
|
||||
"currentTab": 1,
|
||||
"stacked": true
|
||||
}
|
||||
],
|
||||
@@ -84,8 +85,7 @@
|
||||
}
|
||||
],
|
||||
"direction": "horizontal",
|
||||
"width": 300,
|
||||
"collapsed": true
|
||||
"width": 300
|
||||
},
|
||||
"right": {
|
||||
"id": "572110f2baf458e8",
|
||||
@@ -101,7 +101,7 @@
|
||||
"state": {
|
||||
"type": "backlink",
|
||||
"state": {
|
||||
"file": "代码规范/代码规范.md",
|
||||
"file": "并发.md",
|
||||
"collapseAll": false,
|
||||
"extraContext": false,
|
||||
"sortOrder": "alphabetical",
|
||||
@@ -126,7 +126,7 @@
|
||||
"state": {
|
||||
"type": "outgoing-link",
|
||||
"state": {
|
||||
"file": "代码规范/代码规范.md",
|
||||
"file": "并发.md",
|
||||
"linksCollapsed": false,
|
||||
"unlinkedCollapsed": true
|
||||
}
|
||||
@@ -149,7 +149,7 @@
|
||||
"state": {
|
||||
"type": "outline",
|
||||
"state": {
|
||||
"file": "代码规范/代码规范.md"
|
||||
"file": "并发.md"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -183,10 +183,13 @@
|
||||
"command-palette:Open command palette": false
|
||||
}
|
||||
},
|
||||
"active": "157daa1a9b93f46c",
|
||||
"active": "af571c790caf59c7",
|
||||
"lastOpenFiles": [
|
||||
"并发.md",
|
||||
"logseq-java.7z",
|
||||
"Java-Interview.7z",
|
||||
"Java-Interview.zip",
|
||||
"代码规范/代码规范.md",
|
||||
"并发.md",
|
||||
"弱引用.md",
|
||||
"引用类型.md",
|
||||
"内存泄露.md",
|
||||
@@ -211,7 +214,6 @@
|
||||
"方法.md",
|
||||
"变量规范.md",
|
||||
"常量规范.md",
|
||||
"常量.md",
|
||||
"Pasted image 20230403123034.png",
|
||||
"代码规范",
|
||||
"203-Java/Pasted image 20230613181834.png",
|
||||
@@ -225,8 +227,6 @@
|
||||
"203-Java/203.1-Java面试/205.16-RabbitMQ",
|
||||
"203-Java/203.1-Java面试/205.15-Redis",
|
||||
"203-Java/203.1-Java面试/205.14-MySQL",
|
||||
"203-Java/203.1-Java面试/205.13-JVM",
|
||||
"200-计算机/202-算法",
|
||||
"203-Java/203.1-Java面试/205.12-多线程"
|
||||
"203-Java/203.1-Java面试/205.13-JVM"
|
||||
]
|
||||
}
|
||||
BIN
Java-Interview.7z
Normal file
BIN
Java-Interview.7z
Normal file
Binary file not shown.
@@ -1 +0,0 @@
|
||||
1691235278.807335
|
||||
2
Java-Interview/.gitattributes
vendored
2
Java-Interview/.gitattributes
vendored
@@ -1,2 +0,0 @@
|
||||
# Auto detect text files and perform LF normalization
|
||||
* text=auto
|
||||
421
Java-Interview/.gitignore
vendored
421
Java-Interview/.gitignore
vendored
@@ -1,421 +0,0 @@
|
||||
|
||||
## Ignore Visual Studio temporary files, build results, and
|
||||
## files generated by popular Visual Studio add-ons.
|
||||
##
|
||||
## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore
|
||||
|
||||
# User-specific files
|
||||
*.rsuser
|
||||
*.suo
|
||||
*.user
|
||||
*.userosscache
|
||||
*.sln.docstates
|
||||
|
||||
# User-specific files (MonoDevelop/Xamarin Studio)
|
||||
*.userprefs
|
||||
|
||||
# Mono auto generated files
|
||||
mono_crash.*
|
||||
|
||||
# Build results
|
||||
[Dd]ebug/
|
||||
[Dd]ebugPublic/
|
||||
[Rr]elease/
|
||||
[Rr]eleases/
|
||||
x64/
|
||||
x86/
|
||||
[Ww][Ii][Nn]32/
|
||||
[Aa][Rr][Mm]/
|
||||
[Aa][Rr][Mm]64/
|
||||
bld/
|
||||
[Bb]in/
|
||||
[Oo]bj/
|
||||
[Ll]og/
|
||||
[Ll]ogs/
|
||||
|
||||
# Visual Studio 2015/2017 cache/options directory
|
||||
.vs/
|
||||
# Uncomment if you have tasks that create the project's static files in wwwroot
|
||||
#wwwroot/
|
||||
|
||||
# Visual Studio 2017 auto generated files
|
||||
Generated\ Files/
|
||||
|
||||
# MSTest test Results
|
||||
[Tt]est[Rr]esult*/
|
||||
[Bb]uild[Ll]og.*
|
||||
|
||||
# NUnit
|
||||
*.VisualState.xml
|
||||
TestResult.xml
|
||||
nunit-*.xml
|
||||
|
||||
# Build Results of an ATL Project
|
||||
[Dd]ebugPS/
|
||||
[Rr]eleasePS/
|
||||
dlldata.c
|
||||
|
||||
# Benchmark Results
|
||||
BenchmarkDotNet.Artifacts/
|
||||
|
||||
# .NET Core
|
||||
project.lock.json
|
||||
project.fragment.lock.json
|
||||
artifacts/
|
||||
|
||||
# ASP.NET Scaffolding
|
||||
ScaffoldingReadMe.txt
|
||||
|
||||
# StyleCop
|
||||
StyleCopReport.xml
|
||||
|
||||
# Files built by Visual Studio
|
||||
*_i.c
|
||||
*_p.c
|
||||
*_h.h
|
||||
*.ilk
|
||||
*.meta
|
||||
*.obj
|
||||
*.iobj
|
||||
*.pch
|
||||
*.pdb
|
||||
*.ipdb
|
||||
*.pgc
|
||||
*.pgd
|
||||
*.rsp
|
||||
*.sbr
|
||||
*.tlb
|
||||
*.tli
|
||||
*.tlh
|
||||
*.tmp
|
||||
*.tmp_proj
|
||||
*_wpftmp.csproj
|
||||
*.log
|
||||
*.tlog
|
||||
*.vspscc
|
||||
*.vssscc
|
||||
.builds
|
||||
*.pidb
|
||||
*.svclog
|
||||
*.scc
|
||||
|
||||
# Chutzpah Test files
|
||||
_Chutzpah*
|
||||
|
||||
# Visual C++ cache files
|
||||
ipch/
|
||||
*.aps
|
||||
*.ncb
|
||||
*.opendb
|
||||
*.opensdf
|
||||
*.sdf
|
||||
*.cachefile
|
||||
*.VC.db
|
||||
*.VC.VC.opendb
|
||||
|
||||
# Visual Studio profiler
|
||||
*.psess
|
||||
*.vsp
|
||||
*.vspx
|
||||
*.sap
|
||||
|
||||
# Visual Studio Trace Files
|
||||
*.e2e
|
||||
|
||||
# TFS 2012 Local Workspace
|
||||
$tf/
|
||||
|
||||
# Guidance Automation Toolkit
|
||||
*.gpState
|
||||
|
||||
# ReSharper is a .NET coding add-in
|
||||
_ReSharper*/
|
||||
*.[Rr]e[Ss]harper
|
||||
*.DotSettings.user
|
||||
|
||||
# TeamCity is a build add-in
|
||||
_TeamCity*
|
||||
|
||||
# DotCover is a Code Coverage Tool
|
||||
*.dotCover
|
||||
|
||||
# AxoCover is a Code Coverage Tool
|
||||
.axoCover/*
|
||||
!.axoCover/settings.json
|
||||
|
||||
# Coverlet is a free, cross platform Code Coverage Tool
|
||||
coverage*.json
|
||||
coverage*.xml
|
||||
coverage*.info
|
||||
|
||||
# Visual Studio code coverage results
|
||||
*.coverage
|
||||
*.coveragexml
|
||||
|
||||
# NCrunch
|
||||
_NCrunch_*
|
||||
.*crunch*.local.xml
|
||||
nCrunchTemp_*
|
||||
|
||||
# MightyMoose
|
||||
*.mm.*
|
||||
AutoTest.Net/
|
||||
|
||||
# Web workbench (sass)
|
||||
.sass-cache/
|
||||
|
||||
# Installshield output folder
|
||||
[Ee]xpress/
|
||||
|
||||
# DocProject is a documentation generator add-in
|
||||
DocProject/buildhelp/
|
||||
DocProject/Help/*.HxT
|
||||
DocProject/Help/*.HxC
|
||||
DocProject/Help/*.hhc
|
||||
DocProject/Help/*.hhk
|
||||
DocProject/Help/*.hhp
|
||||
DocProject/Help/Html2
|
||||
DocProject/Help/html
|
||||
|
||||
# Click-Once directory
|
||||
publish/
|
||||
|
||||
# Publish Web Output
|
||||
*.[Pp]ublish.xml
|
||||
*.azurePubxml
|
||||
# Note: Comment the next line if you want to checkin your web deploy settings,
|
||||
# but database connection strings (with potential passwords) will be unencrypted
|
||||
*.pubxml
|
||||
*.publishproj
|
||||
|
||||
# Microsoft Azure Web App publish settings. Comment the next line if you want to
|
||||
# checkin your Azure Web App publish settings, but sensitive information contained
|
||||
# in these scripts will be unencrypted
|
||||
PublishScripts/
|
||||
|
||||
# NuGet Packages
|
||||
*.nupkg
|
||||
# NuGet Symbol Packages
|
||||
*.snupkg
|
||||
# The packages folder can be ignored because of Package Restore
|
||||
**/[Pp]ackages/*
|
||||
# except build/, which is used as an MSBuild target.
|
||||
!**/[Pp]ackages/build/
|
||||
# Uncomment if necessary however generally it will be regenerated when needed
|
||||
#!**/[Pp]ackages/repositories.config
|
||||
# NuGet v3's project.json files produces more ignorable files
|
||||
*.nuget.props
|
||||
*.nuget.targets
|
||||
|
||||
# Microsoft Azure Build Output
|
||||
csx/
|
||||
*.build.csdef
|
||||
|
||||
# Microsoft Azure Emulator
|
||||
ecf/
|
||||
rcf/
|
||||
|
||||
# Windows Store app package directories and files
|
||||
AppPackages/
|
||||
BundleArtifacts/
|
||||
Package.StoreAssociation.xml
|
||||
_pkginfo.txt
|
||||
*.appx
|
||||
*.appxbundle
|
||||
*.appxupload
|
||||
|
||||
# Visual Studio cache files
|
||||
# files ending in .cache can be ignored
|
||||
*.[Cc]ache
|
||||
# but keep track of directories ending in .cache
|
||||
!?*.[Cc]ache/
|
||||
|
||||
# Others
|
||||
ClientBin/
|
||||
~$*
|
||||
*~
|
||||
*.dbmdl
|
||||
*.dbproj.schemaview
|
||||
*.jfm
|
||||
*.pfx
|
||||
*.publishsettings
|
||||
orleans.codegen.cs
|
||||
|
||||
# Including strong name files can present a security risk
|
||||
# (https://github.com/github/gitignore/pull/2483#issue-259490424)
|
||||
#*.snk
|
||||
|
||||
# Since there are multiple workflows, uncomment next line to ignore bower_components
|
||||
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
|
||||
#bower_components/
|
||||
|
||||
# RIA/Silverlight projects
|
||||
Generated_Code/
|
||||
|
||||
# Backup & report files from converting an old project file
|
||||
# to a newer Visual Studio version. Backup files are not needed,
|
||||
# because we have git ;-)
|
||||
_UpgradeReport_Files/
|
||||
Backup*/
|
||||
UpgradeLog*.XML
|
||||
UpgradeLog*.htm
|
||||
ServiceFabricBackup/
|
||||
*.rptproj.bak
|
||||
|
||||
# SQL Server files
|
||||
*.mdf
|
||||
*.ldf
|
||||
*.ndf
|
||||
|
||||
# Business Intelligence projects
|
||||
*.rdl.data
|
||||
*.bim.layout
|
||||
*.bim_*.settings
|
||||
*.rptproj.rsuser
|
||||
*- [Bb]ackup.rdl
|
||||
*- [Bb]ackup ([0-9]).rdl
|
||||
*- [Bb]ackup ([0-9][0-9]).rdl
|
||||
|
||||
# Microsoft Fakes
|
||||
FakesAssemblies/
|
||||
|
||||
# GhostDoc plugin setting file
|
||||
*.GhostDoc.xml
|
||||
|
||||
# Node.js Tools for Visual Studio
|
||||
.ntvs_analysis.dat
|
||||
node_modules/
|
||||
|
||||
# Visual Studio 6 build log
|
||||
*.plg
|
||||
|
||||
# Visual Studio 6 workspace options file
|
||||
*.opt
|
||||
|
||||
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
|
||||
*.vbw
|
||||
|
||||
# Visual Studio 6 auto-generated project file (contains which files were open etc.)
|
||||
*.vbp
|
||||
|
||||
# Visual Studio 6 workspace and project file (working project files containing files to include in project)
|
||||
*.dsw
|
||||
*.dsp
|
||||
|
||||
# Visual Studio 6 technical files
|
||||
*.ncb
|
||||
*.aps
|
||||
|
||||
# Visual Studio LightSwitch build output
|
||||
**/*.HTMLClient/GeneratedArtifacts
|
||||
**/*.DesktopClient/GeneratedArtifacts
|
||||
**/*.DesktopClient/ModelManifest.xml
|
||||
**/*.Server/GeneratedArtifacts
|
||||
**/*.Server/ModelManifest.xml
|
||||
_Pvt_Extensions
|
||||
|
||||
# Paket dependency manager
|
||||
.paket/paket.exe
|
||||
paket-files/
|
||||
|
||||
# FAKE - F# Make
|
||||
.fake/
|
||||
|
||||
# CodeRush personal settings
|
||||
.cr/personal
|
||||
|
||||
# Python Tools for Visual Studio (PTVS)
|
||||
__pycache__/
|
||||
*.pyc
|
||||
|
||||
# Cake - Uncomment if you are using it
|
||||
# tools/**
|
||||
# !tools/packages.config
|
||||
|
||||
# Tabs Studio
|
||||
*.tss
|
||||
|
||||
# Telerik's JustMock configuration file
|
||||
*.jmconfig
|
||||
|
||||
# BizTalk build output
|
||||
*.btp.cs
|
||||
*.btm.cs
|
||||
*.odx.cs
|
||||
*.xsd.cs
|
||||
|
||||
# OpenCover UI analysis results
|
||||
OpenCover/
|
||||
|
||||
# Azure Stream Analytics local run output
|
||||
ASALocalRun/
|
||||
|
||||
# MSBuild Binary and Structured Log
|
||||
*.binlog
|
||||
|
||||
# NVidia Nsight GPU debugger configuration file
|
||||
*.nvuser
|
||||
|
||||
# MFractors (Xamarin productivity tool) working folder
|
||||
.mfractor/
|
||||
|
||||
# Local History for Visual Studio
|
||||
.localhistory/
|
||||
|
||||
# Visual Studio History (VSHistory) files
|
||||
.vshistory/
|
||||
|
||||
# BeatPulse healthcheck temp database
|
||||
healthchecksdb
|
||||
|
||||
# Backup folder for Package Reference Convert tool in Visual Studio 2017
|
||||
MigrationBackup/
|
||||
|
||||
# Ionide (cross platform F# VS Code tools) working folder
|
||||
.ionide/
|
||||
|
||||
# Fody - auto-generated XML schema
|
||||
FodyWeavers.xsd
|
||||
|
||||
# VS Code files for those working on multiple tools
|
||||
.vscode/*
|
||||
!.vscode/settings.json
|
||||
!.vscode/tasks.json
|
||||
!.vscode/launch.json
|
||||
!.vscode/extensions.json
|
||||
*.code-workspace
|
||||
|
||||
# Local History for Visual Studio Code
|
||||
.history/
|
||||
|
||||
# Windows Installer files from build outputs
|
||||
*.cab
|
||||
*.msi
|
||||
*.msix
|
||||
*.msm
|
||||
*.msp
|
||||
|
||||
# JetBrains Rider
|
||||
*.sln.iml
|
||||
|
||||
.Archive/
|
||||
.markeditor/
|
||||
!.metion/
|
||||
.metion/*
|
||||
!.metion/*_sort.config
|
||||
.markdown/
|
||||
.sync/
|
||||
.idea/
|
||||
.DS_STORE
|
||||
Thumbs.db*
|
||||
/.posts_info.json
|
||||
/posts_info.json
|
||||
/.git_settings.json
|
||||
/git_settings.json
|
||||
/.ios_file_manager_status*.json
|
||||
/.farbox_token.*
|
||||
/.farbox_auto_sync.*
|
||||
/__wechat.json
|
||||
/*.sqlite3
|
||||
_images_cache/
|
||||
.db/
|
||||
@@ -1,5 +0,0 @@
|
||||
[
|
||||
"Java基础",
|
||||
"集合",
|
||||
"JVM"
|
||||
]
|
||||
6
Java-Interview/.obsidian/app.json
vendored
6
Java-Interview/.obsidian/app.json
vendored
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"alwaysUpdateLinks": true,
|
||||
"strictLineBreaks": true,
|
||||
"showFrontmatter": false,
|
||||
"showLineNumber": true
|
||||
}
|
||||
4
Java-Interview/.obsidian/appearance.json
vendored
4
Java-Interview/.obsidian/appearance.json
vendored
@@ -1,4 +0,0 @@
|
||||
{
|
||||
"accentColor": "",
|
||||
"cssTheme": ""
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
[
|
||||
"easy-typing-obsidian",
|
||||
"cm-editor-syntax-highlight-obsidian",
|
||||
"markdown-prettifier"
|
||||
]
|
||||
@@ -1,30 +0,0 @@
|
||||
{
|
||||
"file-explorer": true,
|
||||
"global-search": true,
|
||||
"switcher": true,
|
||||
"graph": true,
|
||||
"backlink": true,
|
||||
"canvas": true,
|
||||
"outgoing-link": true,
|
||||
"tag-pane": true,
|
||||
"page-preview": true,
|
||||
"daily-notes": true,
|
||||
"templates": true,
|
||||
"note-composer": true,
|
||||
"command-palette": true,
|
||||
"slash-command": false,
|
||||
"editor-status": true,
|
||||
"bookmarks": true,
|
||||
"markdown-importer": false,
|
||||
"zk-prefixer": false,
|
||||
"random-note": false,
|
||||
"outline": true,
|
||||
"word-count": true,
|
||||
"slides": false,
|
||||
"audio-recorder": false,
|
||||
"workspaces": false,
|
||||
"file-recovery": true,
|
||||
"publish": false,
|
||||
"sync": false,
|
||||
"properties": true
|
||||
}
|
||||
21
Java-Interview/.obsidian/core-plugins.json
vendored
21
Java-Interview/.obsidian/core-plugins.json
vendored
@@ -1,21 +0,0 @@
|
||||
[
|
||||
"file-explorer",
|
||||
"global-search",
|
||||
"switcher",
|
||||
"graph",
|
||||
"backlink",
|
||||
"canvas",
|
||||
"outgoing-link",
|
||||
"tag-pane",
|
||||
"properties",
|
||||
"page-preview",
|
||||
"daily-notes",
|
||||
"templates",
|
||||
"note-composer",
|
||||
"command-palette",
|
||||
"editor-status",
|
||||
"bookmarks",
|
||||
"outline",
|
||||
"word-count",
|
||||
"file-recovery"
|
||||
]
|
||||
1
Java-Interview/.obsidian/hotkeys.json
vendored
1
Java-Interview/.obsidian/hotkeys.json
vendored
@@ -1 +0,0 @@
|
||||
{}
|
||||
File diff suppressed because one or more lines are too long
@@ -1,10 +0,0 @@
|
||||
{
|
||||
"id": "cm-editor-syntax-highlight-obsidian",
|
||||
"name": "Editor Syntax Highlight",
|
||||
"author": "death_au",
|
||||
"authorUrl": "https://github.com/deathau",
|
||||
"description": "Show syntax highlighing in code blocks the editor",
|
||||
"isDesktopOnly": false,
|
||||
"version": "0.1.3",
|
||||
"minAppVersion": "0.10.0"
|
||||
}
|
||||
@@ -1,177 +0,0 @@
|
||||
@charset "UTF-8";
|
||||
.cm-s-obsidian pre.HyperMD-codeblock span.cm-formatting-code-block {
|
||||
color: var(--text-muted);
|
||||
}
|
||||
|
||||
.cm-s-obsidian pre.HyperMD-codeblock .cm-keyword {
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
.theme-dark .cm-s-obsidian {
|
||||
/*
|
||||
|
||||
Name: yoncé
|
||||
Author: Thomas MacLean (http://github.com/thomasmaclean)
|
||||
|
||||
Original yoncé color scheme by Mina Markham (https://github.com/minamarkham)
|
||||
|
||||
*/
|
||||
/**/
|
||||
}
|
||||
.theme-dark .cm-s-obsidian .cm-hmd-frontmatter,
|
||||
.theme-dark .cm-s-obsidian pre.HyperMD-codeblock {
|
||||
color: #d4d4d4;
|
||||
}
|
||||
.theme-dark .cm-s-obsidian .cm-hmd-frontmatter.cm-keyword,
|
||||
.theme-dark .cm-s-obsidian .cm-math.cm-keyword,
|
||||
.theme-dark .cm-s-obsidian pre.HyperMD-codeblock .cm-keyword {
|
||||
color: #00A7AA;
|
||||
font-weight: normal;
|
||||
}
|
||||
.theme-dark .cm-s-obsidian .cm-hmd-frontmatter.cm-atom,
|
||||
.theme-dark .cm-s-obsidian .cm-math.cm-atom,
|
||||
.theme-dark .cm-s-obsidian pre.HyperMD-codeblock .cm-atom {
|
||||
color: #F39B35;
|
||||
}
|
||||
.theme-dark .cm-s-obsidian .cm-hmd-frontmatter.cm-number,
|
||||
.theme-dark .cm-s-obsidian .cm-math.cm-number,
|
||||
.theme-dark .cm-s-obsidian pre.HyperMD-codeblock .cm-number {
|
||||
color: #A06FCA;
|
||||
}
|
||||
.theme-dark .cm-s-obsidian span.cm-hmd-frontmatter.cm-type,
|
||||
.theme-dark .cm-s-obsidian span.cm-math.cm-type,
|
||||
.theme-dark .cm-s-obsidian pre.HyperMD-codeblock span.cm-type {
|
||||
color: #A06FCA;
|
||||
}
|
||||
.theme-dark .cm-s-obsidian .cm-hmd-frontmatter.cm-def,
|
||||
.theme-dark .cm-s-obsidian .cm-math.cm-def,
|
||||
.theme-dark .cm-s-obsidian pre.HyperMD-codeblock .cm-def {
|
||||
color: #98E342;
|
||||
}
|
||||
.theme-dark .cm-s-obsidian .cm-hmd-frontmatter.cm-property,
|
||||
.theme-dark .cm-s-obsidian .cm-math.cm-property,
|
||||
.theme-dark .cm-s-obsidian pre.HyperMD-codeblock .cm-property {
|
||||
color: #D4D4D4;
|
||||
}
|
||||
.theme-dark .cm-s-obsidian span.cm-hmd-frontmatter.cm-variable,
|
||||
.theme-dark .cm-s-obsidian span.cm-math.cm-variable,
|
||||
.theme-dark .cm-s-obsidian pre.HyperMD-codeblock span.cm-variable {
|
||||
color: #D4D4D4;
|
||||
}
|
||||
.theme-dark .cm-s-obsidian span.cm-hmd-frontmatter.cm-variable-2,
|
||||
.theme-dark .cm-s-obsidian span.cm-math.cm-variable-2,
|
||||
.theme-dark .cm-s-obsidian pre.HyperMD-codeblock span.cm-variable-2 {
|
||||
color: #da7dae;
|
||||
}
|
||||
.theme-dark .cm-s-obsidian span.cm-hmd-frontmatter.cm-variable-3,
|
||||
.theme-dark .cm-s-obsidian span.cm-math.cm-variable-3,
|
||||
.theme-dark .cm-s-obsidian pre.HyperMD-codeblock span.cm-variable-3 {
|
||||
color: #A06FCA;
|
||||
}
|
||||
.theme-dark .cm-s-obsidian .cm-hmd-frontmatter.cm-type.cm-def,
|
||||
.theme-dark .cm-s-obsidian .cm-math.cm-type.cm-def,
|
||||
.theme-dark .cm-s-obsidian pre.HyperMD-codeblock .cm-type.cm-def {
|
||||
color: #FC4384;
|
||||
}
|
||||
.theme-dark .cm-s-obsidian .cm-hmd-frontmatter.cm-property.cm-def,
|
||||
.theme-dark .cm-s-obsidian .cm-math.cm-property.cm-def,
|
||||
.theme-dark .cm-s-obsidian pre.HyperMD-codeblock .cm-property.cm-def {
|
||||
color: #FC4384;
|
||||
}
|
||||
.theme-dark .cm-s-obsidian .cm-hmd-frontmatter.cm-callee,
|
||||
.theme-dark .cm-s-obsidian .cm-math.cm-callee,
|
||||
.theme-dark .cm-s-obsidian pre.HyperMD-codeblock .cm-callee {
|
||||
color: #FC4384;
|
||||
}
|
||||
.theme-dark .cm-s-obsidian .cm-hmd-frontmatter.cm-operator,
|
||||
.theme-dark .cm-s-obsidian .cm-math.cm-operator,
|
||||
.theme-dark .cm-s-obsidian pre.HyperMD-codeblock .cm-operator {
|
||||
color: #FC4384;
|
||||
}
|
||||
.theme-dark .cm-s-obsidian .cm-hmd-frontmatter.cm-qualifier,
|
||||
.theme-dark .cm-s-obsidian .cm-math.cm-qualifier,
|
||||
.theme-dark .cm-s-obsidian pre.HyperMD-codeblock .cm-qualifier {
|
||||
color: #FC4384;
|
||||
}
|
||||
.theme-dark .cm-s-obsidian .cm-hmd-frontmatter.cm-tag,
|
||||
.theme-dark .cm-s-obsidian .cm-math.cm-tag,
|
||||
.theme-dark .cm-s-obsidian pre.HyperMD-codeblock .cm-tag {
|
||||
color: #FC4384;
|
||||
}
|
||||
.theme-dark .cm-s-obsidian .cm-hmd-frontmatter.cm-tag.cm-bracket,
|
||||
.theme-dark .cm-s-obsidian .cm-math.cm-tag.cm-bracket,
|
||||
.theme-dark .cm-s-obsidian pre.HyperMD-codeblock .cm-tag.cm-bracket {
|
||||
color: #D4D4D4;
|
||||
}
|
||||
.theme-dark .cm-s-obsidian .cm-hmd-frontmatter.cm-attribute,
|
||||
.theme-dark .cm-s-obsidian .cm-math.cm-attribute,
|
||||
.theme-dark .cm-s-obsidian pre.HyperMD-codeblock .cm-attribute {
|
||||
color: #A06FCA;
|
||||
}
|
||||
.theme-dark .cm-s-obsidian .cm-hmd-frontmatter.cm-comment,
|
||||
.theme-dark .cm-s-obsidian .cm-math.cm-comment,
|
||||
.theme-dark .cm-s-obsidian pre.HyperMD-codeblock .cm-comment {
|
||||
color: #696d70;
|
||||
}
|
||||
.theme-dark .cm-s-obsidian .cm-hmd-frontmatter.cm-comment.cm-tag,
|
||||
.theme-dark .cm-s-obsidian .cm-math.cm-comment.cm-tag,
|
||||
.theme-dark .cm-s-obsidian pre.HyperMD-codeblock .cm-comment.cm-tag {
|
||||
color: #FC4384;
|
||||
}
|
||||
.theme-dark .cm-s-obsidian .cm-hmd-frontmatter.cm-comment.cm-attribute,
|
||||
.theme-dark .cm-s-obsidian .cm-math.cm-comment.cm-attribute,
|
||||
.theme-dark .cm-s-obsidian pre.HyperMD-codeblock .cm-comment.cm-attribute {
|
||||
color: #D4D4D4;
|
||||
}
|
||||
.theme-dark .cm-s-obsidian .cm-hmd-frontmatter.cm-string,
|
||||
.theme-dark .cm-s-obsidian .cm-math.cm-string,
|
||||
.theme-dark .cm-s-obsidian pre.HyperMD-codeblock .cm-string {
|
||||
color: #E6DB74;
|
||||
}
|
||||
.theme-dark .cm-s-obsidian .cm-hmd-frontmatter.cm-string-2,
|
||||
.theme-dark .cm-s-obsidian .cm-math.cm-string-2,
|
||||
.theme-dark .cm-s-obsidian pre.HyperMD-codeblock .cm-string-2 {
|
||||
color: #F39B35;
|
||||
}
|
||||
.theme-dark .cm-s-obsidian .cm-hmd-frontmatter.cm-meta,
|
||||
.theme-dark .cm-s-obsidian .cm-math.cm-meta,
|
||||
.theme-dark .cm-s-obsidian pre.HyperMD-codeblock .cm-meta {
|
||||
color: #D4D4D4;
|
||||
background: inherit;
|
||||
}
|
||||
.theme-dark .cm-s-obsidian .cm-hmd-frontmatter.cm-builtin,
|
||||
.theme-dark .cm-s-obsidian .cm-math.cm-builtin,
|
||||
.theme-dark .cm-s-obsidian pre.HyperMD-codeblock .cm-builtin {
|
||||
color: #FC4384;
|
||||
}
|
||||
.theme-dark .cm-s-obsidian .cm-hmd-frontmatter.cm-header,
|
||||
.theme-dark .cm-s-obsidian .cm-math.cm-header,
|
||||
.theme-dark .cm-s-obsidian pre.HyperMD-codeblock .cm-header {
|
||||
color: #da7dae;
|
||||
}
|
||||
.theme-dark .cm-s-obsidian .cm-hmd-frontmatter.cm-hr,
|
||||
.theme-dark .cm-s-obsidian .cm-math.cm-hr,
|
||||
.theme-dark .cm-s-obsidian pre.HyperMD-codeblock .cm-hr {
|
||||
color: #98E342;
|
||||
}
|
||||
.theme-dark .cm-s-obsidian .cm-hmd-frontmatter.cm-link,
|
||||
.theme-dark .cm-s-obsidian .cm-math.cm-link,
|
||||
.theme-dark .cm-s-obsidian pre.HyperMD-codeblock .cm-link {
|
||||
color: #696d70;
|
||||
}
|
||||
.theme-dark .cm-s-obsidian .cm-hmd-frontmatter.cm-error,
|
||||
.theme-dark .cm-s-obsidian .cm-math.cm-error,
|
||||
.theme-dark .cm-s-obsidian pre.HyperMD-codeblock .cm-error {
|
||||
border-bottom: 1px solid #C42412;
|
||||
}
|
||||
.theme-dark .cm-s-obsidian .cm-hmd-frontmatter.CodeMirror-activeline-background,
|
||||
.theme-dark .cm-s-obsidian .cm-math.CodeMirror-activeline-background,
|
||||
.theme-dark .cm-s-obsidian pre.HyperMD-codeblock .CodeMirror-activeline-background {
|
||||
background: #272727;
|
||||
}
|
||||
.theme-dark .cm-s-obsidian .cm-hmd-frontmatter.CodeMirror-matchingbracket,
|
||||
.theme-dark .cm-s-obsidian .cm-math.CodeMirror-matchingbracket,
|
||||
.theme-dark .cm-s-obsidian pre.HyperMD-codeblock .CodeMirror-matchingbracket {
|
||||
outline: 1px solid grey;
|
||||
color: #D4D4D4 !important;
|
||||
}
|
||||
@@ -1,56 +0,0 @@
|
||||
{
|
||||
"Tabout": true,
|
||||
"SelectionEnhance": true,
|
||||
"IntrinsicSymbolPairs": true,
|
||||
"BaseObEditEnhance": true,
|
||||
"FW2HWEnhance": true,
|
||||
"AutoFormat": true,
|
||||
"ExcludeFiles": "",
|
||||
"ChineseEnglishSpace": true,
|
||||
"ChineseNumberSpace": true,
|
||||
"EnglishNumberSpace": true,
|
||||
"ChineseNoSpace": true,
|
||||
"PunctuationSpace": true,
|
||||
"AutoCapital": false,
|
||||
"AutoCapitalMode": "typing",
|
||||
"PunctuationSpaceMode": "typing",
|
||||
"InlineCodeSpaceMode": 1,
|
||||
"InlineFormulaSpaceMode": 1,
|
||||
"InlineLinkSpaceMode": 1,
|
||||
"InlineLinkSmartSpace": true,
|
||||
"UserDefinedRegSwitch": true,
|
||||
"UserDefinedRegExp": "{{.*?}}|++\n<.*?>|--\n\\[\\!.*?\\][-+]{0,1}|-+\n(file:///|https?://|ftp://|obsidian://|zotero://|www.)[^\\s()《》。,,!?;;:“”‘’\\)\\(\\[\\]\\{\\}']+|++\n\n[a-zA-Z0-9_\\-.]+@[a-zA-Z0-9_\\-.]+|++\n(?<!#)#[\\u4e00-\\u9fa5\\w\\/]+|++",
|
||||
"debug": false,
|
||||
"userSelRepRuleTrigger": [
|
||||
"-",
|
||||
"#"
|
||||
],
|
||||
"userSelRepRuleValue": [
|
||||
{
|
||||
"left": "~~",
|
||||
"right": "~~"
|
||||
},
|
||||
{
|
||||
"left": "#",
|
||||
"right": " "
|
||||
}
|
||||
],
|
||||
"userDeleteRulesStrList": [
|
||||
[
|
||||
"demo|",
|
||||
"|"
|
||||
]
|
||||
],
|
||||
"userConvertRulesStrList": [
|
||||
[
|
||||
":)|",
|
||||
"😀|"
|
||||
]
|
||||
],
|
||||
"userSelRuleSettingsOpen": true,
|
||||
"userDelRuleSettingsOpen": true,
|
||||
"userCvtRuleSettingsOpen": true,
|
||||
"EnterTwice": false,
|
||||
"TryFixChineseIM": false,
|
||||
"PuncRectify": false
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@@ -1,11 +0,0 @@
|
||||
{
|
||||
"id": "easy-typing-obsidian",
|
||||
"name": "Easy Typing",
|
||||
"version": "5.1.10",
|
||||
"minAppVersion": "0.15.0",
|
||||
"description": "Autoformat your note as typing.(Auto captalize, autospace)",
|
||||
"author": "yaozhuwa",
|
||||
"authorUrl": "https://github.com/Yaozhuwa",
|
||||
"isDesktopOnly": false,
|
||||
"fundingUrl": "https://www.buymeacoffee.com/yaozhuwa"
|
||||
}
|
||||
28711
Java-Interview/.obsidian/plugins/markdown-prettifier/main.js
vendored
28711
Java-Interview/.obsidian/plugins/markdown-prettifier/main.js
vendored
File diff suppressed because it is too large
Load Diff
@@ -1,10 +0,0 @@
|
||||
{
|
||||
"id": "markdown-prettifier",
|
||||
"name": "Markdown prettifier",
|
||||
"description": "Tries to fix and reformat ugly Markdown and adds things like 'modified date' etc.",
|
||||
"isDesktopOnly": false,
|
||||
"author": "Cristian",
|
||||
"authorUrl": "https://github.com/cristianvasquez",
|
||||
"js": "main.js",
|
||||
"version": "0.1.3"
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
/*Add css here*/
|
||||
183
Java-Interview/.obsidian/workspace.json
vendored
183
Java-Interview/.obsidian/workspace.json
vendored
@@ -1,183 +0,0 @@
|
||||
{
|
||||
"main": {
|
||||
"id": "59e43dfe2be37122",
|
||||
"type": "split",
|
||||
"children": [
|
||||
{
|
||||
"id": "a48234956dd7176a",
|
||||
"type": "tabs",
|
||||
"children": [
|
||||
{
|
||||
"id": "2b540c2e058138b9",
|
||||
"type": "leaf",
|
||||
"state": {
|
||||
"type": "empty",
|
||||
"state": {}
|
||||
}
|
||||
}
|
||||
],
|
||||
"stacked": true
|
||||
}
|
||||
],
|
||||
"direction": "vertical"
|
||||
},
|
||||
"left": {
|
||||
"id": "ad81f8976b7de22a",
|
||||
"type": "split",
|
||||
"children": [
|
||||
{
|
||||
"id": "65ed67cb56123d28",
|
||||
"type": "tabs",
|
||||
"children": [
|
||||
{
|
||||
"id": "c99b4270c7f68a25",
|
||||
"type": "leaf",
|
||||
"state": {
|
||||
"type": "file-explorer",
|
||||
"state": {
|
||||
"sortOrder": "alphabetical"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "295d006c630870c0",
|
||||
"type": "leaf",
|
||||
"state": {
|
||||
"type": "search",
|
||||
"state": {
|
||||
"query": "",
|
||||
"matchingCase": false,
|
||||
"explainSearch": false,
|
||||
"collapseAll": false,
|
||||
"extraContext": false,
|
||||
"sortOrder": "alphabetical"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "6bcd32be2de4e429",
|
||||
"type": "leaf",
|
||||
"state": {
|
||||
"type": "bookmarks",
|
||||
"state": {}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"direction": "horizontal",
|
||||
"width": 300
|
||||
},
|
||||
"right": {
|
||||
"id": "9095f5f3f11cd3ac",
|
||||
"type": "split",
|
||||
"children": [
|
||||
{
|
||||
"id": "7bbf9b08e351d4fd",
|
||||
"type": "tabs",
|
||||
"children": [
|
||||
{
|
||||
"id": "601fa6fe8d4aeb53",
|
||||
"type": "leaf",
|
||||
"state": {
|
||||
"type": "backlink",
|
||||
"state": {
|
||||
"collapseAll": false,
|
||||
"extraContext": false,
|
||||
"sortOrder": "alphabetical",
|
||||
"showSearch": false,
|
||||
"searchQuery": "",
|
||||
"backlinkCollapsed": false,
|
||||
"unlinkedCollapsed": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "0d4f6f5432cd3b6c",
|
||||
"type": "leaf",
|
||||
"state": {
|
||||
"type": "outgoing-link",
|
||||
"state": {
|
||||
"linksCollapsed": false,
|
||||
"unlinkedCollapsed": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "7a1c0fe38b774ff6",
|
||||
"type": "leaf",
|
||||
"state": {
|
||||
"type": "tag",
|
||||
"state": {
|
||||
"sortOrder": "frequency",
|
||||
"useHierarchy": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "9917df38a2708971",
|
||||
"type": "leaf",
|
||||
"state": {
|
||||
"type": "outline",
|
||||
"state": {}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"direction": "horizontal",
|
||||
"width": 300,
|
||||
"collapsed": true
|
||||
},
|
||||
"left-ribbon": {
|
||||
"hiddenItems": {
|
||||
"switcher:Open quick switcher": false,
|
||||
"graph:Open graph view": false,
|
||||
"canvas:Create new canvas": false,
|
||||
"daily-notes:Open today's daily note": false,
|
||||
"templates:Insert template": false,
|
||||
"command-palette:Open command palette": false
|
||||
}
|
||||
},
|
||||
"active": "2b540c2e058138b9",
|
||||
"lastOpenFiles": [
|
||||
"分布式/ZAB协议.md",
|
||||
"数据库/索引.md",
|
||||
"数据库/MySQL.md",
|
||||
"Pasted image 20230810104944.png",
|
||||
"数据库/MongoDB.md",
|
||||
"数据库/ElasticSearch.md",
|
||||
"数据库/字符集.md",
|
||||
"数据库/数据库.md",
|
||||
"集合/List面试问题.md",
|
||||
"常见框架/Spring.md",
|
||||
"常见框架/Spring Boot.md",
|
||||
"分布式/网关.md",
|
||||
"分布式/Raft算法.md",
|
||||
"分布式/Paxos算法.md",
|
||||
"分布式/Zookeeper.md",
|
||||
"Paxos.md",
|
||||
"分布式/分布式锁.md",
|
||||
"分布式/BASE理论.md",
|
||||
"常见框架/SpringMVC工作流程图.png",
|
||||
"Redis 集群.md",
|
||||
"数据库/Redis.md",
|
||||
"数据库/Redis 持久化机制.md",
|
||||
"JVM/类加载.md",
|
||||
"面试题补充.md",
|
||||
"README.md",
|
||||
"计算机基础/Linux.md",
|
||||
"JVM/JMM.md",
|
||||
"JVM/Java内存区域.md",
|
||||
"其他",
|
||||
"高可用",
|
||||
"高性能",
|
||||
"分布式",
|
||||
"系统设计",
|
||||
"常见框架",
|
||||
"开发工具",
|
||||
"数据库",
|
||||
"计算机基础/Untitled",
|
||||
"计算机基础"
|
||||
]
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
1. IO 流
|
||||
2. 字节流和字符流
|
||||
3. 字节缓冲流和字符缓冲流
|
||||
4. 打印流
|
||||
5. 随机访问流
|
||||
## IO 设计模式
|
||||
|
||||
1. 装饰器模式
|
||||
2. 适配器模式
|
||||
3. 工厂模式
|
||||
4. 观察者模式
|
||||
|
||||
## IO 模型
|
||||
|
||||
1. 何为 I/O
|
||||
2. 五种 IO 模型
|
||||
3. Java 中常见三种 IO 模型
|
||||
4. BIO
|
||||
5. NIO
|
||||
6. AIO
|
||||
@@ -1,5 +0,0 @@
|
||||
1. 缓存架构
|
||||
2. 主内存和工作内存
|
||||
3. 原子性,可见性,有序性
|
||||
4. 原子指令
|
||||
5. 工作内存主内存一致性
|
||||
@@ -1,21 +0,0 @@
|
||||
---
|
||||
title: Java内存区域
|
||||
date: 2023-08-02 21:56
|
||||
---
|
||||
|
||||
1. 运行时数据区结构
|
||||
1. 程序计数器
|
||||
2. Java 虚拟机栈
|
||||
3. 本地方法栈
|
||||
4. 堆
|
||||
5. 方法区
|
||||
6. 运行时常量池
|
||||
7. 字符串常量池
|
||||
8. 直接内存
|
||||
|
||||
2. HotSpot 虚拟机
|
||||
1. 对象的创建
|
||||
2. 对象的内存布局
|
||||
3. 对象的访问定位
|
||||
|
||||
3. [[垃圾回收]]
|
||||
@@ -1,41 +0,0 @@
|
||||
1. 堆空间基本结构
|
||||
|
||||
2. 内存分配和回收原则
|
||||
|
||||
3. gc 分类
|
||||
1. Partial GC
|
||||
1. young GC
|
||||
2. Old GC
|
||||
3. Mixed GC
|
||||
2. Full GC
|
||||
|
||||
4. 空间分配担保
|
||||
|
||||
5. 死亡对象判定方法
|
||||
1. 引用计数法
|
||||
2. 可达性分析法
|
||||
|
||||
5. 哪些对象可以作为 GC Roots
|
||||
6. 对象可以被回收,就一定会回收吗
|
||||
7. 4 中引用类型
|
||||
1. 强引用
|
||||
2. 软引用
|
||||
3. 弱引用
|
||||
4. 虚引用
|
||||
8. 如何判断一个常量是废弃常量
|
||||
9. 如何判断一个类是无用的类
|
||||
10. 垃圾收集算法
|
||||
1. 标记收集
|
||||
2. 复制算法
|
||||
3. 标记整理
|
||||
11. 分代收集算法
|
||||
12. 垃圾收集器
|
||||
1. Serial
|
||||
2. parNew
|
||||
3. Parallel Scavenge(JDK 1.8 默认收集器)
|
||||
4. Serial Old
|
||||
5. Parallel Old
|
||||
6. CMS
|
||||
7. G1
|
||||
8. ZGC
|
||||
13. 对象从创建到回收的过程
|
||||
@@ -1,3 +0,0 @@
|
||||
1. 类加载过程
|
||||
2. 初始化过程(父类,子类)
|
||||
3. 破坏双亲委派机制
|
||||
@@ -1,83 +0,0 @@
|
||||
---
|
||||
title: 基础面试题
|
||||
date: 2023-08-02 20:28
|
||||
mdate: 2023-08-02 21:38:53
|
||||
---
|
||||
# Java 基础
|
||||
|
||||
1. 什么是字节码,使用字节码的好处是什么
|
||||
字节码是通过 JavaC 编译器编译出来的可通过 JVM 执行的代码,字节码可以在不同的平台上的 JVM 上执行,从而可以在不重新编译的情况下做到一次编写,处处执行
|
||||
|
||||
2. 为什么不全部使用 AOT
|
||||
通过 jit 可以针对实际运行时的代码进行优化编译,提高运行效率,AOT 无法针对运行时的所有可能情况进行完全优化
|
||||
|
||||
3. continue,break,return 区别
|
||||
|
||||
4. 包装类型的缓存机制
|
||||
4 种整数类型的包装类都缓存了-128,127 的值,Character 则是 0,127 的值,Boolean 直接返回 True/False
|
||||
如果超出这个值就会去建立一个新的对象,否则就是缓存中的对象
|
||||
但是使用构造方法 new 出来的不是在缓存里
|
||||
|
||||
5. 面向对象和面向过程
|
||||
面向过程会将解决问题的过程拆解为一个一个方法,通过执行方法来解决问题
|
||||
面向对象会将要解决的问题抽象出对象,在通过对象执行特定的方法来解决问题
|
||||
|
||||
6. 深拷贝和浅拷贝的区别
|
||||
浅拷贝创建出了一个新的对象,但是内部其他的属性如果是引用类型,则还是原来的引用地址
|
||||
深拷贝完全复制了整个对象以及内部的属性对象
|
||||
|
||||
7. Object 类的方法
|
||||
|
||||
8. equals 和 ==
|
||||
==在基本数据类型比较值,在引用数据类型比较地址
|
||||
equals 比较的是两个对象是否相等,比较时要重写该对象的 equals 方法和 hashCode 方法,否则和==一样
|
||||
|
||||
9. hashCode
|
||||
通过 hashCode 可以获取该对象的哈希码,确定该对象在 hash 表的索引位置
|
||||
hashSet 在添加对象是,会先通过 hashCode 判断加入位置,没有重复则判断该对象没有重复出现,否则使用 equals 来判断是否相等,相同就不添加,不同就散列到其他位置,从而减少调用 equals 方法
|
||||
在 hash 的容器中可以大大提高其运行效率
|
||||
|
||||
10. 重写 hashCode 和 equals 方法
|
||||
hashcode 相同,不一定是同一个对象
|
||||
equals 判断相同,但是 hashcode 值不一定相等
|
||||
|
||||
11. String 不可变
|
||||
String 中使用了 final 关键字来修饰数组保存字符串
|
||||
StringBuffer 可变
|
||||
StrignBuilder 可变且线程安全
|
||||
|
||||
12. 使用+和 StringBuilder
|
||||
在循环内使用+会产生大量临时 StrignBuilder对象,但是 JDK9 后改用动态方法 makeConcatWithConstants()方法实现
|
||||
|
||||
13. 字符串常量池
|
||||
保存的是该字符串在堆中的引用,如果新建一个字符串在字符串常量池中有缓存则会直接返回该对象的地址
|
||||
|
||||
14. 常量折叠
|
||||
|
||||
15. String#intern 方法
|
||||
|
||||
16. 异常
|
||||
分为 Exception 和 Error,都继承 Throwable 类,
|
||||
异常还分 CheckedException(编译时必须捕获否则通不过) 和 uncheckedException(RuntimeException)
|
||||
|
||||
17. finally 一定会执行码
|
||||
不一定,程序如果在 fnally 之前中止就不会执行,System.exit()线程死亡,关闭 CPU
|
||||
|
||||
18. try-with-resource
|
||||
|
||||
19. 泛型
|
||||
可以在编译时对对象的类型进行检测,从而避免类型不一致报错
|
||||
泛型类,泛型接口,泛型方法
|
||||
|
||||
20. 反射
|
||||
程序运行时,通过反射可以动态的获取一个类的实例
|
||||
在 Spirng 和 Mybatis 中大量运用了动态代理,而这就是反射实现的,通过反射可以获取该类上的注解从而对该类进行进一步的处理@Component,@Value
|
||||
|
||||
21. SPI 和 API
|
||||
|
||||
22. 序列化和反序列化
|
||||
序列化是将对象当前的状态转换为二进制字节流的过程
|
||||
反序列化是将二进制字节流转换回对象的过程
|
||||
用于网络传输,对象存储到文件,数据库,内存中
|
||||
不想要序列化的变量使用 **transient** 关键字修饰
|
||||
|
||||
@@ -1,674 +0,0 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU General Public License is a free, copyleft license for
|
||||
software and other kinds of works.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
the GNU General Public License is intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users. We, the Free Software Foundation, use the
|
||||
GNU General Public License for most of our software; it applies also to
|
||||
any other work released this way by its authors. You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to prevent others from denying you
|
||||
these rights or asking you to surrender the rights. Therefore, you have
|
||||
certain responsibilities if you distribute copies of the software, or if
|
||||
you modify it: responsibilities to respect the freedom of others.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must pass on to the recipients the same
|
||||
freedoms that you received. You must make sure that they, too, receive
|
||||
or can get the source code. And you must show them these terms so they
|
||||
know their rights.
|
||||
|
||||
Developers that use the GNU GPL protect your rights with two steps:
|
||||
(1) assert copyright on the software, and (2) offer you this License
|
||||
giving you legal permission to copy, distribute and/or modify it.
|
||||
|
||||
For the developers' and authors' protection, the GPL clearly explains
|
||||
that there is no warranty for this free software. For both users' and
|
||||
authors' sake, the GPL requires that modified versions be marked as
|
||||
changed, so that their problems will not be attributed erroneously to
|
||||
authors of previous versions.
|
||||
|
||||
Some devices are designed to deny users access to install or run
|
||||
modified versions of the software inside them, although the manufacturer
|
||||
can do so. This is fundamentally incompatible with the aim of
|
||||
protecting users' freedom to change the software. The systematic
|
||||
pattern of such abuse occurs in the area of products for individuals to
|
||||
use, which is precisely where it is most unacceptable. Therefore, we
|
||||
have designed this version of the GPL to prohibit the practice for those
|
||||
products. If such problems arise substantially in other domains, we
|
||||
stand ready to extend this provision to those domains in future versions
|
||||
of the GPL, as needed to protect the freedom of users.
|
||||
|
||||
Finally, every program is threatened constantly by software patents.
|
||||
States should not allow patents to restrict development and use of
|
||||
software on general-purpose computers, but in those that do, we wish to
|
||||
avoid the special danger that patents applied to a free program could
|
||||
make it effectively proprietary. To prevent this, the GPL assures that
|
||||
patents cannot be used to render the program non-free.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Use with the GNU Affero General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU Affero General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the special requirements of the GNU Affero General Public License,
|
||||
section 13, concerning interaction through a network will apply to the
|
||||
combination as such.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program does terminal interaction, make it output a short
|
||||
notice like this when it starts in an interactive mode:
|
||||
|
||||
<program> Copyright (C) <year> <name of author>
|
||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, your program's commands
|
||||
might be different; for a GUI interface, you would use an "about box".
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU GPL, see
|
||||
<https://www.gnu.org/licenses/>.
|
||||
|
||||
The GNU General Public License does not permit incorporating your program
|
||||
into proprietary programs. If your program is a subroutine library, you
|
||||
may consider it more useful to permit linking proprietary applications with
|
||||
the library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License. But first, please read
|
||||
<https://www.gnu.org/licenses/why-not-lgpl.html>.
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 180 KiB |
@@ -1,2 +0,0 @@
|
||||
# Java Interview
|
||||
Java Interview
|
||||
@@ -1,19 +0,0 @@
|
||||
## **Redis Sentinel**:
|
||||
|
||||
1. 什么是 Sentinel? 有什么用?
|
||||
2. Sentinel 如何检测节点是否下线?主观下线与客观下线的区别?
|
||||
3. Sentinel 是如何实现故障转移的?
|
||||
4. 为什么建议部署多个 sentinel 节点(哨兵集群)?
|
||||
5. Sentinel 如何选择出新的 master(选举机制)?
|
||||
6. 如何从 Sentinel 集群中选择出 Leader ?
|
||||
7. Sentinel 可以防止脑裂吗?
|
||||
|
||||
## **Redis Cluster**:
|
||||
|
||||
1. 为什么需要 Redis Cluster?解决了什么问题?有什么优势?
|
||||
2. Redis Cluster 是如何分片的?
|
||||
3. 为什么 Redis Cluster 的哈希槽是 16384 个?
|
||||
4. 如何确定给定 key 的应该分布到哪个哈希槽中?
|
||||
5. Redis Cluster 支持重新分配哈希槽吗?
|
||||
6. Redis Cluster 扩容缩容期间可以提供服务吗?
|
||||
7. Redis Cluster 中的节点是怎么进行通信的?
|
||||
@@ -1,5 +0,0 @@
|
||||
> Basically Avaliable
|
||||
> Soft-dtate
|
||||
> Eventually Consistent
|
||||
|
||||
AP 方案的补充
|
||||
@@ -1,8 +0,0 @@
|
||||
> **一致性**
|
||||
>
|
||||
> **可用性**
|
||||
>
|
||||
> **分区容错性**
|
||||
|
||||
1. CAP 理论
|
||||
2. CAP 实际应用案例
|
||||
@@ -1,8 +0,0 @@
|
||||
> 分散式发散消息
|
||||
|
||||
1. Gossip 协议
|
||||
2. 应用
|
||||
3. 协议信息传播模式
|
||||
1. 反熵
|
||||
2. 传谣
|
||||
4. 优势与缺陷
|
||||
@@ -1,7 +0,0 @@
|
||||
> 分布式系统共识算法
|
||||
> 两阶段共识协议
|
||||
|
||||
三个重要角色
|
||||
1. 提议者:协调者,负责接收客户当的请求并发起提案,提案信息包括提案编号和提议的值
|
||||
2. 接收者:投票员,负责对提议者的提案进行投票,同时需要记住自己的投票历史
|
||||
3. 学习者:如果有超过半数接收者就讴歌提议达成共识,学习者就要接受这个提议,并就该提议做出运算,然后将运算结果返回客户端
|
||||
@@ -1,11 +0,0 @@
|
||||
> 远程过程调用
|
||||
|
||||
1. 什么是 RPC
|
||||
2. RPC 的原理
|
||||
3. PCP 框架
|
||||
1. Dubbo
|
||||
2. Motan
|
||||
3. gRPC
|
||||
4. Thrift
|
||||
4. 如何设计并实现一个 RPC 框架
|
||||
5. 既然有了 HTTP,为什么还要有 RPC
|
||||
@@ -1,52 +0,0 @@
|
||||
1. 拜占庭将军
|
||||
|
||||
多个将军,信使可靠但有可能被杀的情况下,将军们如何达成一致性决定
|
||||
> 选举出一个大将军,用来做所有决定
|
||||
|
||||
2. 共识算法
|
||||
|
||||
> 即使面对故障,服务器也可以在共享状态上达成一致
|
||||
|
||||
允许一组节点像一个整体一样一起工作,即使出现某些故障也可以继续工作
|
||||
|
||||
一般使用复制日志实现复制状态机,每一个 Server 存储一份包括命令序列
|
||||
|
||||
|
||||
特性:
|
||||
- **安全**,在非拜占庭条件下的安全性,包括网络延迟,分区,包丢失,复制和重新排序
|
||||
- **高可用**,只要大部分服务器可操作,可通信,就可以与客户端进行通信
|
||||
- **一致性不依赖时序**,错误的始终和极端的消息延迟,在最坏情况下也只会造成可用性,不会产生一致性问题
|
||||
- **大多数服务器完成响应即可完成命令**,不被少数运行缓慢服务器影响整体性能
|
||||
|
||||
3. 节点类型
|
||||
|
||||
- `Leader`负责发起心跳,响应客户端,创建和同步日志,
|
||||
- `Candidate`在Leader选举过程中的临时角色,由Follower转化而来,发起投票和参与竞选,
|
||||
- `Follower`接受Leader的心跳和同步日志,投票给Candidate
|
||||
|
||||
4. 任期
|
||||
|
||||
将时间划分为任意长度的任期,用连续数字表示,每一个任期开始都是选举,如果没有选出Leader,进入下一个任期
|
||||
|
||||
5. 日志
|
||||
|
||||
- entry:每一个时间成为entry,只有Leader可以创建entry
|
||||
- log:由entry构成的数组,每一个entry都有一个表明自己在log中的index
|
||||
|
||||
6. 领导人选举
|
||||
|
||||
使用心跳机制出发Leader选举,一个Follower在一个周期内
|
||||
|
||||
7. 日志复制
|
||||
|
||||
收到请求后,生成一个entry\<index,term,cmd>,将这个entry添加到日志末尾后向所有节点广播这个entry
|
||||
|
||||
Follower接受该entry会添加到自己日志后面,返回给Leader同意
|
||||
|
||||
如果大部分响应成功,Leader 将这个 entry 应用到自己的状态机中,然后这个 entry 就是 commited 的,并向客户端返回结果
|
||||
|
||||
Leader崩溃导致日志不一样,一致性检查失败,Leader强制Follower复制自己的日志处理不一致
|
||||
|
||||
8. 安全性
|
||||
|
||||
Leader需要保证自己存储所有已提交的日志,通过term和index确认日志新旧
|
||||
@@ -1,4 +0,0 @@
|
||||
两种基本模式
|
||||
|
||||
- **崩溃恢复**:Leader 或整个服务框架启动异常时,ZAB 协议进入恢复模式并选举产生新 Leader,产生新 Leader 并且同步过半之后就会退出恢复模式
|
||||
- **消息广播模式**:当过半的 Follower 服务器完成和 Leader 服务器状态同步,进入消息挂脖模式,
|
||||
@@ -1,117 +0,0 @@
|
||||
1. Zookeeper 特点
|
||||
|
||||
一个分布式协调服务
|
||||
- **顺序一致性**:从同一客户端发起事务请求,最终会严格按照顺序应用到 ZooKeeper 中
|
||||
- **原子性**:所有事务请求的处理结果在整个集群中所有机器的应用情况是一致的
|
||||
- **单一系统映像**:无论客户端连接到哪一个 Zookeeper 服务器上,看到的服务的数据模型是一致的
|
||||
- **可靠性**:一旦一次更改请求被应用,更改结果就会持久化
|
||||
|
||||
2. Zookeeper 应用场景
|
||||
|
||||
- **命名服务**:可利用 Zookeeper 的顺序节点生产全局唯一 ID
|
||||
- **数据发布/订阅**:通过 Watcher 机制可以很方便的实现数据发布/订阅
|
||||
- **分布式锁**:通过创建唯一节点获取分布式锁,当获得锁执行完之后或挂掉就释放锁
|
||||
|
||||
3. 重要概念
|
||||
1. Date model
|
||||
|
||||
采用层次化的多叉树形结构,每个节点可以存储数据,可以拥有n个子节点,每个数据节点成为znode
|
||||
|
||||
2. znode
|
||||
|
||||
每个数据节点都是znode
|
||||
- **持久类**:一旦创建就一直存在直到删除
|
||||
- **临时节点**:临时节点生民周期与session绑定,会话消失节点消失,只能做叶子节点
|
||||
- **持久顺序节点**:除了持久节点特点外还有顺序性
|
||||
- **临时顺序节点**:除了临时节点特性外还有顺序性
|
||||
|
||||
组成:
|
||||
- **stat**:状态信息
|
||||
- **data**:节点存放的具体内容
|
||||
|
||||
3. version
|
||||
|
||||
stat中记录的三个相关版本
|
||||
- **dataVerdion**:当前znode节点的版本号
|
||||
- **cverdion**:当前znode子节点的版本
|
||||
- **alcVsersion**:当前znode的ACL版本
|
||||
|
||||
4. ACL
|
||||
|
||||
使用 ACL 进行权限控制
|
||||
- **CREATE**:
|
||||
- **READ**:
|
||||
- **WRITE**:
|
||||
- **DELETE**:
|
||||
- **ADMIN**:
|
||||
|
||||
cerate和delete都是针对子节点的权限控制
|
||||
|
||||
5. Watcher
|
||||
|
||||
允许用户在指定节点上注册一些Watecher,当一些事件触发后,将事件通知到感兴趣的客户端上
|
||||
|
||||
6. Session
|
||||
|
||||
服务器与客户端的一个TCP长连接,每一个sessionID都是唯一分配个每个客户端的
|
||||
|
||||
4. Zookeeper 集群
|
||||
1. 集群角色
|
||||
|
||||
`Leader`:为客户端提供读和写服务,负责投票发起和决议,更新系统状态,
|
||||
`Follower`:为客户端提供读服务,写服务转发给Leader,擦浴选举投票,
|
||||
`Observer`:提供读服务,不参与“过半写成功”策略,不参与投票,提高写性能,
|
||||
集群之间通过ZAB协议保持数据一致性
|
||||
|
||||
2. Leader 选举过程
|
||||
|
||||
- **选举阶段**:一开始都是选举阶段,一个节点获得半数就当选准 Leader
|
||||
- **发现阶段**:followers跟准leader通信,同步follower最近接受的事务提议
|
||||
- **同步阶段**:利用leader前一阶段获得的最新提议历史,同步集群中所有副本,同步完成之后准leader变为真正leader
|
||||
- **广播阶段**:Zookeeper 可以正式对外提供事务服务,leader 可以进行消息广播,新节点加入对新节点进行同步
|
||||
|
||||
服务器状态:
|
||||
- **LOOKING**
|
||||
- **LEADING**
|
||||
- **FOLLOWING**
|
||||
- **OBSERVING**
|
||||
|
||||
3. 集群为啥最好奇数台
|
||||
|
||||
保持超过过半才可用,偶数是增加了一个不需要的节点
|
||||
|
||||
4. 选举过半机制防止脑裂
|
||||
|
||||
|
||||
|
||||
5. [[ZAB协议]]和 [[Paxos算法]]
|
||||
|
||||
6. 一致性问题
|
||||
|
||||
|
||||
|
||||
7. 一致性协议和算法
|
||||
|
||||
1. 2 PC
|
||||
|
||||
|
||||
|
||||
2. 3 PC
|
||||
|
||||
|
||||
|
||||
3. Paxos 算法
|
||||
|
||||
|
||||
|
||||
8. 引出 ZAB
|
||||
|
||||
|
||||
|
||||
9. 几个理论知识
|
||||
|
||||
|
||||
|
||||
10. 几个典型应用场景
|
||||
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
1. 什么是分布式 ID
|
||||
2. 分布式 ID 解决方案
|
||||
1. 数据库
|
||||
2. 算法
|
||||
1. UUID
|
||||
2. snowflake
|
||||
3. 开源框架
|
||||
1. UidGenerator
|
||||
2. Leaf
|
||||
3. Tinyid
|
||||
|
||||
## 设计指南
|
||||
|
||||
1. 订单系统
|
||||
1. 一码付
|
||||
2. 订单号
|
||||
3. 优惠券和兑换券
|
||||
2. Tracing
|
||||
1. 日志跟踪
|
||||
2. TraceId 生成规则
|
||||
3. SpanId 生成规则
|
||||
3. 短网址
|
||||
@@ -1,5 +0,0 @@
|
||||
1. 为什么需要服务注册与发现
|
||||
2. 如何进行配置管理
|
||||
3. 分布式事务的解决方案
|
||||
4. 监控系统如何做
|
||||
5. 如何进行日志管理
|
||||
@@ -1,36 +0,0 @@
|
||||
1. 为什么需要分布式锁
|
||||
|
||||
多线程多个线程竞争会导致系统出现问题,需要对资源实现互斥访问,分布式系统下的悲观锁
|
||||
|
||||
2. 分布式锁需要具备的条件
|
||||
|
||||
- 互斥
|
||||
- 高可用性
|
||||
- 可重入
|
||||
- 高性能
|
||||
- 非阻塞
|
||||
|
||||
3. 分布式锁的实现方案
|
||||
|
||||
- 基于 mysql 实行
|
||||
|
||||
- 基于分布式协调服务 ZooKeeper 实现
|
||||
|
||||
基于**临时顺序节点**和**Watcher(事件监听器)**
|
||||
|
||||
- 基于分布式键值存储系统 Redis 实现
|
||||
|
||||
`SETNX(set if not exist)key value EX 3` 过期时间 3s
|
||||
|
||||
`DEL key`,建议使用 Lua 脚本来通过 key 对应 value(唯一值)判断
|
||||
|
||||
需要保证 key 值和过期时间为一个原子操作,否则无法释放
|
||||
|
||||
锁的续期使用 Redission 实现,提供了一个专门监控和续期锁的看门狗,如果未执行完就延长锁的过期时间
|
||||
RLock lock = redission. get ("lock")
|
||||
lock. lock ()
|
||||
lock. unlock ()
|
||||
|
||||
集群下分布式锁的可靠性
|
||||
|
||||
通过 RedLock 算法解决,让客户端向集群中多个独立的 Redis 依次申请枷锁,半数以上的实例加锁成功才是获得分布式锁
|
||||
@@ -1,5 +0,0 @@
|
||||
[[CAP理论]]
|
||||
[[BASE理论]]
|
||||
[[Paxos算法]]
|
||||
[[Raft算法]]
|
||||
[[Gossip协议]]
|
||||
@@ -1,15 +0,0 @@
|
||||
> 请求转发+请求过滤
|
||||
|
||||
1. 什么是网关
|
||||
2. 网关功能
|
||||
|
||||
## Spring Cloud Gateway
|
||||
|
||||
1. 什么是 Gateway
|
||||
2. 工作流程
|
||||
3. 断言
|
||||
4. 路由和断言的关系
|
||||
5. 如何实现动态路由
|
||||
6. 过滤器有哪些
|
||||
7. 支持限流吗
|
||||
8. 如何自定义全局异常处理
|
||||
@@ -1,15 +0,0 @@
|
||||
1. #{}和${}的区别
|
||||
2. xml 标签类型
|
||||
3. DAO 接口工作原理,方法可以重载吗
|
||||
4. 如何进行分页,分页插件原理
|
||||
5. 插件运行原理
|
||||
6. 批量插入返回数据库主键
|
||||
7. 动态 sql 执行原理
|
||||
8. 如何将 sql 执行结果封装为对象,有哪些映射类型
|
||||
9. 延迟加载及其实现原理
|
||||
10. 不同 xml 映射 id
|
||||
11. 如何执行批处理
|
||||
12. 有哪些 Executor 执行器及区别,如何指定
|
||||
13. 是否可以映射 Enum 类型
|
||||
14. xml 映射文件和 Mybatis 内部数据结构映射关系
|
||||
15. 半自动 ORM 映射框架
|
||||
@@ -1,51 +0,0 @@
|
||||
## 注解
|
||||
|
||||
1. @SpringBootApplication
|
||||
|
||||
- **@SpringBootApplication**,启动类上添加该注解
|
||||
- `@EnableAutoConfiguration`:启用自动配置机制
|
||||
- `@ComponenScan`:扫描组件 Bean,默认扫描该类所在包下所有类
|
||||
- `@Configuraiotn`:允许在 Spring 上下文注册额外 Bean 或导入其他配置类
|
||||
|
||||
2. Spring Bean 相关
|
||||
|
||||
3. 处理常见的 HTTP 请求类型
|
||||
|
||||
4. 前后端传值
|
||||
|
||||
5. 读取配置信息
|
||||
|
||||
- `@Value`
|
||||
- `@configurationProperties`
|
||||
|
||||
6. 参数校验
|
||||
|
||||
7. 全局处理 Controller 层异常
|
||||
|
||||
8. JPA 相关
|
||||
|
||||
9. 事务
|
||||
|
||||
10. json 数据处理
|
||||
|
||||
11. 测试相关
|
||||
|
||||
## 核心
|
||||
|
||||
1. Springboot 自动配置的条件注解原理
|
||||
|
||||
2. 如何实现自动配置
|
||||
|
||||
3. 配置属性值如何绑定
|
||||
|
||||
4. 各种 Starter 如何构建
|
||||
|
||||
5. 启动流程
|
||||
|
||||
6. SpringApplication 对象如何构建
|
||||
|
||||
7. 事件监听机制
|
||||
|
||||
8. 内置生命周期事件详解
|
||||
|
||||
**Spring 自动装配原理**
|
||||
@@ -1,132 +0,0 @@
|
||||
1. Spring 模块
|
||||
2. Spring,Spring MVC, Spring Boot
|
||||
3. IoC
|
||||
将对象创建的控制权交给 Spring 框架来进行管理
|
||||
1. 什么是 Bean
|
||||
被 Spring 的 IOC 容器所管理的 Bean,并通过配置元数据来定义
|
||||
1. 将一个类声明为 Bean 的注解
|
||||
`@Component`,`@Service`,`@Repository `,`@Controller`
|
||||
1. @Componet 和@Bean
|
||||
- Component 作用于类,Bean 作用于方法
|
||||
- Component 用@ComponentScan 来定义需要扫描的路径,
|
||||
- Bean 可以医用第三方库中的类
|
||||
1. 注入 Bean 的注解
|
||||
- `@Autowired`
|
||||
- `@Resource`
|
||||
- `@Inject`
|
||||
|
||||
1. @Autowire 和@Resource
|
||||
Autowire 为 Spring 内置的注解,注入类型为 byType,优先根据接口类型匹配
|
||||
Resource 为 JDK 提供的注解,默认 byName
|
||||
|
||||
1. Bean 的作用域
|
||||
1. singleton
|
||||
2. protoype
|
||||
3. request
|
||||
4. session
|
||||
5. application/global-session
|
||||
6. websocket
|
||||
|
||||
1. Bean 是线程安全的吗
|
||||
取决于 Bean 的作用域和状态,singleton 下只有一个 Bean 实例,如果 bean 为有状态的,就会存在线程安全的问题
|
||||
- 在 Bean 中尽量避免定义可变的成员变量
|
||||
- 在类中定义 ThreadLocal 成员变量,将可变的变量存储在 ThreadLocal 中
|
||||
|
||||
2. Bean 的生命周期
|
||||
|
||||
|
||||
|
||||
3. AoP
|
||||
|
||||
> |含义|术语|
|
||||
> |---|---|
|
||||
> |目标|被代理的对象|
|
||||
> |代理|向目标对象应用通知后创建的代理对象|
|
||||
> |连接点|目标对象所属类中,定义的所有方法都是连接点|
|
||||
> |切入点|被切面拦截/增强的连接点|
|
||||
> |通知|增强的逻辑/代码,拦截到目标对象的连接点之后需要做的事情|
|
||||
> |切面|切入点+通知|
|
||||
> |织入|将通知应用到目标对象生成代理对象的过程|
|
||||
|
||||
---
|
||||
AOP 概念
|
||||
|
||||
1. AOP 概念及术语
|
||||
基于动态代理实现,需要代理的对象实现了某个接口,通过 JDK Proxy 创建一个代理的接口实现类,没有实现的就使用 CGLIB 生成一个被代理对象的子类来实现
|
||||
1. 和 AspectJ 的区别
|
||||
AOP 是运行时增强,AspectJ 时编译时增强,基于字节码
|
||||
1. 通知类型
|
||||
- 前置通知
|
||||
- 后置通知
|
||||
- 返回通知
|
||||
- 异常通知
|
||||
- 环绕通知
|
||||
|
||||
|
||||
1. 多个切面的执行顺序
|
||||
- 使用`@Order`注解
|
||||
- 实现Order接口重写getOrder方法
|
||||
|
||||
2. MVC
|
||||
1. Spring MVC
|
||||
|
||||
MVC 设计模式
|
||||
`model`,`view`,`controller`
|
||||
|
||||
1. 核心组件
|
||||
|
||||
- `Dispatchservlet`:核心中央处理器
|
||||
- `HandlerMapping`:处理器映射器
|
||||
- `HandlerAdapter`:处理器适配器
|
||||
- `Handler`:请求处理器
|
||||
- `ViewResolver`:视图解析器
|
||||
|
||||
1. 工作原理
|
||||
|
||||
![[SpringMVC工作流程图.png]]
|
||||
|
||||
1. 统一异常处理
|
||||
|
||||
使用注解@ControllerAdvice+@ExceptionHandler
|
||||
|
||||
3. Spring 中的设计模式
|
||||
|
||||
- 工厂设计模式
|
||||
- 代理设计模式
|
||||
- 单例设计模式
|
||||
- 模板方法模式
|
||||
- 包装器模式
|
||||
- 观察者模式
|
||||
- 适配器模式
|
||||
|
||||
4. Spring 事务
|
||||
1. 管理事务的方式
|
||||
|
||||
- 编程式事务:通过代码来实现事务管理
|
||||
- 声明式事务:通过 xml 配置或注解的方式,实际通过 AOP 实现
|
||||
|
||||
1. 事务传播行为
|
||||
|
||||
- `PROPAGATION_REQUIRED`
|
||||
- `PROPAGATION_REQUIRES_NEW`
|
||||
- `PROPAGATION_NESTED`
|
||||
- `PROPAGATION_MANDATORY`
|
||||
- `PROPAGATION_SUPPORTS`
|
||||
- `PROPAGATION_NOT_SUPPORT`
|
||||
- `PROPAGATION_NEVER`
|
||||
|
||||
1. 隔离级别
|
||||
|
||||
- `ISOLATION_DEFAULT` :使用后端数据库的默认隔离级别
|
||||
- `ISOLATION_READ_UNCOMMITED`:
|
||||
- `ISOLATION_REPEATABLE_READ`:
|
||||
- `ISOLATION_SERIALIZABLE`:
|
||||
|
||||
1. @Transactional (rollbackFor = Exception. class)注解
|
||||
|
||||
默认回滚RuntimeException
|
||||
|
||||
5. Spring Data JPA
|
||||
|
||||
|
||||
6. Spring Security
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 38 KiB |
@@ -1,9 +0,0 @@
|
||||
1. AQS 是什么
|
||||
2. AQS 原理
|
||||
3. Semaphore 原理
|
||||
4. CountDownLatch 用处
|
||||
5. CountDownLatch 原理
|
||||
6. CountDownLatch 使用场景
|
||||
7. CyclicBarrier 用处
|
||||
8. CyclicBarrier 原理
|
||||
9.
|
||||
@@ -1,3 +0,0 @@
|
||||
1. 什么是Future
|
||||
2. Callable 和 Future 关系
|
||||
3. CompletableFuture 类用法
|
||||
@@ -1,9 +0,0 @@
|
||||
> 实现每一个线程都有一个自己的本地专属本地变量
|
||||
|
||||
1. 用处
|
||||
|
||||
2. 如何使用
|
||||
|
||||
3. 原理
|
||||
|
||||
4. 内存泄漏问题
|
||||
@@ -1,16 +0,0 @@
|
||||
1. 如何保证变量可见性
|
||||
|
||||
2. 如何禁止指令重排序
|
||||
|
||||
内存屏障
|
||||
|
||||
3. 可以保证原子性吗
|
||||
|
||||
4. synchornized 关键字作用
|
||||
|
||||
5. 如何使用 synchornized
|
||||
|
||||
6. synchronized 底层优化
|
||||
|
||||
7. volatile 和 synchorizoned 区别
|
||||
|
||||
@@ -1,48 +0,0 @@
|
||||
1. 线程和进程
|
||||
|
||||
2. 线程和进程的区别及优缺点
|
||||
|
||||
3. 程序计数器为什么是私有的
|
||||
|
||||
4. 虚拟机栈和本地方法栈为什么是私有的
|
||||
|
||||
5. 堆和方法区
|
||||
|
||||
6. 并发和并行的区别
|
||||
|
||||
7. 为什么要使用多线程
|
||||
|
||||
8. 线程安全和线程不安全
|
||||
|
||||
9. 线程的生命周期和状态
|
||||
|
||||
- **new**
|
||||
- **runnable**
|
||||
- **blocking**
|
||||
- **waiting**
|
||||
- **time_waiting**
|
||||
- **terminated**
|
||||
|
||||
10. 线程上下文切换
|
||||
|
||||
11. 线程开始和结束
|
||||
|
||||
12. 如何避免死锁
|
||||
|
||||
**死锁的条件**
|
||||
|
||||
**破坏死锁**
|
||||
|
||||
12. sleep和wait方法
|
||||
|
||||
13. 为什么wait方法不定义在Thread中
|
||||
|
||||
14. 可以直接调用run方法吗
|
||||
|
||||
15. 内存模型
|
||||
|
||||
16. [[volatile和synchorizoned]]关键字
|
||||
|
||||
17. [[线程池]]
|
||||
18. JUC 工具
|
||||
19. 线程资源的可靠性
|
||||
@@ -1,24 +0,0 @@
|
||||
1. 什么是线程池
|
||||
|
||||
2. 为什么要使用线程池
|
||||
3. 线程池工作原理
|
||||
|
||||
4. 如何创建线程池
|
||||
|
||||
5. 为什么不推荐使用内置线程池
|
||||
|
||||
6. 线程池常见参数
|
||||
|
||||
7. 线程池饱和策略
|
||||
|
||||
8. 线程池常用阻塞队列
|
||||
|
||||
9. 给线程池命名
|
||||
|
||||
10. 设定线程大小
|
||||
|
||||
11. 动态修改线程池参数
|
||||
|
||||
12. [[Future]] 类
|
||||
|
||||
13. [[AQS]]
|
||||
@@ -1,23 +0,0 @@
|
||||
1. 乐观锁和悲观锁
|
||||
|
||||
2. CAS 算法
|
||||
|
||||
3. CAS 算法的 ABA 问题
|
||||
|
||||
4. ReentrantLock
|
||||
|
||||
5. 公平锁和非公平锁
|
||||
|
||||
6. Reentrant 和 Synchronized 区别
|
||||
|
||||
7. 可终端锁和不可中断锁
|
||||
|
||||
8. ReentrantReadWriteLock
|
||||
|
||||
9. 共享锁和独占锁
|
||||
|
||||
10. StampedLock
|
||||
|
||||
11. [[Atomic原子类]]
|
||||
|
||||
12. [[ThreadLocal]]
|
||||
@@ -1,3 +0,0 @@
|
||||
1. 什么是容器
|
||||
2. 容器 VS 虚拟机
|
||||
3. Docker 底层原理
|
||||
@@ -1 +0,0 @@
|
||||
1. 版本控制
|
||||
@@ -1,6 +0,0 @@
|
||||
1. 坐标
|
||||
2. 依赖
|
||||
3. 仓库
|
||||
4. 生命周期
|
||||
5. 插件
|
||||
6. 多模块管理
|
||||
@@ -1,203 +0,0 @@
|
||||
1. 什么是关系型数据库
|
||||
|
||||
存储了数据之间的联系
|
||||
|
||||
2. MySQL 优点
|
||||
|
||||
社区,成熟,开源免费,事务分库分表功能完善
|
||||
|
||||
3. MySQL 字段类型
|
||||
|
||||
- **数值类型**:
|
||||
- **字符串类型**:
|
||||
- **日期事件类型 **:
|
||||
![[Pasted image 20230810104944.png]]
|
||||
|
||||
4. char 和 varchar 的区别
|
||||
|
||||
char 是定长,长度不可变,占用长度固定,空白处填充空格,varchar 长度可变,但是需要额外 1 个或两个记录长度
|
||||
|
||||
5. decimal 和 float/double 的区别
|
||||
|
||||
decimal 是定点数,可存储精确小数位,float 是浮点数,只能存储近似精度的
|
||||
|
||||
6. 为什么不推荐 text 和 blob
|
||||
|
||||
text 可存储不限长度的数据,blob 存储二进制对象,
|
||||
都不能有默认值,text 检索效率低,需要指定前缀长度,影响 IO 带宽
|
||||
|
||||
7. datetime 和 timestamp 的区别
|
||||
|
||||
datetime 没有时区信息,占 8 个字节,timestamp 与时区有关,占 4 个字节
|
||||
|
||||
8. NULL 和‘’的区别
|
||||
|
||||
NULL 代表一个不确定的值,都是 NULL 也不一定相等,聚合函数会忽略 NULL 值
|
||||
‘’长度为 0,不占用空间,NULL 占空间,需要用 IS NULL 或 IS NOT NULL 判断
|
||||
|
||||
9. 基础架构/查询过程
|
||||
|
||||
- 连接器
|
||||
- 查询缓存
|
||||
- 分析器
|
||||
- 优化器
|
||||
- 执行器
|
||||
- 插件式存储引擎
|
||||
|
||||
10. 支持的存储引擎,默认使用哪个
|
||||
|
||||
InnoDB 式默认存储引擎,只有 InnoDB 支持事务
|
||||
|
||||
11. 存储引擎架构
|
||||
|
||||
插件式架构,存储引擎基于表,而不是数据库
|
||||
|
||||
12. MyISAM 和 InnoDB 区别,如何选择
|
||||
|
||||
MyISAM 不支持事务和行级锁,崩溃后无法安全恢复,不支持外键,不支持 MMVC,索引与数据分离
|
||||
|
||||
13. [[MySQL索引]]
|
||||
|
||||
14. 查询缓存
|
||||
|
||||
查询时会先查询缓存,在同样的查询条件和数据情况下,会直接命中缓存返回结果
|
||||
**不命中情况**:
|
||||
- 查询在任何字符上的不同
|
||||
- 查询中包含用户自定义函数,存储函数,用户变量,临时表,MySQL 中的系统表
|
||||
- 如果这个表的数据发生变化
|
||||
|
||||
15. 日志
|
||||
|
||||
1. MySQL 中的常见日志有哪些
|
||||
|
||||
1. 慢查询日志有什么用
|
||||
2. binlog 主要记录了什么
|
||||
3. redolog 如何保证事务的持久性
|
||||
4. 页修改之后为什么不直接刷盘
|
||||
5. binlog 和 redolog 有什么区别
|
||||
6. undolog 如何保证事务的原子性
|
||||
|
||||
16. 事务
|
||||
|
||||
1. 什么是事务
|
||||
|
||||
逻辑上的一组操作,要么都执行,要么都不执行
|
||||
|
||||
1. 数据库事务
|
||||
|
||||
要么全部执行成功,要么全部不执行
|
||||
- 原子性
|
||||
- 一致性
|
||||
- 隔离性
|
||||
- 持久性
|
||||
|
||||
1. 并发事务带来的问题
|
||||
|
||||
- 脏读
|
||||
- 丢失修改
|
||||
- 不可重复读
|
||||
- 幻读
|
||||
|
||||
1. 不可重复读和幻读的区别
|
||||
|
||||
不可重复读是多次读取数据值被修改
|
||||
幻读,可以看作是不可重复读的特殊情况,查询记录条数不一致
|
||||
|
||||
1. 并发事务的控制方式
|
||||
|
||||
- 锁
|
||||
通过读写锁来实现并发控制
|
||||
- [[MVCC]]
|
||||
多版本并发控制,对一份数据存储多个变笨,通过事务的可见性办证事务看到自己该刊的版本,主要依赖手段:隐藏字段,read view,undo log
|
||||
|
||||
1. 事务隔离级别
|
||||
|
||||
- 读未提交
|
||||
- 读已提交
|
||||
- 可重复读
|
||||
- 可串行化
|
||||
|
||||
1. MySQL 隔离级别基于锁实行的吗
|
||||
|
||||
SERIALZABLE 是通过锁。READ-COMMIT 和 REPEATABLE-READ 通过 MVCC 实现
|
||||
|
||||
1. 默认隔离级别
|
||||
|
||||
可重复读
|
||||
|
||||
17. MySQL 锁
|
||||
|
||||
1. 表锁和行锁
|
||||
|
||||
表锁是粒度最大的锁,针对非索引字段加的锁,简单,资源消耗小,不会死锁
|
||||
行锁,粒度最小的锁,针对索引字段加的锁,减少数据库操作的冲突,开销大,枷锁慢,会死锁
|
||||
|
||||
1. 行级锁的使用
|
||||
|
||||
执行更新的语句时,WHERE 条件中没有命中唯一索引或索引失效会导致表锁
|
||||
|
||||
1. InnoDB 有哪几类行锁
|
||||
|
||||
- 记录锁:单个行记录上的锁
|
||||
- 间隙锁:锁定一个范围,不包括记录本身
|
||||
- 临键锁:记录锁+间隙锁,解决幻读问题
|
||||
|
||||
默认使用临键锁,操作的索引是唯一索引或主键会降级为记录锁
|
||||
|
||||
1. 共享锁和排他锁
|
||||
|
||||
- 共享锁
|
||||
- 排他锁
|
||||
因为 MVCC,一般 SELECT 语句不会加锁,通过 LOCK IN SHARE MODE 和 FOR SHARE 或 FOR UPDATE 加锁
|
||||
|
||||
1. 意向锁的作用
|
||||
|
||||
通过意向锁快速判断是否可以对某个表使用表锁
|
||||
- 意向共享锁
|
||||
- 意向排他锁
|
||||
意向锁是数据引擎自己维护的,意向锁之间兼容,意向锁和共享锁和排他锁互斥
|
||||
|
||||
1. 当前读和快照读的区别
|
||||
|
||||
快照读是单纯的 select 语句,不包括加锁的语句,不会等待记录上的锁释放而是读取行的一个快照
|
||||
当前读就是给记录加锁
|
||||
|
||||
1. 自增锁
|
||||
|
||||
插入有自增列的表时,会先获取自增锁,拿不到会阻塞
|
||||
|
||||
8. 性能优化
|
||||
|
||||
1. 能直接存储文件吗
|
||||
|
||||
可以但是不建议
|
||||
|
||||
1. 如何存储 IP 地址
|
||||
|
||||
将 IP 转为整型
|
||||
`INET_ATON()`:将 ip 转为无符号整型
|
||||
`INET_NTOA()`:把整型的 ip 转为地址
|
||||
|
||||
1. 常见 SQL 优化手段
|
||||
|
||||
|
||||
|
||||
1. 分析 SQL 的性能
|
||||
|
||||
使用 `EXPLAIN` 命令区分析 [[SQL 执行计划]]
|
||||
|
||||
1. 读写分离
|
||||
|
||||
|
||||
|
||||
1. 分库分表
|
||||
|
||||
|
||||
|
||||
9. redolog 和 undolog
|
||||
|
||||
10. 两阶段提交(redo 和 binlog 一致性)
|
||||
|
||||
11. binlog 作用
|
||||
|
||||
12. 异步复制和同步复制
|
||||
@@ -1,4 +0,0 @@
|
||||
1. NoSQL 是什么
|
||||
2. NoSQL 和 SQL 的区别
|
||||
3. NoSQL 的优势
|
||||
4. NoSQL 数据库的类型
|
||||
@@ -1,51 +0,0 @@
|
||||
## RDB
|
||||
|
||||
> 通过快照来创建所有数据在某个时间节点的快照,是默认启用的持久化机制
|
||||
|
||||
1. RDB 创建快照会阻塞主线程吗
|
||||
|
||||
使用 `save` 时同步保存会阻塞,使用 `bgsave` 会 fork 出一个子线程不会阻塞
|
||||
|
||||
## AOF
|
||||
|
||||
> 日志文件追加,每次执行完都会间命令写入到 AOF 缓冲区中,再写入 AOF 文件中,最后同步到硬盘
|
||||
|
||||
1. 工作流程
|
||||
|
||||
- **命令追加**,将所有写入的命令追加到 AOF 缓冲区
|
||||
- **文件写入**,将 AOF 缓冲区的数据写入到 AOF 文件中
|
||||
- **文件同步**,AOF 根据对应持久化方式(fsync 策略)向硬盘做同步操作
|
||||
- **文件重写**,当 AOF 文件越来越大,达到一定的体积后会修 AOF 文件进行重写,压缩文件
|
||||
- **重启加载**,当 redis 重启时,可以加载 AOF 文件恢复数据
|
||||
|
||||
2. AOF 持久化方式
|
||||
|
||||
- `appendfsync always`:即时同步,主线程写入操作后立即使用 fsync 同步文件再返回
|
||||
- `appendfsync second`:每秒同步,主线程 write 写入后立即返回,后台每秒调用 fsync 同步到硬盘
|
||||
- `appendfsync no`:由操作系统决定何时同步,主线程写入后立即返回
|
||||
|
||||
3. AOF 为什么在执行完命令之后记录日志
|
||||
|
||||
- 避免对命令检查带来的开销
|
||||
- 执行完之后不会阻塞当前命令
|
||||
- 可能会导致数据丢失
|
||||
- 可能阻塞后续命令执行
|
||||
|
||||
4. AOF 重写
|
||||
|
||||
当 AOF 文件过大时,redis 在后台重写 AOF 产生一个新的 AOF 文件,会对文件进行压缩,
|
||||
重写期间会维护一个 AOF 重写缓冲区,期间所有写入命令会记录到这里,当重写完成后会追加到新的 AOF 文件中
|
||||
|
||||
默认重写 64MB,可在配置修改
|
||||
|
||||
5. AOF 校验机制
|
||||
|
||||
启动时对 AOF 文件进行校验,避免文件损坏和丢失,提升数据可靠性
|
||||
|
||||
6. 4.0 对持久化机制做了什么优化
|
||||
|
||||
混合持久化,AOF 重写时把 RDB 内容添加到 AOF 问文件开头,从而快随加载同时避免丢失过多数据,缺点时可读性较差
|
||||
|
||||
7. 如何选择
|
||||
|
||||
如果对于丢失数据没太大影响,使用 RDB,安全性要求较高,使用AOF
|
||||
@@ -1,220 +0,0 @@
|
||||
1. redis 为什么这么快
|
||||
|
||||
- 基于内存来存储数据的,所以读写访问速度可以做到特别快
|
||||
- 单线程的,可以避免多线程上下文切换带来的开销,同时加入了多路 IO 复用
|
||||
- 内置了优化过的数据类型,性能高
|
||||
|
||||
3. 分布式缓存常见的技术选型方案
|
||||
|
||||
|
||||
|
||||
4. 为什么使用 redis/缓存
|
||||
|
||||
- 高性能,频繁访问的数据,访问数据更快
|
||||
- 高并发,加大 QPS 访问量
|
||||
|
||||
5. redis 的应用场景
|
||||
|
||||
- 分布式锁
|
||||
- 限流,通过 redis 加 Lua 脚本实现,令牌桶
|
||||
- 消息队列
|
||||
- 延时队列
|
||||
- 分布式 Session
|
||||
- 复杂业务场景,通过 bitmap 统计用户活跃量,通过或 soted set 实现排行榜
|
||||
|
||||
6. 常见缓存读写分类策略
|
||||
7. 如何实现分布式锁
|
||||
|
||||
set NX key value,del NX key value
|
||||
|
||||
8. redis 数据结构
|
||||
|
||||
- String
|
||||
- List
|
||||
- Set
|
||||
- Zset
|
||||
- Hash
|
||||
- HyperLogLogs
|
||||
- Bitmap
|
||||
- GeoSptial
|
||||
|
||||
10. String 的应用场景
|
||||
|
||||
String 是一种二进制安全的数据结构,可以用来存储任何类型数据,字符串,浮点数,图片(base 64 或地址),序列化
|
||||
|
||||
11. String 还是 Hash 存储对象更好
|
||||
|
||||
String 性能上比 Hash 节省内存,并且在存储多层嵌套的整个对象通过序列化也很方便,Hash 则是可以单独修改或者添加部分字段信息,如果是经常修改对象中的部分信息,就使用 Hash,否则用String
|
||||
|
||||
12. String 的底层实现
|
||||
|
||||
C 语言字符串是以\\0 结尾的字符数组,但是 redis 自己编写了 SDC(简单动态字符串)作为底层实现
|
||||
|
||||
13. 购物车使用 String 还是 Hash
|
||||
|
||||
使用 Hash,用户修改时就只是修改内部的 key 和 value 值即可
|
||||
|
||||
14. 如何实现排行榜
|
||||
|
||||
使用 Zset 实现
|
||||
|
||||
15. Set 的使用场景
|
||||
|
||||
存储不能重复的数据,例如网站的 UV 统计,点赞的统计
|
||||
计算交集并集差集,共同好友
|
||||
需要随机获取数据中的元素的场景,抽奖,随机点名
|
||||
|
||||
16. 使用 Set 实现抽奖系统
|
||||
|
||||
添加元素,随机移除并获取其中一个(不重复),随机获取一个元素(可重复)
|
||||
|
||||
17. 使用 Bitmap 统计活跃用户
|
||||
|
||||
将用户 ID 作为 offset,如果用户活跃过,就将该 bit 位设为 1
|
||||
|
||||
18. 使用 HyperLogLog 统计页面 UV
|
||||
|
||||
添加一个或多个元素到 HyperLogLog 中,
|
||||
获取一个或多个 HyperLogLog 的唯一计数
|
||||
|
||||
19. [[Redis 持久化机制]]
|
||||
|
||||
20. Redis 线程模型
|
||||
|
||||
Redis 在 6.0 引入多线程来提供网络请求处理 IO 的性能,Redis 中的事件处理模型基于 Reacotor 模型,对应其中的文件时间处理器,这个是单线程运行的,Redis 利用 IO 多路复用程序来监听来自客户端的大量链接,无需创建多余的线程来监听,降低资源消耗
|
||||
|
||||
21. Redis 6.0 之前为什么不使用多线程,6.0 为何应用多线程
|
||||
|
||||
为了提高网络 IO 的读写性能,Redis 瓶颈主要在于**内存**和**网络**
|
||||
|
||||
22. Redis 后台线程
|
||||
|
||||
三个后台线程:
|
||||
- `close_file`
|
||||
- `aof_fsync`
|
||||
- `lazy_free`
|
||||
|
||||
23. Rdis 缓存过期时间,如何判断数据是否过期,过期数据删除策略
|
||||
|
||||
redis 内存有限,因此要给缓存设置一定的过期时间,防止 OOM,同时可以实现某些需要一定时间后过期的业务,
|
||||
通过一个过期字典(一个 hash 表)来保存数据过期的时间,过期字典的 key 指向 redis 中的 key,value 是一个 long 类型的整数,存储时间戳
|
||||
|
||||
**过期数据删除策略**
|
||||
- **惰性删除**:只有在数据取出时判断是否过期,对 cpu 友好
|
||||
- **定期删除**:定期取出一批的 key 删除过期的 key,通过限制删除操作执行时长和频率来减少对 CPU 的影响,对内存友好
|
||||
---
|
||||
redis 使用的是定期删除+惰性删除的方式
|
||||
|
||||
24. 内存淘汰机制
|
||||
|
||||
- **volatile-lru**:从已设置过期时间的数据集中挑选最少使用的进行删除
|
||||
- **volatile-ttl**:从已设置过期时间的数据集中挑选将要过期的删除
|
||||
- **volatile-random**:从已设置过期时间的数据集中随机选择数据删除
|
||||
- **allkeys-lru**:内存不足时,移除最近最少使用的 key
|
||||
- **allkeys-random**:从数据中随机选择数据淘汰
|
||||
- **no-eviction**:禁止删除,新写入的操作报错
|
||||
- **volatile-lfu**:从已设置过期时间的数据集中挑选最不经常使用的数据删除
|
||||
- **allkeys-lfu**:从键空间中移除最不经常使用的数据
|
||||
|
||||
25. 什么是 Rdis 事务
|
||||
|
||||
redis 事务将多个命令打包后顺序执行,通过 `MULTI` `EXEC` `DISCARD` `WATCH` 命令实现
|
||||
|
||||
26. Redis 事务支持原子性吗,支持持久性吗
|
||||
|
||||
不支持,运行错误时也不支持回滚,除了出现错误的命令其他命令都会执行,无法保证持久性
|
||||
|
||||
27. 如何解决 Redis 事务缺陷
|
||||
|
||||
利用 Lua 脚本来批量执行,一段 Lua 脚本可以看成一条命令,执行过程中不会有其他命令执行,但是出错的命令之后的命令也不会执行
|
||||
|
||||
28. Redis 性能优化
|
||||
1. 使用批量操作减少网络传输
|
||||
一个 redis 命令执行分为以下四部
|
||||
- 发送命令
|
||||
- 命令排队
|
||||
- 命令执行
|
||||
- 返回结果
|
||||
1 和 4 的耗时为 RTT,就时网络延时,通过批量操作可以减少网络传输次数,减少网络开销
|
||||
1. pipeline
|
||||
`MGET`,`HMGET`,`SADD`,原生支持批量操作
|
||||
1. 通过pipeline
|
||||
1. Lua 脚本
|
||||
30. 大量 key 集中过期问题
|
||||
|
||||
- 给 key 设置随机过期时间
|
||||
- 设置 lazy-free(惰性删除/延迟释放)
|
||||
|
||||
31. bigkey 分析及处理
|
||||
|
||||
String 类型超过 10kb,复合类型超过 5000 个元素,
|
||||
使用 redis 的--bigkey 获取,借助开源工具分析,借助公有云的 Redis 分析服务
|
||||
|
||||
- 分割 BigKey
|
||||
- 手动清理
|
||||
- 采用合适的数据结构(HyperLogLog 统计页面 UV)
|
||||
- 开启 lazy-free
|
||||
|
||||
32. hotkey 危害及处理
|
||||
|
||||
频繁访问的 key,
|
||||
使用--hotkey,使用 `MONITOR`,使用开源项目京东 hotkey,根据业务提前预估,业务代码中记录,借助公有云分析
|
||||
|
||||
- 读写分离
|
||||
- 使用 Redis Cluster
|
||||
- 二级缓存,将 hotkey 存放一份到 JVM 本地内存中(使用Caffeine)
|
||||
|
||||
33. 慢查询命令
|
||||
|
||||
设置慢查询时间,通过查询慢查询日志获取
|
||||
|
||||
34. 内存碎片
|
||||
|
||||
不可用的内存空间
|
||||
- redis 存储数据时申请的空间大于实际需要空间
|
||||
- 频繁修改 redis 中的数据
|
||||
|
||||
通过 redis 的内存整理功能清理碎片
|
||||
|
||||
35. 生产问题
|
||||
|
||||
1. 缓存穿透
|
||||
|
||||
请求的 key 时不存在于缓存,也不存在于数据库中,从而大量请求到数据库中查找,
|
||||
- 缓存无效 key
|
||||
- 布隆过滤器
|
||||
|
||||
1. 缓存击穿
|
||||
|
||||
请求热点数据,但是热点 key过期,请求大量到数据库,
|
||||
- 设置热点key永不过期
|
||||
- 热点数据提前预热
|
||||
- 请求数据到达数据库前获取互斥锁,保证只有一个请求到达数据库
|
||||
|
||||
1. 缓存雪崩
|
||||
|
||||
缓存在同一时间大量失效,大量请求到达数据库,或者是服务器宕机
|
||||
- 设置不同失效时间,随机失效
|
||||
- 缓存永不失效
|
||||
- 二级缓存
|
||||
- 采用 redis 集群
|
||||
- 限流
|
||||
|
||||
36. 如何保证缓存数据和数据库一致性
|
||||
|
||||
**旁路缓存模式**
|
||||
更新完 DB 后直接删除cache
|
||||
|
||||
37. [[Redis 集群]]
|
||||
|
||||
|
||||
38. 为什么要使用分布式缓存
|
||||
|
||||
|
||||
39. 常见的缓存更新策略
|
||||
|
||||
|
||||
40. 如何实现自动化故障转移
|
||||
|
||||
|
||||
41. 缓存数据量太大怎么办
|
||||
@@ -1,8 +0,0 @@
|
||||
1. SQL 语句分类
|
||||
2. 什么是笛卡尔积
|
||||
3. in 和 between
|
||||
4. 函数
|
||||
1. 文本处理
|
||||
2. 日期和时间处理
|
||||
3. 数值处理
|
||||
4. 汇总
|
||||
@@ -1,3 +0,0 @@
|
||||
1. 何为字符集合
|
||||
2. 有哪些常见的字符集
|
||||
3. MySQL 字符集
|
||||
@@ -1,55 +0,0 @@
|
||||
1. 什么是数据库
|
||||
|
||||
- **数据库**
|
||||
- **数据库管理系统**
|
||||
- **数据库系统**
|
||||
- **数据库管理员**
|
||||
|
||||
2. 数据库中的基本概念
|
||||
|
||||
- **元组**
|
||||
- **码**
|
||||
- **候选码**
|
||||
- **主码**
|
||||
- **外码**
|
||||
- **主属性**
|
||||
- **非主属性**
|
||||
|
||||
3. ER 图
|
||||
|
||||
- 实体
|
||||
- 属性
|
||||
- 联系
|
||||
|
||||
4. 数据库三大范式
|
||||
|
||||
- 属性不可再分
|
||||
- 非主属性不依赖于主键
|
||||
|
||||
5. 主键和外键
|
||||
|
||||
一个表只能有一个主键,非空不重复,外键是与其他表建立关系使用,是另一个表的主键,外键可以重复,可以是空值
|
||||
|
||||
6. 为什么不推荐使用外键与级联
|
||||
|
||||
- 增加复杂性
|
||||
- 增加额外工作
|
||||
- 对分库分表不友好(分库分表下外键无法生效)
|
||||
|
||||
7. 存储过程
|
||||
|
||||
一些 SQL 语句的集合,添加了一些逻辑控制语句
|
||||
|
||||
8. drop,delete,truncate 区别
|
||||
|
||||
drop 是删除表,dekete 是删除数据,truncate 不摧毁表结构,同时主键 id 从 1 开始自增
|
||||
速度上 deop>truncate>delete
|
||||
|
||||
9. 数据库设计通常分为那几步
|
||||
|
||||
- 需求分析
|
||||
- 概念结构设计
|
||||
- 逻辑结构设计
|
||||
- 物理结构设计
|
||||
- 数据库实施
|
||||
- 数据库运行与维护
|
||||
@@ -1,15 +0,0 @@
|
||||
1. 优缺点
|
||||
|
||||
- 使用索引可以加快数据的检索速度
|
||||
- 使用唯一索引保证数据库中每一行数据的唯一性
|
||||
|
||||
- 创建和维护索引耗费时间,索引重排会降低效率
|
||||
- 占用额外物理存储
|
||||
|
||||
2. 底层数据结构
|
||||
|
||||
**hash**
|
||||
通过 hash 可以快速通过 key 获取对应的 index,找到对应 value,但是会有 Hash 冲突,MySQL 的 InnoDB 引擎存在一种自适应哈希索引,每一个哈希桶都是一个小型 B+树结构
|
||||
Hash 不支持顺序和范围查询
|
||||
|
||||
**二叉树**
|
||||
@@ -1,12 +0,0 @@
|
||||
1. 什么是 JWT
|
||||
2. JWT 组成部分
|
||||
1. HEADER
|
||||
2. PAYLOAD
|
||||
3. SINGNATURE
|
||||
3. 如何基于 JWT 进行身份验证
|
||||
4. 如何防止篡改
|
||||
5. 如何加强 JWT 安全性
|
||||
6. JWT 优势
|
||||
7. JWT 身份认证问题
|
||||
1. 注销登录后 JWT 还有效
|
||||
2. JWT 续签问题
|
||||
@@ -1,4 +0,0 @@
|
||||
1. SSO 好处
|
||||
2. 设计与实现
|
||||
3. 用户登录状态的存储与校验
|
||||
4.
|
||||
@@ -1,14 +0,0 @@
|
||||
1. 哈希算法
|
||||
1. MD
|
||||
2. SHA
|
||||
3. MAC
|
||||
4. 国密算法
|
||||
5. Bcrypt
|
||||
2. 对称加密
|
||||
1. DES
|
||||
2. 3DES
|
||||
3. AES
|
||||
3. 非对称加密
|
||||
1. RSA
|
||||
2. DSA
|
||||
3. ECC
|
||||
@@ -1,17 +0,0 @@
|
||||
## 认证授权
|
||||
|
||||
1. 认证和授权
|
||||
2. RBAC 模型
|
||||
3. Cookie 作用
|
||||
|
||||
存放在客户端,一般用来保存用户信息
|
||||
|
||||
4. Cookie 和 Seeeion 的区别
|
||||
5. 使用 Session-Cookie 方案进行身份验证
|
||||
6. 多服务器节点下的 Session-Cookie 方案
|
||||
7. 没有 Cookie 的 Session 还能用吗
|
||||
8. Cookie 无法防止 CSRF 攻击,Token 可以
|
||||
9. [[JWT]]
|
||||
10. [[SSO]]
|
||||
11. OAuth 2.0
|
||||
12.
|
||||
@@ -1,12 +0,0 @@
|
||||
1. 为什么需要定时任务
|
||||
2. 单机定时任务技术
|
||||
1. Timer
|
||||
2. ScheduledExecutorService
|
||||
3. SpringTask
|
||||
4. 时间轮
|
||||
3. 分布式定时任务
|
||||
1. Quartz
|
||||
2. Elastic-job
|
||||
3. XXL-JOB
|
||||
4. PowerJob
|
||||
4.
|
||||
@@ -1,2 +0,0 @@
|
||||
1. Trie 树
|
||||
2. DFA
|
||||
@@ -1,8 +0,0 @@
|
||||
1. 什么是消息推送
|
||||
2. 消息推送常见方案
|
||||
1. 短轮询
|
||||
2. 长轮询
|
||||
3. iframe 流
|
||||
4. SSE
|
||||
5. Websocker
|
||||
6. MQTT
|
||||
@@ -1,10 +0,0 @@
|
||||
1. 从输入 URL 到页面展示发生了什么
|
||||
2. HTTP 状态码
|
||||
3. HTTP Header 常见字段
|
||||
4. HTTP 和 HTTPS 区别
|
||||
5. HTTP 和 HTTP 1.1,HTTP 2.0,HTTP 3.0
|
||||
6. HTTP 如何保存用户状态
|
||||
7. URI 和 URL
|
||||
8. Cookie 和 Seeeion
|
||||
9. PING 命令及其工作原理
|
||||
10. DNS 作用和服务器,解析过程
|
||||
@@ -1,14 +0,0 @@
|
||||
1. Linux 系统是什么
|
||||
2. 文件系统 inode
|
||||
3. 硬链接和软链接
|
||||
4. 文件类型
|
||||
5. 目录树
|
||||
6. 常见命令
|
||||
7. 文件压缩
|
||||
8. 文件传输
|
||||
9. 文件权限
|
||||
10. 用户管理
|
||||
11. 系统状态
|
||||
12. 网络通信
|
||||
13. 环境变量
|
||||
14. 查看端口占用
|
||||
@@ -1,7 +0,0 @@
|
||||
1. 什么是 Shell
|
||||
2. 变量
|
||||
3. 字符串
|
||||
4. 数组
|
||||
5. 基本运算符
|
||||
6. 函数
|
||||
7.
|
||||
@@ -1,32 +0,0 @@
|
||||
1. 什么是操作系统
|
||||
2. 操作系统主要功能
|
||||
3. 用户态和内核态
|
||||
4. 系统调用
|
||||
5. 进程和线程
|
||||
6. PCB 是什么,包含什么
|
||||
7. 进程状态
|
||||
8. 进程间通信
|
||||
9. 进程的调度算法
|
||||
10. 僵尸进程和孤儿进程
|
||||
11. 操作系统死锁
|
||||
12. 死锁的四个必要条件
|
||||
13. 解决死锁
|
||||
1. 预防
|
||||
2. 避免
|
||||
3. 检测
|
||||
4. 解除
|
||||
14. 内存管理
|
||||
15. 内存碎片
|
||||
16. 虚拟内存
|
||||
17. 虚拟内存和物理地址
|
||||
18. 虚拟地址空间和物理地址空间
|
||||
19. 虚拟和物理内存地址映射
|
||||
1. 分段机制
|
||||
2. 分页机制
|
||||
3. 段页机制
|
||||
20. 文件系统功能
|
||||
21. 硬链接和软链接
|
||||
22. 硬连接为什么不能跨文件系统
|
||||
23. 提高文件系统性能
|
||||
24. 常见磁盘调度算法
|
||||
25.
|
||||
@@ -1,40 +0,0 @@
|
||||
## 线性
|
||||
|
||||
1. 数组
|
||||
2. 链表
|
||||
3. 栈
|
||||
4. 队列
|
||||
|
||||
## 图
|
||||
|
||||
1. 基本概念
|
||||
2. 存储
|
||||
3. 搜索
|
||||
|
||||
## 堆
|
||||
|
||||
1. 什么是堆
|
||||
2. 用途
|
||||
3. 分类
|
||||
4. 存储
|
||||
5. 操作
|
||||
6. 排序
|
||||
|
||||
## 树
|
||||
|
||||
1. 二叉树
|
||||
2. 存储
|
||||
3. 遍历
|
||||
|
||||
## 红黑树
|
||||
|
||||
1. 特点
|
||||
2. 应用
|
||||
3. 为什么要用红黑树
|
||||
|
||||
## 布隆过滤器
|
||||
|
||||
1. 什么是布隆过滤器
|
||||
2. 原理
|
||||
3. 使用场景
|
||||
4. Redis 中的布隆过滤器
|
||||
@@ -1,12 +0,0 @@
|
||||
1. KMP 算法
|
||||
2. 替换空格
|
||||
3. 最长公共前缀
|
||||
4. 回文串
|
||||
5. 括号匹配深度
|
||||
6. 把字符串转换成整数
|
||||
|
||||
## 链表
|
||||
|
||||
## 剑指 offer
|
||||
|
||||
## 十大经典排序算法
|
||||
@@ -1,27 +0,0 @@
|
||||
1. OSI 七层网络模型
|
||||
2. TCP/IP 四层模型
|
||||
3. 常见网络协议
|
||||
4. 传输层协议
|
||||
1. TCP
|
||||
2. UDP
|
||||
5. 网络层协议
|
||||
1. IP
|
||||
2. ARP
|
||||
3. ICMP
|
||||
4. NAT
|
||||
5. OSPF
|
||||
6. RIP
|
||||
7. BGP
|
||||
6. [[HTTP]]
|
||||
7. TCP 和 UDP 区别
|
||||
8. HTTP 3.0 使用 UDP
|
||||
9. 使用 UDP 和 TCP 的协议
|
||||
10. TCP 三次握手和四次挥手
|
||||
11. TCP 如何保证传输可靠性
|
||||
12. IP 协议
|
||||
1. 作用
|
||||
2. 地址
|
||||
3. 地址过滤
|
||||
4. V 4 和 V6
|
||||
13. NAT 作用
|
||||
14. ARP
|
||||
@@ -1,7 +0,0 @@
|
||||
1. 计算机网络概述
|
||||
2. 物理层
|
||||
3. 数据链路层
|
||||
4. 网络层
|
||||
5. 传输层
|
||||
6. 应用层
|
||||
7.
|
||||
@@ -1,10 +0,0 @@
|
||||
1. 与HashMap和HashTable的区别
|
||||
|
||||
2. 底层数据结构
|
||||
|
||||
3. 实现线程安全的方式
|
||||
|
||||
4. 线程安全的具体实现方式/底层具体实现
|
||||
|
||||
5. 1.7和1.8的区别
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
---
|
||||
title: List面试问题
|
||||
date: 2023-08-02 21:40
|
||||
mdate: 2023-08-06 18:04:07
|
||||
---
|
||||
# List面试题
|
||||
|
||||
1. ArrayList 和 Array 的区别
|
||||
ArrayList 底层是 Array,可以扩容,只能存引用数据类型,具有一些 API 方法
|
||||
|
||||
2. ArrayList 和 LinkedList 增删插元素及区别
|
||||
|
||||
都不是线程安全的
|
||||
ArrayList 底层为数组,LinkedList 底层为双向链表
|
||||
Array 在添加元素和删除元素和 LinkedList 受位置影响,Array 添加时 Array 在末尾时 O(1)在指定位置 i 插入时是 O (n), Linked 在头尾插入为 O(1)在位置 i 插入为 O(n)
|
||||
ArrayList 支持随机快速访问
|
||||
ArrayList 空间连续,在末尾会预留一定空间,Linked 每个元素比 Array 大
|
||||
|
||||
3. LinkedList 没有实现 randomSccess 接口,因为内存不连续性,只能通过指针访问,不支持随机快速访问
|
||||
|
||||
4. ArrayList 扩容机制[[ Set面试问题.md | Set面试问题 ]]
|
||||
首先如果是无参构造器就创建一个空的 object 数组,有参数的就构建一个对应长度的数组,每次扩容 1.5 倍,添加时会先检查当前的容量,如果不足就会先扩容,将当前的元素复制到一个扩容之后的数组,删除元素时会将当前元素之前的元素和之后的元素合成一个新的数组,并返回当前的值
|
||||
|
||||
删除元素时返回 true 或 false,删除下标的时候会返回当前下标对应的元素
|
||||
|
||||
与下表有关的操作都会检查下标是否越界
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
---
|
||||
title: List面试问题
|
||||
date: 2023-08-06 10:46
|
||||
mdate: 2023-08-06 21:48:13
|
||||
---
|
||||
|
||||
# Map面试题
|
||||
|
||||
1. HashMap和HashTable的区别
|
||||
|
||||
2. HashMap和HashSet的区别
|
||||
|
||||
3. HashMap和TreeMap的区别
|
||||
|
||||
4. HashSet如何见检查重复
|
||||
|
||||
5. HashMap的底层实现
|
||||
|
||||
6. HashMap扩容
|
||||
|
||||
7. [[ConcurrentHashMap]]
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user