-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathdump_formats.html
134 lines (134 loc) · 9.81 KB
/
dump_formats.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>WiredTiger: Dump Formats</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
$(document).ready(initResizable);
$(window).load(resizeHeight);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="wiredtiger.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectlogo"><a href="http://wiredtiger.com/"><img alt="Logo" src="LogoFinal-header.png" alt="WiredTiger" /></a></td>
<td style="padding-left: 0.5em;">
<div id="projectname">
 <span id="projectnumber">Version 2.9.2</span>
</div>
<div id="projectbrief"><!-- 2.9.2 --></div>
</td>
</tr>
</tbody>
</table>
</div>
<div class="banner">
<a href="https://github.com/wiredtiger/wiredtiger">Fork me on GitHub</a>
<a class="last" href="http://groups.google.com/group/wiredtiger-users">Join my user group</a>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.10 -->
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main Page</span></a></li>
<li class="current"><a href="pages.html"><span>Related Pages</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="examples.html"><span>Examples</span></a></li>
<li><a href="community.html"><span>Community</span></a></li>
<li><a href="license.html"><span>License</span></a></li>
</ul>
</div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('dump_formats.html','');});
</script>
<div id="doc-content">
<div class="header">
<div class="headertitle">
<div class="title">Dump Formats </div> </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><p>The <a class="el" href="command_line.html#util_dump">wt dump</a> command produces a flat-text representation of a table that can be loaded by <a class="el" href="command_line.html#util_load">wt load</a>. This page describes the output formats of the <a class="el" href="command_line.html#util_dump">wt dump</a> command.</p>
<h1><a class="anchor" id="dump_formats_json"></a>
JSON dump format</h1>
<p>JSON (<a href="http://www.json.org">JavaScript Object Notation</a>) dump files use the standard JSON data-interchange format to specify the objects, and may be interpreted by any JSON reader.</p>
<p>The format is a JSON object where each key is the URI passed to <a class="el" href="struct_w_t___s_e_s_s_i_o_n.html#a358ca4141d59c345f401c58501276bbb" title="Create a table, column group, index or file. ">WT_SESSION::create</a> and the corresponding value is a JSON array of two entries. The first entry in this array is a JSON object composed of configuration information: the "config" key has the configuration string used with <a class="el" href="struct_w_t___s_e_s_s_i_o_n.html#a358ca4141d59c345f401c58501276bbb" title="Create a table, column group, index or file. ">WT_SESSION::create</a>, the "colgroups" and "indices" keys have values that are arrays of objects that are in turn composed of configuration information. The second entry is a JSON array, with each entry an object representing a row of data. If the columns were named in the configuration string used with <a class="el" href="struct_w_t___s_e_s_s_i_o_n.html#a358ca4141d59c345f401c58501276bbb" title="Create a table, column group, index or file. ">WT_SESSION::create</a>, those names are used for keys, otherwise predictable names (for example, "key0", "value0", "value1") are generated. The values in this object are the values for each column in the record.</p>
<p>Here is some sample output:</p>
<div class="fragment"><div class="line">{</div>
<div class="line"> <span class="stringliteral">"table:planets"</span> : [</div>
<div class="line"> {</div>
<div class="line"> <span class="stringliteral">"config"</span> : <span class="stringliteral">"columns=(id,name,distance),key_format=i,value_format=Si"</span>,</div>
<div class="line"> <span class="stringliteral">"colgroups"</span> : [],</div>
<div class="line"> <span class="stringliteral">"indices"</span> : [</div>
<div class="line"> {</div>
<div class="line"> <span class="stringliteral">"uri"</span> : <span class="stringliteral">"index:planets:names"</span>,</div>
<div class="line"> <span class="stringliteral">"config"</span> : <span class="stringliteral">"columns=(name),key_format=Si,source=\"file:astronomy.wt\",type=file"</span></div>
<div class="line"> }</div>
<div class="line"> ]</div>
<div class="line"> },</div>
<div class="line"> [</div>
<div class="line"> {</div>
<div class="line"><span class="stringliteral">"id"</span> : 1,</div>
<div class="line"><span class="stringliteral">"name"</span> : <span class="stringliteral">"Mercury"</span>,</div>
<div class="line"><span class="stringliteral">"distance"</span> : 57910000</div>
<div class="line"> },</div>
<div class="line"> {</div>
<div class="line"><span class="stringliteral">"id"</span> : 2,</div>
<div class="line"><span class="stringliteral">"name"</span> : <span class="stringliteral">"Venus"</span>,</div>
<div class="line"><span class="stringliteral">"distance"</span> : 108200000</div>
<div class="line"> },</div>
<div class="line"> ...</div>
<div class="line"> ]</div>
<div class="line"> ]</div>
<div class="line">}</div>
</div><!-- fragment --><h1><a class="anchor" id="dump_formats_text"></a>
Text dump format</h1>
<p>Text dump files have three parts, a prefix, a header and a body.</p>
<p>The dump prefix includes basic information about the dump including the WiredTiger version that created the dump and the dump format. The dump format consists of a line beginning with <code>"Format="</code>, and contains the following information:</p>
<table class="doxtable">
<tr>
<th>String</th><th>Meaning </th></tr>
<tr>
<td>hex</td><td>the dumped data is in a hexadecimal dump format </td></tr>
<tr>
<td>print</td><td>the dumped data is in a printable format </td></tr>
</table>
<p>The dump header follows a single <code>"Header"</code> line in the file and consists of paired key and value lines, where the key is the URI passed to <a class="el" href="struct_w_t___s_e_s_s_i_o_n.html#a358ca4141d59c345f401c58501276bbb" title="Create a table, column group, index or file. ">WT_SESSION::create</a> and the value is corresponding configuration string. The table or file can be recreated by calling <a class="el" href="struct_w_t___s_e_s_s_i_o_n.html#a358ca4141d59c345f401c58501276bbb" title="Create a table, column group, index or file. ">WT_SESSION::create</a> for each pair of lines in the header.</p>
<p>The dump body follows a single <code>"Data"</code> line in the file and consists of a text representation of the records in the table. Each record is a represented by a pair of lines: the first line is the key and the second line is the value. These lines are encoded in one of two formats: a printable format and a hexadecimal format.</p>
<p>The printable format consists of literal printable characters, and hexadecimal encoded non-printable characters. Encoded characters are written as three separate characters: a backslash character followed by two hexadecimal characters (first the high nibble and then the low nibble). For example, a newline character in the ASCII character set would be encoded as <code>"\0a"</code> and an escape character would be encoded as <code>"\1b"</code>. Backslash characters which do not precede a hexadecimal encoding are paired, that is, the characters <code>"\\"</code> should be interpreted as a single backslash character.</p>
<p>The hexadecimal format consists of encoded characters, where each literal character is written as a pair of characters (first the high-nibble and then the low-nibble). For example, "0a" would be an ASCII newline character and "1b" would be an ASCII escape character.</p>
<p>Because the definition of "printable" may depend on the application's locale, dump files in the printable output format may be less portable than dump files in the hexadecimal output format. </p>
</div></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="index.html">Reference Guide</a></li><li class="navelem"><a class="el" href="command_line.html">WiredTiger command line utility</a></li>
<li class="footer">Copyright (c) 2008-2016 MongoDB, Inc. All rights reserved. Contact <a href="mailto:[email protected]">[email protected]</a> for more information.</li>
</ul>
</div>
</body>
</html>