2014-05-21 90 views
2

a little riak book 41,我試圖使用這些命令傾倒了環狀結構頁面上的說明:二郎打印整個數據結構

{ok,Ring} = riak_core_ring_manager:get_my_ring(). 
riak_core_ring:chash(Ring). 

它的工作原理,但數據被省略。前24個條目打印正確,但其餘的只是用橢圓替換...;見下文。

如何打印完整的戒指結構?

# riak attach 
Attempting to restart script through sudo -H -u riak 
Attaching to /tmp/riak/erlang.pipe.1 (^D to exit) 
{ok,Ring} = riak_core_ring_manager:get_my_ring(). 
{ok,{chstate_v2,'[email protected]', 
     [{'[email protected]',{693,63553468079}}, 
     {'[email protected]',{228,63553468008}}, 
     {'[email protected]',{131,63553468075}}], 
     {128, 
     [{0,'[email protected]'}, 
      {11417981541647679048466287755595961091061972992, 
      '[email protected]'}, 
      {22835963083295358096932575511191922182123945984, 
      '[email protected]'}, 
      {34253944624943037145398863266787883273185918976, 
      '[email protected]'}, 
      {45671926166590716193865151022383844364247891968, 
      '[email protected]'}, 
      {57089907708238395242331438777979805455309864960, 
      '[email protected]'}, 
      {68507889249886074290797726533575766546371837952, 
      '[email protected]'}, 
      {79925870791533753339264014289171727637433810944, 
      '[email protected]'}, 
      {91343852333181432387730302044767688728495783936, 
      '[email protected]'}, 
      {102761833874829111436196589800363649819557756928, 
      '[email protected]'}, 
      {114179815416476790484662877555959610910619729920, 
      '[email protected]'}, 
      {125597796958124469533129165311555572001681702912, 
      '[email protected]'}, 
      {137015778499772148581595453067151533092743675904, 
      '[email protected]'}, 
      {148433760041419827630061740822747494183805648896, 
      '[email protected]'}, 
      {159851741583067506678528028578343455274867621888, 
      '[email protected]'}, 
      {171269723124715185726994316333939416365929594880, 
      '[email protected]'}, 
      {182687704666362864775460604089535377456991567872, 
      '[email protected]'}, 
      {194105686208010543823926891845131338548053540864, 
      '[email protected]'}, 
      {205523667749658222872393179600727299639115513856, 
      '[email protected]'}, 
      {216941649291305901920859467356323260730177486848,...}, 
      {...}|...]}, 
% snip % 
([email protected])4> riak_core_ring:chash(Ring). 
{128, 
[{0,'[email protected]'}, 
    {11417981541647679048466287755595961091061972992, 
    '[email protected]'}, 
    {22835963083295358096932575511191922182123945984, 
    '[email protected]'}, 
    {34253944624943037145398863266787883273185918976, 
    '[email protected]'}, 
    {45671926166590716193865151022383844364247891968, 
    '[email protected]'}, 
    {57089907708238395242331438777979805455309864960, 
    '[email protected]'}, 
    {68507889249886074290797726533575766546371837952, 
    '[email protected]'}, 
    {79925870791533753339264014289171727637433810944, 
    '[email protected]'}, 
    {91343852333181432387730302044767688728495783936, 
    '[email protected]'}, 
    {102761833874829111436196589800363649819557756928, 
    '[email protected]'}, 
    {114179815416476790484662877555959610910619729920, 
    '[email protected]'}, 
    {125597796958124469533129165311555572001681702912, 
    '[email protected]'}, 
    {137015778499772148581595453067151533092743675904, 
    '[email protected]'}, 
    {148433760041419827630061740822747494183805648896, 
    '[email protected]'}, 
    {159851741583067506678528028578343455274867621888, 
    '[email protected]'}, 
    {171269723124715185726994316333939416365929594880, 
    '[email protected]'}, 
    {182687704666362864775460604089535377456991567872, 
    '[email protected]'}, 
    {194105686208010543823926891845131338548053540864, 
    '[email protected]'}, 
    {205523667749658222872393179600727299639115513856, 
    '[email protected]'}, 
    {216941649291305901920859467356323260730177486848, 
    '[email protected]'}, 
    {228359630832953580969325755111919221821239459840, 
    '[email protected]'}, 
    {239777612374601260017792042867515182912301432832, 
    '[email protected]'}, 
    {251195593916248939066258330623111144003363405824, 
    '[email protected]'}, 
    {262613575457896618114724618378707105094425378816, 
    '[email protected]'}, 
    {274031556999544297163190906134303066185487351808, 
    '[email protected]'}, 
    {285449538541191976211657193889899027276549324800,...}, 
    {...}|...]} 
([email protected])5> 

回答

7

如果您在shell中,則可以使用rp(Term)打印任意術語而不截斷。

+0

這很好,謝謝! –

+0

謝謝,這工作:'RingDetails = riak_core_ring:chash(Ring).'然後'rp(RingDetails).' – andrewdotn

3

這是一個控制檯美麗的打印機截斷輸出。所有你需要的是用普通的io:format("~p~n", [Ring]).打印這個值。

+1

如果環足夠大,'〜p'美麗的打印機也會截斷。 '〜P'會讓你在截斷之前增加深度。 – Joe