{"id":1176,"date":"2016-08-18T17:42:16","date_gmt":"2016-08-18T09:42:16","guid":{"rendered":"http:\/\/www.yeetrack.com\/?p=1176"},"modified":"2016-08-18T23:08:06","modified_gmt":"2016-08-18T15:08:06","slug":"%e8%b5%b0%e8%bf%91guava%e4%ba%94-%e7%bc%93%e5%ad%98","status":"publish","type":"post","link":"https:\/\/www.yeetrack.com\/?p=1176","title":{"rendered":"\u8d70\u8fd1Guava(\u4e94): \u7f13\u5b58"},"content":{"rendered":"<div class=\"blog-body\">\n<div class=\"BlogContent\">\n<h1>\u7f13\u5b58\uff1a<\/h1>\n<h2>MapMaker\u7c7b<\/h2>\n<ul>\n<li><span style=\"line-height: 1.5; font-size: 12.5px;\"><span style=\"color: #e53333; font-size: 16px;\">MapMaker<\/span>\u4f5c\u4e3a\u5927\u591a\u6570\u57fa\u672c\u7f13\u5b58\u529f\u80fd\u5730\u63d0\u4f9b\u8005\u3002<\/span><\/li>\n<\/ul>\n<pre class=\"brush:java; toolbar: true; auto-links: false;\"><code>ConcurrentMap&lt;String,Book&gt; books = new MapMaker().concurrencyLevel(2) \/\/\u5e76\u53d1\u7ea7\u522b,\u5373\u5141\u8bb8\u6700\u591a2\u4e2a\u7ebf\u7a0b\u5e76\u53d1\u66f4\u65b0, \u9ed8\u8ba4\u503c\u4e3a4<!--more-->\n\n\n                    \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 .softValues() \/\/\u4f7f\u7528SoftReference\u5f15\u7528\u5bf9\u8c61\u5305\u88c5value\n                    \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 .makeMap(); \/\/\u6784\u5efaMap\u5bf9\u8c61<\/code><\/pre>\n<h2>Guava\u7f13\u5b58\uff1a<\/h2>\n<p>Cache\u7c7b\uff1a<\/p>\n<ul>\n<li><span style=\"line-height: 1.5; font-size: 12.5px;\">\u57fa\u672c\u64cd\u4f5c<\/span><\/li>\n<\/ul>\n<pre class=\"brush:java; toolbar: true; auto-links: false;\"><code>put(key,value); \/\/\u5b58\u653ekey-value\nV value = cache.get(key, Callable&lt;? Extends V&gt; value); \/\/\u83b7\u53d6key\u5bf9\u5e94\u7684\u7f13\u5b58\u5bf9\u8c61\uff0c\u4e0d\u5b58\u5728\u6216\u8c03\u7528Callable\u5b9e\u4f8b\u7684call\u65b9\u6cd5\u6765\u8fd4\u56dekey\u5bf9\u5e94\u7684\u503c<\/code><\/pre>\n<p>\u4e0a\u9762\u7684cache.get\u6709\u6548\u4ee3\u66ff\u4e86\u6211\u4eec\u901a\u5e38\u7684\u64cd\u4f5c\uff1a<\/p>\n<pre class=\"brush:java; toolbar: true; auto-links: false;\"><code>value = cache.get(key);\n   if(value == null){\n       value = someService.retrieveValue();\n       cache.put(key,value);\n   }<\/code><\/pre>\n<p>\u4e0a\u9762\u901a\u8fc7Callable\u83b7\u53d6\u503c\u662f\u4e00\u4e2a\u5f02\u6b65\u8fc7\u7a0b\uff0c\u6211\u4eec\u4e5f\u53ef\u4ee5\u901a\u8fc7\u975e\u5f02\u6b65\u6765\u83b7\u53d6\u503c\uff1a<\/p>\n<pre class=\"brush:java; toolbar: true; auto-links: false;\"><code>cache.get(key,Callables.returning(someService.retrieveValue()); \/\/\u540c\u6b65\u65b9\u5f0f\u83b7\u53d6\u4e0d\u5b58\u5728\u7684key\u7f13\u5b58<\/code><\/pre>\n<p>\u540c\u6837\u6211\u4eec\u4e5f\u53ef\u4ee5\u4f7f\u7f13\u5b58\u7684\u6570\u636e\u5931\u6548\uff1a<\/p>\n<pre class=\"brush:java; toolbar: true; auto-links: false;\"><code>invalidate(key) \/\/\u5e9f\u5f03key\u5bf9\u5e94\u7684\u7f13\u5b58\ninvalidateAll() \/\/\u5e9f\u5f03\u6240\u6709\u7684\u7f13\u5b58\ninvalidateAll(Iterable&lt;?&gt; keys) \/\/\u5e9f\u5f03keys\u5bf9\u5e94\u7684\u7f13\u5b58<\/code><\/pre>\n<h3>LoadingCache\u7c7b\uff1a<\/h3>\n<ul>\n<li><span style=\"line-height: 1.5; font-size: 12.5px;\"><span style=\"color: #e53333; font-size: 16px;\">Loadin<\/span><span style=\"color: #e53333; font-size: 16px;\">gCache<\/span>\u662fCache\u7684\u6269\u5c55\u7c7b\uff0c\u5177\u6709<span style=\"color: #e53333; font-size: 16px;\">\u81ea\u52a0\u8f7d<\/span>\u529f\u80fd\u3002<\/span><\/li>\n<\/ul>\n<ul>\n<li><span style=\"line-height: 1.5; font-size: 12.5px;\">\u57fa\u672c\u64cd\u4f5c\u3002<\/span><\/li>\n<\/ul>\n<pre class=\"brush:java; toolbar: true; auto-links: false;\"><code>Book book = loadingCache.get(id); \/\/\u83b7\u53d6key\u4e3aid\u7684\u7f13\u5b58\nImmutableMap&lt;key,value&gt; map = cache.getAll(Iterable&lt;? Extends key&gt;); \/\/\u83b7\u53d6\u591a\u4e2akey\u7684\u7f13\u5b58\uff0c\u5e76\u8fd4\u56de\u4e0d\u53ef\u53d8map\u5bf9\u8c61\nrefresh(key); \/\/\u5237\u65b0key\u5bf9\u5e94\u7684\u7f13\u5b58<\/code><\/pre>\n<h3>CacheBuilder\u7c7b\uff1a<\/h3>\n<ul>\n<li><span style=\"line-height: 1.5; font-size: 12.5px;\"><span style=\"color: #e53333; font-size: 16px;\">CacheBuilder<\/span>\u901a\u8fc7\u6784\u5efa\u5668\u6a21\u5f0f\u6784\u5efa<span style=\"color: #e53333; font-size: 16px;\">Cache<\/span>\u548c<span style=\"color: #e53333; font-size: 16px;\">LoadingCache<\/span>\u5b9e\u4f8b\u3002<\/span><\/li>\n<\/ul>\n<ul>\n<li><span style=\"line-height: 1.5; font-size: 12.5px;\">\u6784\u5efaLoadingCache\u5bf9\u8c61\u5b9e\u4f8b\u4e00\u3002<\/span><\/li>\n<\/ul>\n<pre class=\"brush:java; toolbar: true; auto-links: false;\"><code>LoadingCache&lt;String, TradeAccount&gt; traLoadingCache =\n\t\t\t\tCacheBuilder.newBuilder()\n\t\t\t\t\t.expireAfterAccess(5L, TimeUnit.MINUTES) \/\/5\u5206\u949f\u540e\u7f13\u5b58\u5931\u6548\n\t\t\t\t\t.maximumSize(5000L) \/\/\u6700\u5927\u7f13\u5b585000\u4e2a\u5bf9\u8c61\n\t\t\t\t\t.removalListener(new TradeAccountRemovalListener()) \/\/\u6ce8\u518c\u7f13\u5b58\u5bf9\u8c61\u79fb\u9664\u76d1\u542c\u5668\n\t\t\t\t\t.ticker(Ticker.systemTicker()) \/\/\u5b9a\u4e49\u7f13\u5b58\u5bf9\u8c61\u5931\u6548\u7684\u65f6\u95f4\u7cbe\u5ea6\u4e3a\u7eb3\u79d2\u7ea7\n\t\t\t\t\t.build(new CacheLoader&lt;String, TradeAccount&gt;(){ \n\t\t\t\t\t\t@Override\n\t\t\t\t\t\tpublic TradeAccount load(String key) throws Exception {\n\t\t\t\t\t\t\t\/\/ load a new TradeAccount not exists in cache\n\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t}\n\t\t\t\t\t});<\/code><\/pre>\n<ul>\n<li><span style=\"line-height: 1.5; font-size: 12.5px;\">\u901a\u8fc7SoftReference\u5bf9\u8c61\u5b9e\u73b0\u81ea\u52a8\u56de\u6536<\/span><\/li>\n<\/ul>\n<pre class=\"brush:java; toolbar: true; auto-links: false;\"><code>LoadingCache&lt;String, TradeAccount&gt; traLoadingCache =\n\t\t\t\tCacheBuilder.newBuilder()\n\t\t\t\t\t.expireAfterAccess(5L, TimeUnit.MINUTES) \/\/5\u5206\u949f\u540e\u7f13\u5b58\u5931\u6548\n\t\t\t\t\t.softValues() \/\/\u4f7f\u7528SoftReference\u5bf9\u8c61\u5c01\u88c5value, \u4f7f\u5f97\u5185\u5b58\u4e0d\u8db3\u65f6\uff0c\u81ea\u52a8\u56de\u6536\n\t\t\t\t\t.removalListener(new TradeAccountRemovalListener()) \/\/\u6ce8\u518c\u7f13\u5b58\u5bf9\u8c61\u79fb\u9664\u76d1\u542c\u5668\n\t\t\t\t\t.ticker(Ticker.systemTicker()) \/\/\u5b9a\u4e49\u7f13\u5b58\u5bf9\u8c61\u5931\u6548\u7684\u65f6\u95f4\u7cbe\u5ea6\u4e3a\u7eb3\u79d2\u7ea7\n\t\t\t\t\t.build(new CacheLoader&lt;String, TradeAccount&gt;(){ \n\t\t\t\t\t\t@Override\n\t\t\t\t\t\tpublic TradeAccount load(String key) throws Exception {\n\t\t\t\t\t\t\t\/\/ load a new TradeAccount not exists in cache\n\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t}\n\t\t\t\t\t});<\/code><\/pre>\n<ul>\n<li><span style=\"line-height: 1.5; font-size: 12.5px;\">\u6784\u5efa\u4e00\u4e2a\u53ef\u81ea\u52a8\u5237\u65b0\u7f13\u5b58\u7684LoadingCache<\/span><\/li>\n<\/ul>\n<pre class=\"brush:java; toolbar: true; auto-links: false;\"><code>LoadingCache&lt;String, TradeAccount&gt; traLoadingCache =\n\t\t\t\tCacheBuilder.newBuilder()\n\t\t\t\t\t.concurrencyLevel(10) \/\/\u5141\u8bb8\u540c\u65f6\u6700\u591a10\u4e2a\u7ebf\u7a0b\u5e76\u53d1\u4fee\u6539\n\t\t\t\t\t.refreshAfterWrite(5L, TimeUnit.SECONDS) \/\/5\u79d2\u4e2d\u540e\u81ea\u52a8\u5237\u65b0\n\t\t\t\t\t.removalListener(new TradeAccountRemovalListener()) \/\/\u6ce8\u518c\u7f13\u5b58\u5bf9\u8c61\u79fb\u9664\u76d1\u542c\u5668\n\t\t\t\t\t.ticker(Ticker.systemTicker()) \/\/\u5b9a\u4e49\u7f13\u5b58\u5bf9\u8c61\u5931\u6548\u7684\u65f6\u95f4\u7cbe\u5ea6\u4e3a\u7eb3\u79d2\u7ea7\n\t\t\t\t\t.build(new CacheLoader&lt;String, TradeAccount&gt;(){ \n\t\t\t\t\t\t@Override\n\t\t\t\t\t\tpublic TradeAccount load(String key) throws Exception {\n\t\t\t\t\t\t\t\/\/ load a new TradeAccount not exists in cache\n\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t}\n\t\t\t\t\t});<\/code><\/pre>\n<h3>CacheBuilderSpec:<\/h3>\n<ul>\n<li><span style=\"line-height: 1.5; font-size: 12.5px;\"><span style=\"color: #e53333; font-size: 16px;\">CacheBuilderSpec<\/span>\u53ef\u4ee5\u7528\u4e8e\u6784\u5efa<span style=\"color: #e53333; font-size: 16px;\">CacheBuilder<\/span>\u65f6\u7684\u914d\u7f6e\u63cf\u8ff0\u3002<\/span><\/li>\n<\/ul>\n<pre class=\"brush:java; toolbar: true; auto-links: false;\"><code>String configString = \"concurrencyLevel=10,refreshAfterWrite=5s\"<\/code><\/pre>\n<ul>\n<li><span style=\"line-height: 1.5; font-size: 12.5px;\">\u901a\u8fc7CacheBuilderSpec\u6784\u5efaLoadingCache:<\/span><\/li>\n<\/ul>\n<pre class=\"brush:java; toolbar: true; auto-links: false;\"><code>String spec = \"concurrencyLevel=10,expireAfterAccess=5m,softValues\";\nCacheBuilderSpec cacheBuilderSpec = CacheBuilderSpec.parse(spec);\nCacheBuilder&lt;Object, Object&gt; cacheBuilder = CacheBuilder.from(cacheBuilderSpec);\nLoadingCache&lt;String, TradeAccount&gt; traLoadingCache = cacheBuilder\n\t\t.ticker(Ticker.systemTicker())\n\t\t.removalListener(new TradeAccountRemovalListener())\n\t\t.build(new CacheLoader&lt;String, TradeAccount&gt;(){ \n\t\t\t@Override\n\t\t\tpublic TradeAccount load(String key) throws Exception {\n\t\t\t\t\/\/ load a new TradeAccount not exists in cache\n\t\t\t\treturn null;\n\t\t\t}\n});<\/code><\/pre>\n<h3>CacheLoader\u7c7b\uff1a<\/h3>\n<ul>\n<li><span style=\"line-height: 1.5; font-size: 12.5px;\">\u6784\u5efaCacheLoader<\/span><\/li>\n<\/ul>\n<pre class=\"brush:java; toolbar: true; auto-links: false;\"><code>\/\/\u7528Function\u6784\u5efaCacheLoader, \u5c06\u8f93\u5165\u8f6c\u6362\u6210\u8f93\u51fa\nCacheLoader&lt;Key,value&gt; cacheLoader = CacheLoader.from(Function&lt;Key,Value&gt; func);\n\/\/\u901a\u8fc7Supplier\u6784\u5efaCacheLoader\nCacheLoader&lt;Object,Value&gt; cacheLoader = CacheLoader.from(Supplier&lt;Value&gt; supplier);<\/code><\/pre>\n<h3>CacheStats\u7c7b\uff1a<\/h3>\n<ul>\n<li><span style=\"line-height: 1.5; font-size: 12.5px;\">\u7528\u4e8e\u6536\u96c6\u4e00\u4e9b\u7f13\u5b58\u4fe1\u606f\u3002<\/span><\/li>\n<\/ul>\n<pre class=\"brush:java; toolbar: true; auto-links: false;\"><code>LoadingCache&lt;String,TradeAccount&gt; tradeAccountCache = CacheBuilder.newBuilder().recordStats() \/\/\u5f00\u542f\u8bb0\u5f55\u72b6\u6001<\/code><\/pre>\n<ul>\n<li><span style=\"line-height: 1.5; font-size: 12.5px;\">\u83b7\u53d6<span style=\"color: #e53333; font-size: 16px;\">Cache<\/span><span style=\"color: #e53333; font-size: 16px;\">Stat<\/span>\u5bf9\u8c61<\/span><\/li>\n<\/ul>\n<pre class=\"brush:java; toolbar: true; auto-links: false;\"><code>CacheStats cacheStats = cache.stats();<\/code><\/pre>\n<ul>\n<li><span style=\"line-height: 1.5; font-size: 12.5px;\">\u901a\u8fc7<span style=\"color: #e53333; font-size: 16px;\">CacheStat<\/span>\u53ef\u4ee5\u83b7\u53d6\u7684\u4fe1\u606f<\/span><\/li>\n<\/ul>\n<pre class=\"brush:java; toolbar: true; auto-links: false;\"><code>1.\u52a0\u8f7d\u65b0\u503c\u6d88\u8017\u7684\u5e73\u5747\u65f6\u95f4\n2.\u547d\u4e2d\u6b21\u6570\n3.\u672a\u547d\u4e2d\u6b21\u6570\n...<\/code><\/pre>\n<h3>RemovalListener\u7c7b\uff1a<\/h3>\n<ul>\n<li><span style=\"line-height: 1.5; font-size: 12.5px;\">\u7528\u4e8e\u76d1\u542cCache\u4e2d\u7684key\u88ab\u79fb\u9664\u65f6\u3002<\/span><\/li>\n<\/ul>\n<h3>RemovalNotification\u7c7b\uff1a<\/h3>\n<ul>\n<li><span style=\"line-height: 1.5; font-size: 12.5px;\">\u7528\u4e8e\u63a5\u6536\u89e6\u53d1RemovalListener\u7684onRemoval\u7684\u53c2\u6570\u4f20\u5165\uff0c\u53ef\u83b7\u53d6\u5bf9\u5e94key,value\u7b49\u3002<\/span><\/li>\n<\/ul>\n<ul>\n<li>\u901a\u8fc7<span style=\"color: #e53333; font-size: 16px;\">RemovalNotification.getCause()<\/span>\u8fd8\u53ef\u4ee5\u77e5\u9053\u8be5\u5bf9\u8c61\u88ab\u79fb\u9664\u7684\u539f\u56e0.<\/li>\n<\/ul>\n<pre class=\"brush:java; toolbar: true; auto-links: false;\"><code>public enum RemovalCause {\n  \/\/\u7528\u6237\u624b\u52a8\u79fb\u9664\n  EXPLICIT,\n  \/\/\u7528\u6237\u624b\u52a8\u66ff\u6362\n  REPLACED,\n  \/\/\u88ab\u5783\u573e\u56de\u6536\n  COLLECTED,\n  \/\/\u8d85\u65f6\u8fc7\u671f\n  EXPIRED,\n  \/\/\u7531\u4e8e\u7f13\u5b58\u5927\u5c0f\u9650\u5236\n  SIZE;\n}<\/code><\/pre>\n<h3>RemovalListeners\u7c7b\uff1a<\/h3>\n<ul>\n<li><span style=\"line-height: 1.5; font-size: 12.5px;\">\u6211\u4eec\u53ef\u4ee5\u5f02\u6b65\u6267\u884cRemovalListener\u7684onRemoval\u89e6\u53d1\u52a8\u4f5c<\/span><\/li>\n<\/ul>\n<pre class=\"brush:java; toolbar: true; auto-links: false;\"><code>RemovalListener&lt;String,TradeAccount&gt; myRemovalListener = new RemovalListener&lt;String, TradeAccount&gt;() {\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0@Override\n           public void onRemoval(RemovalNotification&lt;String,TradeAccount&gt; notification) {\n               \/\/Do something here\n           }\n       };\nRemovalListener&lt;String,TradeAccount&gt; removalListener =\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0RemovalListeners.asynchronous(myRemovalListener,executorService);<\/code><\/pre>\n<p><span style=\"line-height: 1.5; font-size: 12.5px;\">\u4e0a\u9762\u7684\u6b65\u9aa4\u5fc5\u987b\u5728\u6211\u4eec\u6ce8\u518cRemovalListener\u5230 <\/span><span style=\"color: #e53333; font-size: 16px;\">CacheBuilder\u4e4b\u524d<\/span><span style=\"line-height: 1.5; font-size: 12.5px;\">\u3002<\/span><\/p>\n<p>\u6765\u6e90: http:\/\/my.oschina.net\/indestiny\/blog\/219375<\/p>\n<\/div>\n<div class=\"video-container\">\n<blockquote class=\"wp-embedded-content\" data-secret=\"ZIhbi3ZIxi\"><p><a href=\"https:\/\/www.yeetrack.com\/?p=1171\">\u8d70\u8fd1Guava(\u4e00): \u57fa\u672c\u5de5\u5177<\/a><\/p><\/blockquote>\n<p><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" title=\"\u300a\u8d70\u8fd1Guava(\u4e00): \u57fa\u672c\u5de5\u5177\u300b\u2014\u7a7a\u7a7a\u535a\u5ba2\" src=\"https:\/\/www.yeetrack.com\/?p=1171&#038;embed=true#?secret=2ltiKIWlMo#?secret=ZIhbi3ZIxi\" data-secret=\"ZIhbi3ZIxi\" width=\"600\" height=\"338\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe><\/div>\n<div class=\"video-container\">\n<blockquote class=\"wp-embedded-content\" data-secret=\"KzBTj7ZrVk\"><p><a href=\"https:\/\/www.yeetrack.com\/?p=1173\">\u8d70\u8fd1Guava(\u4e8c): \u51fd\u6570\u5f0f\u7f16\u7a0b<\/a><\/p><\/blockquote>\n<p><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" title=\"\u300a\u8d70\u8fd1Guava(\u4e8c): \u51fd\u6570\u5f0f\u7f16\u7a0b\u300b\u2014\u7a7a\u7a7a\u535a\u5ba2\" src=\"https:\/\/www.yeetrack.com\/?p=1173&#038;embed=true#?secret=01RauTkNGJ#?secret=KzBTj7ZrVk\" data-secret=\"KzBTj7ZrVk\" width=\"600\" height=\"338\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe><\/div>\n<div class=\"video-container\">\n<blockquote class=\"wp-embedded-content\" data-secret=\"jHUsJTdklO\"><p><a href=\"https:\/\/www.yeetrack.com\/?p=1174\">\u8d70\u8fd1Guava(\u4e09): \u96c6\u5408<\/a><\/p><\/blockquote>\n<p><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" title=\"\u300a\u8d70\u8fd1Guava(\u4e09): \u96c6\u5408\u300b\u2014\u7a7a\u7a7a\u535a\u5ba2\" src=\"https:\/\/www.yeetrack.com\/?p=1174&#038;embed=true#?secret=gFlrS3KhyW#?secret=jHUsJTdklO\" data-secret=\"jHUsJTdklO\" width=\"600\" height=\"338\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe><\/div>\n<div class=\"video-container\">\n<blockquote class=\"wp-embedded-content\" data-secret=\"TXED4qm3v6\"><p><a href=\"https:\/\/www.yeetrack.com\/?p=1175\">\u8d70\u8fd1Guava(\u56db): \u5e76\u53d1<\/a><\/p><\/blockquote>\n<p><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" title=\"\u300a\u8d70\u8fd1Guava(\u56db): \u5e76\u53d1\u300b\u2014\u7a7a\u7a7a\u535a\u5ba2\" src=\"https:\/\/www.yeetrack.com\/?p=1175&#038;embed=true#?secret=Pd0mmfuiby#?secret=TXED4qm3v6\" data-secret=\"TXED4qm3v6\" width=\"600\" height=\"338\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe><\/div>\n<div class=\"video-container\">\n<blockquote class=\"wp-embedded-content\" data-secret=\"gyNUvxXcyH\"><p><a href=\"https:\/\/www.yeetrack.com\/?p=1176\">\u8d70\u8fd1Guava(\u4e94): \u7f13\u5b58<\/a><\/p><\/blockquote>\n<p><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" title=\"\u300a\u8d70\u8fd1Guava(\u4e94): \u7f13\u5b58\u300b\u2014\u7a7a\u7a7a\u535a\u5ba2\" src=\"https:\/\/www.yeetrack.com\/?p=1176&#038;embed=true#?secret=6t0i1Cusjl#?secret=gyNUvxXcyH\" data-secret=\"gyNUvxXcyH\" width=\"600\" height=\"338\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe><\/div>\n<div class=\"video-container\">\n<blockquote class=\"wp-embedded-content\" data-secret=\"dV5oSOjzlK\"><p><a href=\"https:\/\/www.yeetrack.com\/?p=1177\">\u8d70\u8fd1Guava(\u516d): \u4e8b\u4ef6\u603b\u7ebfEventBus<\/a><\/p><\/blockquote>\n<p><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" title=\"\u300a\u8d70\u8fd1Guava(\u516d): \u4e8b\u4ef6\u603b\u7ebfEventBus\u300b\u2014\u7a7a\u7a7a\u535a\u5ba2\" src=\"https:\/\/www.yeetrack.com\/?p=1177&#038;embed=true#?secret=kpT2J01IEe#?secret=dV5oSOjzlK\" data-secret=\"dV5oSOjzlK\" width=\"600\" height=\"338\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe><\/div>\n<div class=\"video-container\">\n<blockquote class=\"wp-embedded-content\" data-secret=\"3zOH8nO84I\"><p><a href=\"https:\/\/www.yeetrack.com\/?p=1178\">\u8d70\u8fd1Guava(\u4e03): \u6587\u4ef6\u64cd\u4f5c<\/a><\/p><\/blockquote>\n<p><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" title=\"\u300a\u8d70\u8fd1Guava(\u4e03): \u6587\u4ef6\u64cd\u4f5c\u300b\u2014\u7a7a\u7a7a\u535a\u5ba2\" src=\"https:\/\/www.yeetrack.com\/?p=1178&#038;embed=true#?secret=1JRnNLPKGT#?secret=3zOH8nO84I\" data-secret=\"3zOH8nO84I\" width=\"600\" height=\"338\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe><\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u7f13\u5b58\uff1a MapMaker\u7c7b MapMaker\u4f5c\u4e3a\u5927\u591a\u6570\u57fa\u672c\u7f13\u5b58\u529f\u80fd\u5730\u63d0\u4f9b\u8005\u3002 ConcurrentMap&lt;String,Book&gt; books = new MapMaker().concu&#46;&#46;&#46;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"pgc_sgb_lightbox_settings":"","footnotes":""},"categories":[33],"tags":[65,8],"class_list":["post-1176","post","type-post","status-publish","format-standard","hentry","category-coding","tag-guava","tag-java"],"views":4671,"_links":{"self":[{"href":"https:\/\/www.yeetrack.com\/index.php?rest_route=\/wp\/v2\/posts\/1176","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.yeetrack.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.yeetrack.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.yeetrack.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.yeetrack.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1176"}],"version-history":[{"count":1,"href":"https:\/\/www.yeetrack.com\/index.php?rest_route=\/wp\/v2\/posts\/1176\/revisions"}],"predecessor-version":[{"id":1189,"href":"https:\/\/www.yeetrack.com\/index.php?rest_route=\/wp\/v2\/posts\/1176\/revisions\/1189"}],"wp:attachment":[{"href":"https:\/\/www.yeetrack.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1176"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.yeetrack.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1176"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.yeetrack.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1176"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}