You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
arthas/assets/user-question-history15738....

7 lines
9.3 KiB
JavaScript

import{_ as c,o as h,c as i,b as s,w as t,a as e,d as l,e as a,r}from"./app.5024572d.js";const p={},u=l(`<h2 id="\u7528\u6237\u95EE\u9898" tabindex="-1"><a class="header-anchor" href="#\u7528\u6237\u95EE\u9898" aria-hidden="true">#</a> \u7528\u6237\u95EE\u9898 \uFF1A</h2><p>arthas\u5982\u4F55\u67E5\u770Bhashmap\u7684\u503C</p><hr><h2 id="\u4E13\u5BB6\u5B98\u65B9\u89E3\u7B54" tabindex="-1"><a class="header-anchor" href="#\u4E13\u5BB6\u5B98\u65B9\u89E3\u7B54" aria-hidden="true">#</a> \u4E13\u5BB6\u5B98\u65B9\u89E3\u7B54 \uFF1A</h2><p>\u4E3A\u4E86\u67E5\u770BHashMap\u7684\u503C\uFF0C\u4F60\u53EF\u4EE5\u5229\u7528Arthas\u63D0\u4F9B\u7684\u547D\u4EE4\u6765\u52A8\u6001\u5730\u68C0\u67E5\u548C\u64CD\u4F5CJava\u7A0B\u5E8F\u7684\u8FD0\u884C\u65F6\u72B6\u6001\u3002\u57FA\u4E8E\u5DF2\u6709\u7684\u77E5\u8BC6\uFF0C\u8FD9\u91CC\u662F\u4E00\u4E2A\u5206\u6B65\u9AA4\u7684\u6307\u5BFC\u6765\u5E2E\u52A9\u4F60\u5B8C\u6210\u8FD9\u4E00\u4EFB\u52A1\uFF1A</p><h3 id="\u6B65\u9AA4\u5206\u6790\u4E0E\u6267\u884C" tabindex="-1"><a class="header-anchor" href="#\u6B65\u9AA4\u5206\u6790\u4E0E\u6267\u884C" aria-hidden="true">#</a> \u6B65\u9AA4\u5206\u6790\u4E0E\u6267\u884C</h3><h4 id="_1-\u786E\u4FDDarthas\u5DF2\u5B89\u88C5\u5E76\u8FDE\u63A5\u5230\u76EE\u6807java\u8FDB\u7A0B" tabindex="-1"><a class="header-anchor" href="#_1-\u786E\u4FDDarthas\u5DF2\u5B89\u88C5\u5E76\u8FDE\u63A5\u5230\u76EE\u6807java\u8FDB\u7A0B" aria-hidden="true">#</a> 1. \u786E\u4FDDArthas\u5DF2\u5B89\u88C5\u5E76\u8FDE\u63A5\u5230\u76EE\u6807Java\u8FDB\u7A0B</h4><p>\u9996\u5148\uFF0C\u786E\u4FDD\u4F60\u5DF2\u7ECF\u6309\u7167Arthas\u7684\u5B89\u88C5\u6307\u5357\u6210\u529F\u5B89\u88C5\u4E86Arthas\uFF0C\u5E76\u4E14\u5DF2\u7ECF\u5C06\u5176\u8FDE\u63A5\u5230\u4E86\u4F60\u60F3\u8981\u89C2\u5BDF\u7684Java\u8FDB\u7A0B\u4E2D\u3002\u6839\u636E\u4E4B\u524D\u7684\u77E5\u8BC6\uFF0C\u4F60\u53EF\u4EE5\u91C7\u7528\u4EE5\u4E0B\u51E0\u79CD\u65B9\u5F0F\u4E4B\u4E00\u6765\u5B89\u88C5\u548C\u542F\u52A8Arthas\uFF1A</p><ul><li><strong>\u4F7F\u7528arthas-boot\u5B89\u88C5</strong>\uFF08\u63A8\u8350\uFF09<div class="language-bash ext-sh line-numbers-mode"><pre class="language-bash"><code><span class="token function">curl</span> <span class="token parameter variable">-O</span> https://arthas.aliyun.com/arthas-boot.jar
<span class="token function">java</span> <span class="token parameter variable">-jar</span> arthas-boot.jar
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div></div></div></li><li>\u6216\u8005\u4F7F\u7528\u4E00\u952E\u5B89\u88C5\u811A\u672C\uFF08Linux/Unix/Mac\uFF09:<div class="language-bash ext-sh line-numbers-mode"><pre class="language-bash"><code><span class="token function">curl</span> <span class="token parameter variable">-L</span> https://arthas.aliyun.com/install.sh <span class="token operator">|</span> <span class="token function">sh</span>
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div></li></ul><p>\u5B8C\u6210\u8FD9\u4E9B\u6B65\u9AA4\u540E\uFF0C\u4F60\u4F1A\u770B\u5230Arthas\u7684\u542F\u52A8\u4FE1\u606F\uFF0C\u8868\u660E\u5B83\u5DF2\u6210\u529F\u9644\u7740\u5230\u6307\u5B9A\u7684Java\u8FDB\u7A0B\u4E0A\u3002</p><h4 id="_2-\u4F7F\u7528arthas\u547D\u4EE4\u67E5\u770Bhashmap\u7684\u503C" tabindex="-1"><a class="header-anchor" href="#_2-\u4F7F\u7528arthas\u547D\u4EE4\u67E5\u770Bhashmap\u7684\u503C" aria-hidden="true">#</a> 2. \u4F7F\u7528Arthas\u547D\u4EE4\u67E5\u770BHashMap\u7684\u503C</h4><p>\u4E00\u65E6Arthas\u6210\u529F\u8FDE\u63A5\u5230\u76EE\u6807\u8FDB\u7A0B\uFF0C\u4F60\u53EF\u4EE5\u4F7F\u7528<code>watch</code>\u6216\u8005<code>dump</code>\u7B49\u547D\u4EE4\u6765\u67E5\u770BHashMap\u7684\u503C\u3002</p><ul><li><p><strong>\u4F7F\u7528<code>watch</code>\u547D\u4EE4\u76D1\u89C6HashMap\u7684\u53D8\u5316</strong></p><p>\u5982\u679C\u4F60\u60F3\u5728HashMap\u88AB\u8BBF\u95EE\u6216\u4FEE\u6539\u65F6\u67E5\u770B\u5176\u503C\uFF0C\u53EF\u4EE5\u4F7F\u7528<code>watch</code>\u547D\u4EE4\u3002\u4F60\u9700\u8981\u77E5\u9053HashMap\u5B9E\u4F8B\u7684\u53D8\u91CF\u540D\uFF08\u5047\u8BBE\u4E3A<code>myHashMap</code>\uFF09\u4EE5\u53CA\u4F60\u611F\u5174\u8DA3\u7684\u76D1\u542C\u70B9\uFF08\u4F8B\u5982\u65B9\u6CD5\u8C03\u7528\uFF09\u3002</p><div class="language-bash ext-sh line-numbers-mode"><pre class="language-bash"><code><span class="token function">watch</span> myHashMap get <span class="token string">&#39;map =&gt; map.entrySet().forEach(e =&gt; {print(e.getKey() + &quot;: &quot; + e.getValue());})&#39;</span>
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div><p>\u8FD9\u6BB5\u547D\u4EE4\u4F1A\u5728\u6BCF\u6B21<code>get</code>\u65B9\u6CD5\u88AB\u8C03\u7528\u65F6\uFF0C\u6253\u5370\u51FAHashMap\u7684\u6240\u6709\u952E\u503C\u5BF9\u3002</p></li><li><p><strong>\u4F7F\u7528<code>dump</code>\u547D\u4EE4\u83B7\u53D6\u9759\u6001\u5FEB\u7167</strong></p><p>\u5982\u679C\u4F60\u53EA\u60F3\u83B7\u53D6HashMap\u5F53\u524D\u7684\u72B6\u6001\uFF0C\u800C\u4E0D\u662F\u76D1\u63A7\u5176\u53D8\u5316\uFF0C\u53EF\u4EE5\u4F7F\u7528<code>dump</code>\u547D\u4EE4\u83B7\u53D6\u7C7B\u7684\u8BE6\u7EC6\u4FE1\u606F\uFF0C\u7136\u540E\u901A\u8FC7\u67E5\u8BE2\u8FD9\u4E2A\u5FEB\u7167\u6765\u67E5\u770BHashMap\u7684\u503C\u3002</p><div class="language-bash ext-sh line-numbers-mode"><pre class="language-bash"><code>dump className myHashMapId
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div><p>\u8FD9\u91CC\uFF0C<code>className</code>\u662F\u5305\u542BHashMap\u5B9E\u4F8B\u7684\u7C7B\u540D\uFF0C\u800C<code>myHashMapId</code>\u662F\u8BE5HashMap\u5BF9\u8C61\u5728\u5806\u4E2D\u7684ID\uFF0C\u8FD9\u4E24\u4E2A\u4FE1\u606F\u53EF\u4EE5\u901A\u8FC7\u5176\u4ED6Arthas\u547D\u4EE4\u5982<code>sm</code>\uFF08\u641C\u7D22\u65B9\u6CD5\uFF09\u6216<code>trace</code>\u521D\u6B65\u5B9A\u4F4D\u5F97\u5230\u3002</p></li></ul><h3 id="\u89E3\u91CA" tabindex="-1"><a class="header-anchor" href="#\u89E3\u91CA" aria-hidden="true">#</a> \u89E3\u91CA</h3><ul><li><strong><code>watch</code>\u547D\u4EE4</strong> \u5141\u8BB8\u4F60\u5728\u7279\u5B9A\u7684Java\u65B9\u6CD5\u6267\u884C\u524D\u540E\u6267\u884C\u81EA\u5B9A\u4E49\u7684Groovy\u811A\u672C\uFF0C\u8FD9\u5BF9\u4E8E\u89C2\u5BDF\u7279\u5B9A\u6761\u4EF6\u4E0B\u7684HashMap\u72B6\u6001\u975E\u5E38\u6709\u7528\u3002</li><li><strong><code>dump</code>\u547D\u4EE4</strong> \u63D0\u4F9B\u4E86\u4E00\u4E2A\u7C7B\u7684\u5B9E\u4F8B\u7684\u8BE6\u7EC6\u5185\u5B58\u5FEB\u7167\uFF0C\u901A\u8FC7\u8FD9\u4E2A\u5FEB\u7167\uFF0C\u4F60\u53EF\u4EE5\u6DF1\u5165\u5206\u6790\u5BF9\u8C61\u7684\u5185\u90E8\u7ED3\u6784\uFF0C\u5305\u62ECHashMap\u7684\u6240\u6709\u6761\u76EE\u3002</li></ul><p>\u8BF7\u6839\u636E\u5B9E\u9645\u60C5\u51B5\u9009\u62E9\u5408\u9002\u7684\u547D\u4EE4\uFF0C\u5E76\u66FF\u6362\u793A\u4F8B\u4E2D\u7684\u5360\u4F4D\u7B26\uFF08\u5982<code>myHashMap</code>\u3001<code>className</code>\u3001<code>myHashMapId</code>\uFF09\u4EE5\u5339\u914D\u4F60\u7684\u5B9E\u9645\u5E94\u7528\u573A\u666F\u3002</p>`,16),_=a("---------------"),m=e("h2",{id:"\u53C2\u8003\u94FE\u63A5",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#\u53C2\u8003\u94FE\u63A5","aria-hidden":"true"},"#"),a(" \u53C2\u8003\u94FE\u63A5 \uFF1A")],-1),b=a("\u4E13\u5BB6\u7ECF\u9A8C\uFF1AArthas \u5FEB\u901F\u542F\u52A8"),v=a("\u4E13\u5BB6\u7ECF\u9A8C\uFF1Aarthas \u4F60\u597D"),f=a("Arthas Install"),g=a("---------------"),x={id:"\u7B54\u7591\u670D\u52A1\u8BF4\u660E",tabindex:"-1"},H=e("a",{class:"header-anchor",href:"#\u7B54\u7591\u670D\u52A1\u8BF4\u660E","aria-hidden":"true"},"#",-1),M=a(),k=a("\u7B54\u7591\u670D\u52A1\u8BF4\u660E\uFF1A"),y=a("\u672C\u5185\u5BB9\u7ECF\u7531\u6280\u672F\u4E13\u5BB6\u5BA1\u9605\u7684\u7528\u6237\u95EE\u7B54\u7684\u955C\u50CF\u751F\u6210\uFF0C\u6211\u4EEC\u63D0\u4F9B\u4E86"),A=a("\u4E13\u5BB6\u667A\u80FD\u7B54\u7591\u670D\u52A1"),I=a("\uFF0C\u5728"),w=a("\u9875\u9762\u7684\u53F3\u4E0B\u7684\u6D6E\u7A97\u201D\u4E13\u5BB6\u7B54\u7591\u201C"),J=a("\u3002\u60A8\u4E5F\u53EF\u4EE5\u8BBF\u95EE : "),N={href:"https://answer.opensource.alibaba.com/docs/intro",target:"_blank",rel:"noopener noreferrer"},j=a("\u5168\u5C40\u4E13\u5BB6\u7B54\u7591"),F=a(" \u3002 \u54A8\u8BE2\u5176\u4ED6\u4EA7\u54C1\u7684\u7684\u95EE\u9898"),L=e("h3",{id:"\u53CD\u9988",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#\u53CD\u9988","aria-hidden":"true"},"#"),a(" \u53CD\u9988")],-1),q=a("\u5982\u95EE\u7B54\u6709\u9519\u6F0F\uFF0C\u6B22\u8FCE\u70B9\uFF1A"),E={href:"https://ai.nacos.io/user/feedbackByEnhancerGradePOJOID?enhancerGradePOJOId=16095",target:"_blank",rel:"noopener noreferrer"},O=a("\u5DEE\u8BC4"),V=a("\u7ED9\u6211\u4EEC\u53CD\u9988\u3002");function B(G,C){const o=r("font"),n=r("RouterLink"),d=r("ExternalLinkIcon");return h(),i("div",null,[u,s(o,{color:"#949494"},{default:t(()=>[_]),_:1}),m,e("p",null,[s(n,{to:"/doc/expert/user-question-history11440.html"},{default:t(()=>[b]),_:1})]),e("p",null,[s(n,{to:"/doc/expert/user-question-history11442.html"},{default:t(()=>[v]),_:1})]),e("p",null,[s(n,{to:"/doc/install-detail.html"},{default:t(()=>[f]),_:1})]),s(o,{color:"#949494"},{default:t(()=>[g]),_:1}),e("h2",x,[H,M,s(o,{color:"#FF0000"},{default:t(()=>[k]),_:1})]),e("p",null,[y,s(o,{color:"#FF0000"},{default:t(()=>[A]),_:1}),I,s(o,{color:"#FF0000"},{default:t(()=>[w]),_:1}),J,e("a",N,[j,s(d)]),F]),L,e("p",null,[q,e("a",E,[O,s(d)]),V])])}const P=c(p,[["render",B],["__file","user-question-history15738.html.vue"]]);export{P as default};