http://git-wip-us.apache.org/repos/asf/arrow-site/blob/4c7c2f1b/docs/cpp/logging_8h_source.html ---------------------------------------------------------------------- diff --git a/docs/cpp/logging_8h_source.html b/docs/cpp/logging_8h_source.html index fe536d7..a1fc48c 100644 --- a/docs/cpp/logging_8h_source.html +++ b/docs/cpp/logging_8h_source.html @@ -70,7 +70,7 @@ $(function() { <div class="title">logging.h</div> </div> </div><!--header--> <div class="contents"> -<a href="logging_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> <span class="comment">// Licensed to the Apache Software Foundation (ASF) under one</span></div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span> <span class="comment">// or more contributor license agreements. See the NOTICE file</span></div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span> <span class="comment">// distributed with this work for additional information</span></div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span> <span class="comment">// regarding copyright ownership. The ASF licenses this file</span></div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span> <span class="comment">// to you under the Apache License, Version 2.0 (the</span></div><div class="line"><a name="l00006"></a><span class ="lineno"> 6</span> <span class="comment">// "License"); you may not use this file except in compliance</span></div><div class="line"><a name="l00007"></a><span class="lineno"> 7</span> <span class="comment">// with the License. You may obtain a copy of the License at</span></div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span> <span class="comment">//</span></div><div class="line"><a name="l00009"></a><span class="lineno"> 9</span> <span class="comment">// http://www.apache.org/licenses/LICENSE-2.0</span></div><div class="line"><a name="l00010"></a><span class="lineno"> 10</span> <span class="comment">//</span></div><div class="line"><a name="l00011"></a><span class="lineno"> 11</span> <span class="comment">// Unless required by applicable law or agreed to in writing,</span></div><div class="line"><a name="l00012"></a><span class="lineno"> 12</span> <span class="comment">// software distributed u nder the License is distributed on an</span></div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span> <span class="comment">// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY</span></div><div class="line"><a name="l00014"></a><span class="lineno"> 14</span> <span class="comment">// KIND, either express or implied. See the License for the</span></div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span> <span class="comment">// specific language governing permissions and limitations</span></div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span> <span class="comment">// under the License.</span></div><div class="line"><a name="l00017"></a><span class="lineno"> 17</span> </div><div class="line"><a name="l00018"></a><span class="lineno"> 18</span> <span class="preprocessor">#ifndef ARROW_UTIL_LOGGING_H</span></div><div class="line"><a name="l00019"></a><span class="lineno" > 19</span> <span class="preprocessor">#define > ARROW_UTIL_LOGGING_H</span></div><div class="line"><a > name="l00020"></a><span class="lineno"> 20</span> </div><div > class="line"><a name="l00021"></a><span class="lineno"> > 21</span> <span class="preprocessor">#include > <cstdlib></span></div><div class="line"><a name="l00022"></a><span > class="lineno"> 22</span> <span class="preprocessor">#include > <iostream></span></div><div class="line"><a name="l00023"></a><span > class="lineno"> 23</span> </div><div class="line"><a > name="l00024"></a><span class="lineno"> 24</span> <span > class="preprocessor">#include "<a class="code" > href="macros_8h.html">arrow/util/macros.h</a>"</span></div><div > class="line"><a name="l00025"></a><span class="lineno"> > 25</span> </div><div class="line"><a name="l00026"></a><span > class="lineno"> 26</span> <span class="keyword">namespace </span><a > class="code" href="namespacearrow.html">arrow</a> {</ div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span> </div><div class="line"><a name="l00028"></a><span class="lineno"> 28</span> <span class="comment">// Stubbed versions of macros defined in glog/logging.h, intended for</span></div><div class="line"><a name="l00029"></a><span class="lineno"> 29</span> <span class="comment">// environments where glog headers aren't available.</span></div><div class="line"><a name="l00030"></a><span class="lineno"> 30</span> <span class="comment">//</span></div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span> <span class="comment">// Add more as needed.</span></div><div class="line"><a name="l00032"></a><span class="lineno"> 32</span> </div><div class="line"><a name="l00033"></a><span class="lineno"> 33</span> <span class="comment">// Log levels. LOG ignores them, so their values are abitrary.</span></div><div class="line"><a name="l00034"></a><span clas s="lineno"> 34</span> </div><div class="line"><a name="l00035"></a><span class="lineno"><a class="line" href="logging_8h.html#a3057840b0de9d217fdcedddc615295ad"> 35</a></span> <span class="preprocessor">#define ARROW_DEBUG (-1)</span></div><div class="line"><a name="l00036"></a><span class="lineno"><a class="line" href="logging_8h.html#a0670d4558bbb40d053bf4d0698f0a1ea"> 36</a></span> <span class="preprocessor">#define ARROW_INFO 0</span></div><div class="line"><a name="l00037"></a><span class="lineno"><a class="line" href="logging_8h.html#a4f604f658bd8290bc50f1f06119076c3"> 37</a></span> <span class="preprocessor">#define ARROW_WARNING 1</span></div><div class="line"><a name="l00038"></a><span class="lineno"><a class="line" href="logging_8h.html#a8049c0e4c54326ace670750e2b8716d0"> 38</a></span> <span class="preprocessor">#define ARROW_ERROR 2</span></div><div class="line"><a name="l00039"></a><span class="lineno"><a class="line" href="logging_8h.h tml#a12f356b9b859fe60b5fcc906ba71b718"> 39</a></span> <span class="preprocessor">#define ARROW_FATAL 3</span></div><div class="line"><a name="l00040"></a><span class="lineno"> 40</span> </div><div class="line"><a name="l00041"></a><span class="lineno"><a class="line" href="logging_8h.html#a89c958b59b86ed5881d703b5cd5866fd"> 41</a></span> <span class="preprocessor">#define ARROW_LOG_INTERNAL(level) ::arrow::internal::CerrLog(level)</span></div><div class="line"><a name="l00042"></a><span class="lineno"><a class="line" href="logging_8h.html#a6297ec7b42990f6318ea902765172cf0"> 42</a></span> <span class="preprocessor">#define ARROW_LOG(level) ARROW_LOG_INTERNAL(ARROW_##level)</span></div><div class="line"><a name="l00043"></a><span class="lineno"><a class="line" href="logging_8h.html#a479d6d97ef10313772bde465cbc73926"> 43</a></span> <span class="preprocessor">#define ARROW_IGNORE_EXPR(expr) ((void)(expr));</span></div><div class="line"><a name="l00044" ></a><span class="lineno"> 44</span> </div><div class="line"><a >name="l00045"></a><span class="lineno"><a class="line" >href="logging_8h.html#a389e6c69f3ba2e62c5a9e0372059f1a4"> >45</a></span> <span class="preprocessor">#define ARROW_CHECK(condition) > \</span></div><div class="line"><a >name="l00046"></a><span class="lineno"> 46</span> <span >class="preprocessor"> (condition) ? 0 >\</span></div><div class="line"><a name="l00047"></a><span class="lineno"> >47</span> <span class="preprocessor"> : >::arrow::internal::FatalLog(ARROW_FATAL) \</span></div><div class="line"><a >name="l00048"></a><span class="lineno"> 48</span> <span >class="preprocessor"> << __FILE__ << >":" << __LINE__ << " Check failed: " >#condition " "</span></div><div class="line"><a >name="l00049"></a><span class="lineno"> 49</span> </div> <div class="line"><a name="l00050"></a><span class="lineno"> 50</span> <span class="preprocessor">#ifdef NDEBUG</span></div><div class="line"><a name="l00051"></a><span class="lineno"> 51</span> <span class="preprocessor">#define ARROW_DFATAL ARROW_WARNING</span></div><div class="line"><a name="l00052"></a><span class="lineno"> 52</span> </div><div class="line"><a name="l00053"></a><span class="lineno"> 53</span> <span class="preprocessor">#define DCHECK(condition) \</span></div><div class="line"><a name="l00054"></a><span class="lineno"> 54</span> <span class="preprocessor"> ARROW_IGNORE_EXPR(condition) \</span></div><div class="line"><a name="l00055"></a><span class="lineno"> 55</span> <span class="preprocessor"> while (false) ::arrow::internal::NullLog()</span></div><div class="line"><a name="l00056"></a><span class="lineno"> 56</span> <span class="preprocessor">#define DCHECK_EQ(val1, val2) \</span></div><div class="line">< a name="l00057"></a><span class="lineno"> 57</span> <span class="preprocessor"> ARROW_IGNORE_EXPR(val1) \</span></div><div class="line"><a name="l00058"></a><span class="lineno"> 58</span> <span class="preprocessor"> while (false) ::arrow::internal::NullLog()</span></div><div class="line"><a name="l00059"></a><span class="lineno"> 59</span> <span class="preprocessor">#define DCHECK_NE(val1, val2) \</span></div><div class="line"><a name="l00060"></a><span class="lineno"> 60</span> <span class="preprocessor"> ARROW_IGNORE_EXPR(val1) \</span></div><div class="line"><a name="l00061"></a><span class="lineno"> 61</span> <span class="preprocessor"> while (false) ::arrow::internal::NullLog()</span></div><div class="line"><a name="l00062"></a><span class="lineno"> 62</span> <span class="preprocessor">#define DCHECK_LE(val1, val2) \</span></div><div class="line"><a name="l00063"></a><span class="lineno"> 63</span> <span class="prepr ocessor"> ARROW_IGNORE_EXPR(val1) \</span></div><div class="line"><a name="l00064"></a><span class="lineno"> 64</span> <span class="preprocessor"> while (false) ::arrow::internal::NullLog()</span></div><div class="line"><a name="l00065"></a><span class="lineno"> 65</span> <span class="preprocessor">#define DCHECK_LT(val1, val2) \</span></div><div class="line"><a name="l00066"></a><span class="lineno"> 66</span> <span class="preprocessor"> ARROW_IGNORE_EXPR(val1) \</span></div><div class="line"><a name="l00067"></a><span class="lineno"> 67</span> <span class="preprocessor"> while (false) ::arrow::internal::NullLog()</span></div><div class="line"><a name="l00068"></a><span class="lineno"> 68</span> <span class="preprocessor">#define DCHECK_GE(val1, val2) \</span></div><div class="line"><a name="l00069"></a><span class="lineno"> 69</span> <span class="preprocessor"> ARROW_IGNORE_EXPR(val1) \</span></div><div class="line"><a nam e="l00070"></a><span class="lineno"> 70</span> <span class="preprocessor"> while (false) ::arrow::internal::NullLog()</span></div><div class="line"><a name="l00071"></a><span class="lineno"> 71</span> <span class="preprocessor">#define DCHECK_GT(val1, val2) \</span></div><div class="line"><a name="l00072"></a><span class="lineno"> 72</span> <span class="preprocessor"> ARROW_IGNORE_EXPR(val1) \</span></div><div class="line"><a name="l00073"></a><span class="lineno"> 73</span> <span class="preprocessor"> while (false) ::arrow::internal::NullLog()</span></div><div class="line"><a name="l00074"></a><span class="lineno"> 74</span> </div><div class="line"><a name="l00075"></a><span class="lineno"> 75</span> <span class="preprocessor">#else</span></div><div class="line"><a name="l00076"></a><span class="lineno"><a class="line" href="logging_8h.html#ad85fba57e0e48e503ae521494e6b361c"> 76</a></span> <span class="preprocessor">#define AR ROW_DFATAL ARROW_FATAL</span></div><div class="line"><a name="l00077"></a><span class="lineno"> 77</span> </div><div class="line"><a name="l00078"></a><span class="lineno"><a class="line" href="logging_8h.html#ae17f8119c108cf3070bad3449c7e0006"> 78</a></span> <span class="preprocessor">#define DCHECK(condition) ARROW_CHECK(condition)</span></div><div class="line"><a name="l00079"></a><span class="lineno"><a class="line" href="logging_8h.html#ae89df3243bbb8341130c7b3f44145ea0"> 79</a></span> <span class="preprocessor">#define DCHECK_EQ(val1, val2) ARROW_CHECK((val1) == (val2))</span></div><div class="line"><a name="l00080"></a><span class="lineno"><a class="line" href="logging_8h.html#a46e69120fbd3b36e6960e096d23b66f0"> 80</a></span> <span class="preprocessor">#define DCHECK_NE(val1, val2) ARROW_CHECK((val1) != (val2))</span></div><div class="line"><a name="l00081"></a><span class="lineno"><a class="line" href="logging_8h.html#a4395e95bab44e222cb2e77251017 a0e2"> 81</a></span> <span class="preprocessor">#define DCHECK_LE(val1, val2) ARROW_CHECK((val1) <= (val2))</span></div><div class="line"><a name="l00082"></a><span class="lineno"><a class="line" href="logging_8h.html#ab62f5ed8f2d48e29802be0cbbcd1359a"> 82</a></span> <span class="preprocessor">#define DCHECK_LT(val1, val2) ARROW_CHECK((val1) < (val2))</span></div><div class="line"><a name="l00083"></a><span class="lineno"><a class="line" href="logging_8h.html#aae2dc65d9ea248d54bf39daa986dd295"> 83</a></span> <span class="preprocessor">#define DCHECK_GE(val1, val2) ARROW_CHECK((val1) >= (val2))</span></div><div class="line"><a name="l00084"></a><span class="lineno"><a class="line" href="logging_8h.html#ab4f56aa24c4c9cddc47a6abd2d747f9a"> 84</a></span> <span class="preprocessor">#define DCHECK_GT(val1, val2) ARROW_CHECK((val1) > (val2))</span></div><div class="line"><a name="l00085"></a><span class="lineno"> 85</span> </div><div class="li ne"><a name="l00086"></a><span class="lineno"> 86</span> <span class="preprocessor">#endif // NDEBUG</span></div><div class="line"><a name="l00087"></a><span class="lineno"> 87</span> </div><div class="line"><a name="l00088"></a><span class="lineno"> 88</span> <span class="keyword">namespace </span>internal {</div><div class="line"><a name="l00089"></a><span class="lineno"> 89</span> </div><div class="line"><a name="l00090"></a><span class="lineno"> 90</span> <span class="keyword">class </span>NullLog {</div><div class="line"><a name="l00091"></a><span class="lineno"> 91</span>  <span class="keyword">public</span>:</div><div class="line"><a name="l00092"></a><span class="lineno"> 92</span>  <span class="keyword">template</span> <<span class="keyword">class</span> T></div><div class="line"><a name="l00093"></a><span class="lineno"> 93</span>  NullLog& operator<<(<span class="keyword">const</span> T& <a cla ss="code" href="macros_8h.html#a563379ffcc9ec4421d5fdeb876a194aa">ARROW_ARG_UNUSED</a>(t)) {</div><div class="line"><a name="l00094"></a><span class="lineno"> 94</span>  <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div><div class="line"><a name="l00095"></a><span class="lineno"> 95</span>  }</div><div class="line"><a name="l00096"></a><span class="lineno"> 96</span> };</div><div class="line"><a name="l00097"></a><span class="lineno"> 97</span> </div><div class="line"><a name="l00098"></a><span class="lineno"> 98</span> <span class="keyword">class </span>CerrLog {</div><div class="line"><a name="l00099"></a><span class="lineno"> 99</span>  <span class="keyword">public</span>:</div><div class="line"><a name="l00100"></a><span class="lineno"> 100</span>  CerrLog(<span class="keywordtype">int</span> severity) <span class="comment">// NOLINT(runtime/explicit)</span></div><div class="line"><a name="l0010 1"></a><span class="lineno"> 101</span>  : severity_(severity), has_logged_(<span class="keyword">false</span>) {}</div><div class="line"><a name="l00102"></a><span class="lineno"> 102</span> </div><div class="line"><a name="l00103"></a><span class="lineno"> 103</span>  <span class="keyword">virtual</span> ~CerrLog() {</div><div class="line"><a name="l00104"></a><span class="lineno"> 104</span>  <span class="keywordflow">if</span> (has_logged_) {</div><div class="line"><a name="l00105"></a><span class="lineno"> 105</span>  std::cerr << std::endl;</div><div class="line"><a name="l00106"></a><span class="lineno"> 106</span>  }</div><div class="line"><a name="l00107"></a><span class="lineno"> 107</span>  <span class="keywordflow">if</span> (severity_ == <a class="code" href="logging_8h.html#a12f356b9b859fe60b5fcc906ba71b718">ARROW_FATAL</a>) {</div><div class="line"><a name="l00108"></a><span class="lineno"> 108</span >  std::exit(1);</div><div class="line"><a name="l00109"></a><span >class="lineno"> 109</span>  }</div><div class="line"><a >name="l00110"></a><span class="lineno"> 110</span>  }</div><div >class="line"><a name="l00111"></a><span class="lineno"> >111</span> </div><div class="line"><a name="l00112"></a><span >class="lineno"> 112</span>  <span class="keyword">template</span> ><<span class="keyword">class</span> T></div><div class="line"><a >name="l00113"></a><span class="lineno"> 113</span>  CerrLog& >operator<<(<span class="keyword">const</span> T& t) {</div><div >class="line"><a name="l00114"></a><span class="lineno"> 114</span>  ><span class="keywordflow">if</span> (severity_ != <a class="code" >href="logging_8h.html#a3057840b0de9d217fdcedddc615295ad">ARROW_DEBUG</a>) >{</div><div class="line"><a name="l00115"></a><span class="lineno"> >115</span>  has_logged_ = <span >class="keyword">true</span>;</div><div cla ss="line"><a name="l00116"></a><span class="lineno"> 116</span>  std::cerr << t;</div><div class="line"><a name="l00117"></a><span class="lineno"> 117</span>  }</div><div class="line"><a name="l00118"></a><span class="lineno"> 118</span>  <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div><div class="line"><a name="l00119"></a><span class="lineno"> 119</span>  }</div><div class="line"><a name="l00120"></a><span class="lineno"> 120</span> </div><div class="line"><a name="l00121"></a><span class="lineno"> 121</span>  <span class="keyword">protected</span>:</div><div class="line"><a name="l00122"></a><span class="lineno"> 122</span>  <span class="keyword">const</span> <span class="keywordtype">int</span> severity_;</div><div class="line"><a name="l00123"></a><span class="lineno"> 123</span>  <span class="keywordtype">bool</span> has_logged_;</div><div class="line"><a name="l00124"></a><spa n class="lineno"> 124</span> };</div><div class="line"><a name="l00125"></a><span class="lineno"> 125</span> </div><div class="line"><a name="l00126"></a><span class="lineno"> 126</span> <span class="comment">// Clang-tidy isn't smart enough to determine that DCHECK using CerrLog doesn't</span></div><div class="line"><a name="l00127"></a><span class="lineno"> 127</span> <span class="comment">// return so we create a new class to give it a hint.</span></div><div class="line"><a name="l00128"></a><span class="lineno"> 128</span> <span class="keyword">class </span>FatalLog : <span class="keyword">public</span> CerrLog {</div><div class="line"><a name="l00129"></a><span class="lineno"> 129</span>  <span class="keyword">public</span>:</div><div class="line"><a name="l00130"></a><span class="lineno"> 130</span>  <span class="keyword">explicit</span> FatalLog(<span class="keywordtype">int</span> <span class="comment">/* severity */</span>) <span class="comment">// NOLINT</span></div><div class="line"><a name="l00131"></a><span class="lineno"> 131</span>  : CerrLog(<a class="code" href="logging_8h.html#a12f356b9b859fe60b5fcc906ba71b718">ARROW_FATAL</a>) {} <span class="comment">// NOLINT</span></div><div class="line"><a name="l00132"></a><span class="lineno"> 132</span> </div><div class="line"><a name="l00133"></a><span class="lineno"> 133</span>  <a class="code" href="macros_8h.html#a0406f232596131e1c5853411539ce0c7">ARROW_NORETURN</a> ~FatalLog() {</div><div class="line"><a name="l00134"></a><span class="lineno"> 134</span>  <span class="keywordflow">if</span> (has_logged_) {</div><div class="line"><a name="l00135"></a><span class="lineno"> 135</span>  std::cerr << std::endl;</div><div class="line"><a name="l00136"></a><span class="lineno"> 136</span>  }</div><div class="line"><a name="l00137"></a><span class="lineno"> 137</span>  std::exi t(1);</div><div class="line"><a name="l00138"></a><span class="lineno"> 138</span>  }</div><div class="line"><a name="l00139"></a><span class="lineno"> 139</span> };</div><div class="line"><a name="l00140"></a><span class="lineno"> 140</span> </div><div class="line"><a name="l00141"></a><span class="lineno"> 141</span> } <span class="comment">// namespace internal</span></div><div class="line"><a name="l00142"></a><span class="lineno"> 142</span> </div><div class="line"><a name="l00143"></a><span class="lineno"> 143</span> } <span class="comment">// namespace arrow</span></div><div class="line"><a name="l00144"></a><span class="lineno"> 144</span> </div><div class="line"><a name="l00145"></a><span class="lineno"> 145</span> <span class="preprocessor">#endif // ARROW_UTIL_LOGGING_H</span></div><div class="ttc" id="macros_8h_html_a0406f232596131e1c5853411539ce0c7"><div class="ttname"><a href="macros_8h.html#a0406f232596131e1c58534115 39ce0c7">ARROW_NORETURN</a></div><div class="ttdeci">#define ARROW_NORETURN</div><div class="ttdef"><b>Definition:</b> macros.h:47</div></div> +<a href="logging_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> <span class="comment">// Licensed to the Apache Software Foundation (ASF) under one</span></div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span> <span class="comment">// or more contributor license agreements. See the NOTICE file</span></div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span> <span class="comment">// distributed with this work for additional information</span></div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span> <span class="comment">// regarding copyright ownership. The ASF licenses this file</span></div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span> <span class="comment">// to you under the Apache License, Version 2.0 (the</span></div><div class="line"><a name="l00006"></a><span class ="lineno"> 6</span> <span class="comment">// "License"); you may not use this file except in compliance</span></div><div class="line"><a name="l00007"></a><span class="lineno"> 7</span> <span class="comment">// with the License. You may obtain a copy of the License at</span></div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span> <span class="comment">//</span></div><div class="line"><a name="l00009"></a><span class="lineno"> 9</span> <span class="comment">// http://www.apache.org/licenses/LICENSE-2.0</span></div><div class="line"><a name="l00010"></a><span class="lineno"> 10</span> <span class="comment">//</span></div><div class="line"><a name="l00011"></a><span class="lineno"> 11</span> <span class="comment">// Unless required by applicable law or agreed to in writing,</span></div><div class="line"><a name="l00012"></a><span class="lineno"> 12</span> <span class="comment">// software distributed u nder the License is distributed on an</span></div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span> <span class="comment">// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY</span></div><div class="line"><a name="l00014"></a><span class="lineno"> 14</span> <span class="comment">// KIND, either express or implied. See the License for the</span></div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span> <span class="comment">// specific language governing permissions and limitations</span></div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span> <span class="comment">// under the License.</span></div><div class="line"><a name="l00017"></a><span class="lineno"> 17</span> </div><div class="line"><a name="l00018"></a><span class="lineno"> 18</span> <span class="preprocessor">#ifndef ARROW_UTIL_LOGGING_H</span></div><div class="line"><a name="l00019"></a><span class="lineno" > 19</span> <span class="preprocessor">#define > ARROW_UTIL_LOGGING_H</span></div><div class="line"><a > name="l00020"></a><span class="lineno"> 20</span> </div><div > class="line"><a name="l00021"></a><span class="lineno"> > 21</span> <span class="preprocessor">#include > <cstdlib></span></div><div class="line"><a name="l00022"></a><span > class="lineno"> 22</span> <span class="preprocessor">#include > <iostream></span></div><div class="line"><a name="l00023"></a><span > class="lineno"> 23</span> </div><div class="line"><a > name="l00024"></a><span class="lineno"> 24</span> <span > class="preprocessor">#include "<a class="code" > href="macros_8h.html">arrow/util/macros.h</a>"</span></div><div > class="line"><a name="l00025"></a><span class="lineno"> > 25</span> </div><div class="line"><a name="l00026"></a><span > class="lineno"> 26</span> <span class="keyword">namespace </span><a > class="code" href="namespacearrow.html">arrow</a> {</ div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span> </div><div class="line"><a name="l00028"></a><span class="lineno"> 28</span> <span class="comment">// Stubbed versions of macros defined in glog/logging.h, intended for</span></div><div class="line"><a name="l00029"></a><span class="lineno"> 29</span> <span class="comment">// environments where glog headers aren't available.</span></div><div class="line"><a name="l00030"></a><span class="lineno"> 30</span> <span class="comment">//</span></div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span> <span class="comment">// Add more as needed.</span></div><div class="line"><a name="l00032"></a><span class="lineno"> 32</span> </div><div class="line"><a name="l00033"></a><span class="lineno"> 33</span> <span class="comment">// Log levels. LOG ignores them, so their values are arbitrary.</span></div><div class="line"><a name="l00034"></a><span cla ss="lineno"> 34</span> </div><div class="line"><a name="l00035"></a><span class="lineno"><a class="line" href="logging_8h.html#a3057840b0de9d217fdcedddc615295ad"> 35</a></span> <span class="preprocessor">#define ARROW_DEBUG (-1)</span></div><div class="line"><a name="l00036"></a><span class="lineno"><a class="line" href="logging_8h.html#a0670d4558bbb40d053bf4d0698f0a1ea"> 36</a></span> <span class="preprocessor">#define ARROW_INFO 0</span></div><div class="line"><a name="l00037"></a><span class="lineno"><a class="line" href="logging_8h.html#a4f604f658bd8290bc50f1f06119076c3"> 37</a></span> <span class="preprocessor">#define ARROW_WARNING 1</span></div><div class="line"><a name="l00038"></a><span class="lineno"><a class="line" href="logging_8h.html#a8049c0e4c54326ace670750e2b8716d0"> 38</a></span> <span class="preprocessor">#define ARROW_ERROR 2</span></div><div class="line"><a name="l00039"></a><span class="lineno"><a class="line" href="logging_8h. html#a12f356b9b859fe60b5fcc906ba71b718"> 39</a></span> <span class="preprocessor">#define ARROW_FATAL 3</span></div><div class="line"><a name="l00040"></a><span class="lineno"> 40</span> </div><div class="line"><a name="l00041"></a><span class="lineno"><a class="line" href="logging_8h.html#a89c958b59b86ed5881d703b5cd5866fd"> 41</a></span> <span class="preprocessor">#define ARROW_LOG_INTERNAL(level) ::arrow::internal::CerrLog(level)</span></div><div class="line"><a name="l00042"></a><span class="lineno"><a class="line" href="logging_8h.html#a6297ec7b42990f6318ea902765172cf0"> 42</a></span> <span class="preprocessor">#define ARROW_LOG(level) ARROW_LOG_INTERNAL(ARROW_##level)</span></div><div class="line"><a name="l00043"></a><span class="lineno"><a class="line" href="logging_8h.html#a479d6d97ef10313772bde465cbc73926"> 43</a></span> <span class="preprocessor">#define ARROW_IGNORE_EXPR(expr) ((void)(expr));</span></div><div class="line"><a name="l00044 "></a><span class="lineno"> 44</span> </div><div class="line"><a name="l00045"></a><span class="lineno"><a class="line" href="logging_8h.html#a389e6c69f3ba2e62c5a9e0372059f1a4"> 45</a></span> <span class="preprocessor">#define ARROW_CHECK(condition) \</span></div><div class="line"><a name="l00046"></a><span class="lineno"> 46</span> <span class="preprocessor"> (condition) ? 0 \</span></div><div class="line"><a name="l00047"></a><span class="lineno"> 47</span> <span class="preprocessor"> : ::arrow::internal::FatalLog(ARROW_FATAL) \</span></div><div class="line"><a name="l00048"></a><span class="lineno"> 48</span> <span class="preprocessor"> << __FILE__ << ":" << __LINE__ << " Check failed: " #condition " "</span></div><div class="line"><a name="l00049"></a><span class="lineno"> 49</span> </div ><div class="line"><a name="l00050"></a><span class="lineno"> >50</span> <span class="preprocessor">#ifdef NDEBUG</span></div><div >class="line"><a name="l00051"></a><span class="lineno"> >51</span> <span class="preprocessor">#define ARROW_DFATAL >ARROW_WARNING</span></div><div class="line"><a name="l00052"></a><span >class="lineno"> 52</span> </div><div class="line"><a >name="l00053"></a><span class="lineno"> 53</span> <span >class="preprocessor">#define DCHECK(condition) \</span></div><div >class="line"><a name="l00054"></a><span class="lineno"> >54</span> <span class="preprocessor"> ARROW_IGNORE_EXPR(condition) >\</span></div><div class="line"><a name="l00055"></a><span class="lineno"> >55</span> <span class="preprocessor"> while (false) >::arrow::internal::NullLog()</span></div><div class="line"><a >name="l00056"></a><span class="lineno"> 56</span> <span >class="preprocessor">#define DCHECK_OK(status) \</span></div><div >class="line"><a name="l00057"></a><span class="lineno"> 57</span> <span class="preprocessor"> ARROW_IGNORE_EXPR(status) \</span></div><div class="line"><a name="l00058"></a><span class="lineno"> 58</span> <span class="preprocessor"> while (false) ::arrow::internal::NullLog()</span></div><div class="line"><a name="l00059"></a><span class="lineno"> 59</span> <span class="preprocessor">#define DCHECK_EQ(val1, val2) \</span></div><div class="line"><a name="l00060"></a><span class="lineno"> 60</span> <span class="preprocessor"> ARROW_IGNORE_EXPR(val1) \</span></div><div class="line"><a name="l00061"></a><span class="lineno"> 61</span> <span class="preprocessor"> while (false) ::arrow::internal::NullLog()</span></div><div class="line"><a name="l00062"></a><span class="lineno"> 62</span> <span class="preprocessor">#define DCHECK_NE(val1, val2) \</span></div><div class="line"><a name="l00063"></a><span class="lineno"> 63</span> <span class="preproce ssor"> ARROW_IGNORE_EXPR(val1) \</span></div><div class="line"><a name="l00064"></a><span class="lineno"> 64</span> <span class="preprocessor"> while (false) ::arrow::internal::NullLog()</span></div><div class="line"><a name="l00065"></a><span class="lineno"> 65</span> <span class="preprocessor">#define DCHECK_LE(val1, val2) \</span></div><div class="line"><a name="l00066"></a><span class="lineno"> 66</span> <span class="preprocessor"> ARROW_IGNORE_EXPR(val1) \</span></div><div class="line"><a name="l00067"></a><span class="lineno"> 67</span> <span class="preprocessor"> while (false) ::arrow::internal::NullLog()</span></div><div class="line"><a name="l00068"></a><span class="lineno"> 68</span> <span class="preprocessor">#define DCHECK_LT(val1, val2) \</span></div><div class="line"><a name="l00069"></a><span class="lineno"> 69</span> <span class="preprocessor"> ARROW_IGNORE_EXPR(val1) \</span></div><div class="line"><a name=" l00070"></a><span class="lineno"> 70</span> <span class="preprocessor"> while (false) ::arrow::internal::NullLog()</span></div><div class="line"><a name="l00071"></a><span class="lineno"> 71</span> <span class="preprocessor">#define DCHECK_GE(val1, val2) \</span></div><div class="line"><a name="l00072"></a><span class="lineno"> 72</span> <span class="preprocessor"> ARROW_IGNORE_EXPR(val1) \</span></div><div class="line"><a name="l00073"></a><span class="lineno"> 73</span> <span class="preprocessor"> while (false) ::arrow::internal::NullLog()</span></div><div class="line"><a name="l00074"></a><span class="lineno"> 74</span> <span class="preprocessor">#define DCHECK_GT(val1, val2) \</span></div><div class="line"><a name="l00075"></a><span class="lineno"> 75</span> <span class="preprocessor"> ARROW_IGNORE_EXPR(val1) \</span></div><div class="line"><a name="l00076"></a><span class="lineno"> 76</span> <span class="preprocessor" > while (false) ::arrow::internal::NullLog()</span></div><div class="line"><a > name="l00077"></a><span class="lineno"> 77</span> </div><div > class="line"><a name="l00078"></a><span class="lineno"> > 78</span> <span class="preprocessor">#else</span></div><div > class="line"><a name="l00079"></a><span class="lineno"><a class="line" > href="logging_8h.html#ad85fba57e0e48e503ae521494e6b361c"> > 79</a></span> <span class="preprocessor">#define ARROW_DFATAL > ARROW_FATAL</span></div><div class="line"><a name="l00080"></a><span > class="lineno"> 80</span> </div><div class="line"><a > name="l00081"></a><span class="lineno"><a class="line" > href="logging_8h.html#ae17f8119c108cf3070bad3449c7e0006"> > 81</a></span> <span class="preprocessor">#define DCHECK(condition) > ARROW_CHECK(condition)</span></div><div class="line"><a > name="l00082"></a><span class="lineno"><a class="line" > href="logging_8h.html#a37db8fd97314328985c927abacd4ffd3"> > 82</a></span> <span class="preprocess or">#define DCHECK_OK(status) (ARROW_CHECK((status).ok()) << (status).message())</span></div><div class="line"><a name="l00083"></a><span class="lineno"><a class="line" href="logging_8h.html#ae89df3243bbb8341130c7b3f44145ea0"> 83</a></span> <span class="preprocessor">#define DCHECK_EQ(val1, val2) ARROW_CHECK((val1) == (val2))</span></div><div class="line"><a name="l00084"></a><span class="lineno"><a class="line" href="logging_8h.html#a46e69120fbd3b36e6960e096d23b66f0"> 84</a></span> <span class="preprocessor">#define DCHECK_NE(val1, val2) ARROW_CHECK((val1) != (val2))</span></div><div class="line"><a name="l00085"></a><span class="lineno"><a class="line" href="logging_8h.html#a4395e95bab44e222cb2e77251017a0e2"> 85</a></span> <span class="preprocessor">#define DCHECK_LE(val1, val2) ARROW_CHECK((val1) <= (val2))</span></div><div class="line"><a name="l00086"></a><span class="lineno"><a class="line" href="logging_8h.html#ab62f5ed8f2d48e29802be0cbbcd1359a"> 86</a></span> <span class="preprocessor">#define DCHECK_LT(val1, val2) ARROW_CHECK((val1) < (val2))</span></div><div class="line"><a name="l00087"></a><span class="lineno"><a class="line" href="logging_8h.html#aae2dc65d9ea248d54bf39daa986dd295"> 87</a></span> <span class="preprocessor">#define DCHECK_GE(val1, val2) ARROW_CHECK((val1) >= (val2))</span></div><div class="line"><a name="l00088"></a><span class="lineno"><a class="line" href="logging_8h.html#ab4f56aa24c4c9cddc47a6abd2d747f9a"> 88</a></span> <span class="preprocessor">#define DCHECK_GT(val1, val2) ARROW_CHECK((val1) > (val2))</span></div><div class="line"><a name="l00089"></a><span class="lineno"> 89</span> </div><div class="line"><a name="l00090"></a><span class="lineno"> 90</span> <span class="preprocessor">#endif // NDEBUG</span></div><div class="line"><a name="l00091"></a><span class="lineno"> 91</span> </div><div class="line"><a name="l00092"></a><span class="lineno "> 92</span> <span class="keyword">namespace </span>internal {</div><div class="line"><a name="l00093"></a><span class="lineno"> 93</span> </div><div class="line"><a name="l00094"></a><span class="lineno"> 94</span> <span class="keyword">class </span>NullLog {</div><div class="line"><a name="l00095"></a><span class="lineno"> 95</span>  <span class="keyword">public</span>:</div><div class="line"><a name="l00096"></a><span class="lineno"> 96</span>  <span class="keyword">template</span> <<span class="keyword">class</span> T></div><div class="line"><a name="l00097"></a><span class="lineno"> 97</span>  NullLog& operator<<(<span class="keyword">const</span> T& <a class="code" href="macros_8h.html#a563379ffcc9ec4421d5fdeb876a194aa">ARROW_ARG_UNUSED</a>(t)) {</div><div class="line"><a name="l00098"></a><span class="lineno"> 98</span>  <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div><d iv class="line"><a name="l00099"></a><span class="lineno"> 99</span>  }</div><div class="line"><a name="l00100"></a><span class="lineno"> 100</span> };</div><div class="line"><a name="l00101"></a><span class="lineno"> 101</span> </div><div class="line"><a name="l00102"></a><span class="lineno"> 102</span> <span class="keyword">class </span>CerrLog {</div><div class="line"><a name="l00103"></a><span class="lineno"> 103</span>  <span class="keyword">public</span>:</div><div class="line"><a name="l00104"></a><span class="lineno"> 104</span>  CerrLog(<span class="keywordtype">int</span> severity) <span class="comment">// NOLINT(runtime/explicit)</span></div><div class="line"><a name="l00105"></a><span class="lineno"> 105</span>  : severity_(severity), has_logged_(<span class="keyword">false</span>) {}</div><div class="line"><a name="l00106"></a><span class="lineno"> 106</span> </div><div class="line"><a name="l00107"></a><span cla ss="lineno"> 107</span>  <span class="keyword">virtual</span> ~CerrLog() {</div><div class="line"><a name="l00108"></a><span class="lineno"> 108</span>  <span class="keywordflow">if</span> (has_logged_) {</div><div class="line"><a name="l00109"></a><span class="lineno"> 109</span>  std::cerr << std::endl;</div><div class="line"><a name="l00110"></a><span class="lineno"> 110</span>  }</div><div class="line"><a name="l00111"></a><span class="lineno"> 111</span>  <span class="keywordflow">if</span> (severity_ == <a class="code" href="logging_8h.html#a12f356b9b859fe60b5fcc906ba71b718">ARROW_FATAL</a>) {</div><div class="line"><a name="l00112"></a><span class="lineno"> 112</span>  std::abort();</div><div class="line"><a name="l00113"></a><span class="lineno"> 113</span>  }</div><div class="line"><a name="l00114"></a><span class="lineno"> 114</span>  }</div><div class="line"><a name="l00115"></a><span class="lin eno"> 115</span> </div><div class="line"><a name="l00116"></a><span class="lineno"> 116</span>  <span class="keyword">template</span> <<span class="keyword">class</span> T></div><div class="line"><a name="l00117"></a><span class="lineno"> 117</span>  CerrLog& operator<<(<span class="keyword">const</span> T& t) {</div><div class="line"><a name="l00118"></a><span class="lineno"> 118</span>  <span class="keywordflow">if</span> (severity_ != <a class="code" href="logging_8h.html#a3057840b0de9d217fdcedddc615295ad">ARROW_DEBUG</a>) {</div><div class="line"><a name="l00119"></a><span class="lineno"> 119</span>  has_logged_ = <span class="keyword">true</span>;</div><div class="line"><a name="l00120"></a><span class="lineno"> 120</span>  std::cerr << t;</div><div class="line"><a name="l00121"></a><span class="lineno"> 121</span>  }</div><div class="line"><a name="l00122"></a><span class="lineno"> 122</span >  <span class="keywordflow">return</span> *<span >class="keyword">this</span>;</div><div class="line"><a >name="l00123"></a><span class="lineno"> 123</span>  }</div><div >class="line"><a name="l00124"></a><span class="lineno"> >124</span> </div><div class="line"><a name="l00125"></a><span >class="lineno"> 125</span>  <span >class="keyword">protected</span>:</div><div class="line"><a >name="l00126"></a><span class="lineno"> 126</span>  <span >class="keyword">const</span> <span class="keywordtype">int</span> >severity_;</div><div class="line"><a name="l00127"></a><span class="lineno"> >127</span>  <span class="keywordtype">bool</span> >has_logged_;</div><div class="line"><a name="l00128"></a><span >class="lineno"> 128</span> };</div><div class="line"><a >name="l00129"></a><span class="lineno"> 129</span> </div><div >class="line"><a name="l00130"></a><span class="lineno"> >130</span> <span class="comment">// Clang-tidy isn't smart enough to determine that DCHECK using CerrLog doesn't</span></div><div class="line"><a name="l00131"></a><span class="lineno"> 131</span> <span class="comment">// return so we create a new class to give it a hint.</span></div><div class="line"><a name="l00132"></a><span class="lineno"> 132</span> <span class="keyword">class </span>FatalLog : <span class="keyword">public</span> CerrLog {</div><div class="line"><a name="l00133"></a><span class="lineno"> 133</span>  <span class="keyword">public</span>:</div><div class="line"><a name="l00134"></a><span class="lineno"> 134</span>  <span class="keyword">explicit</span> FatalLog(<span class="keywordtype">int</span> <span class="comment">/* severity */</span>) <span class="comment">// NOLINT</span></div><div class="line"><a name="l00135"></a><span class="lineno"> 135</span>  : CerrLog(<a class="code" href="logging_8h.html#a12f356b9b859fe60b5fcc906ba71b718">ARROW_FATAL</a>) {} <span class="comment" >// NOLINT</span></div><div class="line"><a name="l00136"></a><span >class="lineno"> 136</span> </div><div class="line"><a >name="l00137"></a><span class="lineno"> 137</span>  <a class="code" >href="macros_8h.html#a0406f232596131e1c5853411539ce0c7">ARROW_NORETURN</a> >~FatalLog() {</div><div class="line"><a name="l00138"></a><span >class="lineno"> 138</span>  <span class="keywordflow">if</span> >(has_logged_) {</div><div class="line"><a name="l00139"></a><span >class="lineno"> 139</span>  std::cerr << >std::endl;</div><div class="line"><a name="l00140"></a><span class="lineno"> >140</span>  }</div><div class="line"><a name="l00141"></a><span >class="lineno"> 141</span>  std::abort();</div><div class="line"><a >name="l00142"></a><span class="lineno"> 142</span>  }</div><div >class="line"><a name="l00143"></a><span class="lineno"> >143</span> };</div><div class="line"><a name="l00144"></a><span >class="lineno"> 144</span> < /div><div class="line"><a name="l00145"></a><span class="lineno"> 145</span> } <span class="comment">// namespace internal</span></div><div class="line"><a name="l00146"></a><span class="lineno"> 146</span> </div><div class="line"><a name="l00147"></a><span class="lineno"> 147</span> } <span class="comment">// namespace arrow</span></div><div class="line"><a name="l00148"></a><span class="lineno"> 148</span> </div><div class="line"><a name="l00149"></a><span class="lineno"> 149</span> <span class="preprocessor">#endif // ARROW_UTIL_LOGGING_H</span></div><div class="ttc" id="macros_8h_html_a0406f232596131e1c5853411539ce0c7"><div class="ttname"><a href="macros_8h.html#a0406f232596131e1c5853411539ce0c7">ARROW_NORETURN</a></div><div class="ttdeci">#define ARROW_NORETURN</div><div class="ttdef"><b>Definition:</b> macros.h:47</div></div> <div class="ttc" id="logging_8h_html_a12f356b9b859fe60b5fcc906ba71b718"><div class="ttname"><a href="logging_8h.html#a12f356b9b859fe60b5fcc906ba71b718">ARROW_FATAL</a></div><div class="ttdeci">#define ARROW_FATAL</div><div class="ttdef"><b>Definition:</b> logging.h:39</div></div> <div class="ttc" id="logging_8h_html_a3057840b0de9d217fdcedddc615295ad"><div class="ttname"><a href="logging_8h.html#a3057840b0de9d217fdcedddc615295ad">ARROW_DEBUG</a></div><div class="ttdeci">#define ARROW_DEBUG</div><div class="ttdef"><b>Definition:</b> logging.h:35</div></div> <div class="ttc" id="macros_8h_html_a563379ffcc9ec4421d5fdeb876a194aa"><div class="ttname"><a href="macros_8h.html#a563379ffcc9ec4421d5fdeb876a194aa">ARROW_ARG_UNUSED</a></div><div class="ttdeci">#define ARROW_ARG_UNUSED(x)</div><div class="ttdef"><b>Definition:</b> macros.h:29</div></div>
http://git-wip-us.apache.org/repos/asf/arrow-site/blob/4c7c2f1b/docs/cpp/malloc_8h.html ---------------------------------------------------------------------- diff --git a/docs/cpp/malloc_8h.html b/docs/cpp/malloc_8h.html index f3b32ac..fec41d8 100644 --- a/docs/cpp/malloc_8h.html +++ b/docs/cpp/malloc_8h.html @@ -67,7 +67,8 @@ $(function() { </div><!-- top --> <div class="header"> <div class="summary"> -<a href="#func-members">Functions</a> </div> +<a href="#func-members">Functions</a> | +<a href="#var-members">Variables</a> </div> <div class="headertitle"> <div class="title">malloc.h File Reference</div> </div> </div><!--header--> @@ -81,8 +82,17 @@ $(function() { Functions</h2></td></tr> <tr class="memitem:accad68b0d921e2193491a7e817d26244"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="malloc_8h.html#accad68b0d921e2193491a7e817d26244">get_malloc_mapinfo</a> (void *addr, int *fd, int64_t *map_length, ptrdiff_t *offset)</td></tr> <tr class="separator:accad68b0d921e2193491a7e817d26244"><td class="memSeparator" colspan="2"> </td></tr> +<tr class="memitem:a4a0074a92b9537ec87e0ac35499fe09b"><td class="memItemLeft" align="right" valign="top">int64_t </td><td class="memItemRight" valign="bottom"><a class="el" href="malloc_8h.html#a4a0074a92b9537ec87e0ac35499fe09b">get_mmap_size</a> (int fd)</td></tr> +<tr class="memdesc:a4a0074a92b9537ec87e0ac35499fe09b"><td class="mdescLeft"> </td><td class="mdescRight">Get the mmap size corresponding to a specific file descriptor. <a href="#a4a0074a92b9537ec87e0ac35499fe09b">More...</a><br /></td></tr> +<tr class="separator:a4a0074a92b9537ec87e0ac35499fe09b"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:acee77e520eab5248241cda708881b12b"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="malloc_8h.html#acee77e520eab5248241cda708881b12b">set_malloc_granularity</a> (int value)</td></tr> <tr class="separator:acee77e520eab5248241cda708881b12b"><td class="memSeparator" colspan="2"> </td></tr> +</table><table class="memberdecls"> +<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="var-members"></a> +Variables</h2></td></tr> +<tr class="memitem:a9ff42ec0dab896004fba4ad8397f4748"><td class="memItemLeft" align="right" valign="top">constexpr int64_t </td><td class="memItemRight" valign="bottom"><a class="el" href="malloc_8h.html#a9ff42ec0dab896004fba4ad8397f4748">kMmapRegionsGap</a> = sizeof(size_t)</td></tr> +<tr class="memdesc:a9ff42ec0dab896004fba4ad8397f4748"><td class="mdescLeft"> </td><td class="mdescRight">Gap between two consecutive mmap regions allocated by fake_mmap. <a href="#a9ff42ec0dab896004fba4ad8397f4748">More...</a><br /></td></tr> +<tr class="separator:a9ff42ec0dab896004fba4ad8397f4748"><td class="memSeparator" colspan="2"> </td></tr> </table> <h2 class="groupheader">Function Documentation</h2> <a id="accad68b0d921e2193491a7e817d26244"></a> @@ -125,6 +135,33 @@ Functions</h2></td></tr> </div> </div> +<a id="a4a0074a92b9537ec87e0ac35499fe09b"></a> +<h2 class="memtitle"><span class="permalink"><a href="#a4a0074a92b9537ec87e0ac35499fe09b">◆ </a></span>get_mmap_size()</h2> + +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">int64_t get_mmap_size </td> + <td>(</td> + <td class="paramtype">int </td> + <td class="paramname"><em>fd</em></td><td>)</td> + <td></td> + </tr> + </table> +</div><div class="memdoc"> + +<p>Get the mmap size corresponding to a specific file descriptor. </p> +<dl class="params"><dt>Parameters</dt><dd> + <table class="params"> + <tr><td class="paramname">fd</td><td>The file descriptor to look up. </td></tr> + </table> + </dd> +</dl> +<dl class="section return"><dt>Returns</dt><dd>The size of the corresponding memory-mapped file. </dd></dl> + +</div> +</div> <a id="acee77e520eab5248241cda708881b12b"></a> <h2 class="memtitle"><span class="permalink"><a href="#acee77e520eab5248241cda708881b12b">◆ </a></span>set_malloc_granularity()</h2> @@ -143,6 +180,24 @@ Functions</h2></td></tr> </div> </div> +<h2 class="groupheader">Variable Documentation</h2> +<a id="a9ff42ec0dab896004fba4ad8397f4748"></a> +<h2 class="memtitle"><span class="permalink"><a href="#a9ff42ec0dab896004fba4ad8397f4748">◆ </a></span>kMmapRegionsGap</h2> + +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">constexpr int64_t kMmapRegionsGap = sizeof(size_t)</td> + </tr> + </table> +</div><div class="memdoc"> + +<p>Gap between two consecutive mmap regions allocated by fake_mmap. </p> +<p>This ensures that the segments of memory returned by fake_mmap are never contiguous and dlmalloc does not coalesce it (in the client we cannot guarantee that these mmaps are contiguous). </p> + +</div> +</div> </div><!-- contents --> <!-- start footer part --> <hr class="footer"/><address class="footer"><small> http://git-wip-us.apache.org/repos/asf/arrow-site/blob/4c7c2f1b/docs/cpp/malloc_8h_source.html ---------------------------------------------------------------------- diff --git a/docs/cpp/malloc_8h_source.html b/docs/cpp/malloc_8h_source.html index c96e400..f043cd0 100644 --- a/docs/cpp/malloc_8h_source.html +++ b/docs/cpp/malloc_8h_source.html @@ -70,8 +70,10 @@ $(function() { <div class="title">malloc.h</div> </div> </div><!--header--> <div class="contents"> -<a href="malloc_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> <span class="comment">// Licensed to the Apache Software Foundation (ASF) under one</span></div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span> <span class="comment">// or more contributor license agreements. See the NOTICE file</span></div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span> <span class="comment">// distributed with this work for additional information</span></div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span> <span class="comment">// regarding copyright ownership. The ASF licenses this file</span></div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span> <span class="comment">// to you under the Apache License, Version 2.0 (the</span></div><div class="line"><a name="l00006"></a><span class= "lineno"> 6</span> <span class="comment">// "License"); you may not use this file except in compliance</span></div><div class="line"><a name="l00007"></a><span class="lineno"> 7</span> <span class="comment">// with the License. You may obtain a copy of the License at</span></div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span> <span class="comment">//</span></div><div class="line"><a name="l00009"></a><span class="lineno"> 9</span> <span class="comment">// http://www.apache.org/licenses/LICENSE-2.0</span></div><div class="line"><a name="l00010"></a><span class="lineno"> 10</span> <span class="comment">//</span></div><div class="line"><a name="l00011"></a><span class="lineno"> 11</span> <span class="comment">// Unless required by applicable law or agreed to in writing,</span></div><div class="line"><a name="l00012"></a><span class="lineno"> 12</span> <span class="comment">// software distributed un der the License is distributed on an</span></div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span> <span class="comment">// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY</span></div><div class="line"><a name="l00014"></a><span class="lineno"> 14</span> <span class="comment">// KIND, either express or implied. See the License for the</span></div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span> <span class="comment">// specific language governing permissions and limitations</span></div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span> <span class="comment">// under the License.</span></div><div class="line"><a name="l00017"></a><span class="lineno"> 17</span> </div><div class="line"><a name="l00018"></a><span class="lineno"> 18</span> <span class="preprocessor">#ifndef PLASMA_MALLOC_H</span></div><div class="line"><a name="l00019"></a><span class="lineno"> 19 </span> <span class="preprocessor">#define PLASMA_MALLOC_H</span></div><div class="line"><a name="l00020"></a><span class="lineno"> 20</span> </div><div class="line"><a name="l00021"></a><span class="lineno"> 21</span> <span class="preprocessor">#include <inttypes.h></span></div><div class="line"><a name="l00022"></a><span class="lineno"> 22</span> <span class="preprocessor">#include <stddef.h></span></div><div class="line"><a name="l00023"></a><span class="lineno"> 23</span> </div><div class="line"><a name="l00024"></a><span class="lineno"> 24</span> <span class="keywordtype">void</span> <a class="code" href="malloc_8h.html#accad68b0d921e2193491a7e817d26244">get_malloc_mapinfo</a>(<span class="keywordtype">void</span>* addr, <span class="keywordtype">int</span>* fd, int64_t* map_length, ptrdiff_t* offset);</div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span> </div><div class="line"><a name="l00026"></ a><span class="lineno"> 26</span> <span class="keywordtype">void</span> <a class="code" href="malloc_8h.html#acee77e520eab5248241cda708881b12b">set_malloc_granularity</a>(<span class="keywordtype">int</span> value);</div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span> </div><div class="line"><a name="l00028"></a><span class="lineno"> 28</span> <span class="preprocessor">#endif // MALLOC_H</span></div><div class="ttc" id="malloc_8h_html_accad68b0d921e2193491a7e817d26244"><div class="ttname"><a href="malloc_8h.html#accad68b0d921e2193491a7e817d26244">get_malloc_mapinfo</a></div><div class="ttdeci">void get_malloc_mapinfo(void *addr, int *fd, int64_t *map_length, ptrdiff_t *offset)</div></div> +<a href="malloc_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> <span class="comment">// Licensed to the Apache Software Foundation (ASF) under one</span></div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span> <span class="comment">// or more contributor license agreements. See the NOTICE file</span></div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span> <span class="comment">// distributed with this work for additional information</span></div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span> <span class="comment">// regarding copyright ownership. The ASF licenses this file</span></div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span> <span class="comment">// to you under the Apache License, Version 2.0 (the</span></div><div class="line"><a name="l00006"></a><span class= "lineno"> 6</span> <span class="comment">// "License"); you may not use this file except in compliance</span></div><div class="line"><a name="l00007"></a><span class="lineno"> 7</span> <span class="comment">// with the License. You may obtain a copy of the License at</span></div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span> <span class="comment">//</span></div><div class="line"><a name="l00009"></a><span class="lineno"> 9</span> <span class="comment">// http://www.apache.org/licenses/LICENSE-2.0</span></div><div class="line"><a name="l00010"></a><span class="lineno"> 10</span> <span class="comment">//</span></div><div class="line"><a name="l00011"></a><span class="lineno"> 11</span> <span class="comment">// Unless required by applicable law or agreed to in writing,</span></div><div class="line"><a name="l00012"></a><span class="lineno"> 12</span> <span class="comment">// software distributed un der the License is distributed on an</span></div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span> <span class="comment">// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY</span></div><div class="line"><a name="l00014"></a><span class="lineno"> 14</span> <span class="comment">// KIND, either express or implied. See the License for the</span></div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span> <span class="comment">// specific language governing permissions and limitations</span></div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span> <span class="comment">// under the License.</span></div><div class="line"><a name="l00017"></a><span class="lineno"> 17</span> </div><div class="line"><a name="l00018"></a><span class="lineno"> 18</span> <span class="preprocessor">#ifndef PLASMA_MALLOC_H</span></div><div class="line"><a name="l00019"></a><span class="lineno"> 19 </span> <span class="preprocessor">#define PLASMA_MALLOC_H</span></div><div class="line"><a name="l00020"></a><span class="lineno"> 20</span> </div><div class="line"><a name="l00021"></a><span class="lineno"> 21</span> <span class="preprocessor">#include <inttypes.h></span></div><div class="line"><a name="l00022"></a><span class="lineno"> 22</span> <span class="preprocessor">#include <stddef.h></span></div><div class="line"><a name="l00023"></a><span class="lineno"> 23</span> </div><div class="line"><a name="l00028"></a><span class="lineno"><a class="line" href="malloc_8h.html#a9ff42ec0dab896004fba4ad8397f4748"> 28</a></span> constexpr int64_t <a class="code" href="malloc_8h.html#a9ff42ec0dab896004fba4ad8397f4748">kMmapRegionsGap</a> = <span class="keyword">sizeof</span>(size_t);</div><div class="line"><a name="l00029"></a><span class="lineno"> 29</span> </div><div class="line"><a name="l00030"></a><span class="lineno"> 30 </span> <span class="keywordtype">void</span> <a class="code" href="malloc_8h.html#accad68b0d921e2193491a7e817d26244">get_malloc_mapinfo</a>(<span class="keywordtype">void</span>* addr, <span class="keywordtype">int</span>* fd, int64_t* map_length, ptrdiff_t* offset);</div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span> </div><div class="line"><a name="l00036"></a><span class="lineno"> 36</span> int64_t <a class="code" href="malloc_8h.html#a4a0074a92b9537ec87e0ac35499fe09b">get_mmap_size</a>(<span class="keywordtype">int</span> fd);</div><div class="line"><a name="l00037"></a><span class="lineno"> 37</span> </div><div class="line"><a name="l00038"></a><span class="lineno"> 38</span> <span class="keywordtype">void</span> <a class="code" href="malloc_8h.html#acee77e520eab5248241cda708881b12b">set_malloc_granularity</a>(<span class="keywordtype">int</span> value);</div><div class="line"><a name="l00039"></a><span class="lineno"> 39</span> </div><div class="line"><a name="l00040"></a><span class="lineno"> 40</span> <span class="preprocessor">#endif // MALLOC_H</span></div><div class="ttc" id="malloc_8h_html_accad68b0d921e2193491a7e817d26244"><div class="ttname"><a href="malloc_8h.html#accad68b0d921e2193491a7e817d26244">get_malloc_mapinfo</a></div><div class="ttdeci">void get_malloc_mapinfo(void *addr, int *fd, int64_t *map_length, ptrdiff_t *offset)</div></div> +<div class="ttc" id="malloc_8h_html_a9ff42ec0dab896004fba4ad8397f4748"><div class="ttname"><a href="malloc_8h.html#a9ff42ec0dab896004fba4ad8397f4748">kMmapRegionsGap</a></div><div class="ttdeci">constexpr int64_t kMmapRegionsGap</div><div class="ttdoc">Gap between two consecutive mmap regions allocated by fake_mmap. </div><div class="ttdef"><b>Definition:</b> malloc.h:28</div></div> <div class="ttc" id="malloc_8h_html_acee77e520eab5248241cda708881b12b"><div class="ttname"><a href="malloc_8h.html#acee77e520eab5248241cda708881b12b">set_malloc_granularity</a></div><div class="ttdeci">void set_malloc_granularity(int value)</div></div> +<div class="ttc" id="malloc_8h_html_a4a0074a92b9537ec87e0ac35499fe09b"><div class="ttname"><a href="malloc_8h.html#a4a0074a92b9537ec87e0ac35499fe09b">get_mmap_size</a></div><div class="ttdeci">int64_t get_mmap_size(int fd)</div><div class="ttdoc">Get the mmap size corresponding to a specific file descriptor. </div></div> </div><!-- fragment --></div><!-- contents --> <!-- start footer part --> <hr class="footer"/><address class="footer"><small> http://git-wip-us.apache.org/repos/asf/arrow-site/blob/4c7c2f1b/docs/cpp/md__h_d_f_s.html ---------------------------------------------------------------------- diff --git a/docs/cpp/md__h_d_f_s.html b/docs/cpp/md__h_d_f_s.html index 82e87a0..c4dbd5f 100644 --- a/docs/cpp/md__h_d_f_s.html +++ b/docs/cpp/md__h_d_f_s.html @@ -77,7 +77,7 @@ $(function() { <li><code>JAVA_HOME</code>: the location of your Java SDK installation.</li> <li><code>CLASSPATH</code>: must contain the Hadoop jars. You can set these using:</li> </ul> -<p>``<code>shell export CLASSPATH=</code>$HADOOP_HOME/bin/hadoop classpath –glob` </p><div class="fragment"><div class="line">* `ARROW_LIBHDFS_DIR` (optional): explicit location of `libhdfs.so` if it is</div><div class="line">installed somewhere other than `$HADOOP_HOME/lib/native`.</div><div class="line"></div><div class="line">### Mac Specifics</div><div class="line"></div><div class="line">The installed location of Java on OS X can vary, however the following snippet</div><div class="line">will set it automatically for you:</div><div class="line"></div><div class="line">```shell</div><div class="line">export JAVA_HOME=$(/usr/libexec/java_home)</div></div><!-- fragment --><p>Homebrew's Hadoop does not have native libs. Apache doesn't build these, so users must build Hadoop to get the native libs. See this Stack Overflow answer for details:</p> +<p>``<code>shell export CLASSPATH=</code>$HADOOP_HOME/bin/hadoop classpath –glob` </p><div class="fragment"><div class="line">* `ARROW_LIBHDFS_DIR` (optional): explicit location of `libhdfs.so` if it is</div><div class="line">installed somewhere other than `$HADOOP_HOME/lib/native`.</div><div class="line"></div><div class="line">To accommodate distribution-specific nuances, the `JAVA_HOME` variable may be</div><div class="line">set to the root path for the Java SDK, the JRE path itself, or to the directory</div><div class="line">containing the `libjvm` library.</div><div class="line"></div><div class="line">### Mac Specifics</div><div class="line"></div><div class="line">The installed location of Java on OS X can vary, however the following snippet</div><div class="line">will set it automatically for you:</div><div class="line"></div><div class="line">```shell</div><div class="line">export JAVA_HOME=$(/usr/libexec/java_home)</div></div><!-- fragment --><p>Homebrew's Hadoop doe s not have native libs. Apache doesn't build these, so users must build Hadoop to get the native libs. See this Stack Overflow answer for details:</p> <p><a href="http://stackoverflow.com/a/40051353/478288">http://stackoverflow.com/a/40051353/478288</a></p> <p>Be sure to include the path to the native libs in <code>JAVA_LIBRARY_PATH</code>:</p> <div class="fragment"><div class="line">export JAVA_LIBRARY_PATH=$HADOOP_HOME/lib/native:$JAVA_LIBRARY_PATH</div></div><!-- fragment --><p>If you get an error about needing to install Java 6, then add <em>BundledApp</em> and <em>JNI</em> to the <code>JVMCapabilities</code> in <code>$JAVA_HOME/../Info.plist</code>. See</p> http://git-wip-us.apache.org/repos/asf/arrow-site/blob/4c7c2f1b/docs/cpp/md__windows.html ---------------------------------------------------------------------- diff --git a/docs/cpp/md__windows.html b/docs/cpp/md__windows.html index 361d6a8..e14c956 100644 --- a/docs/cpp/md__windows.html +++ b/docs/cpp/md__windows.html @@ -73,61 +73,44 @@ $(function() { <p><a href="https://conda.io/miniconda.html">Miniconda</a> is a minimal Python distribution including the conda package manager. To get started, download and install a 64-bit distribution.</p> <p>We recommend using packages from <a href="https://conda-forge.github.io/">conda-forge</a>. Launch cmd.exe and run following commands:</p> <div class="fragment"><div class="line">conda config --add channels conda-forge</div></div><!-- fragment --><p>Now, you can bootstrap a build environment</p> -<div class="fragment"><div class="line">conda create -n arrow-dev cmake git boost-cpp flatbuffers rapidjson cmake thrift-cpp snappy zlib brotli gflags lz4-c zstd -c conda-forge</div></div><!-- fragment --><p><em><b>Note:</b></em> </p><blockquote class="doxtable"> -<p><em>Make sure to get the <code>conda-forge</code> build of <code>gflags</code> as the </em></p> +<div class="fragment"><div class="line">conda create -n arrow-dev cmake git boost-cpp flatbuffers rapidjson cmake thrift-cpp snappy zlib brotli gflags lz4-c zstd -c conda-forge</div></div><!-- fragment --><blockquote class="doxtable"> +<p><b>Note:</b> Make sure to get the <code>conda-forge</code> build of <code>gflags</code> as the naming of the library differs from that in the <code>defaults</code> channel. </p> </blockquote> -<p>naming of the library differs from that in the <code>defaults</code> channel</p> -<p><em>Activate just created conda environment with pre-installed packages from previous step:</em></p> -<p><em></p><div class="fragment"><div class="line">activate arrow-dev</div></div><!-- fragment --><p></em></p> -<p><em>We are using the <a href="https://cmake.org/">cmake</a> tool to support Windows builds. To allow cmake to pick up 3rd party dependencies, you should set <code>ARROW_BUILD_TOOLCHAIN</code> environment variable to contain <code>Library</code> folder path of new created on previous step <code>arrow-dev</code> conda environment.</em></p> -<p><em>To set <code>ARROW_BUILD_TOOLCHAIN</code> environment variable visible only for current terminal session you can run following. <code>CONDA_PREFIX</code> is set by conda to the current environment root by the <code>activate</code> script. </p><div class="fragment"><div class="line">set ARROW_BUILD_TOOLCHAIN=%CONDA_PREFIX%\Library</div></div><!-- fragment --><p></em></p> -<p><em>To validate value of <code>ARROW_BUILD_TOOLCHAIN</code> environment variable you can run following terminal command: </p><div class="fragment"><div class="line">echo %ARROW_BUILD_TOOLCHAIN%</div></div><!-- fragment --><p></em></p> -<p><em>As alternative to <code>ARROW_BUILD_TOOLCHAIN</code>, it's possible to configure path to each 3rd party dependency separately by setting appropriate environment variable:</em></p> -<p><em><code>FLATBUFFERS_HOME</code> variable with path to <code>flatbuffers</code> installation <code>RAPIDJSON_HOME</code> variable with path to <code>rapidjson</code> installation <code>GFLAGS_HOME</code> variable with path to <code>gflags</code> installation <code>SNAPPY_HOME</code> variable with path to <code>snappy</code> installation <code>ZLIB_HOME</code> variable with path to <code>zlib</code> installation <code>BROTLI_HOME</code> variable with path to <code>brotli</code> installation <code>LZ4_HOME</code> variable with path to <code>lz4</code> installation <code>ZSTD_HOME</code> variable with path to <code>zstd</code> installation</em></p> -<p><em></p><h3>Customize static libraries names lookup of 3rd party dependencies</h3> -<p></em></p> -<p><em></em></p> -<p><em>If you decided to use pre-built 3rd party dependencies libs, it's possible to configure Arrow's cmake build script to search for customized names of 3rd party static libs.</em></p> -<p><em><code>zlib</code>. Pass <code>-DARROW_ZLIB_VENDORED=OFF</code> to enable lookup of custom zlib build. Set <code>ZLIB_HOME</code> environment variable. Pass <code>-DZLIB_MSVC_STATIC_LIB_SUFFIX=ZLIB_SUFFIX%</code> to link with zZLIB_SUFFIX%.lib</em></p> -<p><em><code>brotli</code>. Set <code>BROTLY_HOME</code> environment variable. Pass <code>-DBROTLI_MSVC_STATIC_LIB_SUFFIX=BROTLI_SUFFIX%</code> to link with brotli*BROTLI_SUFFIX%.lib.</em></p> -<p><em><code>snappy</code>. Set <code>SNAPPY_HOME</code> environment variable. Pass <code>-DSNAPPY_MSVC_STATIC_LIB_SUFFIX=SNAPPY_SUFFIX%</code> to link with snappySNAPPY_SUFFIX%.lib.</em></p> -<p><em><code>lz4</code>. Set <code>LZ4_HOME</code> environment variable. Pass <code>-LZ4_MSVC_STATIC_LIB_SUFFIX=LZ4_SUFFIX%</code> to link with lz4LZ4_SUFFIX%.lib.</em></p> -<p><em><code>zstd</code>. Set <code>ZSTD_HOME</code> environment variable. Pass <code>-ZSTD_MSVC_STATIC_LIB_SUFFIX=ZSTD_SUFFIX%</code> to link with zstdZSTD_SUFFIX%.lib.</em></p> -<p><em></p><h3>Visual Studio</h3> -<p></em></p> -<p><em></em></p> -<p><em>Microsoft provides the free Visual Studio Community edition. When doing development, you must launch the developer command prompt using</em></p> -<p><em></p><h4>Visual Studio 2015</h4> -<p></em></p> -<p><em></em></p> -<p><em></p><div class="fragment"><div class="line">{"C:\Program}</div><div class="line"></div><div class="line">#### Visual Studio 2017</div><div class="line"></div><div class="line">```"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\VsDevCmd.bat" -arch=amd6</div></div><!-- fragment --><p></em></p> -<p><em>It's easiest to configure a console emulator like <a href="http://cmder.net/">cmder</a> to automatically launch this when starting a new development console.</em></p> -<p><em></p><h2>Building with NMake</h2> -<p></em></p> -<p><em></em></p> -<p><em>Activate your conda build environment:</em></p> -<p><em></p><div class="fragment"><div class="line">activate arrow-dev</div></div><!-- fragment --><p></em></p> -<p><em>Change working directory in cmd.exe to the root directory of Arrow and do an out of source build using <code>nmake</code>:</em></p> -<p><em></p><div class="fragment"><div class="line">cd cpp</div><div class="line">mkdir build</div><div class="line">cd build</div><div class="line">cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release ..</div><div class="line">nmake</div></div><!-- fragment --><p></em></p> -<p><em>When using conda, only release builds are currently supported.</em></p> -<p><em></p><h2>Build using Visual Studio (MSVC) Solution Files</h2> -<p></em></p> -<p><em></em></p> -<p><em>Activate your conda build environment:</em></p> -<p><em></p><div class="fragment"><div class="line">activate arrow-dev</div></div><!-- fragment --><p></em></p> -<p><em>Change working directory in cmd.exe to the root directory of Arrow and do an out of source build by generating a MSVC solution:</em></p> -<p><em></p><div class="fragment"><div class="line">cd cpp</div><div class="line">mkdir build</div><div class="line">cd build</div><div class="line">cmake -G "Visual Studio 14 2015 Win64" -DCMAKE_BUILD_TYPE=Release ..</div><div class="line">cmake --build . --config Release</div></div><!-- fragment --><p></em></p> -<p><em></p><h2>Debug build</h2> -<p></em></p> -<p><em></em></p> -<p><em>To build Debug version of Arrow you should have pre-insalled Debug version of boost libs.</em></p> -<p><em>It's recommended to configure cmake build with following variables for Debug build:</em></p> -<p><em><code>-DARROW_BOOST_USE_SHARED=OFF</code> - enables static linking with boost debug libs and simplifies run-time loading of 3rd parties. (Recommended)</em></p> -<p><em><code>-DBOOST_ROOT</code> - sets the root directory of boost libs. (Optional)</em></p> -<p><em><code>-DBOOST_LIBRARYDIR</code> - sets the directory with boost lib files. (Optional)</em></p> -<p><em>Command line to build Arrow in Debug might look as following:</em></p> -<p><em></p><div class="fragment"><div class="line">cd cpp</div><div class="line">mkdir build</div><div class="line">cd build</div><div class="line">cmake -G "Visual Studio 14 2015 Win64" ^</div><div class="line"> -DARROW_BOOST_USE_SHARED=OFF ^</div><div class="line"> -DCMAKE_BUILD_TYPE=Debug ^</div><div class="line"> -DBOOST_ROOT=C:/local/boost_1_63_0 ^</div><div class="line"> -DBOOST_LIBRARYDIR=C:/local/boost_1_63_0/lib64-msvc-14.0 ^</div><div class="line"> ..</div><div class="line">cmake --build . --config Debug</div></div><!-- fragment --><p></em></p> -<p><em>To get the latest build instructions, you can reference <a href="https://github.com/apache/arrow/blob/master/ci/msvc-build.bat">msvc-build.bat</a>, which is used by automated Appveyor builds. </em></p> +<p>Activate just created conda environment with pre-installed packages from previous step:</p> +<div class="fragment"><div class="line">activate arrow-dev</div></div><!-- fragment --><p>We are using the <a href="https://cmake.org/">cmake</a> tool to support Windows builds. To allow cmake to pick up 3rd party dependencies, you should set <code>ARROW_BUILD_TOOLCHAIN</code> environment variable to contain <code>Library</code> folder path of new created on previous step <code>arrow-dev</code> conda environment.</p> +<p>To set <code>ARROW_BUILD_TOOLCHAIN</code> environment variable visible only for current terminal session you can run following. <code>CONDA_PREFIX</code> is set by conda to the current environment root by the <code>activate</code> script. </p><div class="fragment"><div class="line">set ARROW_BUILD_TOOLCHAIN=%CONDA_PREFIX%\Library</div></div><!-- fragment --><p>To validate value of <code>ARROW_BUILD_TOOLCHAIN</code> environment variable you can run following terminal command: </p><div class="fragment"><div class="line">echo %ARROW_BUILD_TOOLCHAIN%</div></div><!-- fragment --><p>As alternative to <code>ARROW_BUILD_TOOLCHAIN</code>, it's possible to configure path to each 3rd party dependency separately by setting appropriate environment variable:</p> +<p><code>FLATBUFFERS_HOME</code> variable with path to <code>flatbuffers</code> installation <code>RAPIDJSON_HOME</code> variable with path to <code>rapidjson</code> installation <code>GFLAGS_HOME</code> variable with path to <code>gflags</code> installation <code>SNAPPY_HOME</code> variable with path to <code>snappy</code> installation <code>ZLIB_HOME</code> variable with path to <code>zlib</code> installation <code>BROTLI_HOME</code> variable with path to <code>brotli</code> installation <code>LZ4_HOME</code> variable with path to <code>lz4</code> installation <code>ZSTD_HOME</code> variable with path to <code>zstd</code> installation</p> +<h3>Customize static libraries names lookup of 3rd party dependencies</h3> +<p>If you decided to use pre-built 3rd party dependencies libs, it's possible to configure Arrow's cmake build script to search for customized names of 3rd party static libs.</p> +<p><code>zlib</code>. Pass <code>-DARROW_ZLIB_VENDORED=OFF</code> to enable lookup of custom zlib build. Set <code>ZLIB_HOME</code> environment variable. Pass <code>-DZLIB_MSVC_STATIC_LIB_SUFFIX=ZLIB_SUFFIX%</code> to link with zZLIB_SUFFIX%.lib</p> +<p><code>brotli</code>. Set <code>BROTLI_HOME</code> environment variable. Pass <code>-DBROTLI_MSVC_STATIC_LIB_SUFFIX=BROTLI_SUFFIX%</code> to link with brotli*BROTLI_SUFFIX%.lib. For brotli versions <= 0.6.0 installed from conda-forge this must be set to <code>_static</code>, otherwise the default of <code>-static</code> is used.</p> +<p><code>snappy</code>. Set <code>SNAPPY_HOME</code> environment variable. Pass <code>-DSNAPPY_MSVC_STATIC_LIB_SUFFIX=SNAPPY_SUFFIX%</code> to link with snappySNAPPY_SUFFIX%.lib.</p> +<p><code>lz4</code>. Set <code>LZ4_HOME</code> environment variable. Pass <code>-LZ4_MSVC_STATIC_LIB_SUFFIX=LZ4_SUFFIX%</code> to link with lz4LZ4_SUFFIX%.lib.</p> +<p><code>zstd</code>. Set <code>ZSTD_HOME</code> environment variable. Pass <code>-ZSTD_MSVC_STATIC_LIB_SUFFIX=ZSTD_SUFFIX%</code> to link with zstdZSTD_SUFFIX%.lib.</p> +<h3>Visual Studio</h3> +<p>Microsoft provides the free Visual Studio Community edition. When doing development, you must launch the developer command prompt using:</p> +<h4>Visual Studio 2015</h4> +<div class="fragment"><div class="line">"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64</div></div><!-- fragment --><h4>Visual Studio 2017</h4> +<div class="fragment"><div class="line">"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\VsDevCmd.bat" -arch=amd64</div></div><!-- fragment --><p>It's easiest to configure a console emulator like <a href="http://cmder.net/">cmder</a> to automatically launch this when starting a new development console.</p> +<h2>Building with Ninja and clcache</h2> +<p>We recommend the <a href="https://ninja-build.org/">Ninja</a> build system for better build parallelization, and the optional <a href="https://github.com/frerich/clcache/">clcache</a> compiler cache which keeps track of past compilations to avoid running them over and over again (in a way similar to the Unix-specific "ccache").</p> +<p>Activate your conda build environment to first install those utilities:</p> +<div class="fragment"><div class="line">activate arrow-dev</div><div class="line"></div><div class="line">conda install -c conda-forge ninja</div><div class="line">pip install git+https://github.com/frerich/clcache.git</div></div><!-- fragment --><p>Change working directory in cmd.exe to the root directory of Arrow and do an out of source build by generating Ninja files:</p> +<div class="fragment"><div class="line">cd cpp</div><div class="line">mkdir build</div><div class="line">cd build</div><div class="line">cmake -G "Ninja" -DCMAKE_BUILD_TYPE=Release ..</div><div class="line">cmake --build . --config Release</div></div><!-- fragment --><h2>Building with NMake</h2> +<p>Activate your conda build environment:</p> +<div class="fragment"><div class="line">activate arrow-dev</div></div><!-- fragment --><p>Change working directory in cmd.exe to the root directory of Arrow and do an out of source build using <code>nmake</code>:</p> +<div class="fragment"><div class="line">cd cpp</div><div class="line">mkdir build</div><div class="line">cd build</div><div class="line">cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release ..</div><div class="line">cmake --build . --config Release</div><div class="line">nmake</div></div><!-- fragment --><p>When using conda, only release builds are currently supported.</p> +<h2>Building using Visual Studio (MSVC) Solution Files</h2> +<p>Activate your conda build environment:</p> +<div class="fragment"><div class="line">activate arrow-dev</div></div><!-- fragment --><p>Change working directory in cmd.exe to the root directory of Arrow and do an out of source build by generating a MSVC solution:</p> +<div class="fragment"><div class="line">cd cpp</div><div class="line">mkdir build</div><div class="line">cd build</div><div class="line">cmake -G "Visual Studio 14 2015 Win64" -DCMAKE_BUILD_TYPE=Release ..</div><div class="line">cmake --build . --config Release</div></div><!-- fragment --><h2>Debug build</h2> +<p>To build Debug version of Arrow you should have pre-installed a Debug version of boost libs.</p> +<p>It's recommended to configure cmake build with the following variables for Debug build:</p> +<p><code>-DARROW_BOOST_USE_SHARED=OFF</code> - enables static linking with boost debug libs and simplifies run-time loading of 3rd parties. (Recommended)</p> +<p><code>-DBOOST_ROOT</code> - sets the root directory of boost libs. (Optional)</p> +<p><code>-DBOOST_LIBRARYDIR</code> - sets the directory with boost lib files. (Optional)</p> +<p>Command line to build Arrow in Debug might look as following:</p> +<div class="fragment"><div class="line">cd cpp</div><div class="line">mkdir build</div><div class="line">cd build</div><div class="line">cmake -G "Visual Studio 14 2015 Win64" ^</div><div class="line"> -DARROW_BOOST_USE_SHARED=OFF ^</div><div class="line"> -DCMAKE_BUILD_TYPE=Debug ^</div><div class="line"> -DBOOST_ROOT=C:/local/boost_1_63_0 ^</div><div class="line"> -DBOOST_LIBRARYDIR=C:/local/boost_1_63_0/lib64-msvc-14.0 ^</div><div class="line"> ..</div><div class="line">cmake --build . --config Debug</div></div><!-- fragment --><p>To get the latest build instructions, you can reference <a href="https://github.com/apache/arrow/blob/master/ci/msvc-build.bat">msvc-build.bat</a>, which is used by automated Appveyor builds. </p> </div></div><!-- contents --> <!-- start footer part --> <hr class="footer"/><address class="footer"><small>
