{"id":214,"date":"2011-05-22T01:16:58","date_gmt":"2011-05-21T17:16:58","guid":{"rendered":"http:\/\/guoh.ai\/lifelog\/?p=214"},"modified":"2011-05-22T01:45:25","modified_gmt":"2011-05-21T17:45:25","slug":"multiple-consumers-problem","status":"publish","type":"post","link":"https:\/\/guoh.ai\/lifelog\/2011\/05\/multiple-consumers-problem\/","title":{"rendered":"Java\u591a\u7ebf\u7a0b\u6d88\u8d39\u8005\u95ee\u9898"},"content":{"rendered":"<p>\u6709\u4e00\u4e2a\u7b80\u5355\u7684\u573a\u666f\uff1a\u4e00\u4e2aQueue\uff0c\u5305\u542b\u5f88\u591aTask\uff0c\u73b0\u5728\u7684\u7a0b\u5e8f\u8981\u53bbQueue\u4e2d\u53d6Task\u6765\u6267\u884c<br \/>\n\u53d6\u7684\u65f6\u5019\u662f\u591a\u7ebf\u7a0b\u53bb\u53d6\u7684\uff0c\u4f46\u662f\u4e00\u65e6\u6709\u4e2a\u7ebf\u7a0b\u62ff\u5230Queue\u4e2d\u7684\u67d0\u4e2aTask\uff0c\u5176\u4ed6\u7ebf\u7a0b\u5c31\u5fc5\u987b\u9000\u51fa<\/p>\n<p>\u62ff\u5230Task\u7684\u7ebf\u7a0b\u6839\u636eTask\u91cc\u9762\u7684\u5185\u5bb9\uff0c\u5c06\u5177\u4f53\u5de5\u4f5c(\u56e0\u4e3a\u4e00\u4e2aTask\u4e2d\u53ef\u80fd\u5b58\u5728\u591a\u4e2a\u5177\u4f53\u7684\u5de5\u4f5c)\u5206\u53d1\u7ed9\u6700\u7ec8\u7684\u5de5\u4f5c\u6267\u884c\u7ebf\u7a0b(ProductionLineA\u6216\u8005ProductionLineB)\u53bb\u6267\u884c\uff0c\u5de5\u4f5c\u6267\u884c\u7ebf\u7a0b\u6267\u884c\u5b8c\u4e00\u4e2a\u5177\u4f53\u7684\u5de5\u4f5c\u540e\u5c31\u628a\u4fe1\u606f\u66f4\u65b0\u5230Task\u4e2d\u53bb\uff0c\u62ff\u5230Task\u7684\u7ebf\u7a0b\u4f1a\u4e0d\u65ad\u68c0\u6d4b\u5f53\u524dTask\u91cc\u9762\u7684\u5177\u4f53\u5de5\u4f5c\u662f\u5426\u90fd\u6267\u884c\u5b8c\u6bd5\uff0c\u5982\u679c\u5b8c\u6bd5\uff0c\u62ff\u5230Task\u7684\u7ebf\u7a0b\u9000\u51fa\uff0cTask\u4e5f\u4f1a\u4ece\u961f\u5217\u4e2d\u9500\u6bc1<\/p>\n<p>\u901a\u4fd7\u7684\u6765\u8bb2\u4e5f\u5c31\u662f\u591a\u7ebf\u7a0b\u62a2\u4efb\u52a1\uff0c\u62a2\u5230\u4e00\u4e2a\u4efb\u52a1\u540e\uff0c\u628a\u5177\u4f53\u7684\u5de5\u4f5c\u5206\u7ed9\u591a\u4e2a\u7ebf\u7a0b\u53bb\u6267\u884c\uff0c\u5b83\u8fd8\u53ef\u4ee5\u56de\u6765\u7ee7\u7eed\u62a2\u5176\u4ed6\u7684\u4efb\u52a1<\/p>\n<p>\u6ce8\u610f\u70b9<br \/>\n1\u3001\u62a2\u4efb\u52a1\u7684\u65f6\u5019\u53ef\u4ee5\u6709\u591a\u4e2a\u7ebf\u7a0b\u53bb\u62a2\uff0c\u4f46\u662f\u6700\u7ec8\u4e00\u4e2a\u4efb\u52a1\u53ea\u80fd\u6709\u4e00\u4e2a\u7ebf\u7a0b\u62ff\u5230\uff0c\u4e5f\u5c31\u662f\u6267\u884c\u4efb\u52a1\u5206\u53d1\u7684\u90a3\u6bb5\u4ee3\u7801\u53ea\u80fd\u7531\u67d0\u4e2a\u7ebf\u7a0b\u6267\u884c\u4e00\u6b21\uff0c\u5426\u5219\u5230\u540e\u9762\u5177\u4f53\u7684\u5de5\u4f5c\u53ef\u80fd\u88ab\u6267\u884c\u591a\u6b21<br \/>\n\u6240\u4ee5\u5bf9\u5df2\u7ecf\u62a2\u5230\u7684\u4efb\u52a1\u6253\u6807\u8bb0\u8981\u53ea\u80fd\u6253\u4e00\u6b21\uff0c\u4e0d\u80fd\u5b58\u5728A\u7ebf\u7a0b\u5224\u65ad\u7684\u65f6\u5019\u6807\u8bb0\u6ca1\u6709\u88ab\u6253\u4e0a\uff0cB\u7ebf\u7a0b\u5224\u65ad\u4e5f\u6ca1\u6709\uff0cA\u6253\u6807\u8bb0\uff0cB\u4e5f\u6253\u6807\u8bb0\uff0c\u8fd9\u4e2a\u5230\u540e\u9762\u80af\u5b9a\u5c31\u4e71\u4e86\uff0c\u7528double check\u6765\u5b9e\u73b0\uff1f<br \/>\n2\u3001\u5de5\u4f5c\u6267\u884c\u7ebf\u7a0b\u9700\u8981\u628a\u6267\u884c\u5b8c\u7684\u60c5\u51b5\u66f4\u65b0\u5230Task\u4e2d\u53bb\uff0c\u5982\u679c\u7b2c1\u70b9\u4e2d\u5177\u4f53\u5de5\u4f5c\u5206\u6b63\u786e\u4e86\uff0c\u8fd9\u91cc\u5e94\u8be5\u80fd\u4fdd\u8bc1\u4e0d\u4f1a\u6709\u591a\u4e2a\u7ebf\u7a0b\u6267\u884c\u540c\u6837\u7684\u5177\u4f53\u5de5\u4f5c\uff0c\u6240\u4ee5\u628a\u6267\u884c\u5b8c\u7684\u60c5\u51b5\u5199\u56deTask\u7684\u65f6\u5019\u4e0d\u7528\u540c\u6b65\u4fdd\u8bc1\u4e5f\u884c<\/p>\n<p>\u76ee\u524d\u4efb\u52a1\u6807\u8bb0\u7528\u7684\u662fThread\uff0c\u8fd9\u4e2a\u662f\u4e0d\u662f\u4e0d\u5408\u9002\uff1f<br \/>\n\u68c0\u6d4b\u662f\u5426\u6267\u884c\u5b8c\u6bd5\u7684\u4ee3\u7801\u662f\u5355\u7ebf\u7a0b\u7684\uff0c\u89c1WatchDog\u7c7b\uff0c\u76ee\u524d\u8fd8\u7f3a\u8d85\u65f6\u68c0\u6d4b\uff0c\u591a\u7ebf\u7a0b\u7684\u68c0\u6d4b\u6709\u6ca1\u6709\u5fc5\u8981\uff1f<br \/>\n\u9501\u52a0\u7684\u6070\u4e0d\u6070\u5f53\uff1f<\/p>\n<p>\u591a\u7ebf\u7a0b\u7684\u4ee3\u7801\u786e\u5b9e\u6bd4\u8f83\u96be\u7f16\u5199\u548c\u8c03\u8bd5<\/p>\n<p>\u76ee\u524d\u6211\u5b9e\u73b0\u4e86\u4e00\u4e2a\u4ee3\u7801\uff0c\u770b\u4f3c\u6ca1\u6709\u95ee\u9898\uff0c\u901a\u8fc7\u6d4b\u8bd5\uff0c\u5206\u6790\u65e5\u5fd7\uff0c\u53d1\u73b0\u90fd\u8fd8\u6b63\u5e38<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\t\t\tLock lock = new ReentrantLock();\r\n\t\t\tlock.tryLock();\r\n\t\t\t\/\/ critical area start\r\n\t\t\tif (null != task.getExclusive()\r\n\t\t\t\t\t&amp;&amp; task.getExclusive() != Thread.currentThread()) {\r\n\t\t\t\t\/\/ \u5982\u679c\u6709\u4eba\u5360\u4e86\uff0c\u90a3\u4e48\u81ea\u52a8\u9000\u51fa\r\n\t\t\t\t\/\/ \u8fd9\u91cc\u600e\u4e48\u5b9e\u73b0\u6bd4\u8f83\u597d\uff1f\r\n\t\t\t\tcontinue;\r\n\t\t\t} else {\r\n\t\t\t\tif (null == task.getExclusive()) {\r\n\t\t\t\t\ttask.setExclusive(Thread.currentThread());\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\/\/ critical area end\r\n\t\t\tlock.unlock();<\/pre>\n<p>\u5173\u952e\u4ee3\u7801\u4e2d\uff0c\u76ee\u524d\u8fd9\u4e00\u6bb5\u56e0\u8be5\u8fd8\u6709\u4fee\u6539\u7684\u7a7a\u95f4<\/p>\n<p>\u8fd0\u884c\u6587\u4ef6<a href=\"https:\/\/github.com\/guohai\/multiple-consumers-problem\/blob\/master\/misc\/run.sh\" target=\"_blank\">run.sh<\/a><br \/>\n\u65e5\u5fd7\u5206\u6790<a href=\"https:\/\/github.com\/guohai\/multiple-consumers-problem\/blob\/master\/misc\/LogAnalyzer.java\" target=\"_blank\">LogAnalyzer.java<\/a>\uff0c\u76ee\u524d\u53ea\u80fd\u8bf4\u662f\u5927\u6982\u7684\u5206\u6790\u6709\u6ca1\u6709\u660e\u663e\u51fa\u9519\u7684\u5730\u65b9\uff0c\u6bd4\u5982\u6267\u884c\u7684\u6570\u91cf\u5bf9\u4e0d\u5bf9<\/p>\n<p>\u65e5\u5fd7\uff1a<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">queue has 60 wks\r\ncan only be executed 10 times...\r\ncan only be executed 10 times...\r\ncan only be executed 10 times...\r\ncan only be executed 10 times...\r\ncan only be executed 10 times...\r\ncan only be executed 10 times...\r\ncan only be executed 10 times...\r\ncan only be executed 10 times...\r\ncan only be executed 10 times...\r\nshan$evol in task&#x5B;2] is executing by ProductionLineB...\r\nshan$love in task&#x5B;8] is executing by ProductionLineA...\r\nshan$love in task&#x5B;3] is executing by ProductionLineA...\r\ncan only be executed 10 times...\r\nshan$love in task&#x5B;0] is executing by ProductionLineA...\r\nshan$vole in task&#x5B;3] is executing by ProductionLineB...\r\nshan$elvo in task&#x5B;8] is executing by ProductionLineB...\r\nshan$ovel in task&#x5B;8] is executing by ProductionLineB...\r\nshan$vole in task&#x5B;8] is executing by ProductionLineB...\r\nshan$love in task&#x5B;5] is executing by ProductionLineA...\r\nshan$love in task&#x5B;5] is executing by ProductionLineA...\r\nshan$love in task&#x5B;4] is executing by ProductionLineA...\r\nshan$love in task&#x5B;7] is executing by ProductionLineA...\r\nshan$leov in task&#x5B;8] is executing by ProductionLineB...\r\nshan$elvo in task&#x5B;4] is executing by ProductionLineB...\r\nshan$ovel in task&#x5B;4] is executing by ProductionLineB...\r\nshan$vole in task&#x5B;4] is executing by ProductionLineB...\r\nshan$leov in task&#x5B;4] is executing by ProductionLineB...\r\nshan$ovel in task&#x5B;5] is executing by ProductionLineB...\r\nshan$evol in task&#x5B;5] is executing by ProductionLineB...\r\nshan$elvo in task&#x5B;5] is executing by ProductionLineB...\r\nshan$vole in task&#x5B;1] is executing by ProductionLineB...\r\nshan$ovel in task&#x5B;1] is executing by ProductionLineB...\r\nshan$leov in task&#x5B;1] is executing by ProductionLineB...\r\nshan$evol in task&#x5B;1] is executing by ProductionLineB...\r\nshan$vole in task&#x5B;6] is executing by ProductionLineB...\r\nshan$evol in task&#x5B;3] is executing by ProductionLineB...\r\nshan$elvo in task&#x5B;7] is executing by ProductionLineB...\r\nshan$ovel in task&#x5B;7] is executing by ProductionLineB...\r\nshan$leov in task&#x5B;7] is executing by ProductionLineB...\r\nshan$love in task&#x5B;9] is executing by ProductionLineA...\r\nshan$evol in task&#x5B;7] is executing by ProductionLineB...\r\nshan$ovel in task&#x5B;6] is executing by ProductionLineB...\r\ntask0 is done...\r\nshan$evol in task&#x5B;6] is executing by ProductionLineB...\r\nshan$vole in task&#x5B;9] is executing by ProductionLineB...\r\nshan$leov in task&#x5B;6] is executing by ProductionLineB...\r\nshan$evol in task&#x5B;9] is executing by ProductionLineB...\r\nshan$ovel in task&#x5B;5] is executing by ProductionLineB...\r\nshan$leov in task&#x5B;4] is executing by ProductionLineB...\r\nshan$leov in task&#x5B;8] is executing by ProductionLineB...\r\nshan$leov in task&#x5B;1] is executing by ProductionLineB...\r\ntask2 is done...\r\nshan$elvo in task&#x5B;7] is executing by ProductionLineB...\r\nshan$evol in task&#x5B;5] is executing by ProductionLineB...\r\nshan$ovel in task&#x5B;7] is executing by ProductionLineB...\r\nshan$elvo in task&#x5B;5] is executing by ProductionLineB...\r\nshan$evol in task&#x5B;3] is executing by ProductionLineB...\r\nshan$evol in task&#x5B;6] is executing by ProductionLineB...\r\nshan$vole in task&#x5B;1] is executing by ProductionLineB...\r\nshan$ovel in task&#x5B;1] is executing by ProductionLineB...\r\nshan$vole in task&#x5B;9] is executing by ProductionLineB...\r\nshan$evol in task&#x5B;7] is executing by ProductionLineB...\r\nshan$vole in task&#x5B;6] is executing by ProductionLineB...\r\nshan$evol in task&#x5B;9] is executing by ProductionLineB...\r\nshan$leov in task&#x5B;8] is executing by ProductionLineB...\r\ntask4 is done...\r\nshan$evol in task&#x5B;5] is executing by ProductionLineB...\r\nshan$vole in task&#x5B;1] is executing by ProductionLineB...\r\nshan$ovel in task&#x5B;1] is executing by ProductionLineB...\r\ntask3 is done...\r\nshan$evol in task&#x5B;7] is executing by ProductionLineB...\r\ntask6 is done...\r\nshan$leov in task&#x5B;8] is executing by ProductionLineB...\r\ntask9 is done...\r\ntask5 is done...\r\nshan$vole in task&#x5B;1] is executing by ProductionLineB...\r\nshan$evol in task&#x5B;7] is executing by ProductionLineB...\r\ntask8 is done...\r\ntask1 is done...\r\ntask7 is done...<\/pre>\n<p>\u5b8c\u6574\u6e90\u7801\uff1a<br \/>\n<a href=\"https:\/\/github.com\/guohai\/multiple-consumers-problem\" target=\"_blank\">multiple-consumers-problem<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6709\u4e00\u4e2a\u7b80\u5355\u7684\u573a\u666f\uff1a\u4e00\u4e2aQueue\uff0c\u5305\u542b\u5f88\u591aTask\uff0c\u73b0\u5728\u7684\u7a0b\u5e8f\u8981\u53bbQueue\u4e2d\u53d6Task\u6765\u6267\u884c \u53d6\u7684\u65f6\u5019\u662f\u591a\u7ebf\u7a0b\u53bb\u53d6\u7684\uff0c\u4f46\u662f\u4e00\u65e6\u6709\u4e2a\u7ebf\u7a0b\u62ff\u5230Queue\u4e2d\u7684\u67d0\u4e2aTask\uff0c\u5176\u4ed6\u7ebf\u7a0b\u5c31\u5fc5\u987b\u9000\u51fa \u62ff\u5230Task\u7684\u7ebf\u7a0b\u6839\u636eTask\u91cc\u9762\u7684\u5185\u5bb9\uff0c\u5c06\u5177\u4f53\u5de5\u4f5c(\u56e0\u4e3a\u4e00\u4e2aTask\u4e2d\u53ef\u80fd\u5b58\u5728\u591a\u4e2a\u5177\u4f53\u7684\u5de5\u4f5c)\u5206\u53d1\u7ed9\u6700\u7ec8\u7684\u5de5\u4f5c\u6267\u884c\u7ebf\u7a0b(ProductionLineA\u6216\u8005ProductionLineB)\u53bb\u6267\u884c\uff0c\u5de5\u4f5c\u6267\u884c\u7ebf\u7a0b\u6267\u884c\u5b8c\u4e00\u4e2a\u5177\u4f53\u7684\u5de5\u4f5c\u540e\u5c31\u628a\u4fe1\u606f\u66f4\u65b0\u5230Task\u4e2d\u53bb\uff0c\u62ff\u5230Task\u7684\u7ebf\u7a0b\u4f1a\u4e0d\u65ad\u68c0\u6d4b\u5f53\u524dTask\u91cc\u9762\u7684\u5177\u4f53\u5de5\u4f5c\u662f\u5426\u90fd\u6267\u884c\u5b8c\u6bd5\uff0c\u5982\u679c\u5b8c\u6bd5\uff0c\u62ff\u5230Task\u7684\u7ebf\u7a0b\u9000\u51fa\uff0cTask\u4e5f\u4f1a\u4ece\u961f\u5217\u4e2d\u9500\u6bc1 \u901a\u4fd7\u7684\u6765\u8bb2\u4e5f\u5c31\u662f\u591a\u7ebf\u7a0b\u62a2\u4efb\u52a1\uff0c\u62a2\u5230\u4e00\u4e2a\u4efb\u52a1\u540e\uff0c\u628a\u5177\u4f53\u7684\u5de5\u4f5c\u5206\u7ed9\u591a\u4e2a\u7ebf\u7a0b\u53bb\u6267\u884c\uff0c\u5b83\u8fd8\u53ef\u4ee5\u56de\u6765\u7ee7\u7eed\u62a2\u5176\u4ed6\u7684\u4efb\u52a1 \u6ce8\u610f\u70b9 1\u3001\u62a2\u4efb\u52a1\u7684\u65f6\u5019\u53ef\u4ee5\u6709\u591a\u4e2a\u7ebf\u7a0b\u53bb\u62a2\uff0c\u4f46\u662f\u6700\u7ec8\u4e00\u4e2a\u4efb\u52a1\u53ea\u80fd\u6709\u4e00\u4e2a\u7ebf\u7a0b\u62ff\u5230\uff0c\u4e5f\u5c31\u662f\u6267\u884c\u4efb\u52a1\u5206\u53d1\u7684\u90a3\u6bb5\u4ee3\u7801\u53ea\u80fd\u7531\u67d0\u4e2a\u7ebf\u7a0b\u6267\u884c\u4e00\u6b21\uff0c\u5426\u5219\u5230\u540e\u9762\u5177\u4f53\u7684\u5de5\u4f5c\u53ef\u80fd\u88ab\u6267\u884c\u591a\u6b21 \u6240\u4ee5\u5bf9\u5df2\u7ecf\u62a2\u5230\u7684\u4efb\u52a1\u6253\u6807\u8bb0\u8981\u53ea\u80fd\u6253\u4e00\u6b21\uff0c\u4e0d\u80fd\u5b58\u5728A\u7ebf\u7a0b\u5224\u65ad\u7684\u65f6\u5019\u6807\u8bb0\u6ca1\u6709\u88ab\u6253\u4e0a\uff0cB\u7ebf\u7a0b\u5224\u65ad\u4e5f\u6ca1\u6709\uff0cA\u6253\u6807\u8bb0\uff0cB\u4e5f\u6253\u6807\u8bb0\uff0c\u8fd9\u4e2a\u5230\u540e\u9762\u80af\u5b9a\u5c31\u4e71\u4e86\uff0c\u7528double check\u6765\u5b9e\u73b0\uff1f 2\u3001\u5de5\u4f5c\u6267\u884c\u7ebf\u7a0b\u9700\u8981\u628a\u6267\u884c\u5b8c\u7684\u60c5\u51b5\u66f4\u65b0\u5230Task\u4e2d\u53bb\uff0c\u5982\u679c\u7b2c1\u70b9\u4e2d\u5177\u4f53\u5de5\u4f5c\u5206\u6b63\u786e\u4e86\uff0c\u8fd9\u91cc\u5e94\u8be5\u80fd\u4fdd\u8bc1\u4e0d\u4f1a\u6709\u591a\u4e2a\u7ebf\u7a0b\u6267\u884c\u540c\u6837\u7684\u5177\u4f53\u5de5\u4f5c\uff0c\u6240\u4ee5\u628a\u6267\u884c\u5b8c\u7684\u60c5\u51b5\u5199\u56deTask\u7684\u65f6\u5019\u4e0d\u7528\u540c\u6b65\u4fdd\u8bc1\u4e5f\u884c \u76ee\u524d\u4efb\u52a1\u6807\u8bb0\u7528\u7684\u662fThread\uff0c\u8fd9\u4e2a\u662f\u4e0d\u662f\u4e0d\u5408\u9002\uff1f \u68c0\u6d4b\u662f\u5426\u6267\u884c\u5b8c\u6bd5\u7684\u4ee3\u7801\u662f\u5355\u7ebf\u7a0b\u7684\uff0c\u89c1WatchDog\u7c7b\uff0c\u76ee\u524d\u8fd8\u7f3a\u8d85\u65f6\u68c0\u6d4b\uff0c\u591a\u7ebf\u7a0b\u7684\u68c0\u6d4b\u6709\u6ca1\u6709\u5fc5\u8981\uff1f \u9501\u52a0\u7684\u6070\u4e0d\u6070\u5f53\uff1f \u591a\u7ebf\u7a0b\u7684\u4ee3\u7801\u786e\u5b9e\u6bd4\u8f83\u96be\u7f16\u5199\u548c\u8c03\u8bd5 \u76ee\u524d\u6211\u5b9e\u73b0\u4e86\u4e00\u4e2a\u4ee3\u7801\uff0c\u770b\u4f3c\u6ca1\u6709\u95ee\u9898\uff0c\u901a\u8fc7\u6d4b\u8bd5\uff0c\u5206\u6790\u65e5\u5fd7\uff0c\u53d1\u73b0\u90fd\u8fd8\u6b63\u5e38 Lock lock = new ReentrantLock(); lock.tryLock(); \/\/ critical area start if (null != task.getExclusive() &amp;&amp; task.getExclusive() != Thread.currentThread()) { \/\/ \u5982\u679c\u6709\u4eba\u5360\u4e86\uff0c\u90a3\u4e48\u81ea\u52a8\u9000\u51fa \/\/ \u8fd9\u91cc\u600e\u4e48\u5b9e\u73b0\u6bd4\u8f83\u597d\uff1f continue; } else { if (null == task.getExclusive()) { task.setExclusive(Thread.currentThread()); } } \/\/ critical area end lock.unlock(); \u5173\u952e\u4ee3\u7801\u4e2d\uff0c\u76ee\u524d\u8fd9\u4e00\u6bb5\u56e0\u8be5\u8fd8\u6709\u4fee\u6539\u7684\u7a7a\u95f4 &hellip; <a href=\"https:\/\/guoh.ai\/lifelog\/2011\/05\/multiple-consumers-problem\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Java\u591a\u7ebf\u7a0b\u6d88\u8d39\u8005\u95ee\u9898<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_gfmr_meta_descriptions":[],"_gfmr_multilingual_taxonomy_terms":[],"footnotes":""},"categories":[4],"tags":[],"class_list":["post-214","post","type-post","status-publish","format-standard","hentry","category-java"],"_links":{"self":[{"href":"https:\/\/guoh.ai\/lifelog\/wp-json\/wp\/v2\/posts\/214","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/guoh.ai\/lifelog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/guoh.ai\/lifelog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/guoh.ai\/lifelog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/guoh.ai\/lifelog\/wp-json\/wp\/v2\/comments?post=214"}],"version-history":[{"count":3,"href":"https:\/\/guoh.ai\/lifelog\/wp-json\/wp\/v2\/posts\/214\/revisions"}],"predecessor-version":[{"id":217,"href":"https:\/\/guoh.ai\/lifelog\/wp-json\/wp\/v2\/posts\/214\/revisions\/217"}],"wp:attachment":[{"href":"https:\/\/guoh.ai\/lifelog\/wp-json\/wp\/v2\/media?parent=214"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/guoh.ai\/lifelog\/wp-json\/wp\/v2\/categories?post=214"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/guoh.ai\/lifelog\/wp-json\/wp\/v2\/tags?post=214"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}