├── doc ├── 实战-l2cache高并发下缓存穿透的现象是这样的.md └── 写该组件的初衷.md ├── TDL.MD ├── img ├── weixin.jpg ├── rewards.jpg ├── evictd_keys.png ├── levelcache.png ├── weixinqun.jpg ├── memory_usage.png └── info evictd_keys.png ├── l2cache-spring-boot-starter ├── src │ └── main │ │ ├── resources │ │ └── META-INF │ │ │ ├── spring.provides │ │ │ └── spring.factories │ │ └── java │ │ └── com │ │ └── github │ │ └── jesse │ │ └── l2cache │ │ └── spring │ │ ├── L2CacheProperties.java │ │ ├── EnableL2Cache.java │ │ └── biz │ │ └── AbstractCacheService.java └── read.md ├── l2cache-example └── src │ ├── main │ ├── resources │ │ ├── application-80.yml │ │ ├── application-81.yml │ │ ├── application-82.yml │ │ ├── redisson.yaml │ │ └── redisson-prod-demo.yaml │ └── java │ │ └── com │ │ └── github │ │ └── jesse │ │ └── l2cache │ │ └── example │ │ ├── dto │ │ ├── GoodsPriceRevisionIdsPutReqDTO.java │ │ ├── GoodsPriceRevisionIdsReqDTO.java │ │ ├── BrandRespBO.java │ │ ├── User.java │ │ ├── BrandIdListBO.java │ │ └── GoodsPriceRevisionRespBO.java │ │ ├── util │ │ └── TracingVariable.java │ │ ├── Application81.java │ │ ├── Application82.java │ │ ├── Application80.java │ │ ├── config │ │ ├── RedissonConfig.java │ │ └── TraceIdConfig.java │ │ └── controller │ │ └── ReidsCacheTestController.java │ └── test │ └── java │ └── com │ └── github │ └── jesse │ └── l2cache │ └── example │ └── ConcurrentReferenceHashMapTest.java ├── .gitee ├── ISSUE_TEMPLATE.zh-CN.md └── PULL_REQUEST_TEMPLATE.zh-CN.md ├── l2cache-jd-hotkey ├── jd-hotkey-dashboard │ └── src │ │ └── main │ │ ├── resources │ │ └── static │ │ │ └── admin │ │ │ ├── bootstarp │ │ │ ├── index.html │ │ │ └── jhere.net │ │ │ │ ├── px3032.gif │ │ │ │ └── px5d87.gif │ │ │ ├── images │ │ │ ├── 10.jpg │ │ │ ├── jd.ico │ │ │ ├── main.png │ │ │ └── xiaojingyu.png │ │ │ ├── assets │ │ │ ├── img │ │ │ │ ├── bg.jpg │ │ │ │ ├── bg10.jpg │ │ │ │ ├── bg11.jpg │ │ │ │ ├── bg12.jpg │ │ │ │ ├── bg13.jpg │ │ │ │ ├── bg2.jpg │ │ │ │ ├── bg3.png │ │ │ │ ├── bg5.jpg │ │ │ │ ├── bg8.jpg │ │ │ │ ├── bg9.jpg │ │ │ │ ├── plus.png │ │ │ │ ├── giftly.png │ │ │ │ ├── marker.png │ │ │ │ ├── minus.png │ │ │ │ ├── small-bg.jpg │ │ │ │ ├── small-bg2.jpg │ │ │ │ ├── small-bg5.jpg │ │ │ │ ├── small-bg8.jpg │ │ │ │ ├── small-bg9.jpg │ │ │ │ ├── search-dark.png │ │ │ │ ├── small-bg10.jpg │ │ │ │ ├── small-bg11.jpg │ │ │ │ ├── small-bg12.jpg │ │ │ │ ├── small-bg13.jpg │ │ │ │ └── search-white.png │ │ │ ├── font │ │ │ │ ├── maki.eot │ │ │ │ ├── maki.ttf │ │ │ │ ├── maki.woff │ │ │ │ ├── entypo.eot │ │ │ │ ├── entypo.ttf │ │ │ │ ├── entypo.woff │ │ │ │ ├── makid41d.eot │ │ │ │ ├── dripicons.eot │ │ │ │ ├── dripicons.ttf │ │ │ │ ├── dripicons.woff │ │ │ │ ├── entypod41d.eot │ │ │ │ ├── dripiconsd41d.eot │ │ │ │ ├── open-sans-bold.woff │ │ │ │ ├── open-sans-light.woff │ │ │ │ ├── fontawesome-webfont.woff │ │ │ │ ├── weathericons-regular-webfont.eot │ │ │ │ ├── weathericons-regular-webfont.ttf │ │ │ │ ├── glyphicons-halflings-regular.woff │ │ │ │ ├── weathericons-regular-webfont.woff │ │ │ │ └── weathericons-regular-webfontd41d.eot │ │ │ ├── ico │ │ │ │ └── minus.png │ │ │ ├── font-ali │ │ │ │ ├── iconfont.eot │ │ │ │ ├── iconfont.ttf │ │ │ │ └── iconfont.woff │ │ │ ├── fonts │ │ │ │ ├── FontAwesome.otf │ │ │ │ ├── open-sans-bold.woff │ │ │ │ ├── open-sans-light.woff │ │ │ │ ├── open-sans-normal.woff │ │ │ │ ├── fontawesome-webfont.eot │ │ │ │ ├── fontawesome-webfont.ttf │ │ │ │ ├── fontawesome-webfont.woff │ │ │ │ ├── fontawesome-webfont.woff2 │ │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ │ ├── glyphicons-halflings-regular.woff │ │ │ │ └── glyphicons-halflings-regulard41d.eot │ │ │ ├── js │ │ │ │ ├── iCheck │ │ │ │ │ ├── flat │ │ │ │ │ │ ├── red.png │ │ │ │ │ │ ├── aero.png │ │ │ │ │ │ ├── blue.png │ │ │ │ │ │ ├── flat.png │ │ │ │ │ │ ├── green.png │ │ │ │ │ │ ├── grey.png │ │ │ │ │ │ ├── pink.png │ │ │ │ │ │ ├── aero@2x.png │ │ │ │ │ │ ├── blue@2x.png │ │ │ │ │ │ ├── flat@2x.png │ │ │ │ │ │ ├── green@2x.png │ │ │ │ │ │ ├── grey@2x.png │ │ │ │ │ │ ├── orange.png │ │ │ │ │ │ ├── pink@2x.png │ │ │ │ │ │ ├── purple.png │ │ │ │ │ │ ├── red@2x.png │ │ │ │ │ │ ├── yellow.png │ │ │ │ │ │ ├── orange@2x.png │ │ │ │ │ │ ├── purple@2x.png │ │ │ │ │ │ └── yellow@2x.png │ │ │ │ │ └── line │ │ │ │ │ │ ├── line.png │ │ │ │ │ │ └── line@2x.png │ │ │ │ ├── tree │ │ │ │ │ ├── images │ │ │ │ │ │ ├── file.gif │ │ │ │ │ │ ├── folder.gif │ │ │ │ │ │ ├── ajax-loader.gif │ │ │ │ │ │ ├── folder-closed.gif │ │ │ │ │ │ ├── treeview-gray.gif │ │ │ │ │ │ ├── treeview-red.gif │ │ │ │ │ │ ├── treeview-black.gif │ │ │ │ │ │ ├── treeview-default.gif │ │ │ │ │ │ ├── treeview-famfamfam.gif │ │ │ │ │ │ ├── treeview-gray-line.gif │ │ │ │ │ │ ├── treeview-red-line.gif │ │ │ │ │ │ ├── treeview-black-line.gif │ │ │ │ │ │ ├── treeview-default-line.gif │ │ │ │ │ │ └── treeview-famfamfam-line.gif │ │ │ │ │ └── treetable │ │ │ │ │ │ └── stylesheets │ │ │ │ │ │ └── jquery.treetable.css │ │ │ │ ├── dataTable │ │ │ │ │ ├── img │ │ │ │ │ │ ├── minus.png │ │ │ │ │ │ └── plus.png │ │ │ │ │ ├── lib │ │ │ │ │ │ └── jquery.dataTables │ │ │ │ │ │ │ └── images │ │ │ │ │ │ │ ├── sort_asc.png │ │ │ │ │ │ │ ├── sort_both.png │ │ │ │ │ │ │ ├── sort_desc.png │ │ │ │ │ │ │ ├── sort_asc_disabled.png │ │ │ │ │ │ │ └── sort_desc_disabled.png │ │ │ │ │ └── css │ │ │ │ │ │ └── datatables.responsive.css │ │ │ │ ├── validate │ │ │ │ │ ├── img │ │ │ │ │ │ └── valid.png │ │ │ │ │ └── validate.css │ │ │ │ ├── calendar │ │ │ │ │ ├── img │ │ │ │ │ │ └── tickc81e.png │ │ │ │ │ └── events.json.php │ │ │ │ ├── gage │ │ │ │ │ └── raphael.2.1.0.min.js │ │ │ │ ├── idealform │ │ │ │ │ └── img │ │ │ │ │ │ ├── loading.gif │ │ │ │ │ │ ├── datepicker.png │ │ │ │ │ │ ├── radiocheck.png │ │ │ │ │ │ └── validation.png │ │ │ │ ├── layer │ │ │ │ │ └── theme │ │ │ │ │ │ └── default │ │ │ │ │ │ ├── icon.png │ │ │ │ │ │ ├── icon-ext.png │ │ │ │ │ │ ├── loading-0.gif │ │ │ │ │ │ ├── loading-1.gif │ │ │ │ │ │ └── loading-2.gif │ │ │ │ ├── colorPicker │ │ │ │ │ └── img │ │ │ │ │ │ └── bootstrap-colorpicker │ │ │ │ │ │ ├── hue.png │ │ │ │ │ │ ├── alpha.png │ │ │ │ │ │ └── saturation.png │ │ │ │ ├── bootstrap │ │ │ │ │ ├── fonts │ │ │ │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ │ │ │ ├── glyphicons-halflings-regular.woff │ │ │ │ │ │ └── glyphicons-halflings-regular.woff2 │ │ │ │ │ ├── bootstrap-datetimepicker │ │ │ │ │ │ └── js │ │ │ │ │ │ │ └── bootstrap-datetimepicker.zh-CN.js │ │ │ │ │ └── js │ │ │ │ │ │ └── bootstrap-table │ │ │ │ │ │ └── locale │ │ │ │ │ │ └── bootstrap-table-zh-CN.min.js │ │ │ │ ├── right_hight.js │ │ │ │ ├── preloader.js │ │ │ │ ├── clock │ │ │ │ │ └── date.js │ │ │ │ ├── chart │ │ │ │ │ ├── realTime.js │ │ │ │ │ ├── barChart.js │ │ │ │ │ ├── polarChart.js │ │ │ │ │ ├── lineChart.js │ │ │ │ │ └── radarChart.js │ │ │ │ ├── select2 │ │ │ │ │ └── js │ │ │ │ │ │ └── i18n │ │ │ │ │ │ └── zh-CN.js │ │ │ │ ├── stackable │ │ │ │ │ └── stacktable.css │ │ │ │ ├── progress-bar │ │ │ │ │ └── number-pb.css │ │ │ │ └── toggle_close.js │ │ │ └── css │ │ │ │ ├── ribbons │ │ │ │ ├── awwwards_honorable_black_left.png │ │ │ │ ├── awwwards_honorable_black_left2x.png │ │ │ │ ├── awwwards_honorable_black_right.png │ │ │ │ ├── awwwards_honorable_green_left.png │ │ │ │ ├── awwwards_honorable_green_left2x.png │ │ │ │ ├── awwwards_honorable_green_right.png │ │ │ │ ├── awwwards_honorable_white_left.png │ │ │ │ ├── awwwards_honorable_white_left2x.png │ │ │ │ ├── awwwards_honorable_white_right.png │ │ │ │ ├── awwwards_honorable_black_right2x.png │ │ │ │ ├── awwwards_honorable_green_right2x.png │ │ │ │ └── awwwards_honorable_white_right2x.png │ │ │ │ ├── icons-style.css │ │ │ │ ├── open-sans.css │ │ │ │ └── loader-style.css │ │ │ ├── jn │ │ │ ├── fonts │ │ │ │ ├── fontawesome-webfont.woff │ │ │ │ └── glyphicons-halflings-regular.woff │ │ │ └── css │ │ │ │ └── jquery.numberedtextarea.css │ │ │ └── common │ │ │ ├── js │ │ │ ├── common.js │ │ │ ├── worker-edit.js │ │ │ ├── changelog-edit.js │ │ │ ├── changelog-add.js │ │ │ ├── clearcfg-edit.js │ │ │ ├── rule-edit.js │ │ │ ├── worker-add.js │ │ │ ├── rule-add.js │ │ │ ├── key-edit.js │ │ │ ├── user-edit.js │ │ │ ├── user-add.js │ │ │ └── user-editPwd.js │ │ │ └── css │ │ │ ├── common-edit.css │ │ │ ├── user-editPwd.css │ │ │ └── common-add.css │ │ └── java │ │ └── com │ │ └── jd │ │ └── platform │ │ └── hotkey │ │ └── dashboard │ │ ├── mapper │ │ ├── RulesMapper.java │ │ ├── ChangeLogMapper.java │ │ ├── WorkerMapper.java │ │ ├── UserMapper.java │ │ ├── SummaryMapper.java │ │ ├── KeyRecordMapper.java │ │ └── StatisticsMapper.java │ │ ├── autoconfigure │ │ └── AbstractProperties.java │ │ ├── common │ │ ├── domain │ │ │ ├── req │ │ │ │ └── PageReq.java │ │ │ ├── IRecord.java │ │ │ └── vo │ │ │ │ ├── RuleLineChartVo.java │ │ │ │ └── ClearCfgVo.java │ │ ├── config │ │ │ └── EtcdConfig.java │ │ ├── ex │ │ │ └── BizException.java │ │ └── eunm │ │ │ └── ResultEnum.java │ │ ├── service │ │ ├── ClearService.java │ │ ├── ChangeLogService.java │ │ ├── WorkerService.java │ │ └── RuleService.java │ │ ├── controller │ │ └── TestController.java │ │ ├── cache │ │ └── CaffeineBuilder.java │ │ ├── DashboardApplication.java │ │ └── util │ │ └── PageUtil.java ├── jd-hotkey-sample │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── jd │ │ │ │ └── platform │ │ │ │ └── hotkey │ │ │ │ └── sample │ │ │ │ ├── config │ │ │ │ ├── LocalCache.java │ │ │ │ └── RedisConfig.java │ │ │ │ ├── SampleApplication.java │ │ │ │ └── Starter.java │ │ └── resources │ │ │ └── application.yml │ │ └── test │ │ └── java │ │ └── com │ │ └── jd │ │ └── platform │ │ └── hotkey │ │ └── sample │ │ └── SampleApplicationTests.java ├── jd-hotkey-common │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── jd │ │ └── platform │ │ └── hotkey │ │ └── common │ │ ├── rule │ │ ├── IKeyRule.java │ │ └── DefaultKeyRule.java │ │ ├── model │ │ ├── typeenum │ │ │ ├── KeyType.java │ │ │ └── MessageType.java │ │ └── MsgBuilder.java │ │ ├── tool │ │ ├── IdGenerater.java │ │ ├── KeyRecordKeyTool.java │ │ ├── TwoTuple.java │ │ ├── NettyIpUtil.java │ │ ├── HotKeyPathTool.java │ │ └── Constant.java │ │ └── configcenter │ │ └── etcd │ │ └── JdEtcdBuilder.java ├── jd-hotkey-worker │ ├── src │ │ └── main │ │ │ ├── java │ │ │ └── com │ │ │ │ └── jd │ │ │ │ └── platform │ │ │ │ └── hotkey │ │ │ │ └── worker │ │ │ │ ├── keylistener │ │ │ │ ├── KeyEventOriginal.java │ │ │ │ └── IKeyListener.java │ │ │ │ ├── netty │ │ │ │ ├── filter │ │ │ │ │ └── INettyMsgFilter.java │ │ │ │ ├── holder │ │ │ │ │ ├── ClientInfoHolder.java │ │ │ │ │ └── WhiteListHolder.java │ │ │ │ ├── pusher │ │ │ │ │ ├── IPusher.java │ │ │ │ │ ├── store │ │ │ │ │ │ └── HotkeyTempStore.java │ │ │ │ │ └── DashboardPusher.java │ │ │ │ ├── client │ │ │ │ │ └── IClientChangeListener.java │ │ │ │ └── dashboard │ │ │ │ │ └── DashboardHolder.java │ │ │ │ ├── keydispatcher │ │ │ │ ├── Consumer.java │ │ │ │ └── KeyProducer.java │ │ │ │ ├── WorkerApplication.java │ │ │ │ ├── tool │ │ │ │ ├── AsyncPool.java │ │ │ │ ├── InitConstant.java │ │ │ │ └── SafeExecute.java │ │ │ │ ├── config │ │ │ │ ├── ClientConfig.java │ │ │ │ ├── CaffeineConfig.java │ │ │ │ └── EtcdConfig.java │ │ │ │ ├── model │ │ │ │ └── TotalCount.java │ │ │ │ ├── starters │ │ │ │ └── InitStarter.java │ │ │ │ └── counter │ │ │ │ └── CounterConfig.java │ │ │ └── resources │ │ │ └── application.yml │ └── .gitignore ├── jd-hotkey-client │ └── src │ │ ├── main │ │ └── java │ │ │ └── com │ │ │ └── jd │ │ │ └── platform │ │ │ └── hotkey │ │ │ └── client │ │ │ ├── callback │ │ │ ├── ReceiveNewKeyListener.java │ │ │ ├── ReceiveNewKeyEvent.java │ │ │ └── ReceiveNewKeySubscribe.java │ │ │ ├── Context.java │ │ │ ├── cache │ │ │ ├── DefaultCaffeineCache.java │ │ │ ├── LocalCache.java │ │ │ ├── CacheFactory.java │ │ │ └── CaffeineBuilder.java │ │ │ ├── log │ │ │ ├── HotKeyLogger.java │ │ │ ├── DefaultLogger.java │ │ │ └── JdLogger.java │ │ │ ├── core │ │ │ ├── key │ │ │ │ ├── IKeyCollector.java │ │ │ │ ├── IKeyPusher.java │ │ │ │ ├── KeyRemover.java │ │ │ │ ├── KeyHotModel.java │ │ │ │ ├── KeyHandlerFactory.java │ │ │ │ └── DefaultKeyHandler.java │ │ │ ├── worker │ │ │ │ └── WorkerInfoChangeEvent.java │ │ │ ├── rule │ │ │ │ └── KeyRuleInfoChangeEvent.java │ │ │ └── eventbus │ │ │ │ └── EventBusCenter.java │ │ │ ├── netty │ │ │ └── event │ │ │ │ └── ChannelInactiveEvent.java │ │ │ └── etcd │ │ │ └── EtcdConfigFactory.java │ │ └── test │ │ └── java │ │ └── KeyRuleTool.java ├── .gitignore ├── README.third_party.md ├── pom.xml └── README.en.md ├── l2cache-core └── src │ ├── main │ ├── resources │ │ └── META-INF │ │ │ └── l2cache │ │ │ ├── com.github.jesse.l2cache.CacheSyncPolicy │ │ │ ├── com.github.jesse.l2cache.HotkeyService │ │ │ └── com.github.jesse.l2cache.CacheBuilder │ └── java │ │ └── com │ │ └── github │ │ └── jesse │ │ └── l2cache │ │ ├── cache │ │ ├── CaffeineAsyncCache.java │ │ ├── expire │ │ │ └── CacheExpiredListener.java │ │ └── Level2Cache.java │ │ ├── sync │ │ └── MessageListener.java │ │ ├── consts │ │ ├── ColletConsts.java │ │ ├── CacheSyncPolicyType.java │ │ ├── HotkeyType.java │ │ ├── CacheType.java │ │ └── CacheRange.java │ │ ├── util │ │ ├── pool │ │ │ ├── PoolConsts.java │ │ │ ├── CallableMdcWrapper.java │ │ │ ├── MdcUtil.java │ │ │ └── RunnableMdcWarpper.java │ │ ├── BiConsumerWrapper.java │ │ ├── NullValueUtil.java │ │ └── Tuple2.java │ │ ├── builder │ │ └── NoneCacheBuilder.java │ │ ├── spi │ │ └── SPI.java │ │ ├── hotkey │ │ └── NoneHotkeyService.java │ │ ├── HotkeyService.java │ │ ├── exception │ │ ├── L2CacheException.java │ │ └── RedisTrylockFailException.java │ │ ├── CacheSpec.java │ │ ├── schedule │ │ └── RefreshExpiredCacheTask.java │ │ └── content │ │ └── NullValue.java │ └── test │ ├── java │ └── com │ │ └── github │ │ └── jesse │ │ └── l2cache │ │ └── test │ │ ├── User.java │ │ ├── TestApplication.java │ │ ├── Test1.java │ │ ├── Test2.java │ │ └── ThreadPoolSupportTest.java │ └── resources │ └── redisson.yaml ├── .gitignore └── README.en.md /doc/实战-l2cache高并发下缓存穿透的现象是这样的.md: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /TDL.MD: -------------------------------------------------------------------------------- 1 | - 【已完成】上传开源项目至Maven中央仓库 2 | - 【已完成】把热key组件开源:weeget-infinite-hotkey-client -------------------------------------------------------------------------------- /img/weixin.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/img/weixin.jpg -------------------------------------------------------------------------------- /img/rewards.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/img/rewards.jpg -------------------------------------------------------------------------------- /img/evictd_keys.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/img/evictd_keys.png -------------------------------------------------------------------------------- /img/levelcache.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/img/levelcache.png -------------------------------------------------------------------------------- /img/weixinqun.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/img/weixinqun.jpg -------------------------------------------------------------------------------- /img/memory_usage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/img/memory_usage.png -------------------------------------------------------------------------------- /img/info evictd_keys.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/img/info evictd_keys.png -------------------------------------------------------------------------------- /l2cache-spring-boot-starter/src/main/resources/META-INF/spring.provides: -------------------------------------------------------------------------------- 1 | provides: l2cache-spring-boot-starter -------------------------------------------------------------------------------- /l2cache-example/src/main/resources/application-80.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 8080 3 | #servlet: 4 | # context-path: /l2cache-example -------------------------------------------------------------------------------- /l2cache-example/src/main/resources/application-81.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 8081 3 | #servlet: 4 | # context-path: /l2cache-example -------------------------------------------------------------------------------- /l2cache-example/src/main/resources/application-82.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 8082 3 | #servlet: 4 | # context-path: /l2cache-example -------------------------------------------------------------------------------- /.gitee/ISSUE_TEMPLATE.zh-CN.md: -------------------------------------------------------------------------------- 1 | ### 该问题是怎么引起的? 2 | 3 | 4 | 5 | ### 重现步骤 6 | 7 | 8 | 9 | ### 报错信息 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/bootstarp/index.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gitee/PULL_REQUEST_TEMPLATE.zh-CN.md: -------------------------------------------------------------------------------- 1 | ### 相关的Issue 2 | 3 | 4 | ### 原因(目的、解决的问题等) 5 | 6 | 7 | ### 描述(做了什么,变更了什么) 8 | 9 | 10 | ### 测试用例(新增、改动、可能影响的功能) 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /l2cache-core/src/main/resources/META-INF/l2cache/com.github.jesse.l2cache.CacheSyncPolicy: -------------------------------------------------------------------------------- 1 | redis=com.github.jesse.l2cache.sync.RedisCacheSyncPolicy 2 | kafka=com.github.jesse.l2cache.sync.KafkaCacheSyncPolicy -------------------------------------------------------------------------------- /l2cache-spring-boot-starter/read.md: -------------------------------------------------------------------------------- 1 | yml自定义属性提示,官方文档: 2 | 3 | https://docs.spring.io/spring-boot/docs/current/reference/html/appendix-configuration-metadata.html#configuration-metadata-additional-metadata 4 | -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/images/10.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/images/10.jpg -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/images/jd.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/images/jd.ico -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/images/main.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/images/main.png -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/img/bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/img/bg.jpg -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/img/bg10.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/img/bg10.jpg -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/img/bg11.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/img/bg11.jpg -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/img/bg12.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/img/bg12.jpg -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/img/bg13.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/img/bg13.jpg -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/img/bg2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/img/bg2.jpg -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/img/bg3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/img/bg3.png -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/img/bg5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/img/bg5.jpg -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/img/bg8.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/img/bg8.jpg -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/img/bg9.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/img/bg9.jpg -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/img/plus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/img/plus.png -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/font/maki.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/font/maki.eot -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/font/maki.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/font/maki.ttf -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/font/maki.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/font/maki.woff -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/ico/minus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/ico/minus.png -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/img/giftly.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/img/giftly.png -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/img/marker.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/img/marker.png -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/img/minus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/img/minus.png -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/images/xiaojingyu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/images/xiaojingyu.png -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/font/entypo.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/font/entypo.eot -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/font/entypo.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/font/entypo.ttf -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/font/entypo.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/font/entypo.woff -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/font/makid41d.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/font/makid41d.eot -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/img/small-bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/img/small-bg.jpg -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/img/small-bg2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/img/small-bg2.jpg -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/img/small-bg5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/img/small-bg5.jpg -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/img/small-bg8.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/img/small-bg8.jpg -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/img/small-bg9.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/img/small-bg9.jpg -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/font/dripicons.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/font/dripicons.eot -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/font/dripicons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/font/dripicons.ttf -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/font/dripicons.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/font/dripicons.woff -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/font/entypod41d.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/font/entypod41d.eot -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/img/search-dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/img/search-dark.png -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/img/small-bg10.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/img/small-bg10.jpg -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/img/small-bg11.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/img/small-bg11.jpg -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/img/small-bg12.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/img/small-bg12.jpg -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/img/small-bg13.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/img/small-bg13.jpg -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/font-ali/iconfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/font-ali/iconfont.eot -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/font-ali/iconfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/font-ali/iconfont.ttf -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/font-ali/iconfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/font-ali/iconfont.woff -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/font/dripiconsd41d.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/font/dripiconsd41d.eot -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/img/search-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/img/search-white.png -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/iCheck/flat/red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/iCheck/flat/red.png -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/font/open-sans-bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/font/open-sans-bold.woff -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/iCheck/flat/aero.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/iCheck/flat/aero.png -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/iCheck/flat/blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/iCheck/flat/blue.png -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/iCheck/flat/flat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/iCheck/flat/flat.png -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/iCheck/flat/green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/iCheck/flat/green.png -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/iCheck/flat/grey.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/iCheck/flat/grey.png -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/iCheck/flat/pink.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/iCheck/flat/pink.png -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/iCheck/line/line.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/iCheck/line/line.png -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/tree/images/file.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/tree/images/file.gif -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/bootstarp/jhere.net/px3032.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/bootstarp/jhere.net/px3032.gif -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/bootstarp/jhere.net/px5d87.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/bootstarp/jhere.net/px5d87.gif -------------------------------------------------------------------------------- /l2cache-core/src/main/resources/META-INF/l2cache/com.github.jesse.l2cache.HotkeyService: -------------------------------------------------------------------------------- 1 | none=com.github.jesse.l2cache.hotkey.NoneHotkeyService 2 | jd=com.github.jesse.l2cache.hotkey.JdHotkeyService 3 | sentinel=com.github.jesse.l2cache.hotkey.SentinelHotkeyService -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/font/open-sans-light.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/font/open-sans-light.woff -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/fonts/open-sans-bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/fonts/open-sans-bold.woff -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/fonts/open-sans-light.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/fonts/open-sans-light.woff -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/fonts/open-sans-normal.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/fonts/open-sans-normal.woff -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/dataTable/img/minus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/dataTable/img/minus.png -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/dataTable/img/plus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/dataTable/img/plus.png -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/iCheck/flat/aero@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/iCheck/flat/aero@2x.png -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/iCheck/flat/blue@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/iCheck/flat/blue@2x.png -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/iCheck/flat/flat@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/iCheck/flat/flat@2x.png -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/iCheck/flat/green@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/iCheck/flat/green@2x.png -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/iCheck/flat/grey@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/iCheck/flat/grey@2x.png -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/iCheck/flat/orange.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/iCheck/flat/orange.png -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/iCheck/flat/pink@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/iCheck/flat/pink@2x.png -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/iCheck/flat/purple.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/iCheck/flat/purple.png -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/iCheck/flat/red@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/iCheck/flat/red@2x.png -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/iCheck/flat/yellow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/iCheck/flat/yellow.png -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/iCheck/line/line@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/iCheck/line/line@2x.png -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/tree/images/folder.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/tree/images/folder.gif -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/validate/img/valid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/validate/img/valid.png -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/jn/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/jn/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/font/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/font/fontawesome-webfont.woff -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/calendar/img/tickc81e.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/calendar/img/tickc81e.png -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/gage/raphael.2.1.0.min.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/gage/raphael.2.1.0.min.js -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/iCheck/flat/orange@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/iCheck/flat/orange@2x.png -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/iCheck/flat/purple@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/iCheck/flat/purple@2x.png -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/iCheck/flat/yellow@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/iCheck/flat/yellow@2x.png -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/idealform/img/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/idealform/img/loading.gif -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/fonts/fontawesome-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/fonts/fontawesome-webfont.woff2 -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/idealform/img/datepicker.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/idealform/img/datepicker.png -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/idealform/img/radiocheck.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/idealform/img/radiocheck.png -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/idealform/img/validation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/idealform/img/validation.png -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/layer/theme/default/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/layer/theme/default/icon.png -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/tree/images/ajax-loader.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/tree/images/ajax-loader.gif -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/tree/images/folder-closed.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/tree/images/folder-closed.gif -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/tree/images/treeview-gray.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/tree/images/treeview-gray.gif -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/tree/images/treeview-red.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/tree/images/treeview-red.gif -------------------------------------------------------------------------------- /l2cache-spring-boot-starter/src/main/resources/META-INF/spring.factories: -------------------------------------------------------------------------------- 1 | org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ 2 | com.github.jesse.l2cache.spring.config.L2CacheConfiguration,\ 3 | com.github.jesse.l2cache.spring.config.HotKeyConfiguration 4 | -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/tree/images/treeview-black.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/tree/images/treeview-black.gif -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/font/weathericons-regular-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/font/weathericons-regular-webfont.eot -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/font/weathericons-regular-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/font/weathericons-regular-webfont.ttf -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/layer/theme/default/icon-ext.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/layer/theme/default/icon-ext.png -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/layer/theme/default/loading-0.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/layer/theme/default/loading-0.gif -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/layer/theme/default/loading-1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/layer/theme/default/loading-1.gif -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/layer/theme/default/loading-2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/layer/theme/default/loading-2.gif -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/tree/images/treeview-default.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/tree/images/treeview-default.gif -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/tree/images/treeview-famfamfam.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/tree/images/treeview-famfamfam.gif -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/tree/images/treeview-gray-line.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/tree/images/treeview-gray-line.gif -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/tree/images/treeview-red-line.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/tree/images/treeview-red-line.gif -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/jn/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/jn/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /l2cache-core/src/main/java/com/github/jesse/l2cache/cache/CaffeineAsyncCache.java: -------------------------------------------------------------------------------- 1 | package com.github.jesse.l2cache.cache; 2 | 3 | /** 4 | * Caffeine Async Cache 5 | * 6 | * @author chenck 7 | * @date 2020/8/31 13:02 8 | */ 9 | public class CaffeineAsyncCache { 10 | } 11 | -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/font/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/font/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/font/weathericons-regular-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/font/weathericons-regular-webfont.woff -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/tree/images/treeview-black-line.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/tree/images/treeview-black-line.gif -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/font/weathericons-regular-webfontd41d.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/font/weathericons-regular-webfontd41d.eot -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/fonts/glyphicons-halflings-regulard41d.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/fonts/glyphicons-halflings-regulard41d.eot -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/tree/images/treeview-default-line.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/tree/images/treeview-default-line.gif -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/tree/images/treeview-famfamfam-line.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/tree/images/treeview-famfamfam-line.gif -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/css/ribbons/awwwards_honorable_black_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/css/ribbons/awwwards_honorable_black_left.png -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/css/ribbons/awwwards_honorable_black_left2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/css/ribbons/awwwards_honorable_black_left2x.png -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/css/ribbons/awwwards_honorable_black_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/css/ribbons/awwwards_honorable_black_right.png -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/css/ribbons/awwwards_honorable_green_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/css/ribbons/awwwards_honorable_green_left.png -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/css/ribbons/awwwards_honorable_green_left2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/css/ribbons/awwwards_honorable_green_left2x.png -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/css/ribbons/awwwards_honorable_green_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/css/ribbons/awwwards_honorable_green_right.png -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/css/ribbons/awwwards_honorable_white_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/css/ribbons/awwwards_honorable_white_left.png -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/css/ribbons/awwwards_honorable_white_left2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/css/ribbons/awwwards_honorable_white_left2x.png -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/css/ribbons/awwwards_honorable_white_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/css/ribbons/awwwards_honorable_white_right.png -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-sample/src/main/java/com/jd/platform/hotkey/sample/config/LocalCache.java: -------------------------------------------------------------------------------- 1 | package com.jd.platform.hotkey.sample.config; 2 | 3 | /** 4 | * @author wuweifeng wrote on 2020-02-21 5 | * @version 1.0 6 | */ 7 | public class LocalCache { 8 | 9 | 10 | 11 | } 12 | -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/css/ribbons/awwwards_honorable_black_right2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/css/ribbons/awwwards_honorable_black_right2x.png -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/css/ribbons/awwwards_honorable_green_right2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/css/ribbons/awwwards_honorable_green_right2x.png -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/css/ribbons/awwwards_honorable_white_right2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/css/ribbons/awwwards_honorable_white_right2x.png -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/colorPicker/img/bootstrap-colorpicker/hue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/colorPicker/img/bootstrap-colorpicker/hue.png -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-common/src/main/java/com/jd/platform/hotkey/common/rule/IKeyRule.java: -------------------------------------------------------------------------------- 1 | package com.jd.platform.hotkey.common.rule; 2 | 3 | /** 4 | * @author wuweifeng wrote on 2020-02-26 5 | * @version 1.0 6 | */ 7 | public interface IKeyRule { 8 | KeyRule getKeyRule(); 9 | } 10 | -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/bootstrap/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/bootstrap/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/bootstrap/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/bootstrap/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/bootstrap/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/bootstrap/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/colorPicker/img/bootstrap-colorpicker/alpha.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/colorPicker/img/bootstrap-colorpicker/alpha.png -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/bootstrap/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/bootstrap/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/dataTable/lib/jquery.dataTables/images/sort_asc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/dataTable/lib/jquery.dataTables/images/sort_asc.png -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/colorPicker/img/bootstrap-colorpicker/saturation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/colorPicker/img/bootstrap-colorpicker/saturation.png -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/dataTable/lib/jquery.dataTables/images/sort_both.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/dataTable/lib/jquery.dataTables/images/sort_both.png -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/dataTable/lib/jquery.dataTables/images/sort_desc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/dataTable/lib/jquery.dataTables/images/sort_desc.png -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/dataTable/lib/jquery.dataTables/images/sort_asc_disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/dataTable/lib/jquery.dataTables/images/sort_asc_disabled.png -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/dataTable/lib/jquery.dataTables/images/sort_desc_disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weeget-tech/l2cache/HEAD/l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/dataTable/lib/jquery.dataTables/images/sort_desc_disabled.png -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/right_hight.js: -------------------------------------------------------------------------------- 1 | //控制右边高度得js 2 | //function reinitIframe(){ 3 | // var $parent =window.parent.document.getElementById("mainFrame"); 4 | // $($parent).attr("height",document.body.scrollHeight); 5 | // 6 | // } 7 | //window.setInterval("reinitIframe()", 200); -------------------------------------------------------------------------------- /l2cache-core/src/main/resources/META-INF/l2cache/com.github.jesse.l2cache.CacheBuilder: -------------------------------------------------------------------------------- 1 | none=com.github.jesse.l2cache.builder.NoneCacheBuilder 2 | composite=com.github.jesse.l2cache.builder.CompositeCacheBuilder 3 | caffeine=com.github.jesse.l2cache.builder.CaffeineCacheBuilder 4 | redis=com.github.jesse.l2cache.builder.RedisCacheBuilder 5 | -------------------------------------------------------------------------------- /l2cache-core/src/main/java/com/github/jesse/l2cache/sync/MessageListener.java: -------------------------------------------------------------------------------- 1 | package com.github.jesse.l2cache.sync; 2 | 3 | /** 4 | * @author chenck 5 | * @date 2020/7/7 15:33 6 | */ 7 | public interface MessageListener { 8 | 9 | /** 10 | * 缓存同步消息处理 11 | */ 12 | void onMessage(CacheMessage message); 13 | } 14 | -------------------------------------------------------------------------------- /l2cache-core/src/main/java/com/github/jesse/l2cache/consts/ColletConsts.java: -------------------------------------------------------------------------------- 1 | package com.github.jesse.l2cache.consts; 2 | 3 | /** 4 | * @Author: zengjucai 5 | * @Date: 2021/1/28 13:50 6 | */ 7 | public class ColletConsts { 8 | /** 9 | * 批量缓存集合切分 10 | */ 11 | public static final Integer BATCH_CACHE_COLLECT_SPLIT = 50; 12 | } 13 | -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-common/src/main/java/com/jd/platform/hotkey/common/model/typeenum/KeyType.java: -------------------------------------------------------------------------------- 1 | package com.jd.platform.hotkey.common.model.typeenum; 2 | 3 | /** 4 | * @author wuweifeng wrote on 2019-12-10 5 | * @version 1.0 6 | */ 7 | public enum KeyType { 8 | REDIS_KEY, 9 | REQUEST_PATH, 10 | BLACK_LIST, 11 | OTHER 12 | } 13 | -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-worker/src/main/java/com/jd/platform/hotkey/worker/keylistener/KeyEventOriginal.java: -------------------------------------------------------------------------------- 1 | package com.jd.platform.hotkey.worker.keylistener; 2 | 3 | /** 4 | * key变化的事件来源 5 | * @author wuweifeng wrote on 2019-12-12 6 | * @version 1.0 7 | */ 8 | public enum KeyEventOriginal { 9 | CLIENT, 10 | MQ, 11 | ETCD, 12 | WORKER 13 | } 14 | -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-sample/src/test/java/com/jd/platform/hotkey/sample/SampleApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.jd.platform.hotkey.sample; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class SampleApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /l2cache-core/src/main/java/com/github/jesse/l2cache/cache/expire/CacheExpiredListener.java: -------------------------------------------------------------------------------- 1 | package com.github.jesse.l2cache.cache.expire; 2 | 3 | /** 4 | * 缓存过期监听器 5 | * 6 | * @author chenck 7 | * @date 2020/7/1 20:54 8 | */ 9 | public interface CacheExpiredListener { 10 | 11 | /** 12 | * 缓存过期后触发 13 | */ 14 | void onExpired(K key, V value, String removalCause); 15 | } 16 | -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/preloader.js: -------------------------------------------------------------------------------- 1 | $(function() { // makes sure the whole site is loaded 2 | $('#divstatus').fadeOut(); // will first fade out the loading animation 3 | $('#preloader').fadeOut(); // will fade out the white DIV that covers the website. 4 | $('body').delay(350).css({ 5 | 'overflow': 'visible' 6 | }); 7 | }) -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/common/js/common.js: -------------------------------------------------------------------------------- 1 | $.ajaxSetup({ 2 | contentType:"application/x-www-form-urlencoded;charset=utf-8", 3 | complete:function(XMLHttpRequest,textStatus){ 4 | var token = getCookie("token"); 5 | if(XMLHttpRequest.status == 1000 && ( token == "undefined" || token =="")){ 6 | top.location.href = '/user/login'; 7 | } 8 | } 9 | }); -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-client/src/main/java/com/jd/platform/hotkey/client/callback/ReceiveNewKeyListener.java: -------------------------------------------------------------------------------- 1 | package com.jd.platform.hotkey.client.callback; 2 | 3 | import com.jd.platform.hotkey.common.model.HotKeyModel; 4 | 5 | /** 6 | * 客户端监听到有newKey事件 7 | * @author wuweifeng wrote on 2020-02-21 8 | * @version 1.0 9 | */ 10 | public interface ReceiveNewKeyListener { 11 | 12 | void newKey(HotKeyModel hotKeyModel); 13 | } 14 | -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-client/src/main/java/com/jd/platform/hotkey/client/Context.java: -------------------------------------------------------------------------------- 1 | package com.jd.platform.hotkey.client; 2 | 3 | /** 4 | * @author wuweifeng wrote on 2019-12-05 5 | * @version 1.0 6 | */ 7 | public class Context { 8 | public static String APP_NAME; 9 | 10 | /** 11 | * 与worker连接断开后,是否需要重连 12 | */ 13 | public static boolean NEED_RECONNECT = true; 14 | 15 | public static int CAFFEINE_SIZE; 16 | } 17 | -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/clock/date.js: -------------------------------------------------------------------------------- 1 | var monthNames = ["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"]; 2 | var dayNames = ["星期天","星期一", "星期二", "星期三,", "星期四 ", "星期五 ", "星期六 "] 3 | 4 | var newDate = new Date(); 5 | newDate.setDate(newDate.getDate()); 6 | $('#Date').html(newDate.getFullYear() + ' ' +monthNames[newDate.getMonth()]+ ' ' + newDate.getDate() + ' ' + dayNames[newDate.getDay()] ); 7 | -------------------------------------------------------------------------------- /l2cache-core/src/main/java/com/github/jesse/l2cache/util/pool/PoolConsts.java: -------------------------------------------------------------------------------- 1 | package com.github.jesse.l2cache.util.pool; 2 | 3 | /** 4 | * @author chenck 5 | * @date 2023/8/24 14:55 6 | */ 7 | public class PoolConsts { 8 | /** 9 | * 默认线程名称前缀 10 | */ 11 | public static final String DEFAULT_THREAD_NAME_PREFIX = "custom"; 12 | /** 13 | * 最大线程编号,超过该值,则重置线程编号 14 | */ 15 | public static final int MAX_THREAD_NUMBER = 10000; 16 | } 17 | -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-client/src/main/java/com/jd/platform/hotkey/client/cache/DefaultCaffeineCache.java: -------------------------------------------------------------------------------- 1 | package com.jd.platform.hotkey.client.cache; 2 | 3 | /** 4 | * @author wuweifeng wrote on 2020-02-27 5 | * @version 1.0 6 | */ 7 | public class DefaultCaffeineCache extends CaffeineCache { 8 | public DefaultCaffeineCache() { 9 | this(60); 10 | } 11 | 12 | public DefaultCaffeineCache(int duration) { 13 | super(duration); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-common/src/main/java/com/jd/platform/hotkey/common/tool/IdGenerater.java: -------------------------------------------------------------------------------- 1 | package com.jd.platform.hotkey.common.tool; 2 | 3 | import java.util.UUID; 4 | 5 | /** 6 | * 给每个消息生成一个唯一id 7 | * 8 | * @author wuweifeng wrote on 2019-12-10 9 | * @version 1.0 10 | */ 11 | public class IdGenerater { 12 | public static String generateId() { 13 | String uuid = UUID.randomUUID().toString(); 14 | return uuid.replace("-", ""); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-sample/src/main/java/com/jd/platform/hotkey/sample/SampleApplication.java: -------------------------------------------------------------------------------- 1 | package com.jd.platform.hotkey.sample; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SampleApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SampleApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-sample/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | #etcd的地址,如有多个用逗号分隔 2 | etcd: 3 | server: ${etcdServer:http://127.0.0.1:2379} 4 | # server: ${etcdServer:https://127.0.0.1:2379} 5 | spring: 6 | application: 7 | name: persona-api 8 | ###############################---redis---############################## 9 | redis: 10 | host: ${REDIS_HOST:127.0.0.1} 11 | port: ${REDIS_PORT:6379} 12 | password: ${REDIS_PASSWORD:} 13 | server: 14 | port: 9903 -------------------------------------------------------------------------------- /l2cache-core/src/main/java/com/github/jesse/l2cache/cache/Level2Cache.java: -------------------------------------------------------------------------------- 1 | package com.github.jesse.l2cache.cache; 2 | 3 | import com.github.jesse.l2cache.Cache; 4 | 5 | /** 6 | * 二级缓存 7 | * 8 | * @author chenck 9 | * @date 2020/6/30 11:03 10 | */ 11 | public interface Level2Cache extends Cache { 12 | 13 | /** 14 | * 获取redis过期时间(ms) 15 | */ 16 | long getExpireTime(); 17 | 18 | /** 19 | * 构建key 20 | */ 21 | Object buildKey(Object key); 22 | } 23 | -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/java/com/jd/platform/hotkey/dashboard/mapper/RulesMapper.java: -------------------------------------------------------------------------------- 1 | package com.jd.platform.hotkey.dashboard.mapper; 2 | 3 | import com.jd.platform.hotkey.dashboard.model.Rules; 4 | import org.apache.ibatis.annotations.Mapper; 5 | 6 | 7 | @Mapper 8 | public interface RulesMapper { 9 | 10 | Rules select(String app); 11 | 12 | int insert(Rules record); 13 | 14 | int update(Rules record); 15 | 16 | int delete(String app); 17 | 18 | } -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-client/src/main/java/com/jd/platform/hotkey/client/log/HotKeyLogger.java: -------------------------------------------------------------------------------- 1 | package com.jd.platform.hotkey.client.log; 2 | 3 | /** 4 | * @author wuweifeng 5 | * @version 1.0 6 | * @date 2020-04-21 7 | */ 8 | public interface HotKeyLogger { 9 | void debug(Class className, String info); 10 | 11 | void info(Class className, String info); 12 | 13 | void error(Class className, String info); 14 | 15 | void warn(Class className, String info); 16 | } 17 | -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-worker/src/main/java/com/jd/platform/hotkey/worker/netty/filter/INettyMsgFilter.java: -------------------------------------------------------------------------------- 1 | package com.jd.platform.hotkey.worker.netty.filter; 2 | 3 | import com.jd.platform.hotkey.common.model.HotKeyMsg; 4 | import io.netty.channel.ChannelHandlerContext; 5 | 6 | /** 7 | * 对netty来的消息,进行过滤处理 8 | * @author wuweifeng wrote on 2019-12-11 9 | * @version 1.0 10 | */ 11 | public interface INettyMsgFilter { 12 | boolean chain(HotKeyMsg message, ChannelHandlerContext ctx); 13 | } 14 | -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-worker/src/main/java/com/jd/platform/hotkey/worker/netty/holder/ClientInfoHolder.java: -------------------------------------------------------------------------------- 1 | package com.jd.platform.hotkey.worker.netty.holder; 2 | 3 | import com.jd.platform.hotkey.worker.model.AppInfo; 4 | 5 | import java.util.ArrayList; 6 | import java.util.List; 7 | 8 | /** 9 | * 保存所有与server连接的客户端信息 10 | * @author wuweifeng wrote on 2019-12-04 11 | * @version 1.0 12 | */ 13 | public class ClientInfoHolder { 14 | public static List apps = new ArrayList<>(); 15 | } -------------------------------------------------------------------------------- /l2cache-example/src/main/java/com/github/jesse/l2cache/example/dto/GoodsPriceRevisionIdsPutReqDTO.java: -------------------------------------------------------------------------------- 1 | package com.github.jesse.l2cache.example.dto; 2 | 3 | import lombok.Data; 4 | import org.springframework.web.bind.annotation.RequestBody; 5 | 6 | /** 7 | * @author chenck 8 | * @date 2023/9/26 17:12 9 | */ 10 | @Data 11 | public class GoodsPriceRevisionIdsPutReqDTO { 12 | 13 | GoodsPriceRevisionIdsReqDTO goodsPriceRevisionIdsReqDTO; 14 | GoodsPriceRevisionRespBO goodsPriceRevisionRespBO; 15 | } 16 | -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-worker/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/** 5 | !**/src/test/** 6 | 7 | ### STS ### 8 | .apt_generated 9 | .classpath 10 | .factorypath 11 | .project 12 | .settings 13 | .springBeans 14 | .sts4-cache 15 | 16 | ### IntelliJ IDEA ### 17 | .idea 18 | *.iws 19 | *.iml 20 | *.ipr 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | build/ 29 | 30 | ### VS Code ### 31 | .vscode/ 32 | -------------------------------------------------------------------------------- /l2cache-core/src/main/java/com/github/jesse/l2cache/builder/NoneCacheBuilder.java: -------------------------------------------------------------------------------- 1 | package com.github.jesse.l2cache.builder; 2 | 3 | import com.github.jesse.l2cache.Cache; 4 | import com.github.jesse.l2cache.cache.NoneCache; 5 | 6 | /** 7 | * @author chenck 8 | * @date 2020/7/2 20:49 9 | */ 10 | public class NoneCacheBuilder extends AbstractCacheBuilder { 11 | @Override 12 | public Cache build(String cacheName) { 13 | return new NoneCache(cacheName, this.getCacheConfig()); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-worker/src/main/java/com/jd/platform/hotkey/worker/netty/pusher/IPusher.java: -------------------------------------------------------------------------------- 1 | package com.jd.platform.hotkey.worker.netty.pusher; 2 | 3 | import com.jd.platform.hotkey.common.model.HotKeyModel; 4 | 5 | /** 6 | * @author wuweifeng wrote on 2020-02-24 7 | * @version 1.0 8 | */ 9 | public interface IPusher { 10 | void push(HotKeyModel model); 11 | 12 | /** 13 | * worker是监听不到删除事件了,client不往worker发删除事件了 14 | */ 15 | @Deprecated 16 | void remove(HotKeyModel model); 17 | } 18 | -------------------------------------------------------------------------------- /l2cache-example/src/main/java/com/github/jesse/l2cache/example/dto/GoodsPriceRevisionIdsReqDTO.java: -------------------------------------------------------------------------------- 1 | package com.github.jesse.l2cache.example.dto; 2 | 3 | import lombok.Data; 4 | import lombok.EqualsAndHashCode; 5 | 6 | 7 | @Data 8 | @EqualsAndHashCode// 特别注意:key为自定义DTO,重写equals()和hashcode()方法。目的:获取到缓存数据后,业务代码中可根据自定义DTO对象,找到其对应的缓存项。 9 | public class GoodsPriceRevisionIdsReqDTO { 10 | 11 | private Integer tenantId;// 租户ID 12 | private Integer goodsGroupId;// 商品分组ID 13 | private Integer goodsId;// 商品ID 14 | 15 | } 16 | -------------------------------------------------------------------------------- /l2cache-jd-hotkey/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/** 5 | !**/src/test/** 6 | 7 | ### STS ### 8 | .apt_generated 9 | .classpath 10 | .factorypath 11 | .project 12 | .settings 13 | .springBeans 14 | .sts4-cache 15 | 16 | ### IntelliJ IDEA ### 17 | .idea 18 | *.iws 19 | *.iml 20 | *.ipr 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | build/ 29 | 30 | ### VS Code ### 31 | .vscode/ 32 | 33 | /catalina.base_IS_UNDEFINED/ -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-client/src/main/java/com/jd/platform/hotkey/client/core/key/IKeyCollector.java: -------------------------------------------------------------------------------- 1 | package com.jd.platform.hotkey.client.core.key; 2 | 3 | import java.util.List; 4 | 5 | /** 6 | * 对hotkey进行聚合 7 | * @author wuweifeng wrote on 2020-01-06 8 | * @version 1.0 9 | */ 10 | public interface IKeyCollector { 11 | /** 12 | * 锁定后的返回值 13 | */ 14 | List lockAndGetResult(); 15 | 16 | /** 17 | * 输入的参数 18 | */ 19 | void collect(T t); 20 | 21 | void finishOnce(); 22 | } 23 | -------------------------------------------------------------------------------- /l2cache-example/src/main/java/com/github/jesse/l2cache/example/util/TracingVariable.java: -------------------------------------------------------------------------------- 1 | package com.github.jesse.l2cache.example.util; 2 | 3 | /** 4 | * @author chenck 5 | * @date 2023/5/5 15:39 6 | */ 7 | public class TracingVariable { 8 | 9 | public static final String TRACE_ID = "sid";// 分布式应用链路追踪id 10 | /** 11 | * 调用层级id,可通过 opentracing 实现SPAN。 12 | * SPAN 表示分布式调用链条中的一个调用单元 13 | */ 14 | public static final String SPAN_ID = "span_id";// 调用层级id 15 | public static final String LOCAL_IP = "local_ip"; 16 | } 17 | -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-common/src/main/java/com/jd/platform/hotkey/common/rule/DefaultKeyRule.java: -------------------------------------------------------------------------------- 1 | package com.jd.platform.hotkey.common.rule; 2 | 3 | /** 4 | * 对key的字符串是否命中的规则,以及该key判断是否热key的频率,如2秒500次 5 | * 6 | * @author wuweifeng wrote on 2019-12-12 7 | * @version 1.0 8 | */ 9 | public class DefaultKeyRule implements IKeyRule { 10 | 11 | @Override 12 | public KeyRule getKeyRule() { 13 | return new KeyRule.Builder().key("*").duration(60).prefix(false).interval(5).threshold(1000).build(); 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /l2cache-core/src/test/java/com/github/jesse/l2cache/test/User.java: -------------------------------------------------------------------------------- 1 | package com.github.jesse.l2cache.test; 2 | 3 | import lombok.Data; 4 | 5 | /** 6 | * @author chenck 7 | * @date 2020/5/7 20:27 8 | */ 9 | @Data 10 | public class User { 11 | 12 | public User() { 13 | 14 | } 15 | 16 | public User(String name, String addr) { 17 | this.name = name; 18 | this.addr = addr; 19 | } 20 | 21 | private String name; 22 | private String addr; 23 | private long currTime = System.currentTimeMillis(); 24 | } 25 | -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-client/src/main/java/com/jd/platform/hotkey/client/cache/LocalCache.java: -------------------------------------------------------------------------------- 1 | package com.jd.platform.hotkey.client.cache; 2 | 3 | /** 4 | * @author wuweifeng wrote on 2020-02-21 5 | * @version 1.0 6 | */ 7 | public interface LocalCache { 8 | 9 | Object get(String key); 10 | 11 | Object get(String key, Object defaultValue); 12 | 13 | void delete(String key); 14 | 15 | void set(String key, Object value); 16 | 17 | void set(String key, Object value, long expire); 18 | 19 | void removeAll(); 20 | } 21 | -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-common/src/main/java/com/jd/platform/hotkey/common/tool/KeyRecordKeyTool.java: -------------------------------------------------------------------------------- 1 | package com.jd.platform.hotkey.common.tool; 2 | 3 | import com.jd.platform.hotkey.common.model.HotKeyModel; 4 | 5 | /** 6 | * @author wuweifeng 7 | * @version 1.0 8 | * @date 2020-05-26 9 | */ 10 | public class KeyRecordKeyTool { 11 | /** 12 | * 热key记录,在etcd里的value存放的值 13 | */ 14 | public static String key(HotKeyModel hotKeyModel) { 15 | return hotKeyModel.getAppName() + "/" + hotKeyModel.getKey(); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-common/src/main/java/com/jd/platform/hotkey/common/tool/TwoTuple.java: -------------------------------------------------------------------------------- 1 | package com.jd.platform.hotkey.common.tool; 2 | 3 | /** 4 | * @author wuweifeng 5 | * @version 1.0 6 | * @date 2020-06-24 7 | */ 8 | public class TwoTuple { 9 | 10 | public final A first; 11 | 12 | public final B second; 13 | 14 | public TwoTuple(A a, B b){ 15 | first = a; 16 | second = b; 17 | } 18 | 19 | public String toString(){ 20 | return "(" + first + ", " + second + ")"; 21 | } 22 | 23 | } -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/java/com/jd/platform/hotkey/dashboard/autoconfigure/AbstractProperties.java: -------------------------------------------------------------------------------- 1 | package com.jd.platform.hotkey.dashboard.autoconfigure; 2 | 3 | /** 4 | * User: fuxueliang 5 | * Date: 16/8/25 6 | * Email: fuxueliang@jd.com 7 | */ 8 | public abstract class AbstractProperties { 9 | private boolean enabled = true; 10 | 11 | public boolean isEnabled() { 12 | return enabled; 13 | } 14 | 15 | public void setEnabled(boolean enabled) { 16 | this.enabled = enabled; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /l2cache-example/src/main/java/com/github/jesse/l2cache/example/dto/BrandRespBO.java: -------------------------------------------------------------------------------- 1 | package com.github.jesse.l2cache.example.dto; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | 7 | @Data 8 | public class BrandRespBO implements Serializable { 9 | 10 | private static final long serialVersionUID = 1L; 11 | 12 | private Integer brandId; 13 | 14 | private Integer groupId; 15 | 16 | private String brandName; 17 | 18 | private String brandNumber; 19 | 20 | private String description; 21 | 22 | private Integer state; 23 | 24 | } 25 | -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-worker/src/main/java/com/jd/platform/hotkey/worker/netty/client/IClientChangeListener.java: -------------------------------------------------------------------------------- 1 | package com.jd.platform.hotkey.worker.netty.client; 2 | 3 | import io.netty.channel.ChannelHandlerContext; 4 | 5 | /** 6 | * @author wuweifeng wrote on 2019-12-13 7 | * @version 1.0 8 | */ 9 | public interface IClientChangeListener { 10 | /** 11 | * 发现新连接 12 | */ 13 | void newClient(String appName, String channelId, ChannelHandlerContext ctx); 14 | 15 | /** 16 | * 客户端掉线 17 | */ 18 | void loseClient(ChannelHandlerContext ctx); 19 | } -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-worker/src/main/java/com/jd/platform/hotkey/worker/keydispatcher/Consumer.java: -------------------------------------------------------------------------------- 1 | package com.jd.platform.hotkey.worker.keydispatcher; 2 | 3 | import java.util.List; 4 | 5 | /** 6 | * @author wuweifeng 7 | * @version 1.0 8 | * @date 2020-06-09 9 | */ 10 | public class Consumer { 11 | private List consumerList; 12 | 13 | public Consumer(List consumerList) { 14 | this.consumerList = consumerList; 15 | } 16 | 17 | public KeyConsumer get(int index) { 18 | return consumerList.get(index); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /l2cache-example/src/main/java/com/github/jesse/l2cache/example/Application81.java: -------------------------------------------------------------------------------- 1 | package com.github.jesse.l2cache.example; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | /** 7 | * 基于 l2cache-spring-boot-starter 的demo 8 | */ 9 | @SpringBootApplication 10 | public class Application81 { 11 | 12 | public static void main(String[] args) { 13 | System.setProperty("spring.profiles.active", "81");// 基于端口维度,指定启用的配置文件 14 | SpringApplication.run(Application81.class, args); 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /l2cache-example/src/main/java/com/github/jesse/l2cache/example/Application82.java: -------------------------------------------------------------------------------- 1 | package com.github.jesse.l2cache.example; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | /** 7 | * 基于 l2cache-spring-boot-starter 的demo 8 | */ 9 | @SpringBootApplication 10 | public class Application82 { 11 | 12 | public static void main(String[] args) { 13 | System.setProperty("spring.profiles.active", "82");// 基于端口维度,指定启用的配置文件 14 | SpringApplication.run(Application82.class, args); 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /l2cache-jd-hotkey/README.third_party.md: -------------------------------------------------------------------------------- 1 | 我们的项目中依赖了一些第三方lib,现将依赖的第三方库,列在下方: 2 | 3 | 4 | 4.1.42.Final 5 | 6 | 7 | 3.4.2 8 | 9 | 10 | 1.1.7.3 11 | 12 | 13 | 1.2.70 14 | 15 | 16 | 0.0.14 17 | 18 | 19 | 2.8.0 20 | 21 | 22 | 5.1.0 23 | -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-client/src/test/java/KeyRuleTool.java: -------------------------------------------------------------------------------- 1 | import com.jd.platform.hotkey.common.rule.KeyRule; 2 | import com.jd.platform.hotkey.common.tool.FastJsonUtils; 3 | 4 | import java.util.Arrays; 5 | 6 | /** 7 | * @author wuweifeng wrote on 2020-04-02 8 | * @version 1.0 9 | */ 10 | public class KeyRuleTool { 11 | public static void main(String[] args) { 12 | KeyRule keyRule = new KeyRule.Builder().key("*").prefix(false).duration(60).interval(5).threshold(100).build(); 13 | System.out.println(FastJsonUtils.convertObjectToJSON(Arrays.asList(keyRule))); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-common/src/main/java/com/jd/platform/hotkey/common/configcenter/etcd/JdEtcdBuilder.java: -------------------------------------------------------------------------------- 1 | package com.jd.platform.hotkey.common.configcenter.etcd; 2 | 3 | import com.ibm.etcd.client.EtcdClient; 4 | 5 | /** 6 | * @author wuweifeng wrote on 2019-12-10 7 | * @version 1.0 8 | */ 9 | public class JdEtcdBuilder { 10 | 11 | /** 12 | * @param endPoints 如https://127.0.0.1:2379 有多个时逗号分隔 13 | */ 14 | public static JdEtcdClient build(String endPoints) { 15 | return new JdEtcdClient(EtcdClient.forEndpoints(endPoints).withPlainText().build()); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/java/com/jd/platform/hotkey/dashboard/common/domain/req/PageReq.java: -------------------------------------------------------------------------------- 1 | package com.jd.platform.hotkey.dashboard.common.domain.req; 2 | 3 | 4 | /** 5 | * @author liyunfeng31 6 | */ 7 | public class PageReq { 8 | private int pageNum; 9 | private int pageSize; 10 | public int getPageNum() { 11 | return pageNum; 12 | } 13 | public void setPageNum(int pageNum) { 14 | this.pageNum = pageNum; 15 | } 16 | public int getPageSize() { 17 | return pageSize; 18 | } 19 | public void setPageSize(int pageSize) { 20 | this.pageSize = pageSize; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/java/com/jd/platform/hotkey/dashboard/mapper/ChangeLogMapper.java: -------------------------------------------------------------------------------- 1 | package com.jd.platform.hotkey.dashboard.mapper; 2 | 3 | import com.jd.platform.hotkey.dashboard.common.domain.req.SearchReq; 4 | import com.jd.platform.hotkey.dashboard.model.ChangeLog; 5 | import org.apache.ibatis.annotations.Mapper; 6 | 7 | import java.util.List; 8 | 9 | @Mapper 10 | public interface ChangeLogMapper { 11 | 12 | int insertSelective(ChangeLog record); 13 | 14 | ChangeLog selectByPrimaryKey(Integer id); 15 | 16 | List listChangeLog(SearchReq param); 17 | } -------------------------------------------------------------------------------- /l2cache-core/src/test/java/com/github/jesse/l2cache/test/TestApplication.java: -------------------------------------------------------------------------------- 1 | //package com.github.jesse.l2cache.test; 2 | // 3 | //import com.github.jesse.l2cache.spring.EnableL2Cache; 4 | //import org.springframework.boot.SpringApplication; 5 | //import org.springframework.boot.autoconfigure.SpringBootApplication; 6 | // 7 | ///** 8 | // * 通过 Spring Enable 注解模式来启用二级缓存组件 9 | // */ 10 | //@EnableL2Cache 11 | //@SpringBootApplication 12 | //public class TestApplication { 13 | // public static void main(String[] args) { 14 | // SpringApplication.run(TestApplication.class, args); 15 | // } 16 | //} 17 | -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/java/com/jd/platform/hotkey/dashboard/common/domain/IRecord.java: -------------------------------------------------------------------------------- 1 | package com.jd.platform.hotkey.dashboard.common.domain; 2 | 3 | import java.util.Date; 4 | 5 | /** 6 | * @author wuweifeng 7 | * @version 1.0 8 | * @date 2020-09-02 9 | */ 10 | public interface IRecord { 11 | /** 12 | * appName + "/" + key 13 | */ 14 | String appNameKey(); 15 | 16 | /** 17 | * 手工添加的是时间戳13位,worker传过来的是uuid 18 | */ 19 | String value(); 20 | 21 | /** 22 | * 0插入,1删除 23 | */ 24 | int type(); 25 | 26 | Date createTime(); 27 | } 28 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Mobile Tools for Java (J2ME) 2 | .mtj.tmp/ 3 | 4 | build/ 5 | out/ 6 | 7 | *.class 8 | 9 | .gradle/ 10 | */.gradle/ 11 | 12 | .idea/ 13 | */.idea/ 14 | 15 | .settings/ 16 | */.settings/ 17 | 18 | target/ 19 | */target/ 20 | 21 | .DS_Store 22 | */.DS_Store 23 | *.cache 24 | *.lock 25 | 26 | .classpath 27 | .project 28 | 29 | *.iml 30 | */*.iml 31 | 32 | # Log file 33 | *.log 34 | *.log.* 35 | 36 | # Package Files # 37 | *.jar 38 | *.war 39 | *.nar 40 | *.ear 41 | *.zip 42 | *.tar.gz 43 | *.rar 44 | 45 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 46 | hs_err_pid* -------------------------------------------------------------------------------- /l2cache-example/src/main/java/com/github/jesse/l2cache/example/dto/User.java: -------------------------------------------------------------------------------- 1 | package com.github.jesse.l2cache.example.dto; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | 7 | /** 8 | * @author chenck 9 | * @date 2020/5/7 20:27 10 | */ 11 | @Data 12 | public class User implements Serializable { 13 | 14 | public User() { 15 | 16 | } 17 | 18 | public User(String name, String addr) { 19 | this.name = name; 20 | this.addr = addr; 21 | } 22 | 23 | private String name; 24 | private String addr; 25 | private long currTime = System.currentTimeMillis(); 26 | } 27 | -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-worker/src/main/java/com/jd/platform/hotkey/worker/netty/holder/WhiteListHolder.java: -------------------------------------------------------------------------------- 1 | package com.jd.platform.hotkey.worker.netty.holder; 2 | 3 | import java.util.HashSet; 4 | import java.util.Set; 5 | 6 | /** 7 | * @author wuweifeng 8 | * @version 1.0 9 | * @date 2020-05-28 10 | */ 11 | public class WhiteListHolder { 12 | public static Set whiteList = new HashSet<>(); 13 | 14 | public static void add(String s) { 15 | whiteList.add(s.trim()); 16 | } 17 | 18 | public static boolean contains(String s) { 19 | return whiteList.contains(s); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /l2cache-core/src/main/java/com/github/jesse/l2cache/spi/SPI.java: -------------------------------------------------------------------------------- 1 | package com.github.jesse.l2cache.spi; 2 | 3 | import java.lang.annotation.Documented; 4 | import java.lang.annotation.ElementType; 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | import java.lang.annotation.Target; 8 | 9 | /** 10 | * 扩展点接口标记 11 | * 12 | * @author chenck 13 | * @date 2020/7/2 16:46 14 | */ 15 | @Documented 16 | @Retention(RetentionPolicy.RUNTIME) 17 | @Target({ElementType.TYPE}) 18 | public @interface SPI { 19 | 20 | /** 21 | * 默认扩展名 22 | */ 23 | String value() default ""; 24 | 25 | } -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-worker/src/main/java/com/jd/platform/hotkey/worker/keylistener/IKeyListener.java: -------------------------------------------------------------------------------- 1 | package com.jd.platform.hotkey.worker.keylistener; 2 | 3 | import com.jd.platform.hotkey.common.model.HotKeyModel; 4 | 5 | /** 6 | * @author wuweifeng wrote on 2019-12-06 7 | * @version 1.0 8 | */ 9 | public interface IKeyListener { 10 | /** 11 | * 新来一个key 12 | */ 13 | void newKey(HotKeyModel hotKeyModel, KeyEventOriginal orignal); 14 | 15 | /** 16 | * 删除一个key。(一种是客户端发消息删,二种是本地线程扫描过期的删,三种是etcd里删) 17 | */ 18 | void removeKey(HotKeyModel hotKeyModel, KeyEventOriginal orignal); 19 | } 20 | -------------------------------------------------------------------------------- /l2cache-core/src/main/java/com/github/jesse/l2cache/hotkey/NoneHotkeyService.java: -------------------------------------------------------------------------------- 1 | package com.github.jesse.l2cache.hotkey; 2 | 3 | import com.github.jesse.l2cache.CacheConfig; 4 | import com.github.jesse.l2cache.HotkeyService; 5 | import lombok.extern.slf4j.Slf4j; 6 | 7 | import java.util.List; 8 | 9 | @Slf4j 10 | public class NoneHotkeyService implements HotkeyService { 11 | 12 | @Override 13 | public void init(CacheConfig.Hotkey hotKeyConfig, List cacheNameList) { 14 | 15 | } 16 | 17 | @Override 18 | public boolean isHotkey(String cacheName, String key) { 19 | return false; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/chart/realTime.js: -------------------------------------------------------------------------------- 1 | $(function(){function n(){if(e.length>0)e=e.slice(1);while(e.length0?e[e.length-1]:50;var r=n+Math.random()*10-5;if(r<0)r=0;if(r>100)r=100;e.push(r)}var i=[];for(var s=0;s2e3)r=2e3;$(this).val(""+r)}});var i={series:{shadowSize:0},yaxis:{min:0,max:100},xaxis:{min:0,max:100}};var s=$.plot($("#placeholder"),[n()],i);o()}) -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-worker/src/main/java/com/jd/platform/hotkey/worker/WorkerApplication.java: -------------------------------------------------------------------------------- 1 | package com.jd.platform.hotkey.worker; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.scheduling.annotation.EnableAsync; 6 | import org.springframework.scheduling.annotation.EnableScheduling; 7 | 8 | @EnableAsync 9 | @EnableScheduling 10 | @SpringBootApplication 11 | public class WorkerApplication { 12 | 13 | public static void main(String[] args) { 14 | SpringApplication.run(WorkerApplication.class, args); 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /l2cache-example/src/main/java/com/github/jesse/l2cache/example/dto/BrandIdListBO.java: -------------------------------------------------------------------------------- 1 | package com.github.jesse.l2cache.example.dto; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | import java.util.ArrayList; 7 | import java.util.List; 8 | 9 | @Data 10 | public class BrandIdListBO implements Serializable { 11 | 12 | private static final long serialVersionUID = 1L; 13 | 14 | private List brandIdList; 15 | 16 | public void addBrandId(Integer brandId) { 17 | if (null == brandIdList) { 18 | brandIdList = new ArrayList<>(); 19 | } 20 | brandIdList.add(brandId); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-client/src/main/java/com/jd/platform/hotkey/client/callback/ReceiveNewKeyEvent.java: -------------------------------------------------------------------------------- 1 | package com.jd.platform.hotkey.client.callback; 2 | 3 | import com.jd.platform.hotkey.common.model.HotKeyModel; 4 | 5 | /** 6 | * @author wuweifeng wrote on 2020-02-21 7 | * @version 1.0 8 | */ 9 | public class ReceiveNewKeyEvent { 10 | private HotKeyModel model; 11 | 12 | public ReceiveNewKeyEvent(HotKeyModel model) { 13 | this.model = model; 14 | } 15 | 16 | public HotKeyModel getModel() { 17 | return model; 18 | } 19 | 20 | public void setModel(HotKeyModel model) { 21 | this.model = model; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/css/icons-style.css: -------------------------------------------------------------------------------- 1 | .entypo li, .entypo-tooltip li { 2 | float: left; 3 | height: 10%; 4 | padding: 0.5em; 5 | position: relative; 6 | text-align: center; 7 | -webkit-transition: all 0.5s ease; 8 | -moz-transition: all 0.5s ease; 9 | -o-transition: all 0.5s ease; 10 | -ms-transition: all 0.5s ease; 11 | transition: all 0.5s ease; 12 | width: 10%; 13 | list-style: none; 14 | font-size: 20px; 15 | color: #363E49; 16 | } 17 | .entypo li:hover, .entypo-tooltip li:hover{ 18 | color:#000; 19 | cursor: pointer; 20 | 21 | } 22 | 23 | -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-worker/src/main/java/com/jd/platform/hotkey/worker/tool/AsyncPool.java: -------------------------------------------------------------------------------- 1 | package com.jd.platform.hotkey.worker.tool; 2 | 3 | import java.util.concurrent.ExecutorService; 4 | import java.util.concurrent.Executors; 5 | 6 | /** 7 | * @author wuweifeng 8 | * @version 1.0 9 | * @date 2020-07-10 10 | */ 11 | public class AsyncPool { 12 | private static ExecutorService threadPoolExecutor = Executors.newCachedThreadPool(); 13 | 14 | public static void asyncDo(Runnable runnable) { 15 | threadPoolExecutor.submit(runnable); 16 | } 17 | 18 | public static void shutDown() { 19 | threadPoolExecutor.shutdown(); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /l2cache-core/src/main/java/com/github/jesse/l2cache/HotkeyService.java: -------------------------------------------------------------------------------- 1 | package com.github.jesse.l2cache; 2 | 3 | import com.github.jesse.l2cache.spi.SPI; 4 | 5 | import java.io.Serializable; 6 | import java.util.List; 7 | 8 | /** 9 | * 热key自动识别 10 | * 11 | * @author zengjucai 12 | * @date 2021/6/10 13:45 13 | */ 14 | @SPI("sentinel") 15 | public interface HotkeyService extends Serializable { 16 | 17 | /** 18 | * 初始化 19 | */ 20 | void init(CacheConfig.Hotkey hotkey, List cacheNameList); 21 | 22 | /** 23 | * 是否为热key 24 | * 25 | * @return 返回 true 表示热key 26 | */ 27 | boolean isHotkey(String cacheName, String key); 28 | 29 | } 30 | -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-client/src/main/java/com/jd/platform/hotkey/client/core/key/IKeyPusher.java: -------------------------------------------------------------------------------- 1 | package com.jd.platform.hotkey.client.core.key; 2 | 3 | import com.jd.platform.hotkey.common.model.HotKeyModel; 4 | import com.jd.platform.hotkey.common.model.KeyCountModel; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | * 客户端上传热key到worker接口 10 | * @author wuweifeng wrote on 2020-01-06 11 | * @version 1.0 12 | */ 13 | public interface IKeyPusher { 14 | /** 15 | * 发送待测key 16 | */ 17 | void send(String appName, List list); 18 | 19 | /** 20 | * 发送热key访问量 21 | */ 22 | void sendCount(String appName, List list); 23 | } 24 | -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-client/src/main/java/com/jd/platform/hotkey/client/core/key/KeyRemover.java: -------------------------------------------------------------------------------- 1 | package com.jd.platform.hotkey.client.core.key; 2 | 3 | import com.jd.platform.hotkey.client.etcd.EtcdConfigFactory; 4 | import com.jd.platform.hotkey.client.log.JdLogger; 5 | 6 | /** 7 | * 删除某个key 8 | * @author wuweifeng 9 | * @version 1.0 10 | * @date 2020-07-16 11 | */ 12 | public class KeyRemover { 13 | 14 | public static void remove(String key) { 15 | try { 16 | EtcdConfigFactory.configCenter().delete(key); 17 | } catch (Exception e) { 18 | JdLogger.error(KeyRemover.class, "remove key error"); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/bootstrap/bootstrap-datetimepicker/js/bootstrap-datetimepicker.zh-CN.js: -------------------------------------------------------------------------------- 1 | (function($){ 2 | $.fn.datetimepicker.dates['zh-CN'] = { 3 | days: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六", "星期日"], 4 | daysShort: ["周日", "周一", "周二", "周三", "周四", "周五", "周六", "周日"], 5 | daysMin: ["日", "一", "二", "三", "四", "五", "六", "日"], 6 | months: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"], 7 | monthsShort: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"], 8 | today: "今天", 9 | suffix: [], 10 | meridiem: ["上午", "下午"] 11 | }; 12 | }(jQuery)); 13 | -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/common/js/worker-edit.js: -------------------------------------------------------------------------------- 1 | $("#form-edit").validate({ 2 | 3 | submitHandler : function(form) { 4 | edit(); 5 | } 6 | }); 7 | 8 | function edit() { 9 | var dataFormJson = $("#form-edit").serialize(); 10 | $.ajax({ 11 | cache : true, 12 | type : "POST", 13 | url : "/worker/edit", 14 | data : dataFormJson, 15 | headers: { 16 | "Authorization":getCookie("token") 17 | }, 18 | async : false, 19 | error : function(XMLHttpRequest){ 20 | $.modal.alertError(XMLHttpRequest.responseJSON.msg); 21 | }, 22 | success : function(data) { 23 | $.operate.saveSuccess(data); 24 | } 25 | }); 26 | } 27 | -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-client/src/main/java/com/jd/platform/hotkey/client/netty/event/ChannelInactiveEvent.java: -------------------------------------------------------------------------------- 1 | package com.jd.platform.hotkey.client.netty.event; 2 | 3 | import io.netty.channel.Channel; 4 | 5 | /** 6 | * 客户端netty断线事件 7 | * @author wuweifeng wrote on 2020-01-20 8 | * @version 1.0 9 | */ 10 | public class ChannelInactiveEvent { 11 | private Channel channel; 12 | 13 | public ChannelInactiveEvent(Channel channel) { 14 | this.channel = channel; 15 | } 16 | 17 | public Channel getChannel() { 18 | return channel; 19 | } 20 | 21 | public void setChannel(Channel channel) { 22 | this.channel = channel; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/common/js/changelog-edit.js: -------------------------------------------------------------------------------- 1 | $("#form-edit").validate({ 2 | 3 | submitHandler : function(form) { 4 | edit(); 5 | } 6 | }); 7 | 8 | function edit() { 9 | var dataFormJson = $("#form-edit").serialize(); 10 | $.ajax({ 11 | cache : true, 12 | type : "POST", 13 | url : "/changeLog/edit", 14 | data : dataFormJson, 15 | headers: { 16 | "Authorization":getCookie("token") 17 | }, 18 | async : false, 19 | error : function(XMLHttpRequest){ 20 | $.modal.alertError(XMLHttpRequest.responseJSON.msg); 21 | }, 22 | success : function(data) { 23 | $.operate.saveSuccess(data); 24 | } 25 | }); 26 | } 27 | -------------------------------------------------------------------------------- /l2cache-example/src/main/java/com/github/jesse/l2cache/example/dto/GoodsPriceRevisionRespBO.java: -------------------------------------------------------------------------------- 1 | package com.github.jesse.l2cache.example.dto; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | 7 | @Data 8 | public class GoodsPriceRevisionRespBO implements Serializable { 9 | 10 | private static final long serialVersionUID = 1L; 11 | 12 | private Integer goodsPriceRevisionId; 13 | 14 | private Integer groupId; 15 | 16 | private Integer organizationId; 17 | 18 | private Integer goodsId; 19 | 20 | private Integer goodsGroupId; 21 | 22 | private Long addTime; 23 | 24 | private Long updateTime; 25 | 26 | private Integer state; 27 | } 28 | -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/common/css/common-edit.css: -------------------------------------------------------------------------------- 1 | @CHARSET "UTF-8"; 2 | 3 | body { 4 | font-family: "Open Sans", Arial, sans-serif!important; 5 | font-size: 13px!important; 6 | line-height: 20px; 7 | overflow-x: hidden!important; 8 | min-height: 100%; 9 | z-index: -2; 10 | margin: 0px !important; 11 | background-image: none; 12 | -moz-background-size: cover; 13 | -webkit-background-size: cover; 14 | -o-background-size: cover; 15 | background-size: cover; 16 | } 17 | label.error { 18 | position: absolute; 19 | right: 18px; 20 | top: 5px; 21 | color: #ef392b; 22 | font-size: 12px; 23 | } -------------------------------------------------------------------------------- /l2cache-core/src/main/java/com/github/jesse/l2cache/consts/CacheSyncPolicyType.java: -------------------------------------------------------------------------------- 1 | package com.github.jesse.l2cache.consts; 2 | 3 | /** 4 | * 缓存同步策略类型 5 | * 6 | * @author chenck 7 | * @date 2020/7/7 16:31 8 | */ 9 | public enum CacheSyncPolicyType { 10 | REDIS, 11 | KAFKA, 12 | ROCKETMQ, 13 | ; 14 | 15 | public static CacheSyncPolicyType getCacheType(String type) { 16 | CacheSyncPolicyType[] types = CacheSyncPolicyType.values(); 17 | for (CacheSyncPolicyType cacheType : types) { 18 | if (cacheType.name().equalsIgnoreCase(type)) { 19 | return cacheType; 20 | } 21 | } 22 | return null; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-worker/src/main/java/com/jd/platform/hotkey/worker/config/ClientConfig.java: -------------------------------------------------------------------------------- 1 | package com.jd.platform.hotkey.worker.config; 2 | 3 | import com.jd.platform.hotkey.worker.netty.client.ClientChangeListener; 4 | import com.jd.platform.hotkey.worker.netty.client.IClientChangeListener; 5 | import org.springframework.context.annotation.Bean; 6 | import org.springframework.context.annotation.Configuration; 7 | 8 | /** 9 | * @author wuweifeng wrote on 2019-12-11 10 | * @version 1.0 11 | */ 12 | @Configuration 13 | public class ClientConfig { 14 | @Bean 15 | public IClientChangeListener clientChangeListener() { 16 | return new ClientChangeListener(); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/common/js/changelog-add.js: -------------------------------------------------------------------------------- 1 | $("#form-add").validate({ 2 | 3 | submitHandler:function(form){ 4 | add(); 5 | } 6 | }); 7 | 8 | /** 9 | * 10 | */ 11 | function add() { 12 | var dataFormJson=$("#form-add").serialize(); 13 | $.ajax({ 14 | cache : true, 15 | type : "POST", 16 | url : "/changeLog/add", 17 | data : dataFormJson, 18 | headers: { 19 | "Authorization":getCookie("token") 20 | }, 21 | async : false, 22 | error : function(XMLHttpRequest){ 23 | $.modal.alertError(XMLHttpRequest.responseJSON.msg); 24 | }, 25 | success : function(data) { 26 | $.operate.saveSuccess(data); 27 | } 28 | }); 29 | } 30 | 31 | -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-worker/src/main/java/com/jd/platform/hotkey/worker/config/CaffeineConfig.java: -------------------------------------------------------------------------------- 1 | package com.jd.platform.hotkey.worker.config; 2 | 3 | import com.github.benmanes.caffeine.cache.Cache; 4 | import com.jd.platform.hotkey.worker.cache.CaffeineBuilder; 5 | import org.springframework.context.annotation.Bean; 6 | import org.springframework.context.annotation.Configuration; 7 | 8 | /** 9 | * 10 | * @author wuweifeng wrote on 2019-12-16 11 | * @version 1.0 12 | */ 13 | @Configuration 14 | public class CaffeineConfig { 15 | 16 | @Bean("hotKeyCache") 17 | public Cache hotKeyCache() { 18 | return CaffeineBuilder.buildRecentHotKeyCache(); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /l2cache-core/src/main/java/com/github/jesse/l2cache/consts/HotkeyType.java: -------------------------------------------------------------------------------- 1 | package com.github.jesse.l2cache.consts; 2 | 3 | /** 4 | * 热key类型 5 | * 6 | * @author zengjucai 7 | * @date 2020/7/2 12:06 8 | */ 9 | public enum HotkeyType { 10 | // 没有引入热key功能 11 | NONE, 12 | // 京东 hotkey 13 | JD, 14 | // 阿里 sentinel 15 | SENTINEL, 16 | ; 17 | 18 | public static HotkeyType getHotkeyType(String type) { 19 | HotkeyType[] types = HotkeyType.values(); 20 | for (HotkeyType cacheType : types) { 21 | if (cacheType.name().equalsIgnoreCase(type)) { 22 | return cacheType; 23 | } 24 | } 25 | return null; 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-client/src/main/java/com/jd/platform/hotkey/client/core/worker/WorkerInfoChangeEvent.java: -------------------------------------------------------------------------------- 1 | package com.jd.platform.hotkey.client.core.worker; 2 | 3 | import java.util.List; 4 | 5 | /** 6 | * worker信息有变动 7 | * @author wuweifeng wrote on 2020-01-07 8 | * @version 1.0 9 | */ 10 | public class WorkerInfoChangeEvent { 11 | private List addresses; 12 | 13 | public WorkerInfoChangeEvent(List addresses) { 14 | this.addresses = addresses; 15 | } 16 | 17 | public List getAddresses() { 18 | return addresses; 19 | } 20 | 21 | public void setAddresses(List addresses) { 22 | this.addresses = addresses; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/common/css/user-editPwd.css: -------------------------------------------------------------------------------- 1 | @CHARSET "UTF-8"; 2 | 3 | body { 4 | color: #9ea7b3; 5 | font-family: "Open Sans", Arial, sans-serif!important; 6 | font-size: 13px!important; 7 | line-height: 20px; 8 | overflow-x: hidden!important; 9 | min-height: 100%; 10 | z-index: -2; 11 | margin: 0px !important; 12 | background-image: none; 13 | -moz-background-size: cover; 14 | -webkit-background-size: cover; 15 | -o-background-size: cover; 16 | background-size: cover; 17 | } 18 | label.error { 19 | position: absolute; 20 | right: 18px; 21 | top: 5px; 22 | color: #ef392b; 23 | font-size: 12px; 24 | } -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/css/open-sans.css: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: 'Open Sans'; 3 | font-style: normal; 4 | font-weight: 300; 5 | src: local('Open Sans Light'), local('OpenSans-Light'), url(../fonts/open-sans-light.woff) format('woff'); 6 | } 7 | @font-face { 8 | font-family: 'Open Sans'; 9 | font-style: normal; 10 | font-weight: 400; 11 | src: local('Open Sans'), local('OpenSans'), url(../fonts/open-sans-normal.woff) format('woff'); 12 | } 13 | @font-face { 14 | font-family: 'Open Sans'; 15 | font-style: normal; 16 | font-weight: 700; 17 | src: local('Open Sans Bold'), local('OpenSans-Bold'), url(../fonts/open-sans-bold.woff) format('woff'); 18 | } -------------------------------------------------------------------------------- /l2cache-core/src/main/java/com/github/jesse/l2cache/exception/L2CacheException.java: -------------------------------------------------------------------------------- 1 | package com.github.jesse.l2cache.exception; 2 | 3 | /** 4 | * @author chenck 5 | * @date 2021/1/27 18:42 6 | */ 7 | public class L2CacheException extends RuntimeException { 8 | 9 | private static final long serialVersionUID = 1L; 10 | 11 | private int code; 12 | 13 | public L2CacheException() { 14 | } 15 | 16 | public L2CacheException(String message) { 17 | super(message); 18 | } 19 | 20 | public L2CacheException(int code, String message) { 21 | super(message); 22 | this.code = code; 23 | } 24 | 25 | 26 | public int getCode() { 27 | return this.code; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /l2cache-core/src/main/java/com/github/jesse/l2cache/consts/CacheType.java: -------------------------------------------------------------------------------- 1 | package com.github.jesse.l2cache.consts; 2 | 3 | /** 4 | * 缓存类型 5 | * 6 | * @author chenck 7 | * @date 2020/7/2 12:06 8 | */ 9 | public enum CacheType { 10 | // L1 or L2 11 | NONE, 12 | // 组合 13 | COMPOSITE, 14 | // L1 15 | CAFFEINE, 16 | GUAVA, 17 | // L2 18 | REDIS, 19 | ; 20 | 21 | public static CacheType getCacheType(String type) { 22 | CacheType[] types = CacheType.values(); 23 | for (CacheType cacheType : types) { 24 | if (cacheType.name().equalsIgnoreCase(type)) { 25 | return cacheType; 26 | } 27 | } 28 | return null; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /l2cache-core/src/main/java/com/github/jesse/l2cache/CacheSpec.java: -------------------------------------------------------------------------------- 1 | package com.github.jesse.l2cache; 2 | 3 | import lombok.Getter; 4 | import lombok.Setter; 5 | import lombok.ToString; 6 | import lombok.experimental.Accessors; 7 | 8 | /** 9 | * 缓存配置 10 | * 注:从一级缓存中解析出来的各个维度的值,可用于二级缓存中设置对应的参数。如缓存过期时间、最大缓存数等。 11 | * 12 | * @author chenck 13 | * @date 2020/9/2 16:18 14 | */ 15 | @Getter 16 | @Setter 17 | @Accessors(chain = true) 18 | @ToString 19 | public class CacheSpec { 20 | 21 | /** 22 | * 缓存过期时间(ms) 23 | */ 24 | private long expireTime; 25 | 26 | /** 27 | * 最大缓存数,以便剔除多余元素 28 | * 注:注意如果与一级缓存(如:caffeine)中最大数量大小不一致,会出现一级缓存和二级缓存中缓存数量不一致,所以建议设置为一致减少不必要的歧义。 29 | */ 30 | private int maxSize; 31 | } 32 | -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/css/loader-style.css: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | @import "../js/skin-select/skin-select.css"; 5 | 6 | @import "font-awesome.css"; 7 | @import "entypo-icon.css"; 8 | @import "maki-icons.css"; 9 | @import "weather-icons.min.css"; 10 | @import "dripicon.css"; 11 | @import "open-sans.css"; 12 | @import "awwwards.css"; 13 | /** 导入阿里图标 **/ 14 | @import "../font-ali/iconfont.css"; 15 | 16 | 17 | 18 | @import "../js/pnotify/jquery.pnotify.default.css"; 19 | @import "../js/tip/tooltipster.css"; 20 | 21 | 22 | 23 | 24 | 25 | @import "../js/pace/themes/pace-theme-center-simple.css"; 26 | @import "../js/slidebars/slidebars.css"; 27 | @import "../js/gage/jquery.easy-pie-chart.css"; 28 | -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-client/src/main/java/com/jd/platform/hotkey/client/core/rule/KeyRuleInfoChangeEvent.java: -------------------------------------------------------------------------------- 1 | package com.jd.platform.hotkey.client.core.rule; 2 | 3 | import com.jd.platform.hotkey.common.rule.KeyRule; 4 | 5 | import java.util.List; 6 | 7 | /** 8 | * @author wuweifeng wrote on 2020-02-26 9 | * @version 1.0 10 | */ 11 | public class KeyRuleInfoChangeEvent { 12 | private List keyRules; 13 | 14 | public KeyRuleInfoChangeEvent(List keyRules) { 15 | this.keyRules = keyRules; 16 | } 17 | 18 | public List getKeyRules() { 19 | return keyRules; 20 | } 21 | 22 | public void setKeyRules(List keyRules) { 23 | this.keyRules = keyRules; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/select2/js/i18n/zh-CN.js: -------------------------------------------------------------------------------- 1 | /*! Select2 4.0.10 | https://github.com/select2/select2/blob/master/LICENSE.md */ 2 | 3 | !function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/zh-CN",[],function(){return{errorLoading:function(){return"无法载入结果。"},inputTooLong:function(n){return"请删除"+(n.input.length-n.maximum)+"个字符"},inputTooShort:function(n){return"请再输入至少"+(n.minimum-n.input.length)+"个字符"},loadingMore:function(){return"载入更多结果…"},maximumSelected:function(n){return"最多只能选择"+n.maximum+"个项目"},noResults:function(){return"未找到结果"},searching:function(){return"搜索中…"},removeAllItems:function(){return"删除所有项目"}}}),n.define,n.require}(); -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-worker/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | netty: 2 | port: ${nettyPort:11111} 3 | heartBeat: ${heartBeat:10} 4 | timeOut: ${timeOut:5000} 5 | local: 6 | address: ${localAddress:} #有些获取到的ip不能用,需要手工配worker的地址 7 | open: 8 | timeout: ${openTimeOut:true} 9 | monitor: ${openMonitor:false} #开启持续无key发送监控,如果持续1分钟没发来key,就断开和etcd的连接,之后重建和客户端连接 10 | thread: 11 | count: ${threadCount:0} 12 | caffeine: 13 | minutes: ${caffeineMinutes:1} 14 | disruptor: 15 | bufferSize: ${bufferSize:2} #必须是2的整数倍 16 | #etcd的地址,如有多个用逗号分隔 17 | etcd: 18 | server: ${etcdServer:http://127.0.0.1:2379} #etcd的地址,重要!!! 19 | workerPath: ${workerPath:default} #该worker放到哪个path下,譬如放/app1下,则该worker只能被app1使用,不会为其他client提供服务 20 | server: 21 | port: 9902 -------------------------------------------------------------------------------- /l2cache-core/src/main/java/com/github/jesse/l2cache/consts/CacheRange.java: -------------------------------------------------------------------------------- 1 | package com.github.jesse.l2cache.consts; 2 | 3 | /** 4 | * 缓存范围 5 | * 可用于作为开关 6 | * 7 | * @author chenck 8 | * @date 2020/11/10 21:47 9 | */ 10 | public enum CacheRange { 11 | // 启用 12 | ENABLE, 13 | // 启用部分 14 | ENABLE_PART, 15 | // 停用 16 | DISABLE, 17 | // 停用部分 18 | DISABLE_PART, 19 | ; 20 | 21 | public static CacheRange getCacheRange(String range) { 22 | CacheRange[] ranges = CacheRange.values(); 23 | for (CacheRange cacheRange : ranges) { 24 | if (cacheRange.name().equalsIgnoreCase(range)) { 25 | return cacheRange; 26 | } 27 | } 28 | return null; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/java/com/jd/platform/hotkey/dashboard/service/ClearService.java: -------------------------------------------------------------------------------- 1 | package com.jd.platform.hotkey.dashboard.service; 2 | 3 | import com.github.pagehelper.PageInfo; 4 | import com.jd.platform.hotkey.dashboard.common.domain.req.PageReq; 5 | import com.jd.platform.hotkey.dashboard.common.domain.vo.ClearCfgVo; 6 | 7 | /** 8 | * @ProjectName: hotkey 9 | * @ClassName: ClearService 10 | * @Description: TODO(一句话描述该类的功能) 11 | * @Author: liyunfeng31 12 | * @Date: 2020/8/3 9:51 13 | */ 14 | public interface ClearService { 15 | 16 | 17 | PageInfo pageClearCfg(PageReq page, String app); 18 | 19 | ClearCfgVo selectClearCfg(String app); 20 | 21 | int saveClearCfg(ClearCfgVo cfg); 22 | 23 | } 24 | -------------------------------------------------------------------------------- /doc/写该组件的初衷.md: -------------------------------------------------------------------------------- 1 | 2 | **写该组件的初衷:** 3 | 4 | 目前所在公司所使用的缓存方案没有统一的标准,以至于不同的团队各自为战,比如Redis/Guava/自研cache组件/Jetcache 等等不一而足,下面针对主要的几种做一下简单分析: 5 | 6 | `Redis`缓存: 7 | 8 | > 优点:分布式缓存,且可采用Redis Cluster等方案保证高可用。 9 | > 10 | > 缺点:需要在应用端对缓存雪崩、缓存击穿、缓存穿透、热点key访问等问题进行编码实现,难度高。 11 | 12 | `Guava`缓存: 13 | 14 | > 优点:Guava是一个线程安全的本地缓存,其定义了一套自己的缓存处理策略,自动回收,自动清除,自动加载等。相对于Redis或数据库,访问内存中的数据更加高效。 15 | > 16 | > 缺点:因其是一个本地缓存,所以天然存在分布式不一致的情况;另一个是缓存数据无法持久化。 17 | 18 | `自研cache组件`: 19 | 20 | > 优点:实现思路值得借鉴。 21 | > 22 | > 缺点:扩展性低,使用复杂,代码侵入严重,需client端实现缓存结构。 23 | 24 | 结合上述分析,可以发现 `Redis` 和 `Guava` 在一定程度上是互补的,所以让我萌生了一个想法:将Redis 和 Guava结合起来实现一个通用的二级缓存;既可以利用Redis的分布式缓存特性,也可以利用Guava的线程安全和缓存处理策略的特性,还可以保证并发编程的稳定性和降低并发编码难度,这样岂不美哉。 25 | 26 | > 经了解发现,Spring5开始使用Caffeine替代了Guava,所以果断选择抱紧Spring的大腿。 27 | -------------------------------------------------------------------------------- /l2cache-core/src/main/java/com/github/jesse/l2cache/exception/RedisTrylockFailException.java: -------------------------------------------------------------------------------- 1 | package com.github.jesse.l2cache.exception; 2 | 3 | /** 4 | * @author chenck 5 | * @date 2020/9/22 20:26 6 | */ 7 | public class RedisTrylockFailException extends RuntimeException { 8 | 9 | private static final long serialVersionUID = 1L; 10 | 11 | private int code; 12 | 13 | public RedisTrylockFailException() { 14 | } 15 | 16 | public RedisTrylockFailException(String message) { 17 | super(message); 18 | } 19 | 20 | public RedisTrylockFailException(int code, String message) { 21 | super(message); 22 | this.code = code; 23 | } 24 | 25 | 26 | public int getCode() { 27 | return this.code; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/jn/css/jquery.numberedtextarea.css: -------------------------------------------------------------------------------- 1 | 2 | div.numberedtextarea-wrapper { position: relative; } 3 | 4 | div.numberedtextarea-wrapper textarea { 5 | display: block; 6 | -webkit-box-sizing: border-box; 7 | -moz-box-sizing: border-box; 8 | box-sizing: border-box; 9 | } 10 | 11 | div.numberedtextarea-line-numbers { 12 | position: absolute; 13 | display: none; 14 | background-color: #fafafa; 15 | top: 0; 16 | left: 0; 17 | right: 0; 18 | bottom: 0; 19 | width: 40px; 20 | border-right: 1px dashed #eee; 21 | border-bottom:solid 1px #ddd; 22 | color: #999; 23 | overflow: hidden; 24 | } 25 | 26 | div.numberedtextarea-number { 27 | padding-right: 6px; 28 | text-align: center; 29 | } 30 | -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/java/com/jd/platform/hotkey/dashboard/service/ChangeLogService.java: -------------------------------------------------------------------------------- 1 | package com.jd.platform.hotkey.dashboard.service; 2 | 3 | import com.github.pagehelper.PageInfo; 4 | import com.jd.platform.hotkey.dashboard.common.domain.req.PageReq; 5 | import com.jd.platform.hotkey.dashboard.common.domain.req.SearchReq; 6 | import com.jd.platform.hotkey.dashboard.model.ChangeLog; 7 | 8 | /** 9 | * @ProjectName: hotkey 10 | * @ClassName: ChangeLogService 11 | * @Description: TODO(一句话描述该类的功能) 12 | * @Author: liyunfeng31 13 | * @Date: 2020/4/17 16:29 14 | */ 15 | public interface ChangeLogService { 16 | 17 | PageInfo pageChangeLog(PageReq page, SearchReq param); 18 | 19 | ChangeLog selectByPrimaryKey(int id); 20 | 21 | } 22 | -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/common/js/clearcfg-edit.js: -------------------------------------------------------------------------------- 1 | $("#form-edit").validate({ 2 | submitHandler:function(form){ 3 | edit(); 4 | } 5 | }); 6 | 7 | function edit() { 8 | var dataFormJson=$("#form-edit").serialize(); 9 | $.ajax({ 10 | cache : true, 11 | type : "POST", 12 | url : "/clear/save", 13 | data : dataFormJson, 14 | headers: { 15 | "Authorization":getCookie("token") 16 | }, 17 | async : false, 18 | error : function(XMLHttpRequest){ 19 | $.modal.alertError(XMLHttpRequest.responseJSON.msg); 20 | }, 21 | success : function(data) { 22 | $.operate.saveSuccess(data); 23 | } 24 | }); 25 | } 26 | -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-client/src/main/java/com/jd/platform/hotkey/client/core/key/KeyHotModel.java: -------------------------------------------------------------------------------- 1 | package com.jd.platform.hotkey.client.core.key; 2 | 3 | /** 4 | * @author wuweifeng 5 | * @version 1.0 6 | * @date 2020-06-24 7 | */ 8 | public class KeyHotModel { 9 | private String key; 10 | private boolean isHot; 11 | 12 | public KeyHotModel(String key, boolean isHot) { 13 | this.key = key; 14 | this.isHot = isHot; 15 | } 16 | 17 | public String getKey() { 18 | return key; 19 | } 20 | 21 | public void setKey(String key) { 22 | this.key = key; 23 | } 24 | 25 | public boolean isHot() { 26 | return isHot; 27 | } 28 | 29 | public void setHot(boolean hot) { 30 | isHot = hot; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-client/src/main/java/com/jd/platform/hotkey/client/etcd/EtcdConfigFactory.java: -------------------------------------------------------------------------------- 1 | package com.jd.platform.hotkey.client.etcd; 2 | 3 | import com.jd.platform.hotkey.common.configcenter.IConfigCenter; 4 | import com.jd.platform.hotkey.common.configcenter.etcd.JdEtcdBuilder; 5 | 6 | /** 7 | * @author wuweifeng wrote on 2020-01-07 8 | * @version 1.0 9 | */ 10 | public class EtcdConfigFactory { 11 | private static IConfigCenter configCenter; 12 | 13 | private EtcdConfigFactory() {} 14 | 15 | public static IConfigCenter configCenter() { 16 | return configCenter; 17 | } 18 | 19 | public static void buildConfigCenter(String etcdServer) { 20 | //连接多个时,逗号分隔 21 | configCenter = JdEtcdBuilder.build(etcdServer); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-common/src/main/java/com/jd/platform/hotkey/common/tool/NettyIpUtil.java: -------------------------------------------------------------------------------- 1 | package com.jd.platform.hotkey.common.tool; 2 | 3 | import io.netty.channel.ChannelHandlerContext; 4 | 5 | import java.net.InetSocketAddress; 6 | 7 | /** 8 | * @author wuweifeng 9 | * @version 1.0 10 | * @date 2020-04-27 11 | */ 12 | public class NettyIpUtil { 13 | /** 14 | * 从netty连接中读取ip地址 15 | */ 16 | public static String clientIp(ChannelHandlerContext ctx) { 17 | try { 18 | InetSocketAddress insocket = (InetSocketAddress) ctx.channel() 19 | .remoteAddress(); 20 | return insocket.getAddress().getHostAddress(); 21 | } catch (Exception e) { 22 | return "未知"; 23 | } 24 | 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/validate/validate.css: -------------------------------------------------------------------------------- 1 | /* ======================================= 2 | 3 | Main Stylesheet 4 | 5 | Building on Twitter Bootstrap 6 | http://twitter.github.com/bootstrap/ 7 | 8 | ========================================== */ 9 | 10 | @import url('assets/css/bootstrap.min.html'); 11 | @import url('assets/css/bootstrap-responsive.min.html'); 12 | 13 | /* New styles below */ 14 | 15 | label.valid { 16 | width: 24px; 17 | height: 24px; 18 | background: url(img/valid.png) center center no-repeat; 19 | display: inline-block; 20 | text-indent: -9999px; 21 | } 22 | label.error { 23 | font-weight: bold; 24 | color: #FF0064; 25 | padding: 2px 8px; 26 | margin-top: 2px; 27 | } -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/common/js/rule-edit.js: -------------------------------------------------------------------------------- 1 | $("#form-edit").validate({ 2 | 3 | submitHandler : function(form) { 4 | edit(); 5 | } 6 | }); 7 | 8 | function edit() { 9 | var dataFormJson = $("#form-edit").serialize(); 10 | $.ajax({ 11 | cache : true, 12 | type : "POST", 13 | url : "/rule/edit", 14 | data : dataFormJson, 15 | headers: { 16 | "Authorization":getCookie("token") 17 | }, 18 | async : false, 19 | error : function(XMLHttpRequest) { 20 | var token = getCookie("token"); 21 | if(XMLHttpRequest.status == 1000 && ( token == "undefined" || token =="")){ 22 | top.location.href = '/user/login'; 23 | } 24 | }, 25 | success : function(data) { 26 | $.operate.saveSuccess(data); 27 | } 28 | }); 29 | } 30 | -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-worker/src/main/java/com/jd/platform/hotkey/worker/tool/InitConstant.java: -------------------------------------------------------------------------------- 1 | package com.jd.platform.hotkey.worker.tool; 2 | 3 | import java.util.concurrent.atomic.LongAdder; 4 | 5 | /** 6 | * @author wuweifeng 7 | * @version 1.0 8 | * @date 2020-05-22 9 | */ 10 | public class InitConstant { 11 | public static int timeOut = 5000; 12 | 13 | //单位是百万 14 | public static int bufferSize = 2; 15 | 16 | public static final LongAdder expireTotalCount = new LongAdder(); 17 | 18 | public static final LongAdder totalDealCount = new LongAdder(); 19 | 20 | public static final LongAdder totalOfferCount = new LongAdder(); 21 | 22 | /** 23 | * key在caffeine里多久过期,默认只存1分钟的 24 | */ 25 | public static int caffeineMaxMinutes = 1; 26 | } 27 | -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/common/js/worker-add.js: -------------------------------------------------------------------------------- 1 | $("#form-add").validate({ 2 | rules:{ 3 | ip:{ 4 | required:true, 5 | }, 6 | port:{ 7 | required:true, 8 | } 9 | }, 10 | submitHandler:function(form){ 11 | add(); 12 | } 13 | }); 14 | 15 | /** 16 | * 17 | */ 18 | function add() { 19 | var dataFormJson=$("#form-add").serialize(); 20 | $.ajax({ 21 | cache : true, 22 | type : "POST", 23 | url : "/worker/add", 24 | data : dataFormJson, 25 | headers: { 26 | "Authorization":getCookie("token") 27 | }, 28 | async : false, 29 | error : function(XMLHttpRequest){ 30 | $.modal.alertError(XMLHttpRequest.responseJSON.msg); 31 | }, 32 | success : function(data) { 33 | $.operate.saveSuccess(data); 34 | } 35 | }); 36 | } 37 | 38 | -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-common/src/main/java/com/jd/platform/hotkey/common/model/MsgBuilder.java: -------------------------------------------------------------------------------- 1 | package com.jd.platform.hotkey.common.model; 2 | 3 | import com.jd.platform.hotkey.common.tool.Constant; 4 | import com.jd.platform.hotkey.common.tool.FastJsonUtils; 5 | import io.netty.buffer.ByteBuf; 6 | import io.netty.buffer.Unpooled; 7 | 8 | /** 9 | * @author wuweifeng 10 | * @version 1.0 11 | * @date 2020-04-22 12 | */ 13 | public class MsgBuilder { 14 | public static ByteBuf buildByteBuf(String msg) { 15 | return Unpooled.copiedBuffer((msg + Constant.DELIMITER).getBytes()); 16 | } 17 | 18 | public static ByteBuf buildByteBuf(HotKeyMsg hotKeyMsg) { 19 | return Unpooled.copiedBuffer((FastJsonUtils.convertObjectToJSON(hotKeyMsg) + Constant.DELIMITER).getBytes()); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/dataTable/css/datatables.responsive.css: -------------------------------------------------------------------------------- 1 | table.has-columns-hidden > tbody > tr > td > span.responsiveExpander { 2 | background: url('../img/plus.png') no-repeat 5px center; 3 | padding-left: 32px; 4 | cursor: pointer; 5 | } 6 | 7 | table.has-columns-hidden > tbody > tr.detail-show > td span.responsiveExpander { 8 | background: url('../img/minus.png') no-repeat 5px center; 9 | } 10 | 11 | table.has-columns-hidden > tbody > tr.row-detail > td { 12 | background: #eee; 13 | } 14 | 15 | table.has-columns-hidden > tbody > tr.row-detail > td > ul { 16 | list-style: none; 17 | margin: 0; 18 | } 19 | 20 | table.has-columns-hidden > tbody > tr.row-detail > td > ul > li > span.columnTitle { 21 | font-weight: bold; 22 | } 23 | -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/chart/barChart.js: -------------------------------------------------------------------------------- 1 | var barChartData = { 2 | 3 | labels : ["January","February","March","April","May","June","July"], 4 | datasets : [ 5 | { 6 | fillColor : "rgba(106, 218, 228, 0.8)", 7 | data : [65,59,90,81,56,55,40] 8 | }, 9 | { 10 | fillColor : "rgba(52, 152, 219, 0.8)", 11 | data : [28,48,40,19,96,27,100] 12 | } 13 | ] 14 | 15 | 16 | } 17 | 18 | var myLine = new Chart(document.getElementById("canvas1").getContext("2d")).Bar(barChartData,{ 19 | scaleShowLabels : false, 20 | pointLabelFontSize : 24 21 | }); 22 | -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/stackable/stacktable.css: -------------------------------------------------------------------------------- 1 | .stacktable { 2 | width: 100%; 3 | } 4 | .st-head-row { 5 | padding-top: 1em; 6 | text-align: center; 7 | } 8 | .st-head-row.st-head-row-main { 9 | font-size: 1.5em; 10 | padding-top: 0; 11 | text-align: center; 12 | } 13 | .st-key { 14 | width: 49%; 15 | text-align: right; 16 | padding-right: 1%; 17 | } 18 | .st-val { 19 | width: 49%; 20 | padding-left: 1%; 21 | } 22 | /* RESPONSIVE EXAMPLE */ 23 | .stacktable.large-only { 24 | display: table; 25 | } 26 | .small-only { 27 | display: none; 28 | } 29 | @media (max-width: 800px) { 30 | .large-only { 31 | display: none; 32 | } 33 | .stacktable.small-only { 34 | display: table; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /l2cache-example/src/main/java/com/github/jesse/l2cache/example/Application80.java: -------------------------------------------------------------------------------- 1 | package com.github.jesse.l2cache.example; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | /** 7 | * 基于 l2cache-spring-boot-starter 的demo 8 | */ 9 | @SpringBootApplication 10 | public class Application80 { 11 | 12 | /** 13 | * -Xmx256M -Xms256M -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -Xloggc:F:/temp/jvm/gc_%t.log -XX:+UseConcMarkSweepGC -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=F:/temp/jvm/heap_%t.hprof 14 | */ 15 | public static void main(String[] args) { 16 | System.setProperty("spring.profiles.active", "80");// 基于端口维度,指定启用的配置文件 17 | SpringApplication.run(Application80.class, args); 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/java/com/jd/platform/hotkey/dashboard/mapper/WorkerMapper.java: -------------------------------------------------------------------------------- 1 | package com.jd.platform.hotkey.dashboard.mapper; 2 | 3 | import com.jd.platform.hotkey.dashboard.common.domain.req.SearchReq; 4 | import com.jd.platform.hotkey.dashboard.model.Worker; 5 | import org.apache.ibatis.annotations.Mapper; 6 | import org.apache.ibatis.annotations.Options; 7 | 8 | import java.util.List; 9 | 10 | @Mapper 11 | public interface WorkerMapper { 12 | 13 | int logicDeleteByKey(Integer id, String updateUser); 14 | 15 | @Options(useGeneratedKeys = true) 16 | int insertSelective(Worker record); 17 | 18 | Worker selectByPrimaryKey(Integer id); 19 | 20 | int updateByKey(Worker record); 21 | 22 | List listWorker(SearchReq param); 23 | 24 | Worker selectByKey(String name); 25 | } -------------------------------------------------------------------------------- /l2cache-core/src/main/java/com/github/jesse/l2cache/schedule/RefreshExpiredCacheTask.java: -------------------------------------------------------------------------------- 1 | package com.github.jesse.l2cache.schedule; 2 | 3 | import com.github.jesse.l2cache.cache.Level1Cache; 4 | 5 | /** 6 | * 刷新过期缓存Task 7 | *

8 | * 该Task的主要目的是尽可能的保证 L1Cache 中是最新的数据。如guava、caffeine在访问时,若数据过期则先返回旧数据,再执行数据加载。 9 | * 如果 L1Cache 是 LoadingCache,并且自定义CuntomCacheLoader中 L2Cache 不为空,则同时刷新L1Cache和L2Cache。 10 | * 11 | * @author chenck 12 | * @date 2020/7/6 9:58 13 | */ 14 | public class RefreshExpiredCacheTask implements Runnable { 15 | 16 | private final Level1Cache level1Cache; 17 | 18 | public RefreshExpiredCacheTask(Level1Cache level1Cache) { 19 | this.level1Cache = level1Cache; 20 | } 21 | 22 | @Override 23 | public void run() { 24 | this.level1Cache.refreshAllExpireCache(); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/common/js/rule-add.js: -------------------------------------------------------------------------------- 1 | $("#form-add").validate({ 2 | submitHandler:function(form){ 3 | add(); 4 | } 5 | }); 6 | 7 | function add() { 8 | var dataFormJson=$("#form-add").serialize(); 9 | $.ajax({ 10 | cache : true, 11 | type : "POST", 12 | url : "/rule/add", 13 | data : dataFormJson, 14 | headers: { 15 | "Authorization":getCookie("token") 16 | }, 17 | async : false, 18 | error : function(XMLHttpRequest){ 19 | $.modal.alertError(XMLHttpRequest.responseJSON.msg); 20 | var token = getCookie("token"); 21 | if(XMLHttpRequest.status == 1000 && ( token == "undefined" || token =="")){ 22 | top.location.href = '/user/login'; 23 | } 24 | }, 25 | success : function(data) { 26 | $.operate.saveSuccess(data); 27 | } 28 | }); 29 | } 30 | 31 | -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-worker/src/main/java/com/jd/platform/hotkey/worker/netty/pusher/store/HotkeyTempStore.java: -------------------------------------------------------------------------------- 1 | package com.jd.platform.hotkey.worker.netty.pusher.store; 2 | 3 | import com.jd.platform.hotkey.common.model.HotKeyModel; 4 | 5 | import java.util.concurrent.LinkedBlockingQueue; 6 | 7 | /** 8 | * 已热待上报入库的热key集中营 9 | * @author wuweifeng 10 | * @version 1.0 11 | * @date 2020-08-31 12 | */ 13 | public class HotkeyTempStore { 14 | /** 15 | * 热key集中营 16 | */ 17 | private static LinkedBlockingQueue hotKeyStoreQueue = new LinkedBlockingQueue<>(); 18 | 19 | public static void push(HotKeyModel model) { 20 | hotKeyStoreQueue.offer(model); 21 | } 22 | 23 | public static LinkedBlockingQueue getQueue() { 24 | return hotKeyStoreQueue; 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/java/com/jd/platform/hotkey/dashboard/mapper/UserMapper.java: -------------------------------------------------------------------------------- 1 | package com.jd.platform.hotkey.dashboard.mapper; 2 | 3 | import com.jd.platform.hotkey.dashboard.common.domain.req.SearchReq; 4 | import com.jd.platform.hotkey.dashboard.model.User; 5 | import org.apache.ibatis.annotations.Mapper; 6 | 7 | import java.util.List; 8 | 9 | @Mapper 10 | public interface UserMapper { 11 | int deleteByPrimaryKey(Integer id); 12 | 13 | int insertSelective(User user); 14 | 15 | User selectByPrimaryKey(Integer id); 16 | 17 | int updateByPk(User record); 18 | 19 | List listUser(SearchReq param); 20 | 21 | User findByNameAndPwd(User user); 22 | 23 | List listApp(); 24 | 25 | List selectHkUserList(User user); 26 | 27 | User selectByUserName(String userName); 28 | } -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/common/js/key-edit.js: -------------------------------------------------------------------------------- 1 | $("#form-edit").validate({ 2 | 3 | submitHandler : function(form) { 4 | edit(); 5 | } 6 | }); 7 | 8 | function edit() { 9 | var dataFormJson = $("#form-edit").serialize(); 10 | $.ajax({ 11 | cache : true, 12 | type : "POST", 13 | url : "/key/edit", 14 | data : dataFormJson, 15 | headers: { 16 | "Authorization":getCookie("token") 17 | }, 18 | async : false, 19 | error : function(XMLHttpRequest){ 20 | $.modal.alertError(XMLHttpRequest.responseJSON.msg); 21 | var token = getCookie("token"); 22 | if(XMLHttpRequest.status == 1000 && ( token == "undefined" || token =="")){ 23 | top.location.href = '/user/login'; 24 | } 25 | }, 26 | success : function(data) { 27 | $.operate.saveSuccess(data); 28 | } 29 | }); 30 | } 31 | -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/common/js/user-edit.js: -------------------------------------------------------------------------------- 1 | $("#form-edit").validate({ 2 | 3 | submitHandler : function(form) { 4 | edit(); 5 | } 6 | }); 7 | 8 | function edit() { 9 | var dataFormJson = $("#form-edit").serialize(); 10 | $.ajax({ 11 | cache : true, 12 | type : "POST", 13 | url : "/user/edit", 14 | data : dataFormJson, 15 | headers: { 16 | "Authorization":getCookie("token") 17 | }, 18 | async : false, 19 | error : function(XMLHttpRequest){ 20 | $.modal.alertError(XMLHttpRequest.responseJSON.msg); 21 | var token = getCookie("token"); 22 | if(XMLHttpRequest.status == 1000 && ( token == "undefined" || token =="")){ 23 | top.location.href = '/user/login'; 24 | } 25 | }, 26 | success : function(data) { 27 | $.operate.saveSuccess(data); 28 | } 29 | }); 30 | } 31 | -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/java/com/jd/platform/hotkey/dashboard/mapper/SummaryMapper.java: -------------------------------------------------------------------------------- 1 | package com.jd.platform.hotkey.dashboard.mapper; 2 | 3 | import com.jd.platform.hotkey.dashboard.common.domain.req.SearchReq; 4 | import com.jd.platform.hotkey.dashboard.common.domain.vo.HitCountVo; 5 | import com.jd.platform.hotkey.dashboard.model.Summary; 6 | import org.apache.ibatis.annotations.Mapper; 7 | 8 | import java.util.Date; 9 | import java.util.List; 10 | 11 | /** 12 | * @author liyunfeng31 13 | */ 14 | @Mapper 15 | public interface SummaryMapper { 16 | 17 | /** 18 | * records 19 | * @param records records 20 | * @return row 21 | */ 22 | int saveOrUpdate(Summary records); 23 | 24 | List listRuleHitCount(SearchReq req); 25 | 26 | int clearExpireData(String app, Date expireDate); 27 | } -------------------------------------------------------------------------------- /l2cache-spring-boot-starter/src/main/java/com/github/jesse/l2cache/spring/L2CacheProperties.java: -------------------------------------------------------------------------------- 1 | package com.github.jesse.l2cache.spring; 2 | 3 | import com.github.jesse.l2cache.CacheConfig; 4 | import org.springframework.boot.context.properties.ConfigurationProperties; 5 | import org.springframework.cloud.context.config.annotation.RefreshScope; 6 | 7 | /** 8 | * 一二级缓存属性配置 9 | * 注:Caffeine 一级缓存,Redis 二级缓存 10 | * 11 | * @author chenck 12 | * @date 2020/4/26 20:44 13 | */ 14 | @ConfigurationProperties(prefix = "l2cache") 15 | @RefreshScope 16 | public class L2CacheProperties { 17 | /** 18 | * 缓存配置 19 | */ 20 | private CacheConfig config; 21 | 22 | public CacheConfig getConfig() { 23 | return config; 24 | } 25 | 26 | public void setConfig(CacheConfig config) { 27 | this.config = config; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/java/com/jd/platform/hotkey/dashboard/controller/TestController.java: -------------------------------------------------------------------------------- 1 | package com.jd.platform.hotkey.dashboard.controller; 2 | 3 | /** 4 | * @author wuweifeng 5 | * @version 1.0 6 | * @date 2020-07-16 7 | */ 8 | //@RestController 9 | //public class TestController { 10 | // @Resource 11 | // private IConfigCenter configCenter; 12 | // 13 | // @RequestMapping("delete") 14 | // public Object delete(String key) { 15 | //// configCenter.putAndGrant(ConfigConstant.hotKeyRecordPath + "sample" + "/" + key, cn.weeget.hotkey.common.tool.Constant.DEFAULT_DELETE_VALUE, 1); 16 | // configCenter.putAndGrant(ConfigConstant.hotKeyRecordPath + "bbb" + "/" + key, "", 60); 17 | //// configCenter.delete(ConfigConstant.hotKeyPath + "sample" + "/" + key); 18 | // 19 | // return "1"; 20 | // } 21 | //} 22 | -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/java/com/jd/platform/hotkey/dashboard/common/domain/vo/RuleLineChartVo.java: -------------------------------------------------------------------------------- 1 | package com.jd.platform.hotkey.dashboard.common.domain.vo; 2 | 3 | /** 4 | * @author liyunfeng31 5 | */ 6 | public class RuleLineChartVo { 7 | 8 | private String rule; 9 | 10 | private Integer count; 11 | 12 | public RuleLineChartVo() { 13 | } 14 | 15 | public RuleLineChartVo(String rule, Integer count) { 16 | this.rule = rule; 17 | this.count = count; 18 | } 19 | 20 | public String getRule() { 21 | return rule; 22 | } 23 | 24 | public void setRule(String rule) { 25 | this.rule = rule; 26 | } 27 | 28 | public Integer getCount() { 29 | return count; 30 | } 31 | 32 | public void setCount(Integer count) { 33 | this.count = count; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/bootstrap/js/bootstrap-table/locale/bootstrap-table-zh-CN.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | * bootstrap-table - v1.9.0 - 2015-09-30 3 | * https://github.com/wenzhixin/bootstrap-table 4 | * Copyright (c) 2015 zhixin wen 5 | * Licensed MIT License 6 | */ 7 | !function(a){"use strict";a.fn.bootstrapTable.locales["zh-CN"]={formatLoadingMessage:function(){return"正在努力地加载数据中,请稍候……"},formatRecordsPerPage:function(a){return"每页显示 "+a+" 条记录"},formatShowingRows:function(a,b,c){return"显示第 "+a+" 到第 "+b+" 条记录,总共 "+c+" 条记录"},formatSearch:function(){return"搜索"},formatNoMatches:function(){return"没有找到匹配的记录"},formatPaginationSwitch:function(){return"隐藏/显示分页"},formatRefresh:function(){return"刷新"},formatToggle:function(){return"切换"},formatColumns:function(){return"列"}},a.extend(a.fn.bootstrapTable.defaults,a.fn.bootstrapTable.locales["zh-CN"])}(jQuery); 8 | -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-sample/src/main/java/com/jd/platform/hotkey/sample/config/RedisConfig.java: -------------------------------------------------------------------------------- 1 | package com.jd.platform.hotkey.sample.config; 2 | 3 | import org.springframework.context.annotation.Bean; 4 | import org.springframework.context.annotation.Configuration; 5 | import org.springframework.data.redis.connection.RedisConnectionFactory; 6 | import org.springframework.data.redis.core.StringRedisTemplate; 7 | 8 | /** 9 | * @author wuweifeng wrote on 2017/10/27. 10 | */ 11 | @Configuration 12 | public class RedisConfig { 13 | 14 | @Bean(name = {"redisTemplate", "stringRedisTemplate"}) 15 | public StringRedisTemplate stringRedisTemplate(RedisConnectionFactory factory) { 16 | StringRedisTemplate redisTemplate = new StringRedisTemplate(); 17 | redisTemplate.setConnectionFactory(factory); 18 | return redisTemplate; 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/tree/treetable/stylesheets/jquery.treetable.css: -------------------------------------------------------------------------------- 1 | table.treetable span.indenter { 2 | display: inline-block; 3 | margin: 0; 4 | padding: 0; 5 | text-align: right; 6 | 7 | /* Disable text selection of nodes (for better D&D UX) */ 8 | user-select: none; 9 | -khtml-user-select: none; 10 | -moz-user-select: none; 11 | -o-user-select: none; 12 | -webkit-user-select: none; 13 | 14 | /* Force content-box box model for indenter (Bootstrap compatibility) */ 15 | -webkit-box-sizing: content-box; 16 | -moz-box-sizing: content-box; 17 | box-sizing: content-box; 18 | 19 | width: 19px; 20 | } 21 | 22 | table.treetable span.indenter a { 23 | background-position: left center; 24 | background-repeat: no-repeat; 25 | display: inline-block; 26 | text-decoration: none; 27 | width: 19px; 28 | } 29 | -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-client/src/main/java/com/jd/platform/hotkey/client/callback/ReceiveNewKeySubscribe.java: -------------------------------------------------------------------------------- 1 | package com.jd.platform.hotkey.client.callback; 2 | 3 | import com.google.common.eventbus.Subscribe; 4 | import com.jd.platform.hotkey.common.model.HotKeyModel; 5 | 6 | 7 | /** 8 | * 监听有新key推送事件 9 | * @author wuweifeng wrote on 2020-02-21 10 | * @version 1.0 11 | */ 12 | public class ReceiveNewKeySubscribe { 13 | 14 | private ReceiveNewKeyListener receiveNewKeyListener = new DefaultNewKeyListener(); 15 | 16 | @Subscribe 17 | public void newKeyComing(ReceiveNewKeyEvent event) { 18 | HotKeyModel hotKeyModel = event.getModel(); 19 | if (hotKeyModel == null) { 20 | return; 21 | } 22 | //收到新key推送 23 | if (receiveNewKeyListener != null) { 24 | receiveNewKeyListener.newKey(hotKeyModel); 25 | } 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-client/src/main/java/com/jd/platform/hotkey/client/core/eventbus/EventBusCenter.java: -------------------------------------------------------------------------------- 1 | package com.jd.platform.hotkey.client.core.eventbus; 2 | 3 | import com.google.common.eventbus.EventBus; 4 | 5 | /** 6 | * @author wuweifeng wrote on 2020-01-07 7 | * @version 1.0 8 | */ 9 | @SuppressWarnings("UnstableApiUsage") 10 | public class EventBusCenter { 11 | 12 | private static final EventBus eventBus = new EventBus(); 13 | 14 | private EventBusCenter() { 15 | 16 | } 17 | 18 | public static EventBus getInstance() { 19 | return eventBus; 20 | } 21 | 22 | public static void register(Object obj) { 23 | eventBus.register(obj); 24 | } 25 | 26 | public static void unregister(Object obj) { 27 | eventBus.unregister(obj); 28 | } 29 | 30 | public static void post(Object obj) { 31 | eventBus.post(obj); 32 | } 33 | 34 | } -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-worker/src/main/java/com/jd/platform/hotkey/worker/netty/dashboard/DashboardHolder.java: -------------------------------------------------------------------------------- 1 | package com.jd.platform.hotkey.worker.netty.dashboard; 2 | 3 | import com.jd.platform.hotkey.common.model.HotKeyMsg; 4 | import com.jd.platform.hotkey.common.model.MsgBuilder; 5 | import com.jd.platform.hotkey.common.model.typeenum.MessageType; 6 | import io.netty.channel.Channel; 7 | 8 | /** 9 | * @author wuweifeng 10 | * @version 1.0 11 | * @date 2020-08-31 12 | */ 13 | public class DashboardHolder { 14 | /** 15 | * 是否连上了dashboard 16 | */ 17 | public static boolean hasConnected = false; 18 | /** 19 | * channel 20 | */ 21 | public static Channel channel = null; 22 | 23 | public static void flushToDashboard(String message) { 24 | channel.writeAndFlush(MsgBuilder.buildByteBuf(new HotKeyMsg(MessageType.REQUEST_HOT_KEY, message))); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-common/src/main/java/com/jd/platform/hotkey/common/tool/HotKeyPathTool.java: -------------------------------------------------------------------------------- 1 | package com.jd.platform.hotkey.common.tool; 2 | 3 | import com.jd.platform.hotkey.common.configcenter.ConfigConstant; 4 | import com.jd.platform.hotkey.common.model.HotKeyModel; 5 | 6 | /** 7 | * @author wuweifeng wrote on 2020-02-24 8 | * @version 1.0 9 | */ 10 | public class HotKeyPathTool { 11 | /** 12 | * app的热key存放地址,client会监听该地址,当有热key变化时会响应 13 | */ 14 | public static String keyPath(HotKeyModel hotKeyModel) { 15 | return ConfigConstant.hotKeyPath + hotKeyModel.getAppName() + "/" + hotKeyModel.getKey(); 16 | } 17 | 18 | /** 19 | * worker将热key推送到该地址,供dashboard监听入库做记录 20 | */ 21 | public static String keyRecordPath(HotKeyModel hotKeyModel) { 22 | return ConfigConstant.hotKeyRecordPath + hotKeyModel.getAppName() + "/" + hotKeyModel.getKey(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-client/src/main/java/com/jd/platform/hotkey/client/core/key/KeyHandlerFactory.java: -------------------------------------------------------------------------------- 1 | package com.jd.platform.hotkey.client.core.key; 2 | 3 | import com.jd.platform.hotkey.common.model.HotKeyModel; 4 | import com.jd.platform.hotkey.common.model.KeyCountModel; 5 | 6 | /** 7 | * @author wuweifeng wrote on 2020-01-06 8 | * @version 1.0 9 | */ 10 | public class KeyHandlerFactory { 11 | private static final DefaultKeyHandler iKeyHandler = new DefaultKeyHandler(); 12 | 13 | private KeyHandlerFactory() { 14 | } 15 | 16 | public static IKeyPusher getPusher() { 17 | return iKeyHandler.keyPusher(); 18 | } 19 | 20 | public static IKeyCollector getCollector() { 21 | return iKeyHandler.keyCollector(); 22 | } 23 | 24 | public static IKeyCollector getCounter() { 25 | return iKeyHandler.keyCounter(); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/chart/polarChart.js: -------------------------------------------------------------------------------- 1 | var chartData = [ 2 | { 3 | value : Math.random(), 4 | color: "#6ADAE4" 5 | }, 6 | { 7 | value : Math.random(), 8 | color: "#F89406" 9 | }, 10 | { 11 | value : Math.random(), 12 | color: "#FF0064" 13 | }, 14 | { 15 | value : Math.random(), 16 | color: "#3498DB" 17 | }, 18 | { 19 | value : Math.random(), 20 | color: "#1ABC9C" 21 | }, 22 | { 23 | value : Math.random(), 24 | color: "#E74C3C" 25 | } 26 | ]; 27 | var myPolarArea = new Chart(document.getElementById("canvas3").getContext("2d")).PolarArea(chartData); -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-client/src/main/java/com/jd/platform/hotkey/client/log/DefaultLogger.java: -------------------------------------------------------------------------------- 1 | package com.jd.platform.hotkey.client.log; 2 | 3 | import org.slf4j.LoggerFactory; 4 | 5 | /** 6 | * @author wuweifeng 7 | * @version 1.0 8 | * @date 2020-04-21 9 | */ 10 | public class DefaultLogger implements HotKeyLogger { 11 | @Override 12 | public void debug(Class className, String info) { 13 | LoggerFactory.getLogger(className).debug(info); 14 | } 15 | 16 | @Override 17 | public void info(Class className, String info) { 18 | LoggerFactory.getLogger(className).info(info); 19 | } 20 | 21 | @Override 22 | public void error(Class className, String info) { 23 | LoggerFactory.getLogger(className).error(info); 24 | } 25 | 26 | @Override 27 | public void warn(Class className, String info) { 28 | LoggerFactory.getLogger(className).warn(info); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /l2cache-core/src/main/java/com/github/jesse/l2cache/content/NullValue.java: -------------------------------------------------------------------------------- 1 | package com.github.jesse.l2cache.content; 2 | 3 | import java.io.Serializable; 4 | 5 | /** 6 | * 简单的可序列化类,用作{@code null}替换缓存存储,否则不支持{@code null}值 7 | * 8 | * @author chenck 9 | * @date 2020/7/1 17:39 10 | */ 11 | public class NullValue implements Serializable { 12 | 13 | private static final long serialVersionUID = 1L; 14 | 15 | public static final Object INSTANCE = new NullValue(); 16 | 17 | private NullValue() { 18 | } 19 | 20 | private Object readResolve() { 21 | return INSTANCE; 22 | } 23 | 24 | @Override 25 | public boolean equals(Object obj) { 26 | return (this == obj || obj == null); 27 | } 28 | 29 | @Override 30 | public int hashCode() { 31 | return NullValue.class.hashCode(); 32 | } 33 | 34 | @Override 35 | public String toString() { 36 | return "NullValue"; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/progress-bar/number-pb.css: -------------------------------------------------------------------------------- 1 | .number-pb { 2 | background-color: #DDDDDD; 3 | height: 10px; 4 | margin: 10px 0; 5 | position: relative; 6 | } 7 | .number-pb .number-pb-shown { 8 | position: absolute; 9 | background-color: #65C3DF; 10 | /* background-image: linear-gradient(to right, #176785, #499989); */ 11 | top: -1px; 12 | left: 0; 13 | height: 11px; 14 | } 15 | .number-pb .number-pb-num { 16 | position: absolute; 17 | background-color: #fff; 18 | left: 0; 19 | top: -0.45em; 20 | padding: 0 5px; 21 | min-width: 20px; 22 | } 23 | .number-pb-shown.dream { 24 | /* background-image: linear-gradient(to right, #0e153a, #1d2b64, #f8cdda); */ 25 | background: #45B6B0; 26 | } 27 | .number-pb-shown.sun { 28 | /* background-image: linear-gradient(to right, #0f1b58, #e0a681, #e5e9bf); */ 29 | background: #FF6B6B; 30 | } 31 | -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-client/src/main/java/com/jd/platform/hotkey/client/log/JdLogger.java: -------------------------------------------------------------------------------- 1 | package com.jd.platform.hotkey.client.log; 2 | 3 | /** 4 | * @author wuweifeng wrote on 2020-02-24 5 | * @version 1.0 6 | */ 7 | public class JdLogger { 8 | private static HotKeyLogger logger = new DefaultLogger(); 9 | 10 | public static void setLogger(HotKeyLogger log) { 11 | if (log != null) { 12 | logger = log; 13 | } 14 | } 15 | 16 | public static void debug(Class className, String info) { 17 | logger.debug(className, info); 18 | } 19 | 20 | public static void info(Class className, String info) { 21 | logger.info(className, info); 22 | } 23 | 24 | public static void warn(Class className, String info) { 25 | logger.warn(className, info); 26 | } 27 | 28 | public static void error(Class className, String info) { 29 | logger.error(className, info); 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/java/com/jd/platform/hotkey/dashboard/mapper/KeyRecordMapper.java: -------------------------------------------------------------------------------- 1 | package com.jd.platform.hotkey.dashboard.mapper; 2 | 3 | import com.jd.platform.hotkey.dashboard.common.domain.req.SearchReq; 4 | import com.jd.platform.hotkey.dashboard.model.KeyRecord; 5 | import com.jd.platform.hotkey.dashboard.model.Statistics; 6 | import org.apache.ibatis.annotations.Mapper; 7 | 8 | import java.util.Date; 9 | import java.util.List; 10 | 11 | /** 12 | * @author liyunfeng31 13 | */ 14 | @Mapper 15 | public interface KeyRecordMapper { 16 | 17 | int insertSelective(KeyRecord record); 18 | 19 | KeyRecord selectByPrimaryKey(Long id); 20 | 21 | List listKeyRecord(SearchReq req); 22 | 23 | int batchInsert(List list); 24 | 25 | List maxHotKey(SearchReq req); 26 | 27 | List statisticsByRule(SearchReq req); 28 | 29 | int clearExpireData(String app, Date expireDate); 30 | } -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-worker/src/main/java/com/jd/platform/hotkey/worker/tool/SafeExecute.java: -------------------------------------------------------------------------------- 1 | package com.jd.platform.hotkey.worker.tool; 2 | 3 | import java.util.function.Consumer; 4 | 5 | /** 6 | * @author wuweifeng wrote on 2020-03-10 7 | * @version 1.0 8 | */ 9 | public class SafeExecute { 10 | 11 | public static void execute(Consumer consumer, String exMsg) { 12 | try { 13 | consumer.accept(null); 14 | } catch (Exception e) { 15 | System.out.println(exMsg); 16 | } 17 | } 18 | 19 | public static void main(String[] args) { 20 | execute(s -> doSome1(0), "exception"); 21 | } 22 | 23 | public static void doSome(int i) { 24 | try { 25 | int j = 1 / i; 26 | } catch (Exception e) { 27 | System.out.println("exception"); 28 | } 29 | } 30 | 31 | public static void doSome1(int i) { 32 | int j = 1 / i; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /l2cache-core/src/test/resources/redisson.yaml: -------------------------------------------------------------------------------- 1 | # cluster sentinel with high availability 2 | singleServerConfig: 3 | # 节点地址 4 | address: "redis://127.0.0.1:6379" 5 | # 密码 6 | password: 7 | # 连接空闲超时,单位:毫秒,默认10000 8 | idleConnectionTimeout: 10000 9 | # 连接超时,单位:毫秒,默认10000 10 | connectTimeout: 10000 11 | # 命令等待超时,单位:毫秒,默认3000 12 | timeout: 3000 13 | # 命令失败重试次数,默认3 14 | retryAttempts: 3 15 | # 命令重试发送时间间隔,单位:毫秒,默认1500 16 | retryInterval: 1500 17 | # 单个连接最大订阅数量,默认5 18 | subscriptionsPerConnection: 5 19 | # 客户端名称,默认null 20 | clientName: null 21 | # 发布和订阅连接的最小空闲连接数(默认1) 22 | subscriptionConnectionMinimumIdleSize: 1 23 | # 发布和订阅连接池大小(默认50) 24 | subscriptionConnectionPoolSize: 50 25 | # 最小空闲连接数(默认32) 26 | connectionMinimumIdleSize: 10 27 | # 连接池大小(默认64) 28 | connectionPoolSize: 64 29 | # 数据库编号,默认0 30 | database: 0 31 | # 线程池数量 32 | threads: 2 33 | # Netty线程池数量 34 | nettyThreads: 2 35 | # 编码,序列化反序列化 36 | codec: ! {} -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-common/src/main/java/com/jd/platform/hotkey/common/model/typeenum/MessageType.java: -------------------------------------------------------------------------------- 1 | package com.jd.platform.hotkey.common.model.typeenum; 2 | 3 | /** 4 | * @author wuweifeng wrote on 2020-01-06 5 | * @version 1.0 6 | */ 7 | public enum MessageType { 8 | APP_NAME((byte) 1), 9 | REQUEST_NEW_KEY((byte) 2), 10 | RESPONSE_NEW_KEY((byte) 3), 11 | REQUEST_HIT_COUNT((byte) 7), //命中率 12 | REQUEST_HOT_KEY((byte) 8), //热key,worker->dashboard 13 | PING((byte) 4), PONG((byte) 5), 14 | EMPTY((byte) 6); 15 | 16 | private byte type; 17 | 18 | MessageType(byte type) { 19 | this.type = type; 20 | } 21 | 22 | public byte getType() { 23 | return type; 24 | } 25 | 26 | public static MessageType get(byte type) { 27 | for (MessageType value : values()) { 28 | if (value.type == type) { 29 | return value; 30 | } 31 | } 32 | return null; 33 | } 34 | } -------------------------------------------------------------------------------- /l2cache-core/src/test/java/com/github/jesse/l2cache/test/Test1.java: -------------------------------------------------------------------------------- 1 | package com.github.jesse.l2cache.test; 2 | 3 | import org.redisson.api.RLock; 4 | import org.redisson.api.RedissonClient; 5 | 6 | import java.util.concurrent.TimeUnit; 7 | import java.util.concurrent.atomic.AtomicInteger; 8 | 9 | /** 10 | * @author chenck 11 | * @date 2020/12/3 18:47 12 | */ 13 | public class Test1 { 14 | 15 | public static void main(String[] args) { 16 | AtomicInteger waitRefreshNum = new AtomicInteger(); 17 | System.out.println("获取:" + waitRefreshNum.get()); 18 | System.out.println("加1:" + waitRefreshNum.getAndIncrement()); 19 | System.out.println("获取:" + waitRefreshNum.get()); 20 | System.out.println("加1:" + waitRefreshNum.getAndIncrement()); 21 | 22 | System.out.println("获取:" + waitRefreshNum.get()); 23 | System.out.println(waitRefreshNum.getAndSet(0)); 24 | System.out.println("获取:" + waitRefreshNum.get()); 25 | 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-client/src/main/java/com/jd/platform/hotkey/client/cache/CacheFactory.java: -------------------------------------------------------------------------------- 1 | package com.jd.platform.hotkey.client.cache; 2 | 3 | import com.jd.platform.hotkey.client.core.rule.KeyRuleHolder; 4 | 5 | /** 6 | * 用户可以自定义cache 7 | * @author wuweifeng wrote on 2020-02-24 8 | * @version 1.0 9 | */ 10 | public class CacheFactory { 11 | private static final LocalCache DEFAULT_CACHE = new DefaultCaffeineCache(); 12 | 13 | /** 14 | * 创建一个本地缓存实例 15 | */ 16 | public static LocalCache build(int duration) { 17 | return new CaffeineCache(duration); 18 | } 19 | 20 | public static LocalCache getNonNullCache(String key) { 21 | LocalCache localCache = getCache(key); 22 | if (localCache == null) { 23 | return DEFAULT_CACHE; 24 | } 25 | return localCache; 26 | } 27 | 28 | public static LocalCache getCache(String key) { 29 | return KeyRuleHolder.findByKey(key); 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /l2cache-core/src/main/java/com/github/jesse/l2cache/util/pool/CallableMdcWrapper.java: -------------------------------------------------------------------------------- 1 | package com.github.jesse.l2cache.util.pool; 2 | 3 | import org.slf4j.MDC; 4 | 5 | import java.util.Map; 6 | import java.util.concurrent.Callable; 7 | 8 | /** 9 | * @author chenck 10 | * @date 2021/5/11 17:09 11 | */ 12 | public class CallableMdcWrapper implements Callable { 13 | 14 | private static final long serialVersionUID = 1L; 15 | 16 | Callable callable; 17 | Map contextMap; 18 | 19 | public CallableMdcWrapper(Callable callable) { 20 | this.callable = callable; 21 | this.contextMap = MDC.getCopyOfContextMap(); 22 | } 23 | 24 | @Override 25 | public T call() throws Exception { 26 | Map oldContext = MdcUtil.beforeExecution(contextMap); 27 | try { 28 | return callable.call(); 29 | } finally { 30 | MdcUtil.afterExecution(oldContext); 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /l2cache-spring-boot-starter/src/main/java/com/github/jesse/l2cache/spring/EnableL2Cache.java: -------------------------------------------------------------------------------- 1 | package com.github.jesse.l2cache.spring; 2 | 3 | import com.github.jesse.l2cache.spring.config.HotKeyConfiguration; 4 | import com.github.jesse.l2cache.spring.config.L2CacheConfiguration; 5 | import org.springframework.context.annotation.Configuration; 6 | import org.springframework.context.annotation.Import; 7 | 8 | import java.lang.annotation.Documented; 9 | import java.lang.annotation.ElementType; 10 | import java.lang.annotation.Retention; 11 | import java.lang.annotation.RetentionPolicy; 12 | import java.lang.annotation.Target; 13 | 14 | /** 15 | * 开启 L2Cache 组件 16 | *

17 | * 注:Spring Enable 注解模式 18 | * 19 | * @author chenck 20 | * @date 2020/5/26 17:10 21 | */ 22 | @Retention(RetentionPolicy.RUNTIME) 23 | @Target({ElementType.TYPE}) 24 | @Documented 25 | @Import({L2CacheConfiguration.class, HotKeyConfiguration.class}) 26 | @Configuration 27 | public @interface EnableL2Cache { 28 | 29 | } 30 | -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-worker/src/main/java/com/jd/platform/hotkey/worker/model/TotalCount.java: -------------------------------------------------------------------------------- 1 | package com.jd.platform.hotkey.worker.model; 2 | 3 | /** 4 | * @author wuweifeng 5 | * @version 1.0 6 | * @date 2020-05-20 7 | */ 8 | public class TotalCount { 9 | private long totalReceiveCount; 10 | private long totalDealCount; 11 | 12 | public TotalCount(long totalReceiveCount, long totalDealCount) { 13 | this.totalReceiveCount = totalReceiveCount; 14 | this.totalDealCount = totalDealCount; 15 | } 16 | 17 | public long getTotalReceiveCount() { 18 | return totalReceiveCount; 19 | } 20 | 21 | public void setTotalReceiveCount(long totalReceiveCount) { 22 | this.totalReceiveCount = totalReceiveCount; 23 | } 24 | 25 | public long getTotalDealCount() { 26 | return totalDealCount; 27 | } 28 | 29 | public void setTotalDealCount(long totalDealCount) { 30 | this.totalDealCount = totalDealCount; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/java/com/jd/platform/hotkey/dashboard/cache/CaffeineBuilder.java: -------------------------------------------------------------------------------- 1 | package com.jd.platform.hotkey.dashboard.cache; 2 | 3 | import com.github.benmanes.caffeine.cache.Cache; 4 | import com.github.benmanes.caffeine.cache.Caffeine; 5 | 6 | import java.util.concurrent.TimeUnit; 7 | 8 | /** 9 | * @author wuweifeng wrote on 2019-12-12 10 | * @version 1.0 11 | */ 12 | public class CaffeineBuilder { 13 | 14 | public static Cache cache(int duration) { 15 | return cache(128, 1000000, duration); 16 | } 17 | 18 | 19 | /** 20 | * 构建所有来的要缓存的key getCache 21 | */ 22 | public static Cache cache(int minSize, int maxSize, int expireSeconds) { 23 | return Caffeine.newBuilder() 24 | .initialCapacity(minSize)//初始大小 25 | .maximumSize(maxSize)//最大数量 26 | .expireAfterWrite(expireSeconds, TimeUnit.SECONDS)//过期时间 27 | .build(); 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /README.en.md: -------------------------------------------------------------------------------- 1 | # l2cache 2 | 3 | #### Description 4 | 基于 `Caffeine`、 `Redis` 、 `Spring Cache` 实现的二级缓存。 5 | 6 | #### Software Architecture 7 | Software architecture description 8 | 9 | #### Installation 10 | 11 | 1. xxxx 12 | 2. xxxx 13 | 3. xxxx 14 | 15 | #### Instructions 16 | 17 | 1. xxxx 18 | 2. xxxx 19 | 3. xxxx 20 | 21 | #### Contribution 22 | 23 | 1. Fork the repository 24 | 2. Create Feat_xxx branch 25 | 3. Commit your code 26 | 4. Create Pull Request 27 | 28 | 29 | #### Gitee Feature 30 | 31 | 1. You can use Readme\_XXX.md to support different languages, such as Readme\_en.md, Readme\_zh.md 32 | 2. Gitee blog [blog.gitee.com](https://blog.gitee.com) 33 | 3. Explore open source project [https://gitee.com/explore](https://gitee.com/explore) 34 | 4. The most valuable open source project [GVP](https://gitee.com/gvp) 35 | 5. The manual of Gitee [https://gitee.com/help](https://gitee.com/help) 36 | 6. The most popular members [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) 37 | -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-client/src/main/java/com/jd/platform/hotkey/client/core/key/DefaultKeyHandler.java: -------------------------------------------------------------------------------- 1 | package com.jd.platform.hotkey.client.core.key; 2 | 3 | import com.jd.platform.hotkey.common.model.HotKeyModel; 4 | import com.jd.platform.hotkey.common.model.KeyCountModel; 5 | 6 | /** 7 | * @author wuweifeng wrote on 2020-02-25 8 | * @version 1.0 9 | */ 10 | public class DefaultKeyHandler { 11 | private IKeyPusher iKeyPusher = new NettyKeyPusher(); 12 | 13 | private IKeyCollector iKeyCollector = new TurnKeyCollector(); 14 | 15 | private IKeyCollector iKeyCounter = new TurnCountCollector(); 16 | 17 | 18 | public IKeyPusher keyPusher() { 19 | return iKeyPusher; 20 | } 21 | 22 | public IKeyCollector keyCollector() { 23 | return iKeyCollector; 24 | } 25 | 26 | public IKeyCollector keyCounter() { 27 | return iKeyCounter; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-worker/src/main/java/com/jd/platform/hotkey/worker/starters/InitStarter.java: -------------------------------------------------------------------------------- 1 | package com.jd.platform.hotkey.worker.starters; 2 | 3 | import com.jd.platform.hotkey.worker.tool.InitConstant; 4 | import org.springframework.beans.factory.annotation.Value; 5 | import org.springframework.context.annotation.Bean; 6 | import org.springframework.stereotype.Component; 7 | 8 | /** 9 | * @author wuweifeng 10 | * @version 1.0 11 | * @date 2020-05-22 12 | */ 13 | @Component 14 | public class InitStarter { 15 | @Value("${netty.timeOut}") 16 | private int timeOut; 17 | @Value("${disruptor.bufferSize}") 18 | private int bufferSize; 19 | @Value("${caffeine.minutes}") 20 | private int caffeineMinutes; 21 | 22 | @Bean("initParam") 23 | public Object init() { 24 | InitConstant.timeOut = timeOut; 25 | InitConstant.bufferSize = bufferSize; 26 | InitConstant.caffeineMaxMinutes = caffeineMinutes; 27 | 28 | return null; 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /l2cache-example/src/main/java/com/github/jesse/l2cache/example/config/RedissonConfig.java: -------------------------------------------------------------------------------- 1 | package com.github.jesse.l2cache.example.config; 2 | 3 | import lombok.extern.slf4j.Slf4j; 4 | import org.redisson.Redisson; 5 | import org.redisson.api.RedissonClient; 6 | import org.springframework.cloud.context.config.annotation.RefreshScope; 7 | import org.springframework.context.annotation.Bean; 8 | import org.springframework.context.annotation.Configuration; 9 | 10 | /** 11 | * Redisson 配置 12 | * 13 | * @author chenck 14 | * @date 2020/9/2 14:32 15 | */ 16 | @RefreshScope 17 | @Slf4j 18 | @Configuration 19 | public class RedissonConfig { 20 | 21 | 22 | // @Bean 23 | // public RedissonClient redissonClient2() { 24 | // RedissonClient redissonClient = Redisson.create(); 25 | // return redissonClient; 26 | // } 27 | // @Bean 28 | // public RedissonClient redissonClient() { 29 | // RedissonClient redissonClient = Redisson.create(); 30 | // return redissonClient; 31 | // } 32 | } 33 | -------------------------------------------------------------------------------- /l2cache-example/src/test/java/com/github/jesse/l2cache/example/ConcurrentReferenceHashMapTest.java: -------------------------------------------------------------------------------- 1 | package com.github.jesse.l2cache.example; 2 | 3 | import org.springframework.util.ConcurrentReferenceHashMap; 4 | 5 | import java.util.Map; 6 | 7 | /** 8 | * @author chenck 9 | * @date 2020/10/5 19:30 10 | */ 11 | public class ConcurrentReferenceHashMapTest { 12 | 13 | /** 14 | * -Xmx5M -Xms5M -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps 15 | * 结论:频繁的GC 16 | */ 17 | public static void main(String[] args) { 18 | Map valueLoaderCache = new ConcurrentReferenceHashMap<>(); 19 | for (int i = 0; i < 10000000; i++) { 20 | if (i % 10000 == 0) { 21 | System.out.println(valueLoaderCache.size()); 22 | } 23 | valueLoaderCache.put("key" + i, "valuevvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv" + i); 24 | } 25 | System.out.println(valueLoaderCache.size()); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-common/src/main/java/com/jd/platform/hotkey/common/tool/Constant.java: -------------------------------------------------------------------------------- 1 | package com.jd.platform.hotkey.common.tool; 2 | 3 | /** 4 | * @author wuweifeng wrote on 2019-12-05 5 | * @version 1.0 6 | */ 7 | public class Constant { 8 | public static String PING = "ping"; 9 | public static String PONG = "pong"; 10 | 11 | /** 12 | * 该值在ProducerFactory有修改 13 | */ 14 | public static int Default_Threads = 4; 15 | 16 | public static int MAGIC_NUMBER = 0x12fcf76; 17 | /** 18 | * netty的分隔符 19 | */ 20 | public static String DELIMITER = "$(* *)$"; 21 | /** 22 | * 数量统计时,rule+时间 组成key用的分隔符 23 | */ 24 | public static String COUNT_DELIMITER = "#**#"; 25 | 26 | public static String BAK_DELIMITER = "#\\*\\*#"; 27 | 28 | /** 29 | * 当客户端要删除某个key时,就往etcd里赋值这个value,设置1秒过期,就算删除了 30 | */ 31 | public static String DEFAULT_DELETE_VALUE = "#[DELETE]#"; 32 | 33 | //单次包最大2M 34 | public static int MAX_LENGTH = 2 * 1024 * 1024; 35 | 36 | } 37 | -------------------------------------------------------------------------------- /l2cache-core/src/main/java/com/github/jesse/l2cache/util/BiConsumerWrapper.java: -------------------------------------------------------------------------------- 1 | package com.github.jesse.l2cache.util; 2 | 3 | import com.github.jesse.l2cache.util.pool.MdcUtil; 4 | import org.slf4j.MDC; 5 | 6 | import java.util.Map; 7 | import java.util.function.BiConsumer; 8 | 9 | /** 10 | * @author chenck 11 | * @date 2023/5/9 14:38 12 | */ 13 | public class BiConsumerWrapper implements BiConsumer { 14 | 15 | BiConsumer action; 16 | Map contextMap; 17 | 18 | public BiConsumerWrapper(BiConsumer action) { 19 | this.action = action; 20 | this.contextMap = MDC.getCopyOfContextMap(); 21 | } 22 | 23 | @Override 24 | public void accept(Object object, Throwable throwable) { 25 | Map oldContext = MdcUtil.beforeExecution(contextMap); 26 | try { 27 | action.accept(object, throwable); 28 | } finally { 29 | MdcUtil.afterExecution(oldContext); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-worker/src/main/java/com/jd/platform/hotkey/worker/config/EtcdConfig.java: -------------------------------------------------------------------------------- 1 | package com.jd.platform.hotkey.worker.config; 2 | 3 | import com.jd.platform.hotkey.common.configcenter.IConfigCenter; 4 | import com.jd.platform.hotkey.common.configcenter.etcd.JdEtcdBuilder; 5 | import org.slf4j.Logger; 6 | import org.slf4j.LoggerFactory; 7 | import org.springframework.beans.factory.annotation.Value; 8 | import org.springframework.context.annotation.Bean; 9 | import org.springframework.context.annotation.Configuration; 10 | 11 | 12 | /** 13 | * @author wuweifeng wrote on 2019-12-06 14 | * @version 1.0 15 | */ 16 | @Configuration 17 | public class EtcdConfig { 18 | @Value("${etcd.server}") 19 | private String etcdServer; 20 | 21 | private Logger logger = LoggerFactory.getLogger(getClass()); 22 | 23 | @Bean 24 | public IConfigCenter client() { 25 | logger.info("etcd address : " + etcdServer); 26 | //连接多个时,逗号分隔 27 | return JdEtcdBuilder.build(etcdServer); 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/java/com/jd/platform/hotkey/dashboard/service/WorkerService.java: -------------------------------------------------------------------------------- 1 | package com.jd.platform.hotkey.dashboard.service; 2 | 3 | import com.github.pagehelper.PageInfo; 4 | import com.jd.platform.hotkey.dashboard.common.domain.req.PageReq; 5 | import com.jd.platform.hotkey.dashboard.common.domain.req.SearchReq; 6 | import com.jd.platform.hotkey.dashboard.model.Worker; 7 | 8 | /** 9 | * @ProjectName: hotkey 10 | * @ClassName: WorkerService 11 | * @Description: TODO(一句话描述该类的功能) 12 | * @Author: liyunfeng31 13 | * @Date: 2020/4/17 16:28 14 | */ 15 | public interface WorkerService { 16 | PageInfo pageWorker(PageReq page, SearchReq param); 17 | 18 | int insertWorkerByUser(Worker worker); 19 | 20 | int insertWorkerBySys(Worker worker); 21 | 22 | Worker selectByPrimaryKey(int id); 23 | 24 | int updateWorkerByUser(Worker worker); 25 | 26 | int delWorkerByUser(Worker worker); 27 | 28 | int updateWorker(Worker worker); 29 | 30 | Worker selectByKey(String key); 31 | } 32 | -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-worker/src/main/java/com/jd/platform/hotkey/worker/counter/CounterConfig.java: -------------------------------------------------------------------------------- 1 | package com.jd.platform.hotkey.worker.counter; 2 | 3 | import com.jd.platform.hotkey.common.configcenter.IConfigCenter; 4 | import org.springframework.context.annotation.Bean; 5 | import org.springframework.context.annotation.Configuration; 6 | 7 | import javax.annotation.Resource; 8 | import java.util.concurrent.LinkedBlockingQueue; 9 | 10 | /** 11 | * @author wuweifeng 12 | * @version 1.0 13 | * @date 2020-06-28 14 | */ 15 | @Configuration 16 | public class CounterConfig { 17 | /** 18 | * 队列 19 | */ 20 | public static LinkedBlockingQueue COUNTER_QUEUE = new LinkedBlockingQueue<>(); 21 | 22 | @Resource 23 | private IConfigCenter configCenter; 24 | 25 | @Bean 26 | public CounterConsumer counterConsumer() { 27 | CounterConsumer counterConsumer = new CounterConsumer(); 28 | counterConsumer.beginConsume(configCenter); 29 | return counterConsumer; 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/chart/lineChart.js: -------------------------------------------------------------------------------- 1 | var lineChartData = { 2 | labels : ["January","February","March","April","May","June","July"], 3 | datasets : [ 4 | { 5 | fillColor : "rgba(49, 195, 166, 0.2)", 6 | strokeColor : "rgba(49, 195, 166, 1)", 7 | pointColor : "rgba(49, 195, 166, 1)", 8 | pointStrokeColor : "#fff", 9 | data : [65,59,90,81,56,55,40] 10 | }, 11 | { 12 | fillColor : "rgba(151,187,205,0.5)", 13 | strokeColor : "rgba(151,187,205,1)", 14 | pointColor : "rgba(151,187,205,1)", 15 | pointStrokeColor : "#fff", 16 | data : [28,48,40,19,96,27,100] 17 | } 18 | ] 19 | 20 | } 21 | 22 | var myLine = new Chart(document.getElementById("canvas4").getContext("2d")).Line(lineChartData); -------------------------------------------------------------------------------- /l2cache-example/src/main/resources/redisson.yaml: -------------------------------------------------------------------------------- 1 | # cluster sentinel with high availability 2 | singleServerConfig: 3 | # 节点地址 4 | address: "redis://127.0.0.1:6379" 5 | # 密码 6 | password: 7 | # 连接空闲超时,单位:毫秒,默认10000 8 | idleConnectionTimeout: 10000 9 | # 连接超时,单位:毫秒,默认10000 10 | connectTimeout: 1000 11 | # 命令等待超时,单位:毫秒,默认3000 12 | timeout: 1000 13 | # 命令失败重试次数,默认3 14 | retryAttempts: 3 15 | # 命令重试发送时间间隔,单位:毫秒,默认1500 16 | retryInterval: 1500 17 | # 单个连接最大订阅数量,默认5 18 | subscriptionsPerConnection: 5 19 | # 定义每个连接到Redis的PING命令发送间隔,默认0 20 | pingConnectionInterval: 5000 21 | # 客户端名称,默认null 22 | clientName: null 23 | # 发布和订阅连接的最小空闲连接数(默认1) 24 | subscriptionConnectionMinimumIdleSize: 1 25 | # 发布和订阅连接池大小(默认50) 26 | subscriptionConnectionPoolSize: 50 27 | # 最小空闲连接数(默认32) 28 | connectionMinimumIdleSize: 10 29 | # 连接池大小(默认64) 30 | connectionPoolSize: 64 31 | # 数据库编号,默认0 32 | database: 0 33 | # 线程池数量 34 | threads: 2 35 | # Netty线程池数量 36 | nettyThreads: 2 37 | # 编码,序列化反序列化 38 | codec: ! {} -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-worker/src/main/java/com/jd/platform/hotkey/worker/netty/pusher/DashboardPusher.java: -------------------------------------------------------------------------------- 1 | package com.jd.platform.hotkey.worker.netty.pusher; 2 | 3 | import com.jd.platform.hotkey.common.model.HotKeyModel; 4 | import com.jd.platform.hotkey.common.tool.FastJsonUtils; 5 | import com.jd.platform.hotkey.worker.netty.pusher.store.HotkeyTempStore; 6 | import org.slf4j.Logger; 7 | import org.slf4j.LoggerFactory; 8 | import org.springframework.stereotype.Component; 9 | 10 | /** 11 | * 将热key推送到dashboard供入库 12 | * @author wuweifeng 13 | * @version 1.0 14 | * @date 2020-08-31 15 | */ 16 | @Component 17 | public class DashboardPusher implements IPusher { 18 | private Logger logger = LoggerFactory.getLogger(getClass()); 19 | 20 | @Override 21 | public void push(HotKeyModel model) { 22 | logger.info("start DashboardPusher model={}", FastJsonUtils.convertObjectToJSON(model)); 23 | HotkeyTempStore.push(model); 24 | } 25 | 26 | @Override 27 | public void remove(HotKeyModel model) { 28 | 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/java/com/jd/platform/hotkey/dashboard/common/config/EtcdConfig.java: -------------------------------------------------------------------------------- 1 | package com.jd.platform.hotkey.dashboard.common.config; 2 | 3 | import com.jd.platform.hotkey.common.configcenter.IConfigCenter; 4 | import com.jd.platform.hotkey.common.configcenter.etcd.JdEtcdBuilder; 5 | import org.slf4j.Logger; 6 | import org.slf4j.LoggerFactory; 7 | import org.springframework.beans.factory.annotation.Value; 8 | import org.springframework.context.annotation.Bean; 9 | import org.springframework.context.annotation.Configuration; 10 | 11 | 12 | /** 13 | * @author wuweifeng wrote on 2019-12-06 14 | * @version 1.0 15 | */ 16 | @Configuration 17 | public class EtcdConfig { 18 | @Value("${etcd.server}") 19 | private String etcdServer; 20 | 21 | private Logger logger = LoggerFactory.getLogger(getClass()); 22 | 23 | @Bean 24 | public IConfigCenter client() { 25 | logger.info("etcd address : " + etcdServer); 26 | //连接多个时,逗号分隔 27 | return JdEtcdBuilder.build(etcdServer); 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/common/js/user-add.js: -------------------------------------------------------------------------------- 1 | $("#form-add").validate({ 2 | rules:{ 3 | pwd:{ 4 | required:true, 5 | minlength: 5, 6 | maxlength: 20 7 | }, 8 | }, 9 | messages: { 10 | "userName": { 11 | remote: "用户已经存在" 12 | } 13 | }, 14 | submitHandler:function(form){ 15 | add(); 16 | } 17 | }); 18 | 19 | /** 20 | * 21 | */ 22 | function add() { 23 | var dataFormJson=$("#form-add").serialize(); 24 | $.ajax({ 25 | cache : true, 26 | type : "POST", 27 | url : "/user/add", 28 | data : dataFormJson, 29 | headers: { 30 | "Authorization":getCookie("token") 31 | }, 32 | async : false, 33 | error : function(XMLHttpRequest){ 34 | $.modal.alertError(XMLHttpRequest.responseJSON.msg); 35 | var token = getCookie("token"); 36 | if(XMLHttpRequest.status == 1000 && ( token == "undefined" || token =="")){ 37 | top.location.href = '/user/login'; 38 | } 39 | }, 40 | success : function(data) { 41 | $.operate.saveSuccess(data); 42 | } 43 | }); 44 | } 45 | 46 | -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/toggle_close.js: -------------------------------------------------------------------------------- 1 | 2 | //TOGLE SHOW HIDE 3 | $('.nav-toggle-alt').click(function() { 4 | //get collapse content selector 5 | var collapse_content_selector = $(this).attr('href'); 6 | 7 | //make the collapse content to be shown or hide 8 | var toggle_switch = $(this); 9 | $(collapse_content_selector).slideToggle(function() { 10 | if ($(this).css('display') == 'block') { 11 | //change the button label to be 'Show' 12 | toggle_switch.html(''); 13 | } else { 14 | //change the button label to be 'Hide' 15 | toggle_switch.html(''); 16 | } 17 | }); 18 | return false; 19 | }); 20 | //CLOSE ELEMENT 21 | $(".gone").click(function() { 22 | var collapse_content_close = $(this).attr('href'); 23 | $(collapse_content_close).hide(); 24 | 25 | 26 | 27 | }); 28 | -------------------------------------------------------------------------------- /l2cache-example/src/main/java/com/github/jesse/l2cache/example/config/TraceIdConfig.java: -------------------------------------------------------------------------------- 1 | package com.github.jesse.l2cache.example.config; 2 | 3 | import com.github.jesse.l2cache.example.filter.ServletTraceInfoAttachmentFilter; 4 | import org.springframework.boot.web.servlet.FilterRegistrationBean; 5 | import org.springframework.context.annotation.Bean; 6 | import org.springframework.context.annotation.Configuration; 7 | 8 | /** 9 | * @author chenck 10 | * @date 2023/5/5 15:38 11 | */ 12 | @Configuration 13 | public class TraceIdConfig { 14 | /** 15 | * 配置http请求日志跟踪信息拦截器,header中无trace_id则生成 16 | */ 17 | @Bean 18 | public FilterRegistrationBean logFilterRegister() { 19 | FilterRegistrationBean registration = new FilterRegistrationBean(); 20 | registration.setFilter(new ServletTraceInfoAttachmentFilter()); 21 | registration.setName(ServletTraceInfoAttachmentFilter.class.getSimpleName()); 22 | registration.addUrlPatterns("/*"); 23 | // 从小到大的顺序来依次过滤 24 | registration.setOrder(1); 25 | return registration; 26 | } 27 | } -------------------------------------------------------------------------------- /l2cache-core/src/main/java/com/github/jesse/l2cache/util/NullValueUtil.java: -------------------------------------------------------------------------------- 1 | package com.github.jesse.l2cache.util; 2 | 3 | import com.github.jesse.l2cache.content.NullValue; 4 | 5 | /** 6 | * NullValue 工具类 7 | * 8 | * @author chenck 9 | * @date 2020/9/21 14:37 10 | */ 11 | public class NullValueUtil { 12 | 13 | /** 14 | * 转换为存储值 15 | */ 16 | public static Object toStoreValue(Object userValue, boolean allowNullValues, String cacheName) { 17 | if (userValue == null) { 18 | if (allowNullValues) { 19 | return NullValue.INSTANCE; 20 | } 21 | throw new IllegalArgumentException("Cache '" + cacheName + "' is configured to not allow null values but null was provided"); 22 | } 23 | return userValue; 24 | } 25 | 26 | /** 27 | * 从存储值解析为具体值 28 | */ 29 | public static Object fromStoreValue(Object storeValue, boolean allowNullValues) { 30 | if (allowNullValues && storeValue instanceof NullValue) { 31 | return null; 32 | } 33 | return storeValue; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /l2cache-core/src/test/java/com/github/jesse/l2cache/test/Test2.java: -------------------------------------------------------------------------------- 1 | package com.github.jesse.l2cache.test; 2 | 3 | import com.github.jesse.l2cache.util.pool.RunnableMdcWarpper; 4 | import com.github.jesse.l2cache.util.pool.ThreadPoolSupport; 5 | 6 | import java.util.concurrent.ThreadPoolExecutor; 7 | 8 | /** 9 | * @author chenck 10 | * @date 2020/12/3 23:45 11 | */ 12 | public class Test2 { 13 | 14 | private static final ThreadPoolExecutor poolExecutor = ThreadPoolSupport.getPool("publish_redis_msg"); 15 | 16 | public static void main(String[] args) { 17 | 18 | for (int i = 0; i < 10; i++) { 19 | int finalI = i; 20 | poolExecutor.execute(new RunnableMdcWarpper(() -> { 21 | System.out.println("publish message " + finalI); 22 | try { 23 | Thread.sleep(2000); 24 | } catch (InterruptedException e) { 25 | e.printStackTrace(); 26 | } 27 | }, "publish message " + finalI)); 28 | } 29 | while (true) { 30 | 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/java/com/jd/platform/hotkey/dashboard/DashboardApplication.java: -------------------------------------------------------------------------------- 1 | package com.jd.platform.hotkey.dashboard; 2 | 3 | 4 | import org.slf4j.Logger; 5 | import org.slf4j.LoggerFactory; 6 | import org.springframework.boot.CommandLineRunner; 7 | import org.springframework.boot.SpringApplication; 8 | import org.springframework.boot.autoconfigure.SpringBootApplication; 9 | import org.springframework.scheduling.annotation.EnableAsync; 10 | import org.springframework.scheduling.annotation.EnableScheduling; 11 | 12 | 13 | @EnableAsync 14 | @EnableScheduling 15 | @SpringBootApplication 16 | public class DashboardApplication implements CommandLineRunner { 17 | 18 | private Logger logger = LoggerFactory.getLogger(getClass()); 19 | 20 | 21 | public static void main(String[] args) { 22 | try { 23 | SpringApplication.run(DashboardApplication.class, args); 24 | }catch (Exception e){ 25 | e.printStackTrace(); 26 | } 27 | } 28 | 29 | 30 | @Override 31 | public void run(String... args) { 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /l2cache-core/src/test/java/com/github/jesse/l2cache/test/ThreadPoolSupportTest.java: -------------------------------------------------------------------------------- 1 | package com.github.jesse.l2cache.test; 2 | 3 | import com.github.jesse.l2cache.util.pool.ThreadPoolSupport; 4 | import org.junit.Test; 5 | 6 | import java.util.concurrent.ThreadPoolExecutor; 7 | 8 | /** 9 | * @author chenck 10 | * @date 2023/5/6 11:06 11 | */ 12 | public class ThreadPoolSupportTest { 13 | 14 | /** 15 | * 线程池队列溢出的验证 16 | */ 17 | @Test 18 | public void test() { 19 | ThreadPoolExecutor pool = ThreadPoolSupport.getPool("testPool", 2, 2, 30, 10 20 | , new ThreadPoolSupport.MyAbortPolicy("testPool")); 21 | 22 | for (int i = 0; i < 100; i++) { 23 | int finalI = i; 24 | pool.execute(() -> { 25 | System.out.println("run" + finalI); 26 | try { 27 | Thread.sleep(500); 28 | } catch (InterruptedException e) { 29 | throw new RuntimeException(e); 30 | } 31 | }); 32 | } 33 | 34 | while (true) { 35 | 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /l2cache-example/src/main/java/com/github/jesse/l2cache/example/controller/ReidsCacheTestController.java: -------------------------------------------------------------------------------- 1 | package com.github.jesse.l2cache.example.controller; 2 | 3 | import com.github.jesse.l2cache.spring.cache.L2CacheCacheManager; 4 | import lombok.extern.slf4j.Slf4j; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.cache.Cache; 7 | import org.springframework.web.bind.annotation.RequestMapping; 8 | import org.springframework.web.bind.annotation.RestController; 9 | 10 | /** 11 | * 12 | */ 13 | @Slf4j 14 | @RestController 15 | public class ReidsCacheTestController { 16 | 17 | @Autowired 18 | L2CacheCacheManager cacheManager; 19 | 20 | @RequestMapping(value = "/redis/put") 21 | public void put(String cacheName, String key, String value) { 22 | Cache cache = cacheManager.getCache(cacheName); 23 | cache.put(key, value); 24 | } 25 | 26 | @RequestMapping(value = "/redis/get") 27 | public void get(String cacheName, String key) { 28 | Cache cache = cacheManager.getCache(cacheName); 29 | cache.get(key); 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /l2cache-core/src/main/java/com/github/jesse/l2cache/util/Tuple2.java: -------------------------------------------------------------------------------- 1 | package com.github.jesse.l2cache.util; 2 | 3 | /** 4 | * 二元组类型 5 | * 6 | * @author chenck 7 | * @date 2020/4/22 11:35 8 | */ 9 | public class Tuple2 { 10 | private T1 t1; 11 | private T2 t2; 12 | 13 | public Tuple2(T1 t1, T2 t2) { 14 | this.t1 = t1; 15 | this.t2 = t2; 16 | } 17 | 18 | public T1 getT1() { 19 | return t1; 20 | } 21 | 22 | public void setT1(T1 t1) { 23 | this.t1 = t1; 24 | } 25 | 26 | public T2 getT2() { 27 | return t2; 28 | } 29 | 30 | public void setT2(T2 t2) { 31 | this.t2 = t2; 32 | } 33 | 34 | /** 35 | * 快捷入口 36 | */ 37 | public static Tuple2 of(C1 c1, C2 c2) { 38 | return new Tuple2(c1, c2); 39 | } 40 | 41 | /** 42 | * 交换 43 | */ 44 | public Tuple2 swap() { 45 | return new Tuple2(this.t2, this.t1); 46 | } 47 | 48 | @Override 49 | public String toString() { 50 | return "Tuple2{r1=" + this.t1 + ", r2=" + this.t2 + '}'; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/common/js/user-editPwd.js: -------------------------------------------------------------------------------- 1 | $("#form-edit").validate({ 2 | rules:{ 3 | password:{ 4 | required:true, 5 | minlength: 5, 6 | maxlength: 20 7 | }, 8 | confirm:{ 9 | required:true, 10 | minlength: 5, 11 | maxlength: 20, 12 | equalTo:"#pwd" 13 | } 14 | 15 | }, 16 | messages: { 17 | password: { 18 | required: "请输入新密码", 19 | minlength: "密码不能小于6个字符", 20 | maxlength: "密码不能大于20个字符" 21 | }, 22 | confirm: { 23 | required: "请再次输入新密码", 24 | equalTo: "两次密码输入不一致" 25 | } 26 | }, 27 | submitHandler:function(form){ 28 | edit(); 29 | } 30 | }); 31 | 32 | 33 | function edit() { 34 | var dataFormJson=$("#form-edit").serialize(); 35 | $.ajax({ 36 | cache : true, 37 | type : "POST", 38 | url : "/user/editPwd", 39 | data : dataFormJson, 40 | async : false, 41 | headers: { 42 | "Authorization":getCookie("token") 43 | }, 44 | error : function(XMLHttpRequest){ 45 | $.modal.alertError(XMLHttpRequest.responseJSON.msg); 46 | }, 47 | success : function(data) { 48 | $.operate.saveSuccess(data); 49 | } 50 | }); 51 | } 52 | -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/java/com/jd/platform/hotkey/dashboard/common/domain/vo/ClearCfgVo.java: -------------------------------------------------------------------------------- 1 | package com.jd.platform.hotkey.dashboard.common.domain.vo; 2 | 3 | /** 4 | * @ProjectName: hotkey 5 | * @ClassName: ClearCfgVo 6 | * @Description: TODO(一句话描述该类的功能) 7 | * @Author: liyunfeng31 8 | * @Date: 2020/8/3 9:54 9 | */ 10 | public class ClearCfgVo { 11 | 12 | private String app; 13 | 14 | private String ttl; 15 | 16 | private Long version; 17 | 18 | public ClearCfgVo(String app, String ttl, Long version) { 19 | this.app = app; 20 | this.ttl = ttl; 21 | this.version = version; 22 | } 23 | 24 | public String getApp() { 25 | return app; 26 | } 27 | 28 | public void setApp(String app) { 29 | this.app = app; 30 | } 31 | 32 | public String getTtl() { 33 | return ttl; 34 | } 35 | 36 | public void setTtl(String ttl) { 37 | this.ttl = ttl; 38 | } 39 | 40 | public Long getVersion() { 41 | return version; 42 | } 43 | 44 | public void setVersion(Long version) { 45 | this.version = version; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/common/css/common-add.css: -------------------------------------------------------------------------------- 1 | @CHARSET "UTF-8"; 2 | .content-wrap { 3 | padding: 0px; 4 | } 5 | body { 6 | font-family: "Open Sans", Arial, sans-serif!important; 7 | font-size: 13px!important; 8 | line-height: 20px; 9 | overflow-x: hidden!important; 10 | min-height: 100%; 11 | z-index: -2; 12 | margin: 0px !important; 13 | background-image:none!important; 14 | -moz-background-size: cover; 15 | -webkit-background-size: cover; 16 | -o-background-size: cover; 17 | background-size: cover; 18 | } 19 | label.error { 20 | position: absolute; 21 | right: 18px; 22 | top: 5px; 23 | color: #ef392b; 24 | font-size: 12px; 25 | } 26 | .icheckbox-blue > label{ 27 | display: inline-block; 28 | box-sizing: border-box; 29 | cursor: pointer; 30 | position: relative; 31 | /* padding-left: 25px; */ 32 | padding-right: 15px; 33 | padding-top: 5px; 34 | } 35 | .sqcheckbox{ 36 | width: 16px; 37 | height: 16px; 38 | background-color: red; 39 | display: inline-block; 40 | position: relative; 41 | top: 3px; 42 | } -------------------------------------------------------------------------------- /l2cache-jd-hotkey/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | l2cache 6 | io.github.ck-jesse 7 | 1.0.38 8 | 9 | 4.0.0 10 | l2cache-jd-hotkey 11 | l2cache-jd-hotkey 12 | pom 13 | Jd HotKey 14 | 15 | 16 | jd-hotkey-worker 17 | jd-hotkey-client 18 | jd-hotkey-common 19 | jd-hotkey-sample 20 | jd-hotkey-dashboard 21 | 22 | 23 | 24 | 1.8 25 | 1.8 26 | 1.8 27 | 28 | -------------------------------------------------------------------------------- /l2cache-spring-boot-starter/src/main/java/com/github/jesse/l2cache/spring/biz/AbstractCacheService.java: -------------------------------------------------------------------------------- 1 | package com.github.jesse.l2cache.spring.biz; 2 | 3 | import com.github.jesse.l2cache.Cache; 4 | import com.github.jesse.l2cache.biz.CacheService; 5 | import com.github.jesse.l2cache.exception.L2CacheException; 6 | import com.github.jesse.l2cache.spring.cache.L2CacheCacheManager; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.stereotype.Component; 9 | 10 | /** 11 | * 抽象缓存类 12 | * 定义该类的初始目的是为了简化 get()和isExist() 的开发,抽象公共逻辑,避免每个实现类中都定义类似的代码逻辑。 13 | * 14 | * @author chenck 15 | * @date 2021/4/13 14:04 16 | */ 17 | @Component 18 | public abstract class AbstractCacheService implements CacheService { 19 | 20 | @Autowired 21 | L2CacheCacheManager l2CacheCacheManager; 22 | 23 | @Override 24 | public Cache getNativeL2cache() { 25 | Cache cache = (Cache) l2CacheCacheManager.getCache(this.getCacheName()).getNativeCache(); 26 | if (null == cache) { 27 | throw new L2CacheException("未找到Cache对象,请检查缓存配置是否正确"); 28 | } 29 | return cache; 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /l2cache-example/src/main/resources/redisson-prod-demo.yaml: -------------------------------------------------------------------------------- 1 | # 一个8c16g的商品中心pod的生产配置(nacos) 2 | # cluster sentinel with high availability 3 | singleServerConfig: 4 | address: "redis://xx.redis.rds.aliyuncs.com:6379" 5 | # default 10000 milliseconds 6 | idleConnectionTimeout: 10000 7 | # default 10000 milliseconds 8 | connectTimeout: 1000 9 | # default 3000 milliseconds 10 | timeout: 1000 11 | # default 3 12 | retryAttempts: 3 13 | # default 1500 milliseconds 14 | retryInterval: 1500 15 | # default 5 16 | subscriptionsPerConnection: 5 17 | # default 30000 18 | pingConnectionInterval: 5000 19 | # default null 20 | clientName: null 21 | # default 1 22 | subscriptionConnectionMinimumIdleSize: 1 23 | # default 50 24 | subscriptionConnectionPoolSize: 50 25 | # default 24 26 | connectionMinimumIdleSize: 100 27 | # default 64 28 | connectionPoolSize: 300 29 | # default 0 30 | database: 0 31 | # default 16, 0 means current_processors_amount * 2 32 | threads: 128 33 | # default 32, 0 means current_processors_amount * 2 34 | nettyThreads: 256 35 | # key/value codec, default JsonJacksonCodec 36 | # codec: ! {} -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/java/com/jd/platform/hotkey/dashboard/service/RuleService.java: -------------------------------------------------------------------------------- 1 | package com.jd.platform.hotkey.dashboard.service; 2 | 3 | import com.github.pagehelper.PageInfo; 4 | import com.jd.platform.hotkey.dashboard.common.domain.req.PageReq; 5 | import com.jd.platform.hotkey.dashboard.common.domain.req.SearchReq; 6 | import com.jd.platform.hotkey.dashboard.common.domain.vo.HitCountVo; 7 | import com.jd.platform.hotkey.dashboard.model.Rules; 8 | 9 | import java.util.List; 10 | 11 | /** 12 | * @ProjectName: hotkey 13 | * @ClassName: RuleService 14 | * @Description: TODO(一句话描述该类的功能) 15 | * @Author: liyunfeng31 16 | * @Date: 2020/4/17 16:29 17 | */ 18 | public interface RuleService { 19 | 20 | 21 | Rules selectRules(String app); 22 | 23 | int updateRule(Rules rules); 24 | 25 | Integer add(Rules rules); 26 | 27 | int delRule(String key, String updater); 28 | 29 | PageInfo pageKeyRule(PageReq page, String appName); 30 | 31 | int save(Rules rules); 32 | 33 | List listRules(String app); 34 | 35 | PageInfo pageRuleHitCount(PageReq pageReq, SearchReq req, String ownApp); 36 | } 37 | -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/chart/radarChart.js: -------------------------------------------------------------------------------- 1 | var radarChartData = { 2 | labels : ["Eating","Drinking","Sleeping","Designing","Coding","Partying","Running"], 3 | datasets : [ 4 | { 5 | fillColor : "rgba(255, 0, 100, 0.5)", 6 | strokeColor : "rgba(255, 0, 100, 1)", 7 | pointColor : "rgba(255, 0, 100, 1)", 8 | pointStrokeColor : "#fff", 9 | data : [65,59,90,81,56,55,40] 10 | }, 11 | { 12 | fillColor : "rgba(255, 185, 0, 0.5)", 13 | strokeColor : "rgba(255, 185, 0, 1)", 14 | pointColor : "rgba(255, 185, 0, 1)", 15 | pointStrokeColor : "#fff", 16 | data : [28,48,40,19,96,27,100] 17 | } 18 | ] 19 | 20 | } 21 | 22 | var myRadar = new Chart(document.getElementById("canvas2").getContext("2d")).Radar(radarChartData,{ 23 | scaleShowLabels : false, 24 | pointLabelFontSize : 12 25 | }); 26 | -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/java/com/jd/platform/hotkey/dashboard/common/ex/BizException.java: -------------------------------------------------------------------------------- 1 | package com.jd.platform.hotkey.dashboard.common.ex; 2 | 3 | 4 | import com.jd.platform.hotkey.dashboard.common.eunm.ResultEnum; 5 | 6 | public class BizException extends RuntimeException { 7 | 8 | private int code; 9 | private String msg; 10 | 11 | public BizException(int code, String message) { 12 | this.code = code; 13 | this.msg = message; 14 | } 15 | 16 | public BizException(ResultEnum result) { 17 | this.code = result.getCode(); 18 | this.msg = result.getMsg(); 19 | } 20 | 21 | public int getCode() { 22 | return code; 23 | } 24 | 25 | public void setCode(int code) { 26 | this.code = code; 27 | } 28 | 29 | public String getMsg() { 30 | return msg; 31 | } 32 | 33 | public void setMsg(String msg) { 34 | this.msg = msg; 35 | } 36 | 37 | @Override 38 | public String toString() { 39 | return "BizException{" + 40 | "code=" + code + 41 | ", msg='" + msg + '\'' + 42 | '}'; 43 | } 44 | } -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-client/src/main/java/com/jd/platform/hotkey/client/cache/CaffeineBuilder.java: -------------------------------------------------------------------------------- 1 | package com.jd.platform.hotkey.client.cache; 2 | 3 | import com.github.benmanes.caffeine.cache.Cache; 4 | import com.github.benmanes.caffeine.cache.Caffeine; 5 | import com.jd.platform.hotkey.client.Context; 6 | 7 | import java.util.concurrent.TimeUnit; 8 | 9 | /** 10 | * @author wuweifeng wrote on 2019-12-12 11 | * @version 1.0 12 | */ 13 | public class CaffeineBuilder { 14 | 15 | public static Cache cache(int duration) { 16 | return cache(128, Context.CAFFEINE_SIZE, duration); 17 | } 18 | 19 | public static Cache cache() { 20 | return cache(128, Context.CAFFEINE_SIZE, 60); 21 | } 22 | 23 | /** 24 | * 构建所有来的要缓存的key getCache 25 | */ 26 | public static Cache cache(int minSize, int maxSize, int expireSeconds) { 27 | return Caffeine.newBuilder() 28 | .initialCapacity(minSize)//初始大小 29 | .maximumSize(maxSize)//最大数量 30 | .expireAfterWrite(expireSeconds, TimeUnit.SECONDS)//过期时间 31 | .build(); 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-sample/src/main/java/com/jd/platform/hotkey/sample/Starter.java: -------------------------------------------------------------------------------- 1 | package com.jd.platform.hotkey.sample; 2 | 3 | import com.jd.platform.hotkey.client.ClientStarter; 4 | import org.springframework.beans.factory.annotation.Value; 5 | import org.springframework.stereotype.Component; 6 | 7 | import javax.annotation.PostConstruct; 8 | import java.util.HashMap; 9 | import java.util.HashSet; 10 | import java.util.Map; 11 | 12 | /** 13 | * @author wuweifeng wrote on 2020-01-14 14 | * @version 1.0 15 | */ 16 | @Component 17 | public class Starter { 18 | @Value("${etcd.server}") 19 | private String etcd; 20 | @Value("${spring.application.name}") 21 | private String appName; 22 | 23 | @PostConstruct 24 | public void init() { 25 | ClientStarter.Builder builder = new ClientStarter.Builder(); 26 | ClientStarter starter = builder.setAppName(appName).setEtcdServer(etcd).build(); 27 | starter.startPipeline(); 28 | } 29 | 30 | public static void main(String[] args) { 31 | Map> totalSkuSet = new HashMap<>(); 32 | System.out.println(totalSkuSet.get("a")); 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/java/com/jd/platform/hotkey/dashboard/mapper/StatisticsMapper.java: -------------------------------------------------------------------------------- 1 | package com.jd.platform.hotkey.dashboard.mapper; 2 | 3 | import com.jd.platform.hotkey.dashboard.common.domain.req.SearchReq; 4 | import com.jd.platform.hotkey.dashboard.model.Statistics; 5 | import org.apache.ibatis.annotations.Mapper; 6 | 7 | import java.util.Date; 8 | import java.util.List; 9 | 10 | /** 11 | * @author liyunfeng31 12 | */ 13 | @Mapper 14 | public interface StatisticsMapper { 15 | 16 | 17 | /** 18 | * 查看 19 | * @return list 20 | */ 21 | List listStatistics(SearchReq req); 22 | 23 | 24 | /** 25 | * 查看 26 | * @return list 27 | */ 28 | List listOrderByTime(SearchReq req); 29 | 30 | /** 31 | * records 32 | * @param records records 33 | * @return row 34 | */ 35 | int batchInsert(List records); 36 | 37 | /** 38 | * 多个时间聚合统计列表 39 | * @param req req 40 | * @return list 41 | */ 42 | List sumStatistics(SearchReq req); 43 | 44 | /** 45 | * 清理 46 | */ 47 | int clearExpireData(String app, Date expireDate); 48 | } -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/resources/static/admin/assets/js/calendar/events.json.php: -------------------------------------------------------------------------------- 1 | { "success": 1, "result": [ { "id": "293", "title": "This is warning class event", "url": "http://www.google.com/", "class": "event-warning", "start": "1362938400000", "end": "1363197686300" }, { "id": "294", "title": "This is information class ", "url": "http://www.google.com/", "class": "event-info", "start": "1363111200000", "end": "1363284086400" }, { "id": "297", "title": "This is success event", "url": "http://www.google.com/", "class": "event-success", "start": "1363284000000", "end": "1363284086400" }, { "id": "54", "title": "This is simple event", "url": "http://www.google.com/", "class": "", "start": "1363629600000", "end": "1363716086400" }, { "id": "532", "title": "This is inverse event", "url": "http://www.google.com/", "class": "event-inverse", "start": "1364407200000", "end": "1364493686400" }, { "id": "548", "title": "This is special event", "url": "http://www.google.com/", "class": "event-special", "start": "1363197600000", "end": "1363629686400" }, { "id": "295", "title": "Event 3", "url": "http://www.google.com/", "class": "event-important", "start": "1364320800000", "end": "1364407286400" } ] } -------------------------------------------------------------------------------- /l2cache-jd-hotkey/README.en.md: -------------------------------------------------------------------------------- 1 | # hotkey 2 | 3 | #### Description 4 | 对任意突发性的无法预先感知的热点请求,包括并不限于热点数据(如突发大量请求同一个商品)、热用户(如恶意爬虫刷子)、热接口(突发海量请求同一个接口)等,进行秒级精准探测到。 5 | 然后对这些热数据、热用户等,推送到所有客户端JVM内存中,以大幅减轻对后端数据存储层的冲击,并可以由客户端决定如何分配、使用这些热key(譬如对热商品做本地缓存、对热用户进行拒绝访问、对热接口进行熔断或返回默认值)。 6 | 这些热数据在整个客户端集群内保持一致性。 7 | 8 | #### Software Architecture 9 | Software architecture description 10 | 11 | #### Installation 12 | 13 | 1. xxxx 14 | 2. xxxx 15 | 3. xxxx 16 | 17 | #### Instructions 18 | 19 | 1. xxxx 20 | 2. xxxx 21 | 3. xxxx 22 | 23 | #### Contribution 24 | 25 | 1. Fork the repository 26 | 2. Create Feat_xxx branch 27 | 3. Commit your code 28 | 4. Create Pull Request 29 | 30 | 31 | #### Gitee Feature 32 | 33 | 1. You can use Readme\_XXX.md to support different languages, such as Readme\_en.md, Readme\_zh.md 34 | 2. Gitee blog [blog.gitee.com](https://blog.gitee.com) 35 | 3. Explore open source project [https://gitee.com/explore](https://gitee.com/explore) 36 | 4. The most valuable open source project [GVP](https://gitee.com/gvp) 37 | 5. The manual of Gitee [https://gitee.com/help](https://gitee.com/help) 38 | 6. The most popular members [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) 39 | -------------------------------------------------------------------------------- /l2cache-core/src/main/java/com/github/jesse/l2cache/util/pool/MdcUtil.java: -------------------------------------------------------------------------------- 1 | package com.github.jesse.l2cache.util.pool; 2 | 3 | import org.slf4j.MDC; 4 | 5 | import java.util.Map; 6 | 7 | /** 8 | * @author chenck 9 | * @date 2021/5/11 17:00 10 | */ 11 | public class MdcUtil { 12 | 13 | /** 14 | * Invoked before running a task. 15 | * 16 | * @param newMdcContext the new MDC context 17 | * @return the old MDC context 18 | */ 19 | public static Map beforeExecution(Map newMdcContext) { 20 | Map oldMdcContext = MDC.getCopyOfContextMap(); 21 | if (newMdcContext == null) { 22 | MDC.clear(); 23 | } else { 24 | MDC.setContextMap(newMdcContext); 25 | } 26 | return oldMdcContext; 27 | } 28 | 29 | /** 30 | * Invoked after running a task. 31 | * 32 | * @param oldMdcContext the old MDC context 33 | */ 34 | public static void afterExecution(Map oldMdcContext) { 35 | if (oldMdcContext == null) { 36 | MDC.clear(); 37 | } else { 38 | MDC.setContextMap(oldMdcContext); 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/java/com/jd/platform/hotkey/dashboard/util/PageUtil.java: -------------------------------------------------------------------------------- 1 | package com.jd.platform.hotkey.dashboard.util; 2 | 3 | import com.google.common.collect.Lists; 4 | import com.jd.platform.hotkey.dashboard.common.domain.Page; 5 | import org.springframework.util.CollectionUtils; 6 | 7 | import java.util.ArrayList; 8 | import java.util.List; 9 | 10 | /** 11 | * @author wuweifeng 12 | * @version 1.0 13 | * @date 2020-09-01 14 | */ 15 | public class PageUtil { 16 | /** 17 | * 通用分页工具类 18 | * 19 | * @param data 20 | * @param pageSize 21 | * @param pageNum 22 | * @param 23 | * @return 24 | */ 25 | public static Page pagination(final List data, final int pageSize, final int pageNum) { 26 | if (CollectionUtils.isEmpty(data)) { 27 | return new Page<>(1, 0, new ArrayList<>()); 28 | } 29 | List> lists = Lists.partition(data, pageSize); 30 | int localPageNum = pageNum; 31 | if (localPageNum >= lists.size()) { 32 | localPageNum = lists.size() - 1; 33 | } 34 | return new Page<>(localPageNum, data.size(), lists.get(localPageNum)); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-worker/src/main/java/com/jd/platform/hotkey/worker/keydispatcher/KeyProducer.java: -------------------------------------------------------------------------------- 1 | package com.jd.platform.hotkey.worker.keydispatcher; 2 | 3 | import com.jd.platform.hotkey.common.model.HotKeyModel; 4 | import com.jd.platform.hotkey.worker.tool.InitConstant; 5 | import org.springframework.stereotype.Component; 6 | 7 | import static com.jd.platform.hotkey.worker.tool.InitConstant.expireTotalCount; 8 | import static com.jd.platform.hotkey.worker.tool.InitConstant.totalOfferCount; 9 | 10 | /** 11 | * @author wuweifeng 12 | * @version 1.0 13 | * @date 2020-06-09 14 | */ 15 | @Component 16 | public class KeyProducer { 17 | 18 | public void push(HotKeyModel model, long now) { 19 | if (model == null || model.getKey() == null) { 20 | return; 21 | } 22 | //5秒前的过时消息就不处理了 23 | if (now - model.getCreateTime() > InitConstant.timeOut) { 24 | expireTotalCount.increment(); 25 | return; 26 | } 27 | 28 | try { 29 | DispatcherConfig.QUEUE.put(model); 30 | totalOfferCount.increment(); 31 | } catch (InterruptedException e) { 32 | e.printStackTrace(); 33 | } 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /l2cache-jd-hotkey/jd-hotkey-dashboard/src/main/java/com/jd/platform/hotkey/dashboard/common/eunm/ResultEnum.java: -------------------------------------------------------------------------------- 1 | package com.jd.platform.hotkey.dashboard.common.eunm; 2 | 3 | 4 | public enum ResultEnum { 5 | 6 | /** 7 | * 操作成功 8 | */ 9 | SUCCESS(200, "操作成功!"), 10 | 11 | NO_LOGIN(1000, "未登录"), 12 | 13 | NO_CHANGE(1001, "操作无影响"), 14 | 15 | PWD_ERROR(1002, "账户/密码错误"), 16 | 17 | NO_PERMISSION(1003, "没有操作权限"), 18 | 19 | NO_RESOURCE(1004, "没有资源"), 20 | 21 | PARAM_ERROR(1005, "参数错误"), 22 | 23 | BIZ_ERROR(1006, "业务异常"), 24 | 25 | CONFLICT_ERROR(1007, "用户名/手机号已存在"), 26 | 27 | ILLEGAL_JSON_ARR(1008, "非法的json数组"), 28 | 29 | TIME_RANGE_LARGE(1022, "查询时间过大"); 30 | 31 | 32 | private int code; 33 | 34 | private String msg; 35 | 36 | ResultEnum(int code, String msg) { 37 | this.code = code; 38 | this.msg = msg; 39 | } 40 | 41 | public int getCode() { 42 | return code; 43 | } 44 | 45 | public void setCode(int code) { 46 | this.code = code; 47 | } 48 | 49 | public String getMsg() { 50 | return msg; 51 | } 52 | 53 | public void setMsg(String msg) { 54 | this.msg = msg; 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /l2cache-core/src/main/java/com/github/jesse/l2cache/util/pool/RunnableMdcWarpper.java: -------------------------------------------------------------------------------- 1 | package com.github.jesse.l2cache.util.pool; 2 | 3 | import org.slf4j.MDC; 4 | 5 | import java.util.Map; 6 | 7 | /** 8 | * Runnable 包装 MDC 9 | * 10 | * @author chenck 11 | * @date 2020/9/23 19:37 12 | */ 13 | public class RunnableMdcWarpper implements Runnable { 14 | 15 | private static final long serialVersionUID = 1L; 16 | 17 | Runnable runnable; 18 | Map contextMap; 19 | Object param; 20 | 21 | public RunnableMdcWarpper(Runnable runnable) { 22 | this.runnable = runnable; 23 | this.contextMap = MDC.getCopyOfContextMap(); 24 | } 25 | 26 | public RunnableMdcWarpper(Runnable runnable, Object param) { 27 | this.runnable = runnable; 28 | this.contextMap = MDC.getCopyOfContextMap(); 29 | this.param = param; 30 | } 31 | 32 | @Override 33 | public void run() { 34 | Map oldContext = MdcUtil.beforeExecution(contextMap); 35 | try { 36 | runnable.run(); 37 | } finally { 38 | MdcUtil.afterExecution(oldContext); 39 | } 40 | } 41 | 42 | public Object getParam() { 43 | return param; 44 | } 45 | } 46 | --------------------------------------------------------------------------------