Browse files

License changed to BSD from MPL as per Yahoo! requirements

@All: Please note that the license has been changed from
MPL to BSD. Also all the dependencies that were bundled
along with the release have been hosted separately to
iron out any licensing issues that may arise later. Request
to update all your forks.
  • Loading branch information...
1 parent 37639db commit a369c484a9bf94eb19559923e963a0ac16758a93 Shravan Narayanamurthy committed Jul 19, 2011
Showing with 6,177 additions and 5,105 deletions.
  1. +1 −1 Makefile
  2. +47 −1 README
  3. BIN dependencies/boostinclude.tar.gz
  4. BIN dependencies/bzip2-1.0.5.tar.gz
  5. BIN dependencies/cppunit-1.12.1.tar.gz
  6. BIN dependencies/gflags-1.2.tar.gz
  7. BIN dependencies/glog-0.3.0.tar.gz
  8. BIN dependencies/mcpp-2.7.2.tar.gz
  9. BIN dependencies/protobuf-2.2.0a.tar.gz
  10. BIN dependencies/tbb22_20090809oss.tar.gz
  11. +1 −1 docs/html/_checkpointer_8h.html
  12. +72 −53 docs/html/_checkpointer_8h_source.html
  13. +1 −1 docs/html/_client_8h.html
  14. +90 −71 docs/html/_client_8h_source.html
  15. +1 −1 docs/html/_context_8cpp.html
  16. +1 −1 docs/html/_context_8h.html
  17. +89 −70 docs/html/_context_8h_source.html
  18. +1 −1 docs/html/_d_m___client_8cpp.html
  19. +1 −1 docs/html/_d_m___client_8h.html
  20. +216 −197 docs/html/_d_m___client_8h_source.html
  21. +1 −1 docs/html/_d_m___server_8cpp.html
  22. +1 −1 docs/html/_d_m___server_8h.html
  23. +187 −168 docs/html/_d_m___server_8h_source.html
  24. +1 −1 docs/html/_data___formatter_8h.html
  25. +73 −54 docs/html/_data___formatter_8h_source.html
  26. +1 −1 docs/html/_dirichlet_8cpp.html
  27. +1 −1 docs/html/_dirichlet_8h.html
  28. +55 −36 docs/html/_dirichlet_8h_source.html
  29. +1 −1 docs/html/_distributed_map_8cpp.html
  30. +1 −1 docs/html/_distributed_map_8h.html
  31. +1,356 −1,337 docs/html/_distributed_map_8h_source.html
  32. +1 −1 docs/html/_document_reader_8cpp.html
  33. +1 −1 docs/html/_document_reader_8h.html
  34. +107 −88 docs/html/_document_reader_8h_source.html
  35. +1 −1 docs/html/_document_writer_8cpp.html
  36. +1 −1 docs/html/_document_writer_8h.html
  37. +94 −75 docs/html/_document_writer_8h_source.html
  38. +1 −1 docs/html/_execution___strategy_8h.html
  39. +62 −43 docs/html/_execution___strategy_8h_source.html
  40. +1 −1 docs/html/_filter___eval_8cpp.html
  41. +1 −1 docs/html/_filter___eval_8h.html
  42. +75 −56 docs/html/_filter___eval_8h_source.html
  43. +1 −1 docs/html/_filter___optimizer_8cpp.html
  44. +1 −1 docs/html/_filter___optimizer_8h.html
  45. +69 −50 docs/html/_filter___optimizer_8h_source.html
  46. +1 −1 docs/html/_filter___reader_8cpp.html
  47. +1 −1 docs/html/_filter___reader_8h.html
  48. +74 −55 docs/html/_filter___reader_8h_source.html
  49. +1 −1 docs/html/_filter___sampler_8cpp.html
  50. +1 −1 docs/html/_filter___sampler_8h.html
  51. +71 −52 docs/html/_filter___sampler_8h_source.html
  52. +1 −1 docs/html/_filter___tester_8cpp.html
  53. +1 −1 docs/html/_filter___tester_8h.html
  54. +70 −51 docs/html/_filter___tester_8h_source.html
  55. +1 −1 docs/html/_filter___updater_8cpp.html
  56. +1 −1 docs/html/_filter___updater_8h.html
  57. +66 −47 docs/html/_filter___updater_8h_source.html
  58. +1 −1 docs/html/_filter___writer_8cpp.html
  59. +1 −1 docs/html/_filter___writer_8h.html
  60. +70 −51 docs/html/_filter___writer_8h_source.html
  61. +1 −1 docs/html/_format_data__flags__define_8h.html
  62. +57 −38 docs/html/_format_data__flags__define_8h_source.html
  63. +1 −1 docs/html/_formatter_2_controller_8cpp.html
  64. +1 −1 docs/html/_generic_top_k_list_8h.html
  65. +113 −94 docs/html/_generic_top_k_list_8h_source.html
  66. +1 −1 docs/html/_hadoop___checkpointer_8cpp.html
  67. +1 −1 docs/html/_hadoop___checkpointer_8h.html
  68. +59 −40 docs/html/_hadoop___checkpointer_8h_source.html
  69. +1 −1 docs/html/_hashmap___array_8h.html
  70. +172 −153 docs/html/_hashmap___array_8h_source.html
  71. +1 −1 docs/html/_l_d_a_util_8cpp.html
  72. +1 −1 docs/html/_l_d_a_util_8h.html
  73. +97 −78 docs/html/_l_d_a_util_8h_source.html
  74. +1 −1 docs/html/_local___checkpointer_8cpp.html
  75. +1 −1 docs/html/_local___checkpointer_8h.html
  76. +60 −41 docs/html/_local___checkpointer_8h_source.html
  77. +1 −1 docs/html/_main__flags__define_8h.html
  78. +82 −63 docs/html/_main__flags__define_8h_source.html
  79. +1 −1 docs/html/_merge___dictionaries_8cpp.html
  80. +1 −1 docs/html/_merge___topic___counts_8cpp.html
  81. +1 −1 docs/html/_model_8h.html
  82. +73 −54 docs/html/_model_8h_source.html
  83. +1 −1 docs/html/_model___builder_8h.html
  84. +85 −66 docs/html/_model___builder_8h_source.html
  85. +1 −1 docs/html/_model___director_8cpp.html
  86. +1 −1 docs/html/_model___director_8h.html
  87. +73 −54 docs/html/_model___director_8h_source.html
  88. +1 −1 docs/html/_model___refiner_8h.html
  89. +78 −59 docs/html/_model___refiner_8h_source.html
  90. +1 −1 docs/html/_parameter_8cpp.html
  91. +1 −1 docs/html/_parameter_8h.html
  92. +78 −59 docs/html/_parameter_8h_source.html
  93. +1 −1 docs/html/_pipeline_8h.html
  94. +73 −54 docs/html/_pipeline_8h_source.html
  95. +1 −1 docs/html/_server___helper_8h.html
  96. +71 −52 docs/html/_server___helper_8h_source.html
  97. +1 −1 docs/html/_synchronized___training___execution___strategy_8cpp.html
  98. +1 −1 docs/html/_synchronized___training___execution___strategy_8h.html
  99. +67 −48 docs/html/_synchronized___training___execution___strategy_8h_source.html
  100. +1 −1 docs/html/_synchronizer_8cpp.html
  101. +1 −1 docs/html/_synchronizer_8h.html
  102. +92 −73 docs/html/_synchronizer_8h_source.html
  103. +1 −1 docs/html/_synchronizer___helper_8h.html
  104. +80 −61 docs/html/_synchronizer___helper_8h_source.html
  105. +1 −1 docs/html/_t_b_b___pipeline_8cpp.html
  106. +1 −1 docs/html/_t_b_b___pipeline_8h.html
  107. +96 −77 docs/html/_t_b_b___pipeline_8h_source.html
  108. +1 −1 docs/html/_testing___execution___strategy_8cpp.html
  109. +1 −1 docs/html/_testing___execution___strategy_8h.html
  110. +71 −52 docs/html/_testing___execution___strategy_8h_source.html
  111. +1 −1 docs/html/_top_k_list_8cpp.html
  112. +1 −1 docs/html/_top_k_list_8h.html
  113. +90 −71 docs/html/_top_k_list_8h_source.html
  114. +1 −1 docs/html/_topic_counts_8cpp.html
  115. +1 −1 docs/html/_topic_counts_8h.html
  116. +149 −130 docs/html/_topic_counts_8h_source.html
  117. +1 −1 docs/html/_topic_learner_2_controller_8cpp.html
  118. +1 −1 docs/html/_training___execution___strategy_8cpp.html
  119. +1 −1 docs/html/_training___execution___strategy_8h.html
  120. +76 −57 docs/html/_training___execution___strategy_8h_source.html
  121. +1 −1 docs/html/_type_topic_counts_8cpp.html
  122. +1 −1 docs/html/_type_topic_counts_8h.html
  123. +172 −153 docs/html/_type_topic_counts_8h_source.html
  124. +1 −1 docs/html/_unigram___model_8cpp.html
  125. +1 −1 docs/html/_unigram___model_8h.html
  126. +81 −62 docs/html/_unigram___model_8h_source.html
  127. +1 −1 docs/html/_unigram___model___server___helper_8cpp.html
  128. +1 −1 docs/html/_unigram___model___server___helper_8h.html
  129. +60 −41 docs/html/_unigram___model___server___helper_8h_source.html
  130. +1 −1 docs/html/_unigram___model___streamer_8cpp.html
  131. +1 −1 docs/html/_unigram___model___streamer_8h.html
  132. +67 −48 docs/html/_unigram___model___streamer_8h_source.html
  133. +1 −1 docs/html/_unigram___model___streaming___builder_8cpp.html
  134. +1 −1 docs/html/_unigram___model___streaming___builder_8h.html
  135. +75 −56 docs/html/_unigram___model___streaming___builder_8h_source.html
  136. +1 −1 docs/html/_unigram___model___synchronized___training___builder_8cpp.html
  137. +1 −1 docs/html/_unigram___model___synchronized___training___builder_8h.html
  138. +62 −43 docs/html/_unigram___model___synchronized___training___builder_8h_source.html
  139. +1 −1 docs/html/_unigram___model___synchronizer___helper_8cpp.html
  140. +1 −1 docs/html/_unigram___model___synchronizer___helper_8h.html
  141. +78 −59 docs/html/_unigram___model___synchronizer___helper_8h_source.html
  142. +1 −1 docs/html/_unigram___model___tester_8cpp.html
  143. +1 −1 docs/html/_unigram___model___tester_8h.html
  144. +96 −77 docs/html/_unigram___model___tester_8h_source.html
  145. +1 −1 docs/html/_unigram___model___testing___builder_8cpp.html
  146. +1 −1 docs/html/_unigram___model___testing___builder_8h.html
  147. +58 −39 docs/html/_unigram___model___testing___builder_8h_source.html
  148. +1 −1 docs/html/_unigram___model___trainer_8cpp.html
  149. +1 −1 docs/html/_unigram___model___trainer_8h.html
  150. +156 −137 docs/html/_unigram___model___trainer_8h_source.html
  151. +1 −1 docs/html/_unigram___model___training___builder_8cpp.html
  152. +1 −1 docs/html/_unigram___model___training___builder_8h.html
  153. +77 −58 docs/html/_unigram___model___training___builder_8h_source.html
  154. +1 −1 docs/html/_unigram___test___data___formatter_8cpp.html
  155. +1 −1 docs/html/_unigram___test___data___formatter_8h.html
  156. +62 −43 docs/html/_unigram___test___data___formatter_8h_source.html
  157. +1 −1 docs/html/_unigram___train___data___formatter_8cpp.html
  158. +1 −1 docs/html/_unigram___train___data___formatter_8h.html
  159. +77 −58 docs/html/_unigram___train___data___formatter_8h_source.html
  160. +1 −1 docs/html/_word_index_dictionary_8cpp.html
  161. +1 −1 docs/html/_word_index_dictionary_8h.html
  162. +99 −80 docs/html/_word_index_dictionary_8h_source.html
  163. +1 −1 docs/html/annotated.html
  164. +1 −1 docs/html/architecture.html
  165. +1 −1 docs/html/architecture_8h.html
  166. +1 −1 docs/html/architecture_8h_source.html
  167. +1 −1 docs/html/class_checkpointer-members.html
  168. +1 −1 docs/html/class_checkpointer.html
  169. +1 −1 docs/html/class_client-members.html
  170. +1 −1 docs/html/class_client.html
  171. +1 −1 docs/html/class_context-members.html
  172. +1 −1 docs/html/class_context.html
  173. +1 −1 docs/html/class_d_m___client-members.html
  174. +1 −1 docs/html/class_d_m___client.html
  175. +1 −1 docs/html/class_d_m___server-members.html
  176. +1 −1 docs/html/class_d_m___server.html
  177. +1 −1 docs/html/class_data___formatter-members.html
  178. +1 −1 docs/html/class_data___formatter.html
  179. +1 −1 docs/html/class_document_reader-members.html
  180. +1 −1 docs/html/class_document_reader.html
  181. +1 −1 docs/html/class_document_writer-members.html
  182. +1 −1 docs/html/class_document_writer.html
  183. +1 −1 docs/html/class_execution___strategy-members.html
  184. +1 −1 docs/html/class_execution___strategy.html
  185. +1 −1 docs/html/class_filter___eval-members.html
Sorry, we could not display the entire diff because too many files (520) changed.
View
2 Makefile
@@ -9,9 +9,9 @@ export OTHERS=-MMD -MP
LIBS=-lprotobuf -ltbb -lcppunit -lpthread -lgflags -lglog -lIce -lIceUtil -lrt
all: compile link
+ chmod +x learntopics formatter DM_Server Merge_Dictionaries Merge_Topic_Counts
compile: libraries children
- chmod +x learntopics formatter DM_Server Merge_Dictionaries Merge_Topic_Counts
children:
$(MAKE) -C src all
View
48 README
@@ -1 +1,47 @@
-Please refer to the html or pdf documentation present at docs/html/index.html & docs/latex/refman.pdf respectively.
+The Yahoo_LDA project uses several 3rd party open source libraries and tools.
+
+This file summarizes the tools used, their purpose, and the licenses under which they're released.
+
+Except as specifically stated below, the 3rd party software packages are not distributed as part of
+
+this project, but instead are separately downloaded and built on the developer’s machine as a
+
+pre-build step.
+
+* Ice-3.4.1 (GNU GENERAL PUBLIC LICENSE)
+* An efficient inter process communication framework which is used for the distributed storage of (topic, word) tables.
+* http://www.zeroc.com/
+
+* cppunit-1.12.1 (GNU LESSER GENERAL PUBLIC LICENSE)
+* C++ unit testing framework. We use this for unit tests.
+* http://cppunit.sourceforge.net
+
+* glog-0.3.0 (BSD)
+* Logfile generation (Google's log library).
+* http://code.google.com/p/google-glog/
+
+* mcpp-2.7.2 (BSD)
+* C++ preprocessor
+* http://mcpp.sourceforge.net/
+
+* tbb22_20090809oss (GNU GENERAL PUBLIC LICENSE)
+* Intel Threading Building Blocks. Multithreaded processing library. Much easier to use than pthreads. We use the pipeline class.
+* http://threadingbuildingblocks.org
+
+* bzip2-1.0.5 (BSD)
+* Data compression
+* http://www.bzip.org/
+
+* gflags-1.2 (BSD)
+* Google's flag processing library (used for commandline options)
+* http://code.google.com/p/google-gflags/
+
+* protobuf-2.2.0a (BSD)
+* Protocol buffers (used for serializing data to disk and as internal key data structure). Google's serialization library
+* http://code.google.com/p/protobuf/
+
+* boost-1.46.0 (Boost Software License - Version 1.0 - August 17th, 2003)
+* Boost Libraries (various datatypes)
+* http://www.boost.org/
+
+Please refer to the html or pdf documentation present at docs/html/index.html & docs/latex/refman.pdf respectively for more information.
View
BIN dependencies/boostinclude.tar.gz
Binary file not shown.
View
BIN dependencies/bzip2-1.0.5.tar.gz
Binary file not shown.
View
BIN dependencies/cppunit-1.12.1.tar.gz
Binary file not shown.
View
BIN dependencies/gflags-1.2.tar.gz
Binary file not shown.
View
BIN dependencies/glog-0.3.0.tar.gz
Binary file not shown.
View
BIN dependencies/mcpp-2.7.2.tar.gz
Binary file not shown.
View
BIN dependencies/protobuf-2.2.0a.tar.gz
Binary file not shown.
View
BIN dependencies/tbb22_20090809oss.tar.gz
Binary file not shown.
View
2 docs/html/_checkpointer_8h.html
@@ -35,7 +35,7 @@
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Used to implement failure recovery. <a href="class_checkpointer.html#_details">More...</a><br/></td></tr>
</table>
</div>
-<hr class="footer"/><address style="text-align: right;"><small>Generated on Thu Jul 14 12:04:31 2011 for Y!LDA by&nbsp;
+<hr class="footer"/><address style="text-align: right;"><small>Generated on Tue Jul 19 11:45:25 2011 for Y!LDA by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.3 </small></address>
</body>
View
125 docs/html/_checkpointer_8h_source.html
@@ -24,61 +24,80 @@
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
-<h1>src/commons/TopicLearner/Checkpointer.h</h1><a href="_checkpointer_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*****************************************************************************</span>
-<a name="l00002"></a>00002 <span class="comment"> The contents of this file are subject to the Mozilla Public License</span>
-<a name="l00003"></a>00003 <span class="comment"> Version 1.1 (the &quot;License&quot;); you may not use this file except in</span>
-<a name="l00004"></a>00004 <span class="comment"> compliance with the License. You may obtain a copy of the License at</span>
-<a name="l00005"></a>00005 <span class="comment"> http://www.mozilla.org/MPL/</span>
-<a name="l00006"></a>00006 <span class="comment"></span>
-<a name="l00007"></a>00007 <span class="comment"> Software distributed under the License is distributed on an &quot;AS IS&quot;</span>
-<a name="l00008"></a>00008 <span class="comment"> basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the</span>
-<a name="l00009"></a>00009 <span class="comment"> License for the specific language governing rights and limitations</span>
-<a name="l00010"></a>00010 <span class="comment"> under the License.</span>
-<a name="l00011"></a>00011 <span class="comment"></span>
-<a name="l00012"></a>00012 <span class="comment"> The Original Code is Copyright (C) by Yahoo! Research.</span>
-<a name="l00013"></a>00013 <span class="comment"></span>
-<a name="l00014"></a>00014 <span class="comment"> The Initial Developer of the Original Code is Shravan Narayanamurthy.</span>
-<a name="l00015"></a>00015 <span class="comment"></span>
-<a name="l00016"></a>00016 <span class="comment"> All Rights Reserved.</span>
-<a name="l00017"></a>00017 <span class="comment">******************************************************************************/</span>
-<a name="l00018"></a>00018 <span class="comment">/*</span>
-<a name="l00019"></a>00019 <span class="comment"> * Checkpointer.h</span>
-<a name="l00020"></a>00020 <span class="comment"> *</span>
-<a name="l00021"></a>00021 <span class="comment"> *</span>
-<a name="l00022"></a>00022 <span class="comment"> *</span>
-<a name="l00023"></a>00023 <span class="comment"> * Created on: 07-Mar-2011</span>
-<a name="l00024"></a>00024 <span class="comment"> * </span>
-<a name="l00025"></a>00025 <span class="comment"> */</span>
-<a name="l00026"></a>00026
-<a name="l00027"></a>00027 <span class="preprocessor">#ifndef CHECKPOINTER_H_</span>
-<a name="l00028"></a>00028 <span class="preprocessor"></span><span class="preprocessor">#define CHECKPOINTER_H_</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span>
-<a name="l00030"></a>00030 <span class="preprocessor">#include &lt;string&gt;</span>
-<a name="l00031"></a>00031 <span class="comment"></span>
-<a name="l00032"></a>00032 <span class="comment">//!Used to implement failure recovery</span>
-<a name="l00033"></a>00033 <span class="comment"></span><span class="comment">/**</span>
-<a name="l00034"></a>00034 <span class="comment"> * The checkpointer interface.</span>
-<a name="l00035"></a>00035 <span class="comment"> * A checkpointer object helps create a checkpoint and</span>
-<a name="l00036"></a>00036 <span class="comment"> * also to load from a checkpoint</span>
-<a name="l00037"></a>00037 <span class="comment"> *</span>
-<a name="l00038"></a>00038 <span class="comment"> * A checkpointer has two things:</span>
-<a name="l00039"></a>00039 <span class="comment"> * 1. Metadata - (Ex.: The iteration at which this checkpoint was created)</span>
-<a name="l00040"></a>00040 <span class="comment"> * 2. The method to serialize the necessary data structures to disk</span>
+<h1>src/commons/TopicLearner/Checkpointer.h</h1><a href="_checkpointer_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*******************************************************************************</span>
+<a name="l00002"></a>00002 <span class="comment"> Copyright (c) 2011, Yahoo! Inc.</span>
+<a name="l00003"></a>00003 <span class="comment"> All rights reserved.</span>
+<a name="l00004"></a>00004 <span class="comment"></span>
+<a name="l00005"></a>00005 <span class="comment"> Redistribution and use of this software in source and binary forms, </span>
+<a name="l00006"></a>00006 <span class="comment"> with or without modification, are permitted provided that the following </span>
+<a name="l00007"></a>00007 <span class="comment"> conditions are met:</span>
+<a name="l00008"></a>00008 <span class="comment"></span>
+<a name="l00009"></a>00009 <span class="comment"> * Redistributions of source code must retain the above</span>
+<a name="l00010"></a>00010 <span class="comment"> copyright notice, this list of conditions and the</span>
+<a name="l00011"></a>00011 <span class="comment"> following disclaimer.</span>
+<a name="l00012"></a>00012 <span class="comment"></span>
+<a name="l00013"></a>00013 <span class="comment"> * Redistributions in binary form must reproduce the above</span>
+<a name="l00014"></a>00014 <span class="comment"> copyright notice, this list of conditions and the</span>
+<a name="l00015"></a>00015 <span class="comment"> following disclaimer in the documentation and/or other</span>
+<a name="l00016"></a>00016 <span class="comment"> materials provided with the distribution.</span>
+<a name="l00017"></a>00017 <span class="comment"></span>
+<a name="l00018"></a>00018 <span class="comment"> * Neither the name of Yahoo! Inc. nor the names of its</span>
+<a name="l00019"></a>00019 <span class="comment"> contributors may be used to endorse or promote products</span>
+<a name="l00020"></a>00020 <span class="comment"> derived from this software without specific prior</span>
+<a name="l00021"></a>00021 <span class="comment"> written permission of Yahoo! Inc.</span>
+<a name="l00022"></a>00022 <span class="comment"></span>
+<a name="l00023"></a>00023 <span class="comment"> THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS &quot;AS </span>
+<a name="l00024"></a>00024 <span class="comment"> IS&quot; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED </span>
+<a name="l00025"></a>00025 <span class="comment"> TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A </span>
+<a name="l00026"></a>00026 <span class="comment"> PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT </span>
+<a name="l00027"></a>00027 <span class="comment"> OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, </span>
+<a name="l00028"></a>00028 <span class="comment"> SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT </span>
+<a name="l00029"></a>00029 <span class="comment"> LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, </span>
+<a name="l00030"></a>00030 <span class="comment"> DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY </span>
+<a name="l00031"></a>00031 <span class="comment"> THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT </span>
+<a name="l00032"></a>00032 <span class="comment"> (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE </span>
+<a name="l00033"></a>00033 <span class="comment"> OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</span>
+<a name="l00034"></a>00034 <span class="comment"></span>
+<a name="l00035"></a>00035 <span class="comment"> The Initial Developer of the Original Code is Shravan Narayanamurthy.</span>
+<a name="l00036"></a>00036 <span class="comment">******************************************************************************/</span>
+<a name="l00037"></a>00037 <span class="comment">/*</span>
+<a name="l00038"></a>00038 <span class="comment"> * Checkpointer.h</span>
+<a name="l00039"></a>00039 <span class="comment"> *</span>
+<a name="l00040"></a>00040 <span class="comment"> *</span>
<a name="l00041"></a>00041 <span class="comment"> *</span>
-<a name="l00042"></a>00042 <span class="comment"> */</span>
-<a name="l00043"></a><a class="code" href="class_checkpointer.html">00043</a> <span class="keyword">class </span><a class="code" href="class_checkpointer.html" title="Used to implement failure recovery.">Checkpointer</a> {
-<a name="l00044"></a>00044 <span class="keyword">public</span>:<span class="comment"></span>
-<a name="l00045"></a>00045 <span class="comment"> //!Serialize the metadata</span>
-<a name="l00046"></a>00046 <span class="comment"></span> <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_checkpointer.html#a2dd3cfe87847c8e3d1dac001c8d75a8c" title="Serialize the metadata.">save_metadata</a>(std::string&amp; state) = 0;<span class="comment"></span>
-<a name="l00047"></a>00047 <span class="comment"> //!Load the metadata</span>
-<a name="l00048"></a>00048 <span class="comment"></span> <span class="keyword">virtual</span> std::string <a class="code" href="class_checkpointer.html#ab3823bbe8bab653084697af29296323d" title="Load the metadata.">load_metadata</a>() = 0;<span class="comment"></span>
-<a name="l00049"></a>00049 <span class="comment"> //!Serialize other necessary data structures</span>
-<a name="l00050"></a>00050 <span class="comment"></span> <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_checkpointer.html#a7a0f2b3220292d7a3be972776ea8f2d3" title="Serialize other necessary data structures.">checkpoint</a>() = 0;
-<a name="l00051"></a>00051 };
-<a name="l00052"></a>00052
-<a name="l00053"></a>00053 <span class="preprocessor">#endif </span><span class="comment">/* CHECKPOINTER_H_ */</span>
+<a name="l00042"></a>00042 <span class="comment"> * Created on: 07-Mar-2011</span>
+<a name="l00043"></a>00043 <span class="comment"> * </span>
+<a name="l00044"></a>00044 <span class="comment"> */</span>
+<a name="l00045"></a>00045
+<a name="l00046"></a>00046 <span class="preprocessor">#ifndef CHECKPOINTER_H_</span>
+<a name="l00047"></a>00047 <span class="preprocessor"></span><span class="preprocessor">#define CHECKPOINTER_H_</span>
+<a name="l00048"></a>00048 <span class="preprocessor"></span>
+<a name="l00049"></a>00049 <span class="preprocessor">#include &lt;string&gt;</span>
+<a name="l00050"></a>00050 <span class="comment"></span>
+<a name="l00051"></a>00051 <span class="comment">//!Used to implement failure recovery</span>
+<a name="l00052"></a>00052 <span class="comment"></span><span class="comment">/**</span>
+<a name="l00053"></a>00053 <span class="comment"> * The checkpointer interface.</span>
+<a name="l00054"></a>00054 <span class="comment"> * A checkpointer object helps create a checkpoint and</span>
+<a name="l00055"></a>00055 <span class="comment"> * also to load from a checkpoint</span>
+<a name="l00056"></a>00056 <span class="comment"> *</span>
+<a name="l00057"></a>00057 <span class="comment"> * A checkpointer has two things:</span>
+<a name="l00058"></a>00058 <span class="comment"> * 1. Metadata - (Ex.: The iteration at which this checkpoint was created)</span>
+<a name="l00059"></a>00059 <span class="comment"> * 2. The method to serialize the necessary data structures to disk</span>
+<a name="l00060"></a>00060 <span class="comment"> *</span>
+<a name="l00061"></a>00061 <span class="comment"> */</span>
+<a name="l00062"></a><a class="code" href="class_checkpointer.html">00062</a> <span class="keyword">class </span><a class="code" href="class_checkpointer.html" title="Used to implement failure recovery.">Checkpointer</a> {
+<a name="l00063"></a>00063 <span class="keyword">public</span>:<span class="comment"></span>
+<a name="l00064"></a>00064 <span class="comment"> //!Serialize the metadata</span>
+<a name="l00065"></a>00065 <span class="comment"></span> <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_checkpointer.html#a2dd3cfe87847c8e3d1dac001c8d75a8c" title="Serialize the metadata.">save_metadata</a>(std::string&amp; state) = 0;<span class="comment"></span>
+<a name="l00066"></a>00066 <span class="comment"> //!Load the metadata</span>
+<a name="l00067"></a>00067 <span class="comment"></span> <span class="keyword">virtual</span> std::string <a class="code" href="class_checkpointer.html#ab3823bbe8bab653084697af29296323d" title="Load the metadata.">load_metadata</a>() = 0;<span class="comment"></span>
+<a name="l00068"></a>00068 <span class="comment"> //!Serialize other necessary data structures</span>
+<a name="l00069"></a>00069 <span class="comment"></span> <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_checkpointer.html#a7a0f2b3220292d7a3be972776ea8f2d3" title="Serialize other necessary data structures.">checkpoint</a>() = 0;
+<a name="l00070"></a>00070 };
+<a name="l00071"></a>00071
+<a name="l00072"></a>00072 <span class="preprocessor">#endif </span><span class="comment">/* CHECKPOINTER_H_ */</span>
</pre></div></div>
-<hr class="footer"/><address style="text-align: right;"><small>Generated on Thu Jul 14 12:04:31 2011 for Y!LDA by&nbsp;
+<hr class="footer"/><address style="text-align: right;"><small>Generated on Tue Jul 19 11:45:24 2011 for Y!LDA by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.3 </small></address>
</body>
View
2 docs/html/_client_8h.html
@@ -34,7 +34,7 @@
<tr><td class="memItemLeft" align="right" valign="top">class &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_client.html">Client</a></td></tr>
</table>
</div>
-<hr class="footer"/><address style="text-align: right;"><small>Generated on Thu Jul 14 12:04:31 2011 for Y!LDA by&nbsp;
+<hr class="footer"/><address style="text-align: right;"><small>Generated on Tue Jul 19 11:45:25 2011 for Y!LDA by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.3 </small></address>
</body>
View
161 docs/html/_client_8h_source.html
@@ -24,80 +24,99 @@
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
-<h1>src/commons/Client.h</h1><a href="_client_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*****************************************************************************</span>
-<a name="l00002"></a>00002 <span class="comment"> The contents of this file are subject to the Mozilla Public License</span>
-<a name="l00003"></a>00003 <span class="comment"> Version 1.1 (the &quot;License&quot;); you may not use this file except in</span>
-<a name="l00004"></a>00004 <span class="comment"> compliance with the License. You may obtain a copy of the License at</span>
-<a name="l00005"></a>00005 <span class="comment"> http://www.mozilla.org/MPL/</span>
-<a name="l00006"></a>00006 <span class="comment"></span>
-<a name="l00007"></a>00007 <span class="comment"> Software distributed under the License is distributed on an &quot;AS IS&quot;</span>
-<a name="l00008"></a>00008 <span class="comment"> basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the</span>
-<a name="l00009"></a>00009 <span class="comment"> License for the specific language governing rights and limitations</span>
-<a name="l00010"></a>00010 <span class="comment"> under the License.</span>
-<a name="l00011"></a>00011 <span class="comment"></span>
-<a name="l00012"></a>00012 <span class="comment"> The Original Code is Copyright (C) by Yahoo! Research.</span>
-<a name="l00013"></a>00013 <span class="comment"></span>
-<a name="l00014"></a>00014 <span class="comment"> The Initial Developer of the Original Code is Shravan Narayanamurthy.</span>
-<a name="l00015"></a>00015 <span class="comment"></span>
-<a name="l00016"></a>00016 <span class="comment"> All Rights Reserved.</span>
-<a name="l00017"></a>00017 <span class="comment">******************************************************************************/</span>
-<a name="l00018"></a>00018 <span class="comment">/*</span>
-<a name="l00019"></a>00019 <span class="comment"> * Client.h</span>
-<a name="l00020"></a>00020 <span class="comment"> *</span>
-<a name="l00021"></a>00021 <span class="comment"> *</span>
-<a name="l00022"></a>00022 <span class="comment"> *</span>
-<a name="l00023"></a>00023 <span class="comment"> * Created on: 07-Jan-2011</span>
-<a name="l00024"></a>00024 <span class="comment"> * </span>
-<a name="l00025"></a>00025 <span class="comment"> */</span>
-<a name="l00026"></a>00026
-<a name="l00027"></a>00027 <span class="preprocessor">#ifndef CLIENT_H_</span>
-<a name="l00028"></a>00028 <span class="preprocessor"></span><span class="preprocessor">#define CLIENT_H_</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span>
-<a name="l00030"></a>00030 <span class="preprocessor">#include &lt;string&gt;</span>
-<a name="l00031"></a>00031
-<a name="l00032"></a>00032 <span class="keyword">using namespace </span>std;
-<a name="l00033"></a>00033 <span class="comment"></span>
-<a name="l00034"></a>00034 <span class="comment">/**</span>
-<a name="l00035"></a>00035 <span class="comment"> * The interface to be implemented by any client for the</span>
-<a name="l00036"></a>00036 <span class="comment"> * Distributed Map service</span>
-<a name="l00037"></a>00037 <span class="comment"> */</span>
-<a name="l00038"></a><a class="code" href="class_client.html">00038</a> <span class="keyword">class </span><a class="code" href="class_client.html">Client</a> {
-<a name="l00039"></a>00039 <span class="keyword">public</span>:<span class="comment"></span>
-<a name="l00040"></a>00040 <span class="comment"> //!Gets the serialized val stored for the key in</span>
-<a name="l00041"></a>00041 <span class="comment"> //!the Distributed Map. Returns true if key exists</span>
-<a name="l00042"></a>00042 <span class="comment"> //!and false otherwise</span>
-<a name="l00043"></a>00043 <span class="comment"></span> <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <span class="keyword">get</span>(<span class="keyword">const</span> <span class="keywordtype">string</span>&amp; key, <span class="keywordtype">string</span>&amp; val) = 0;
-<a name="l00044"></a>00044 <span class="comment"></span>
-<a name="l00045"></a>00045 <span class="comment"> //!Sets val as the serialized value for the key in</span>
-<a name="l00046"></a>00046 <span class="comment"> //!the Distributed Map. This has replace semantics</span>
-<a name="l00047"></a>00047 <span class="comment"></span> <span class="keyword">virtual</span> <span class="keywordtype">void</span> <span class="keyword">set</span>(<span class="keyword">const</span> <span class="keywordtype">string</span>&amp; key, <span class="keyword">const</span> <span class="keywordtype">string</span>&amp; val) = 0;
-<a name="l00048"></a>00048 <span class="comment"></span>
-<a name="l00049"></a>00049 <span class="comment"> //!Adds delta to the serialized value for the key in</span>
-<a name="l00050"></a>00050 <span class="comment"> //!the Distributed Map. This has accumulator semantics.</span>
-<a name="l00051"></a>00051 <span class="comment"> //!The accumulator logic is provided by the Server_Helper.</span>
-<a name="l00052"></a>00052 <span class="comment"></span> <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_client.html#a7369bb878f12a07b717638efb5871668">put</a>(<span class="keyword">const</span> <span class="keywordtype">string</span>&amp; key, <span class="keyword">const</span> <span class="keywordtype">string</span>&amp; delta) = 0;
-<a name="l00053"></a>00053 <span class="comment"></span>
-<a name="l00054"></a>00054 <span class="comment"> //!Asynchronous put and get operation. It begins with</span>
-<a name="l00055"></a>00055 <span class="comment"> //!a put. The call back in Synchronizer_Helper is called</span>
-<a name="l00056"></a>00056 <span class="comment"> //!which creates the effect of a get</span>
-<a name="l00057"></a>00057 <span class="comment"></span> <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_client.html#a3c7e1cbb61e8a9b2c5c89de884f22253">begin_putNget</a>(<span class="keyword">const</span> <span class="keywordtype">string</span>&amp; key, <span class="keyword">const</span> <span class="keywordtype">string</span>&amp; val) = 0;
-<a name="l00058"></a>00058 <span class="comment"></span>
-<a name="l00059"></a>00059 <span class="comment"> //!Remove the key from the Distributed Map returning</span>
-<a name="l00060"></a>00060 <span class="comment"> //!the serialized value stored as val. Returns true if key exists</span>
+<h1>src/commons/Client.h</h1><a href="_client_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*******************************************************************************</span>
+<a name="l00002"></a>00002 <span class="comment"> Copyright (c) 2011, Yahoo! Inc.</span>
+<a name="l00003"></a>00003 <span class="comment"> All rights reserved.</span>
+<a name="l00004"></a>00004 <span class="comment"></span>
+<a name="l00005"></a>00005 <span class="comment"> Redistribution and use of this software in source and binary forms, </span>
+<a name="l00006"></a>00006 <span class="comment"> with or without modification, are permitted provided that the following </span>
+<a name="l00007"></a>00007 <span class="comment"> conditions are met:</span>
+<a name="l00008"></a>00008 <span class="comment"></span>
+<a name="l00009"></a>00009 <span class="comment"> * Redistributions of source code must retain the above</span>
+<a name="l00010"></a>00010 <span class="comment"> copyright notice, this list of conditions and the</span>
+<a name="l00011"></a>00011 <span class="comment"> following disclaimer.</span>
+<a name="l00012"></a>00012 <span class="comment"></span>
+<a name="l00013"></a>00013 <span class="comment"> * Redistributions in binary form must reproduce the above</span>
+<a name="l00014"></a>00014 <span class="comment"> copyright notice, this list of conditions and the</span>
+<a name="l00015"></a>00015 <span class="comment"> following disclaimer in the documentation and/or other</span>
+<a name="l00016"></a>00016 <span class="comment"> materials provided with the distribution.</span>
+<a name="l00017"></a>00017 <span class="comment"></span>
+<a name="l00018"></a>00018 <span class="comment"> * Neither the name of Yahoo! Inc. nor the names of its</span>
+<a name="l00019"></a>00019 <span class="comment"> contributors may be used to endorse or promote products</span>
+<a name="l00020"></a>00020 <span class="comment"> derived from this software without specific prior</span>
+<a name="l00021"></a>00021 <span class="comment"> written permission of Yahoo! Inc.</span>
+<a name="l00022"></a>00022 <span class="comment"></span>
+<a name="l00023"></a>00023 <span class="comment"> THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS &quot;AS </span>
+<a name="l00024"></a>00024 <span class="comment"> IS&quot; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED </span>
+<a name="l00025"></a>00025 <span class="comment"> TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A </span>
+<a name="l00026"></a>00026 <span class="comment"> PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT </span>
+<a name="l00027"></a>00027 <span class="comment"> OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, </span>
+<a name="l00028"></a>00028 <span class="comment"> SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT </span>
+<a name="l00029"></a>00029 <span class="comment"> LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, </span>
+<a name="l00030"></a>00030 <span class="comment"> DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY </span>
+<a name="l00031"></a>00031 <span class="comment"> THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT </span>
+<a name="l00032"></a>00032 <span class="comment"> (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE </span>
+<a name="l00033"></a>00033 <span class="comment"> OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</span>
+<a name="l00034"></a>00034 <span class="comment"></span>
+<a name="l00035"></a>00035 <span class="comment"> The Initial Developer of the Original Code is Shravan Narayanamurthy.</span>
+<a name="l00036"></a>00036 <span class="comment">******************************************************************************/</span>
+<a name="l00037"></a>00037 <span class="comment">/*</span>
+<a name="l00038"></a>00038 <span class="comment"> * Client.h</span>
+<a name="l00039"></a>00039 <span class="comment"> *</span>
+<a name="l00040"></a>00040 <span class="comment"> *</span>
+<a name="l00041"></a>00041 <span class="comment"> *</span>
+<a name="l00042"></a>00042 <span class="comment"> * Created on: 07-Jan-2011</span>
+<a name="l00043"></a>00043 <span class="comment"> * </span>
+<a name="l00044"></a>00044 <span class="comment"> */</span>
+<a name="l00045"></a>00045
+<a name="l00046"></a>00046 <span class="preprocessor">#ifndef CLIENT_H_</span>
+<a name="l00047"></a>00047 <span class="preprocessor"></span><span class="preprocessor">#define CLIENT_H_</span>
+<a name="l00048"></a>00048 <span class="preprocessor"></span>
+<a name="l00049"></a>00049 <span class="preprocessor">#include &lt;string&gt;</span>
+<a name="l00050"></a>00050
+<a name="l00051"></a>00051 <span class="keyword">using namespace </span>std;
+<a name="l00052"></a>00052 <span class="comment"></span>
+<a name="l00053"></a>00053 <span class="comment">/**</span>
+<a name="l00054"></a>00054 <span class="comment"> * The interface to be implemented by any client for the</span>
+<a name="l00055"></a>00055 <span class="comment"> * Distributed Map service</span>
+<a name="l00056"></a>00056 <span class="comment"> */</span>
+<a name="l00057"></a><a class="code" href="class_client.html">00057</a> <span class="keyword">class </span><a class="code" href="class_client.html">Client</a> {
+<a name="l00058"></a>00058 <span class="keyword">public</span>:<span class="comment"></span>
+<a name="l00059"></a>00059 <span class="comment"> //!Gets the serialized val stored for the key in</span>
+<a name="l00060"></a>00060 <span class="comment"> //!the Distributed Map. Returns true if key exists</span>
<a name="l00061"></a>00061 <span class="comment"> //!and false otherwise</span>
-<a name="l00062"></a>00062 <span class="comment"></span> <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <span class="keyword">remove</span>(<span class="keyword">const</span> <span class="keywordtype">string</span>&amp; key, <span class="keywordtype">string</span>&amp; val) = 0;
+<a name="l00062"></a>00062 <span class="comment"></span> <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <span class="keyword">get</span>(<span class="keyword">const</span> <span class="keywordtype">string</span>&amp; key, <span class="keywordtype">string</span>&amp; val) = 0;
<a name="l00063"></a>00063 <span class="comment"></span>
-<a name="l00064"></a>00064 <span class="comment"> //!Provides barrier functionality</span>
-<a name="l00065"></a>00065 <span class="comment"></span> <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_client.html#af1bfd186c6afcddd19e0e6f69e1a8fc1" title="Provides barrier functionality.">wait_for_all</a>() = 0;
-<a name="l00066"></a>00066 <span class="comment"></span>
-<a name="l00067"></a>00067 <span class="comment"> //!Provides functionality to wait for any asynchronous communication</span>
-<a name="l00068"></a>00068 <span class="comment"> //!to end</span>
-<a name="l00069"></a>00069 <span class="comment"></span> <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_client.html#a7cc1fed7f1d161586a8abef93a24b715">wait_till_done</a>() = 0;
-<a name="l00070"></a>00070 };
-<a name="l00071"></a>00071
-<a name="l00072"></a>00072 <span class="preprocessor">#endif </span><span class="comment">/* CLIENT_H_ */</span>
+<a name="l00064"></a>00064 <span class="comment"> //!Sets val as the serialized value for the key in</span>
+<a name="l00065"></a>00065 <span class="comment"> //!the Distributed Map. This has replace semantics</span>
+<a name="l00066"></a>00066 <span class="comment"></span> <span class="keyword">virtual</span> <span class="keywordtype">void</span> <span class="keyword">set</span>(<span class="keyword">const</span> <span class="keywordtype">string</span>&amp; key, <span class="keyword">const</span> <span class="keywordtype">string</span>&amp; val) = 0;
+<a name="l00067"></a>00067 <span class="comment"></span>
+<a name="l00068"></a>00068 <span class="comment"> //!Adds delta to the serialized value for the key in</span>
+<a name="l00069"></a>00069 <span class="comment"> //!the Distributed Map. This has accumulator semantics.</span>
+<a name="l00070"></a>00070 <span class="comment"> //!The accumulator logic is provided by the Server_Helper.</span>
+<a name="l00071"></a>00071 <span class="comment"></span> <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_client.html#a7369bb878f12a07b717638efb5871668">put</a>(<span class="keyword">const</span> <span class="keywordtype">string</span>&amp; key, <span class="keyword">const</span> <span class="keywordtype">string</span>&amp; delta) = 0;
+<a name="l00072"></a>00072 <span class="comment"></span>
+<a name="l00073"></a>00073 <span class="comment"> //!Asynchronous put and get operation. It begins with</span>
+<a name="l00074"></a>00074 <span class="comment"> //!a put. The call back in Synchronizer_Helper is called</span>
+<a name="l00075"></a>00075 <span class="comment"> //!which creates the effect of a get</span>
+<a name="l00076"></a>00076 <span class="comment"></span> <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_client.html#a3c7e1cbb61e8a9b2c5c89de884f22253">begin_putNget</a>(<span class="keyword">const</span> <span class="keywordtype">string</span>&amp; key, <span class="keyword">const</span> <span class="keywordtype">string</span>&amp; val) = 0;
+<a name="l00077"></a>00077 <span class="comment"></span>
+<a name="l00078"></a>00078 <span class="comment"> //!Remove the key from the Distributed Map returning</span>
+<a name="l00079"></a>00079 <span class="comment"> //!the serialized value stored as val. Returns true if key exists</span>
+<a name="l00080"></a>00080 <span class="comment"> //!and false otherwise</span>
+<a name="l00081"></a>00081 <span class="comment"></span> <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <span class="keyword">remove</span>(<span class="keyword">const</span> <span class="keywordtype">string</span>&amp; key, <span class="keywordtype">string</span>&amp; val) = 0;
+<a name="l00082"></a>00082 <span class="comment"></span>
+<a name="l00083"></a>00083 <span class="comment"> //!Provides barrier functionality</span>
+<a name="l00084"></a>00084 <span class="comment"></span> <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_client.html#af1bfd186c6afcddd19e0e6f69e1a8fc1" title="Provides barrier functionality.">wait_for_all</a>() = 0;
+<a name="l00085"></a>00085 <span class="comment"></span>
+<a name="l00086"></a>00086 <span class="comment"> //!Provides functionality to wait for any asynchronous communication</span>
+<a name="l00087"></a>00087 <span class="comment"> //!to end</span>
+<a name="l00088"></a>00088 <span class="comment"></span> <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_client.html#a7cc1fed7f1d161586a8abef93a24b715">wait_till_done</a>() = 0;
+<a name="l00089"></a>00089 };
+<a name="l00090"></a>00090
+<a name="l00091"></a>00091 <span class="preprocessor">#endif </span><span class="comment">/* CLIENT_H_ */</span>
</pre></div></div>
-<hr class="footer"/><address style="text-align: right;"><small>Generated on Thu Jul 14 12:04:31 2011 for Y!LDA by&nbsp;
+<hr class="footer"/><address style="text-align: right;"><small>Generated on Tue Jul 19 11:45:24 2011 for Y!LDA by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.3 </small></address>
</body>
View
2 docs/html/_context_8cpp.html
@@ -36,7 +36,7 @@
<table border="0" cellpadding="0" cellspacing="0">
</table>
</div>
-<hr class="footer"/><address style="text-align: right;"><small>Generated on Thu Jul 14 12:04:31 2011 for Y!LDA by&nbsp;
+<hr class="footer"/><address style="text-align: right;"><small>Generated on Tue Jul 19 11:45:25 2011 for Y!LDA by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.3 </small></address>
</body>
View
2 docs/html/_context_8h.html
@@ -36,7 +36,7 @@
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">An object that maintains the context for the executing code. <a href="class_context.html#_details">More...</a><br/></td></tr>
</table>
</div>
-<hr class="footer"/><address style="text-align: right;"><small>Generated on Thu Jul 14 12:04:31 2011 for Y!LDA by&nbsp;
+<hr class="footer"/><address style="text-align: right;"><small>Generated on Tue Jul 19 11:45:25 2011 for Y!LDA by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.3 </small></address>
</body>
View
159 docs/html/_context_8h_source.html
@@ -24,79 +24,98 @@
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
-<h1>src/commons/Context.h</h1><a href="_context_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*****************************************************************************</span>
-<a name="l00002"></a>00002 <span class="comment"> The contents of this file are subject to the Mozilla Public License</span>
-<a name="l00003"></a>00003 <span class="comment"> Version 1.1 (the &quot;License&quot;); you may not use this file except in</span>
-<a name="l00004"></a>00004 <span class="comment"> compliance with the License. You may obtain a copy of the License at</span>
-<a name="l00005"></a>00005 <span class="comment"> http://www.mozilla.org/MPL/</span>
-<a name="l00006"></a>00006 <span class="comment"></span>
-<a name="l00007"></a>00007 <span class="comment"> Software distributed under the License is distributed on an &quot;AS IS&quot;</span>
-<a name="l00008"></a>00008 <span class="comment"> basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the</span>
-<a name="l00009"></a>00009 <span class="comment"> License for the specific language governing rights and limitations</span>
-<a name="l00010"></a>00010 <span class="comment"> under the License.</span>
-<a name="l00011"></a>00011 <span class="comment"></span>
-<a name="l00012"></a>00012 <span class="comment"> The Original Code is Copyright (C) by Yahoo! Research.</span>
-<a name="l00013"></a>00013 <span class="comment"></span>
-<a name="l00014"></a>00014 <span class="comment"> The Initial Developer of the Original Code is Shravan Narayanamurthy.</span>
-<a name="l00015"></a>00015 <span class="comment"></span>
-<a name="l00016"></a>00016 <span class="comment"> All Rights Reserved.</span>
-<a name="l00017"></a>00017 <span class="comment">******************************************************************************/</span>
-<a name="l00018"></a>00018 <span class="comment">/*</span>
-<a name="l00019"></a>00019 <span class="comment"> * Context.h</span>
-<a name="l00020"></a>00020 <span class="comment"> *</span>
-<a name="l00021"></a>00021 <span class="comment"> *</span>
-<a name="l00022"></a>00022 <span class="comment"> * Created on: 23-Dec-2010</span>
-<a name="l00023"></a>00023 <span class="comment"> * </span>
-<a name="l00024"></a>00024 <span class="comment"> */</span>
-<a name="l00025"></a>00025
-<a name="l00026"></a>00026 <span class="preprocessor">#ifndef CONTEXT_H_</span>
-<a name="l00027"></a>00027 <span class="preprocessor"></span><span class="preprocessor">#define CONTEXT_H_</span>
-<a name="l00028"></a>00028 <span class="preprocessor"></span>
-<a name="l00029"></a>00029 <span class="preprocessor">#include &quot;boost/unordered_map.hpp&quot;</span>
-<a name="l00030"></a>00030 <span class="preprocessor">#include &lt;string&gt;</span>
-<a name="l00031"></a>00031
-<a name="l00032"></a>00032 <span class="keyword">using namespace </span>std;
-<a name="l00033"></a>00033 <span class="keyword">using namespace </span>boost;
+<h1>src/commons/Context.h</h1><a href="_context_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*******************************************************************************</span>
+<a name="l00002"></a>00002 <span class="comment"> Copyright (c) 2011, Yahoo! Inc.</span>
+<a name="l00003"></a>00003 <span class="comment"> All rights reserved.</span>
+<a name="l00004"></a>00004 <span class="comment"></span>
+<a name="l00005"></a>00005 <span class="comment"> Redistribution and use of this software in source and binary forms, </span>
+<a name="l00006"></a>00006 <span class="comment"> with or without modification, are permitted provided that the following </span>
+<a name="l00007"></a>00007 <span class="comment"> conditions are met:</span>
+<a name="l00008"></a>00008 <span class="comment"></span>
+<a name="l00009"></a>00009 <span class="comment"> * Redistributions of source code must retain the above</span>
+<a name="l00010"></a>00010 <span class="comment"> copyright notice, this list of conditions and the</span>
+<a name="l00011"></a>00011 <span class="comment"> following disclaimer.</span>
+<a name="l00012"></a>00012 <span class="comment"></span>
+<a name="l00013"></a>00013 <span class="comment"> * Redistributions in binary form must reproduce the above</span>
+<a name="l00014"></a>00014 <span class="comment"> copyright notice, this list of conditions and the</span>
+<a name="l00015"></a>00015 <span class="comment"> following disclaimer in the documentation and/or other</span>
+<a name="l00016"></a>00016 <span class="comment"> materials provided with the distribution.</span>
+<a name="l00017"></a>00017 <span class="comment"></span>
+<a name="l00018"></a>00018 <span class="comment"> * Neither the name of Yahoo! Inc. nor the names of its</span>
+<a name="l00019"></a>00019 <span class="comment"> contributors may be used to endorse or promote products</span>
+<a name="l00020"></a>00020 <span class="comment"> derived from this software without specific prior</span>
+<a name="l00021"></a>00021 <span class="comment"> written permission of Yahoo! Inc.</span>
+<a name="l00022"></a>00022 <span class="comment"></span>
+<a name="l00023"></a>00023 <span class="comment"> THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS &quot;AS </span>
+<a name="l00024"></a>00024 <span class="comment"> IS&quot; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED </span>
+<a name="l00025"></a>00025 <span class="comment"> TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A </span>
+<a name="l00026"></a>00026 <span class="comment"> PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT </span>
+<a name="l00027"></a>00027 <span class="comment"> OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, </span>
+<a name="l00028"></a>00028 <span class="comment"> SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT </span>
+<a name="l00029"></a>00029 <span class="comment"> LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, </span>
+<a name="l00030"></a>00030 <span class="comment"> DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY </span>
+<a name="l00031"></a>00031 <span class="comment"> THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT </span>
+<a name="l00032"></a>00032 <span class="comment"> (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE </span>
+<a name="l00033"></a>00033 <span class="comment"> OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</span>
<a name="l00034"></a>00034 <span class="comment"></span>
-<a name="l00035"></a>00035 <span class="comment">//!An object that maintains the context for the executing code</span>
-<a name="l00036"></a>00036 <span class="comment"></span><span class="comment">/**</span>
-<a name="l00037"></a>00037 <span class="comment"> * This is a Singleton object that maintains a context</span>
-<a name="l00038"></a>00038 <span class="comment"> * for the executing code. It contains a list of properties</span>
-<a name="l00039"></a>00039 <span class="comment"> * stored as a key-value map</span>
+<a name="l00035"></a>00035 <span class="comment"> The Initial Developer of the Original Code is Shravan Narayanamurthy.</span>
+<a name="l00036"></a>00036 <span class="comment">******************************************************************************/</span>
+<a name="l00037"></a>00037 <span class="comment">/*</span>
+<a name="l00038"></a>00038 <span class="comment"> * Context.h</span>
+<a name="l00039"></a>00039 <span class="comment"> *</span>
<a name="l00040"></a>00040 <span class="comment"> *</span>
-<a name="l00041"></a>00041 <span class="comment"> * All the flags defined are made available through this</span>
-<a name="l00042"></a>00042 <span class="comment"> * object. It can also be used as a mechanism for message</span>
-<a name="l00043"></a>00043 <span class="comment"> * passing. This reduces coupling between the code and</span>
-<a name="l00044"></a>00044 <span class="comment"> * gflags.</span>
-<a name="l00045"></a>00045 <span class="comment"> */</span>
-<a name="l00046"></a><a class="code" href="class_context.html">00046</a> <span class="keyword">class </span><a class="code" href="class_context.html" title="An object that maintains the context for the executing code.">Context</a> {
-<a name="l00047"></a>00047 <span class="keyword">public</span>:
-<a name="l00048"></a>00048 <span class="keyword">static</span> <a class="code" href="class_context.html" title="An object that maintains the context for the executing code.">Context</a>&amp; <a class="code" href="class_context.html#a021d5f8012c65a185a9b14e210eb289c">get_instance</a>();
-<a name="l00049"></a>00049 <span class="comment"></span>
-<a name="l00050"></a>00050 <span class="comment"> //!Get an integer valued property named key</span>
-<a name="l00051"></a>00051 <span class="comment"></span> <span class="keywordtype">int</span> <a class="code" href="class_context.html#a0b8f0d939e07208fe32337ace2196f24" title="Get an integer valued property named key.">get_int</a>(<span class="keywordtype">string</span> key);<span class="comment"></span>
-<a name="l00052"></a>00052 <span class="comment"> //!Get a string valued property named key</span>
-<a name="l00053"></a>00053 <span class="comment"></span> <span class="keywordtype">string</span> <a class="code" href="class_context.html#af0cb505ad6b35c252e69de53c193f6f4" title="Get a string valued property named key.">get_string</a>(<span class="keywordtype">string</span> key);<span class="comment"></span>
-<a name="l00054"></a>00054 <span class="comment"> //!Get a double valued property named key</span>
-<a name="l00055"></a>00055 <span class="comment"></span> <span class="keywordtype">double</span> <a class="code" href="class_context.html#a71717f004732933da32ba9de6db156b3" title="Get a double valued property named key.">get_double</a>(<span class="keywordtype">string</span> key);<span class="comment"></span>
-<a name="l00056"></a>00056 <span class="comment"> //!Get a bool valued property named key</span>
-<a name="l00057"></a>00057 <span class="comment"></span> <span class="keywordtype">bool</span> <a class="code" href="class_context.html#a16045011711b9cf47ef4a54c73427f43" title="Get a bool valued property named key.">get_bool</a>(<span class="keywordtype">string</span> key);
-<a name="l00058"></a>00058 <span class="comment"></span>
-<a name="l00059"></a>00059 <span class="comment"> //!Put a string value for property key</span>
-<a name="l00060"></a>00060 <span class="comment"> //!into the map</span>
-<a name="l00061"></a>00061 <span class="comment"></span> <span class="keywordtype">void</span> <a class="code" href="class_context.html#a324bb843de0425a28051ccc872f3bbe2">put_string</a>(<span class="keywordtype">string</span> key, <span class="keywordtype">string</span> val);
-<a name="l00062"></a>00062
-<a name="l00063"></a>00063 <span class="keyword">private</span>:
-<a name="l00064"></a>00064 <a class="code" href="class_context.html" title="An object that maintains the context for the executing code.">Context</a>();
-<a name="l00065"></a>00065 <span class="keyword">virtual</span> ~<a class="code" href="class_context.html" title="An object that maintains the context for the executing code.">Context</a>();
-<a name="l00066"></a>00066
-<a name="l00067"></a>00067 <span class="keyword">static</span> <a class="code" href="class_context.html" title="An object that maintains the context for the executing code.">Context</a>* _instance;
-<a name="l00068"></a>00068 unordered_map&lt;string, string&gt; _flags;
-<a name="l00069"></a>00069 };
-<a name="l00070"></a>00070
-<a name="l00071"></a>00071 <span class="preprocessor">#endif </span><span class="comment">/* CONTEXT_H_ */</span>
+<a name="l00041"></a>00041 <span class="comment"> * Created on: 23-Dec-2010</span>
+<a name="l00042"></a>00042 <span class="comment"> * </span>
+<a name="l00043"></a>00043 <span class="comment"> */</span>
+<a name="l00044"></a>00044
+<a name="l00045"></a>00045 <span class="preprocessor">#ifndef CONTEXT_H_</span>
+<a name="l00046"></a>00046 <span class="preprocessor"></span><span class="preprocessor">#define CONTEXT_H_</span>
+<a name="l00047"></a>00047 <span class="preprocessor"></span>
+<a name="l00048"></a>00048 <span class="preprocessor">#include &quot;boost/unordered_map.hpp&quot;</span>
+<a name="l00049"></a>00049 <span class="preprocessor">#include &lt;string&gt;</span>
+<a name="l00050"></a>00050
+<a name="l00051"></a>00051 <span class="keyword">using namespace </span>std;
+<a name="l00052"></a>00052 <span class="keyword">using namespace </span>boost;
+<a name="l00053"></a>00053 <span class="comment"></span>
+<a name="l00054"></a>00054 <span class="comment">//!An object that maintains the context for the executing code</span>
+<a name="l00055"></a>00055 <span class="comment"></span><span class="comment">/**</span>
+<a name="l00056"></a>00056 <span class="comment"> * This is a Singleton object that maintains a context</span>
+<a name="l00057"></a>00057 <span class="comment"> * for the executing code. It contains a list of properties</span>
+<a name="l00058"></a>00058 <span class="comment"> * stored as a key-value map</span>
+<a name="l00059"></a>00059 <span class="comment"> *</span>
+<a name="l00060"></a>00060 <span class="comment"> * All the flags defined are made available through this</span>
+<a name="l00061"></a>00061 <span class="comment"> * object. It can also be used as a mechanism for message</span>
+<a name="l00062"></a>00062 <span class="comment"> * passing. This reduces coupling between the code and</span>
+<a name="l00063"></a>00063 <span class="comment"> * gflags.</span>
+<a name="l00064"></a>00064 <span class="comment"> */</span>
+<a name="l00065"></a><a class="code" href="class_context.html">00065</a> <span class="keyword">class </span><a class="code" href="class_context.html" title="An object that maintains the context for the executing code.">Context</a> {
+<a name="l00066"></a>00066 <span class="keyword">public</span>:
+<a name="l00067"></a>00067 <span class="keyword">static</span> <a class="code" href="class_context.html" title="An object that maintains the context for the executing code.">Context</a>&amp; <a class="code" href="class_context.html#a021d5f8012c65a185a9b14e210eb289c">get_instance</a>();
+<a name="l00068"></a>00068 <span class="comment"></span>
+<a name="l00069"></a>00069 <span class="comment"> //!Get an integer valued property named key</span>
+<a name="l00070"></a>00070 <span class="comment"></span> <span class="keywordtype">int</span> <a class="code" href="class_context.html#a0b8f0d939e07208fe32337ace2196f24" title="Get an integer valued property named key.">get_int</a>(<span class="keywordtype">string</span> key);<span class="comment"></span>
+<a name="l00071"></a>00071 <span class="comment"> //!Get a string valued property named key</span>
+<a name="l00072"></a>00072 <span class="comment"></span> <span class="keywordtype">string</span> <a class="code" href="class_context.html#af0cb505ad6b35c252e69de53c193f6f4" title="Get a string valued property named key.">get_string</a>(<span class="keywordtype">string</span> key);<span class="comment"></span>
+<a name="l00073"></a>00073 <span class="comment"> //!Get a double valued property named key</span>
+<a name="l00074"></a>00074 <span class="comment"></span> <span class="keywordtype">double</span> <a class="code" href="class_context.html#a71717f004732933da32ba9de6db156b3" title="Get a double valued property named key.">get_double</a>(<span class="keywordtype">string</span> key);<span class="comment"></span>
+<a name="l00075"></a>00075 <span class="comment"> //!Get a bool valued property named key</span>
+<a name="l00076"></a>00076 <span class="comment"></span> <span class="keywordtype">bool</span> <a class="code" href="class_context.html#a16045011711b9cf47ef4a54c73427f43" title="Get a bool valued property named key.">get_bool</a>(<span class="keywordtype">string</span> key);
+<a name="l00077"></a>00077 <span class="comment"></span>
+<a name="l00078"></a>00078 <span class="comment"> //!Put a string value for property key</span>
+<a name="l00079"></a>00079 <span class="comment"> //!into the map</span>
+<a name="l00080"></a>00080 <span class="comment"></span> <span class="keywordtype">void</span> <a class="code" href="class_context.html#a324bb843de0425a28051ccc872f3bbe2">put_string</a>(<span class="keywordtype">string</span> key, <span class="keywordtype">string</span> val);
+<a name="l00081"></a>00081
+<a name="l00082"></a>00082 <span class="keyword">private</span>:
+<a name="l00083"></a>00083 <a class="code" href="class_context.html" title="An object that maintains the context for the executing code.">Context</a>();
+<a name="l00084"></a>00084 <span class="keyword">virtual</span> ~<a class="code" href="class_context.html" title="An object that maintains the context for the executing code.">Context</a>();
+<a name="l00085"></a>00085
+<a name="l00086"></a>00086 <span class="keyword">static</span> <a class="code" href="class_context.html" title="An object that maintains the context for the executing code.">Context</a>* _instance;
+<a name="l00087"></a>00087 unordered_map&lt;string, string&gt; _flags;
+<a name="l00088"></a>00088 };
+<a name="l00089"></a>00089
+<a name="l00090"></a>00090 <span class="preprocessor">#endif </span><span class="comment">/* CONTEXT_H_ */</span>
</pre></div></div>
-<hr class="footer"/><address style="text-align: right;"><small>Generated on Thu Jul 14 12:04:31 2011 for Y!LDA by&nbsp;
+<hr class="footer"/><address style="text-align: right;"><small>Generated on Tue Jul 19 11:45:24 2011 for Y!LDA by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.3 </small></address>
</body>
View
2 docs/html/_d_m___client_8cpp.html
@@ -40,7 +40,7 @@
<table border="0" cellpadding="0" cellspacing="0">
</table>
</div>
-<hr class="footer"/><address style="text-align: right;"><small>Generated on Thu Jul 14 12:04:31 2011 for Y!LDA by&nbsp;
+<hr class="footer"/><address style="text-align: right;"><small>Generated on Tue Jul 19 11:45:25 2011 for Y!LDA by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.3 </small></address>
</body>
View
2 docs/html/_d_m___client_8h.html
@@ -76,7 +76,7 @@
</div>
</div>
</div>
-<hr class="footer"/><address style="text-align: right;"><small>Generated on Thu Jul 14 12:04:31 2011 for Y!LDA by&nbsp;
+<hr class="footer"/><address style="text-align: right;"><small>Generated on Tue Jul 19 11:45:25 2011 for Y!LDA by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.3 </small></address>
</body>
View
413 docs/html/_d_m___client_8h_source.html
@@ -24,205 +24,224 @@
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
-<h1>src/commons/TopicLearner/DM_Client.h</h1><a href="_d_m___client_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*****************************************************************************</span>
-<a name="l00002"></a>00002 <span class="comment"> The contents of this file are subject to the Mozilla Public License</span>
-<a name="l00003"></a>00003 <span class="comment"> Version 1.1 (the &quot;License&quot;); you may not use this file except in</span>
-<a name="l00004"></a>00004 <span class="comment"> compliance with the License. You may obtain a copy of the License at</span>
-<a name="l00005"></a>00005 <span class="comment"> http://www.mozilla.org/MPL/</span>
-<a name="l00006"></a>00006 <span class="comment"></span>
-<a name="l00007"></a>00007 <span class="comment"> Software distributed under the License is distributed on an &quot;AS IS&quot;</span>
-<a name="l00008"></a>00008 <span class="comment"> basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the</span>
-<a name="l00009"></a>00009 <span class="comment"> License for the specific language governing rights and limitations</span>
-<a name="l00010"></a>00010 <span class="comment"> under the License.</span>
-<a name="l00011"></a>00011 <span class="comment"></span>
-<a name="l00012"></a>00012 <span class="comment"> The Original Code is Copyright (C) by Yahoo! Research.</span>
-<a name="l00013"></a>00013 <span class="comment"></span>
-<a name="l00014"></a>00014 <span class="comment"> The Initial Developer of the Original Code is Shravan Narayanamurthy.</span>
-<a name="l00015"></a>00015 <span class="comment"></span>
-<a name="l00016"></a>00016 <span class="comment"> All Rights Reserved.</span>
-<a name="l00017"></a>00017 <span class="comment">******************************************************************************/</span>
-<a name="l00018"></a>00018 <span class="comment">/*</span>
-<a name="l00019"></a>00019 <span class="comment"> * DM_Client.h</span>
-<a name="l00020"></a>00020 <span class="comment"> *</span>
-<a name="l00021"></a>00021 <span class="comment"> *</span>
-<a name="l00022"></a>00022 <span class="comment"> *</span>
-<a name="l00023"></a>00023 <span class="comment"> * Created on: 19-Oct-2010</span>
-<a name="l00024"></a>00024 <span class="comment"> * </span>
-<a name="l00025"></a>00025 <span class="comment"> */</span>
-<a name="l00026"></a>00026
-<a name="l00027"></a>00027 <span class="preprocessor">#ifndef DM_CLIENT_H_</span>
-<a name="l00028"></a>00028 <span class="preprocessor"></span><span class="preprocessor">#define DM_CLIENT_H_</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span>
-<a name="l00030"></a>00030 <span class="preprocessor">#include &lt;Ice/Ice.h&gt;</span>
-<a name="l00031"></a>00031 <span class="preprocessor">#include &lt;vector&gt;</span>
-<a name="l00032"></a>00032 <span class="preprocessor">#include &quot;<a class="code" href="_distributed_map_8h.html">Server/DistributedMap.h</a>&quot;</span>
-<a name="l00033"></a>00033 <span class="preprocessor">#include &lt;IceUtil/Handle.h&gt;</span>
-<a name="l00034"></a>00034 <span class="preprocessor">#include &quot;<a class="code" href="_synchronizer___helper_8h.html">TopicLearner/Synchronizer_Helper.h</a>&quot;</span>
-<a name="l00035"></a>00035 <span class="preprocessor">#include &quot;<a class="code" href="_client_8h.html">Client.h</a>&quot;</span>
-<a name="l00036"></a>00036 <span class="preprocessor">#include &quot;boost/unordered_map.hpp&quot;</span>
-<a name="l00037"></a>00037 <span class="preprocessor">#include &quot;<a class="code" href="constants_8h.html">constants.h</a>&quot;</span>
-<a name="l00038"></a>00038
-<a name="l00039"></a>00039 <span class="keyword">using namespace </span>std;
-<a name="l00040"></a>00040 <span class="keyword">using namespace </span>GlobalTable;
-<a name="l00041"></a>00041
-<a name="l00042"></a><a class="code" href="struct_cookie.html">00042</a> <span class="keyword">struct </span><a class="code" href="struct_cookie.html">Cookie</a>: <span class="keyword">public</span> Ice::LocalObject {
-<a name="l00043"></a><a class="code" href="struct_cookie.html#af682661b60384bdf6eb3a4e06e3acfa7">00043</a> <span class="keywordtype">string</span> <a class="code" href="struct_cookie.html#af682661b60384bdf6eb3a4e06e3acfa7">entity</a>;
-<a name="l00044"></a><a class="code" href="struct_cookie.html#a21043e54cb9fa8d0d3ca1c6892f02a93">00044</a> <span class="keywordtype">int</span> <a class="code" href="struct_cookie.html#a21043e54cb9fa8d0d3ca1c6892f02a93">msg_id</a>;
-<a name="l00045"></a>00045 };
-<a name="l00046"></a><a class="code" href="_d_m___client_8h.html#aa1b3c782db5b0bc73e294ec95ebd43c6">00046</a> <span class="keyword">typedef</span> IceUtil::Handle&lt;Cookie&gt; <a class="code" href="_d_m___client_8h.html#aa1b3c782db5b0bc73e294ec95ebd43c6">CookiePtr</a>;
-<a name="l00047"></a>00047 <span class="comment"></span>
-<a name="l00048"></a>00048 <span class="comment">//!The call back object for the Put and Get AMI.</span>
-<a name="l00049"></a>00049 <span class="comment"></span><span class="comment">/**</span>
-<a name="l00050"></a>00050 <span class="comment"> * Ice calls the finished method once the AMI completes. The</span>
-<a name="l00051"></a>00051 <span class="comment"> * client is not tied to any particular call back. The actual</span>
-<a name="l00052"></a>00052 <span class="comment"> * call back is provided by a helper class, the sync_helper</span>
-<a name="l00053"></a>00053 <span class="comment"> * whose end method is called to complete the full AMI call.</span>
-<a name="l00054"></a>00054 <span class="comment"> *</span>
-<a name="l00055"></a>00055 <span class="comment"> * This call back class also doubles up as a rate limiter</span>
-<a name="l00056"></a>00056 <span class="comment"> * implementing a sliding window mechanism for sending</span>
-<a name="l00057"></a>00057 <span class="comment"> * messages to the server.</span>
-<a name="l00058"></a>00058 <span class="comment"> *</span>
-<a name="l00059"></a>00059 <span class="comment"> * Given a max number of msgs, it creates an array to track</span>
-<a name="l00060"></a>00060 <span class="comment"> * the status of the msgs that have been sent to the server</span>
-<a name="l00061"></a>00061 <span class="comment"> *</span>
-<a name="l00062"></a>00062 <span class="comment"> * It provides a monitor based wait mechanism for the client</span>
-<a name="l00063"></a>00063 <span class="comment"> * which can wait till the server responds back to a particular</span>
-<a name="l00064"></a>00064 <span class="comment"> * msg. We take the liberty of making a fcfs assumption on the</span>
-<a name="l00065"></a>00065 <span class="comment"> * server side processing for keeping things simple.</span>
-<a name="l00066"></a>00066 <span class="comment"> */</span>
-<a name="l00067"></a><a class="code" href="class_p_n_g_callback.html">00067</a> <span class="keyword">class </span><a class="code" href="class_p_n_g_callback.html" title="The call back object for the Put and Get AMI.">PNGCallback</a>: <span class="keyword">public</span> IceUtil::Shared {
-<a name="l00068"></a>00068 <span class="keyword">public</span>:<span class="comment"></span>
-<a name="l00069"></a>00069 <span class="comment"> //!The sync_helper and the max num of msgs to track</span>
-<a name="l00070"></a><a class="code" href="class_p_n_g_callback.html#a5171eeb1412a198a7645858067ee0e32">00070</a> <span class="comment"></span> <a class="code" href="class_p_n_g_callback.html#a5171eeb1412a198a7645858067ee0e32" title="The sync_helper and the max num of msgs to track.">PNGCallback</a>(<a class="code" href="class_synchronizer___helper.html" title="A helper class for the synchronizer.">Synchronizer_Helper</a>&amp; sync_helper, <span class="keywordtype">int</span> num_msgs) :
-<a name="l00071"></a>00071 _sync_helper(sync_helper), _num_msgs(num_msgs) {
-<a name="l00072"></a>00072 _num_synchs = 0;
-<a name="l00073"></a>00073 _waiting = -1;
-<a name="l00074"></a>00074 _status = <span class="keyword">new</span> <span class="keywordtype">bool</span>[_num_msgs];
-<a name="l00075"></a>00075 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; _num_msgs; i++) {
-<a name="l00076"></a>00076 _status[i] = <span class="keyword">true</span>;
-<a name="l00077"></a>00077 }
-<a name="l00078"></a>00078 }
-<a name="l00079"></a>00079
-<a name="l00080"></a><a class="code" href="class_p_n_g_callback.html#ac3e33d408123c2cfafef78a38652fdaa">00080</a> <a class="code" href="class_p_n_g_callback.html#ac3e33d408123c2cfafef78a38652fdaa">~PNGCallback</a>() {
-<a name="l00081"></a>00081 <span class="keyword">delete</span>[] _status;
-<a name="l00082"></a>00082 }
-<a name="l00083"></a>00083 <span class="comment"></span>
-<a name="l00084"></a>00084 <span class="comment"> //!Wait till the server responds to msg with id msg_id</span>
-<a name="l00085"></a><a class="code" href="class_p_n_g_callback.html#ad596e1f14c89d03e3f18cb71833d02c5">00085</a> <span class="comment"></span> <span class="keywordtype">bool</span> <a class="code" href="class_p_n_g_callback.html#ad596e1f14c89d03e3f18cb71833d02c5" title="Wait till the server responds to msg with id msg_id.">wait_till_done</a>(<span class="keywordtype">int</span> msg_id) {
-<a name="l00086"></a>00086 <span class="keywordflow">if</span> (_status[msg_id])
-<a name="l00087"></a>00087 <span class="keywordflow">return</span> <span class="keyword">true</span>;
-<a name="l00088"></a>00088 IceUtil::Monitor&lt;IceUtil::Mutex&gt;::Lock lock(_monitor);
-<a name="l00089"></a>00089 <span class="keywordflow">while</span> (!_status[msg_id]) {
-<a name="l00090"></a>00090 <span class="keywordflow">try</span> {
-<a name="l00091"></a>00091 _waiting = msg_id;
-<a name="l00092"></a>00092 _monitor.wait();
-<a name="l00093"></a>00093 _waiting = -1;
-<a name="l00094"></a>00094 } <span class="keywordflow">catch</span> (<span class="keyword">const</span> Ice::Exception&amp; ex) {
-<a name="l00095"></a>00095 _waiting = -1;
-<a name="l00096"></a>00096 <span class="keywordflow">throw</span> ex;
-<a name="l00097"></a>00097 }
-<a name="l00098"></a>00098 }
-<a name="l00099"></a>00099 <span class="keywordflow">return</span> <span class="keyword">true</span>;
-<a name="l00100"></a>00100 }
-<a name="l00101"></a>00101 <span class="comment"></span>
-<a name="l00102"></a>00102 <span class="comment"> //!set or clear the status flag for a particular msg_id</span>
-<a name="l00103"></a><a class="code" href="class_p_n_g_callback.html#acdc65eaca43bead9c0f08cfe5e9e5338">00103</a> <span class="comment"></span> <span class="keywordtype">void</span> <a class="code" href="class_p_n_g_callback.html#acdc65eaca43bead9c0f08cfe5e9e5338" title="set or clear the status flag for a particular msg_id">set_done</a>(<span class="keywordtype">int</span> msg_id, <span class="keywordtype">bool</span> status) {
-<a name="l00104"></a>00104 _status[msg_id] = status;
-<a name="l00105"></a>00105 }
-<a name="l00106"></a>00106 <span class="comment"></span>
-<a name="l00107"></a>00107 <span class="comment"> //!Provides the number of completed AMI callbacks</span>
-<a name="l00108"></a><a class="code" href="class_p_n_g_callback.html#a29f77829fce8f6a82032ece93fc8226e">00108</a> <span class="comment"></span> <span class="keywordtype">int</span> <a class="code" href="class_p_n_g_callback.html#a29f77829fce8f6a82032ece93fc8226e" title="Provides the number of completed AMI callbacks.">num_synchs</a>() {
-<a name="l00109"></a>00109 <span class="keywordflow">return</span> _num_synchs;
-<a name="l00110"></a>00110 }
-<a name="l00111"></a>00111 <span class="comment"></span>
-<a name="l00112"></a>00112 <span class="comment"> /**</span>
-<a name="l00113"></a>00113 <span class="comment"> * This method is called by Ice run time when the server</span>
-<a name="l00114"></a>00114 <span class="comment"> * responds. We do some bookkeeping and delegate the</span>
-<a name="l00115"></a>00115 <span class="comment"> * task of actually completing the AMI by calling</span>
-<a name="l00116"></a>00116 <span class="comment"> * sync_helper.end method</span>
-<a name="l00117"></a>00117 <span class="comment"> */</span>
-<a name="l00118"></a><a class="code" href="class_p_n_g_callback.html#a568d03d9ea319a1b2d7207b25a3847a5">00118</a> <span class="keywordtype">void</span> <a class="code" href="class_p_n_g_callback.html#a568d03d9ea319a1b2d7207b25a3847a5">finished</a>(<span class="keyword">const</span> Ice::AsyncResultPtr&amp; r) {
-<a name="l00119"></a>00119 DistributedMapPrx dist_map = DistributedMapPrx::uncheckedCast(
-<a name="l00120"></a>00120 r-&gt;getProxy());
-<a name="l00121"></a>00121 <span class="keywordtype">string</span> global_cnts;
-<a name="l00122"></a>00122 <a class="code" href="_d_m___client_8h.html#aa1b3c782db5b0bc73e294ec95ebd43c6">CookiePtr</a> cookie = CookiePtr::dynamicCast(r-&gt;getCookie());
-<a name="l00123"></a>00123 <span class="keywordtype">int</span> msg_id = cookie-&gt;msg_id;
-<a name="l00124"></a>00124 <span class="keywordtype">string</span> entity = cookie-&gt;entity;
-<a name="l00125"></a>00125 <span class="keywordflow">try</span> {
-<a name="l00126"></a>00126 dist_map-&gt;end_putNget(global_cnts, r);
-<a name="l00127"></a>00127 } <span class="keywordflow">catch</span> (<span class="keyword">const</span> Ice::Exception&amp; ex) {
-<a name="l00128"></a>00128 <span class="keywordflow">throw</span> ex;
-<a name="l00129"></a>00129 }
-<a name="l00130"></a>00130 _sync_helper.<a class="code" href="class_synchronizer___helper.html#a29ac0b4b630f56e59e6587bb6275d97e">end_putNget</a>(entity, global_cnts);
-<a name="l00131"></a>00131 ++_num_synchs;
-<a name="l00132"></a>00132 IceUtil::Monitor&lt;IceUtil::Mutex&gt;::Lock lock(_monitor);
-<a name="l00133"></a>00133 _status[msg_id] = <span class="keyword">true</span>;
-<a name="l00134"></a>00134 <span class="keywordflow">if</span> (_waiting == msg_id) {
-<a name="l00135"></a>00135 _monitor.notify();
-<a name="l00136"></a>00136 }
-<a name="l00137"></a>00137 }
-<a name="l00138"></a>00138
-<a name="l00139"></a>00139 <span class="keyword">private</span>:
-<a name="l00140"></a>00140 <a class="code" href="class_synchronizer___helper.html" title="A helper class for the synchronizer.">Synchronizer_Helper</a>&amp; _sync_helper;
-<a name="l00141"></a>00141 <span class="keywordtype">int</span> _num_msgs, _num_synchs;
-<a name="l00142"></a>00142 <span class="keywordtype">bool</span> *_status;
-<a name="l00143"></a>00143 <span class="keywordtype">int</span> _waiting;
-<a name="l00144"></a>00144 IceUtil::Monitor&lt;IceUtil::Mutex&gt; _monitor;
-<a name="l00145"></a>00145 };
-<a name="l00146"></a><a class="code" href="_d_m___client_8h.html#a592c96463884c49ba35c94bf1d3f30e7">00146</a> <span class="keyword">typedef</span> IceUtil::Handle&lt;PNGCallback&gt; <a class="code" href="_d_m___client_8h.html#a592c96463884c49ba35c94bf1d3f30e7">PNGCallbackPtr</a>;
-<a name="l00147"></a>00147 <span class="comment"></span>
-<a name="l00148"></a>00148 <span class="comment">//!The client used to access the Distributed Map</span>
-<a name="l00149"></a>00149 <span class="comment"></span><span class="comment">/**</span>
-<a name="l00150"></a>00150 <span class="comment"> * Wrapper class to delegate the Distributed Map</span>
-<a name="l00151"></a>00151 <span class="comment"> * operations to the appropriate Server</span>
-<a name="l00152"></a>00152 <span class="comment"> */</span>
-<a name="l00153"></a><a class="code" href="class_d_m___client.html">00153</a> <span class="keyword">class </span><a class="code" href="class_d_m___client.html" title="The client used to access the Distributed Map.">DM_Client</a>: <span class="keyword">public</span> <a class="code" href="class_client.html">Client</a> {
-<a name="l00154"></a>00154 <span class="keyword">public</span>:<span class="comment"></span>
-<a name="l00155"></a>00155 <span class="comment"> /**</span>
-<a name="l00156"></a>00156 <span class="comment"> * The servers in the Distributed Map setup</span>
-<a name="l00157"></a>00157 <span class="comment"> * The max number of entities that you are going to</span>
-<a name="l00158"></a>00158 <span class="comment"> * store in the map. This is just to make sure that</span>
-<a name="l00159"></a>00159 <span class="comment"> * things dont break when you are processing a very small</span>
-<a name="l00160"></a>00160 <span class="comment"> * number of entities particularly smaller than MAX_MSGS</span>
-<a name="l00161"></a>00161 <span class="comment"> * The helper class that provides the actual call back functionality</span>
-<a name="l00162"></a>00162 <span class="comment"> */</span>
-<a name="l00163"></a>00163 <a class="code" href="class_d_m___client.html#a4366fbc81789bd7b4ba0f681ad4b7c0e">DM_Client</a>(<span class="keywordtype">int</span> num_entities, <span class="keyword">const</span> <span class="keywordtype">string</span>&amp; servers,
-<a name="l00164"></a>00164 <a class="code" href="class_synchronizer___helper.html" title="A helper class for the synchronizer.">Synchronizer_Helper</a>&amp; sync_helper);
-<a name="l00165"></a>00165 <span class="keyword">virtual</span> <a class="code" href="class_d_m___client.html#a7c4036aa31873a238dca15210d4c15bc">~DM_Client</a>();
+<h1>src/commons/TopicLearner/DM_Client.h</h1><a href="_d_m___client_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*******************************************************************************</span>
+<a name="l00002"></a>00002 <span class="comment"> Copyright (c) 2011, Yahoo! Inc.</span>
+<a name="l00003"></a>00003 <span class="comment"> All rights reserved.</span>
+<a name="l00004"></a>00004 <span class="comment"></span>
+<a name="l00005"></a>00005 <span class="comment"> Redistribution and use of this software in source and binary forms, </span>
+<a name="l00006"></a>00006 <span class="comment"> with or without modification, are permitted provided that the following </span>
+<a name="l00007"></a>00007 <span class="comment"> conditions are met:</span>
+<a name="l00008"></a>00008 <span class="comment"></span>
+<a name="l00009"></a>00009 <span class="comment"> * Redistributions of source code must retain the above</span>
+<a name="l00010"></a>00010 <span class="comment"> copyright notice, this list of conditions and the</span>
+<a name="l00011"></a>00011 <span class="comment"> following disclaimer.</span>
+<a name="l00012"></a>00012 <span class="comment"></span>
+<a name="l00013"></a>00013 <span class="comment"> * Redistributions in binary form must reproduce the above</span>
+<a name="l00014"></a>00014 <span class="comment"> copyright notice, this list of conditions and the</span>
+<a name="l00015"></a>00015 <span class="comment"> following disclaimer in the documentation and/or other</span>
+<a name="l00016"></a>00016 <span class="comment"> materials provided with the distribution.</span>
+<a name="l00017"></a>00017 <span class="comment"></span>
+<a name="l00018"></a>00018 <span class="comment"> * Neither the name of Yahoo! Inc. nor the names of its</span>
+<a name="l00019"></a>00019 <span class="comment"> contributors may be used to endorse or promote products</span>
+<a name="l00020"></a>00020 <span class="comment"> derived from this software without specific prior</span>
+<a name="l00021"></a>00021 <span class="comment"> written permission of Yahoo! Inc.</span>
+<a name="l00022"></a>00022 <span class="comment"></span>
+<a name="l00023"></a>00023 <span class="comment"> THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS &quot;AS </span>
+<a name="l00024"></a>00024 <span class="comment"> IS&quot; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED </span>
+<a name="l00025"></a>00025 <span class="comment"> TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A </span>
+<a name="l00026"></a>00026 <span class="comment"> PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT </span>
+<a name="l00027"></a>00027 <span class="comment"> OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, </span>
+<a name="l00028"></a>00028 <span class="comment"> SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT </span>
+<a name="l00029"></a>00029 <span class="comment"> LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, </span>
+<a name="l00030"></a>00030 <span class="comment"> DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY </span>
+<a name="l00031"></a>00031 <span class="comment"> THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT </span>
+<a name="l00032"></a>00032 <span class="comment"> (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE </span>
+<a name="l00033"></a>00033 <span class="comment"> OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</span>
+<a name="l00034"></a>00034 <span class="comment"></span>
+<a name="l00035"></a>00035 <span class="comment"> The Initial Developer of the Original Code is Shravan Narayanamurthy.</span>
+<a name="l00036"></a>00036 <span class="comment">******************************************************************************/</span>
+<a name="l00037"></a>00037 <span class="comment">/*</span>
+<a name="l00038"></a>00038 <span class="comment"> * DM_Client.h</span>
+<a name="l00039"></a>00039 <span class="comment"> *</span>
+<a name="l00040"></a>00040 <span class="comment"> *</span>
+<a name="l00041"></a>00041 <span class="comment"> *</span>
+<a name="l00042"></a>00042 <span class="comment"> * Created on: 19-Oct-2010</span>
+<a name="l00043"></a>00043 <span class="comment"> * </span>
+<a name="l00044"></a>00044 <span class="comment"> */</span>
+<a name="l00045"></a>00045
+<a name="l00046"></a>00046 <span class="preprocessor">#ifndef DM_CLIENT_H_</span>
+<a name="l00047"></a>00047 <span class="preprocessor"></span><span class="preprocessor">#define DM_CLIENT_H_</span>
+<a name="l00048"></a>00048 <span class="preprocessor"></span>
+<a name="l00049"></a>00049 <span class="preprocessor">#include &lt;Ice/Ice.h&gt;</span>
+<a name="l00050"></a>00050 <span class="preprocessor">#include &lt;vector&gt;</span>
+<a name="l00051"></a>00051 <span class="preprocessor">#include &quot;<a class="code" href="_distributed_map_8h.html">Server/DistributedMap.h</a>&quot;</span>
+<a name="l00052"></a>00052 <span class="preprocessor">#include &lt;IceUtil/Handle.h&gt;</span>
+<a name="l00053"></a>00053 <span class="preprocessor">#include &quot;<a class="code" href="_synchronizer___helper_8h.html">TopicLearner/Synchronizer_Helper.h</a>&quot;</span>
+<a name="l00054"></a>00054 <span class="preprocessor">#include &quot;<a class="code" href="_client_8h.html">Client.h</a>&quot;</span>
+<a name="l00055"></a>00055 <span class="preprocessor">#include &quot;boost/unordered_map.hpp&quot;</span>
+<a name="l00056"></a>00056 <span class="preprocessor">#include &quot;<a class="code" href="constants_8h.html">constants.h</a>&quot;</span>
+<a name="l00057"></a>00057
+<a name="l00058"></a>00058 <span class="keyword">using namespace </span>std;
+<a name="l00059"></a>00059 <span class="keyword">using namespace </span>GlobalTable;
+<a name="l00060"></a>00060
+<a name="l00061"></a><a class="code" href="struct_cookie.html">00061</a> <span class="keyword">struct </span><a class="code" href="struct_cookie.html">Cookie</a>: <span class="keyword">public</span> Ice::LocalObject {
+<a name="l00062"></a><a class="code" href="struct_cookie.html#af682661b60384bdf6eb3a4e06e3acfa7">00062</a> <span class="keywordtype">string</span> <a class="code" href="struct_cookie.html#af682661b60384bdf6eb3a4e06e3acfa7">entity</a>;
+<a name="l00063"></a><a class="code" href="struct_cookie.html#a21043e54cb9fa8d0d3ca1c6892f02a93">00063</a> <span class="keywordtype">int</span> <a class="code" href="struct_cookie.html#a21043e54cb9fa8d0d3ca1c6892f02a93">msg_id</a>;
+<a name="l00064"></a>00064 };
+<a name="l00065"></a><a class="code" href="_d_m___client_8h.html#aa1b3c782db5b0bc73e294ec95ebd43c6">00065</a> <span class="keyword">typedef</span> IceUtil::Handle&lt;Cookie&gt; <a class="code" href="_d_m___client_8h.html#aa1b3c782db5b0bc73e294ec95ebd43c6">CookiePtr</a>;
+<a name="l00066"></a>00066 <span class="comment"></span>
+<a name="l00067"></a>00067 <span class="comment">//!The call back object for the Put and Get AMI.</span>
+<a name="l00068"></a>00068 <span class="comment"></span><span class="comment">/**</span>
+<a name="l00069"></a>00069 <span class="comment"> * Ice calls the finished method once the AMI completes. The</span>
+<a name="l00070"></a>00070 <span class="comment"> * client is not tied to any particular call back. The actual</span>
+<a name="l00071"></a>00071 <span class="comment"> * call back is provided by a helper class, the sync_helper</span>
+<a name="l00072"></a>00072 <span class="comment"> * whose end method is called to complete the full AMI call.</span>
+<a name="l00073"></a>00073 <span class="comment"> *</span>
+<a name="l00074"></a>00074 <span class="comment"> * This call back class also doubles up as a rate limiter</span>
+<a name="l00075"></a>00075 <span class="comment"> * implementing a sliding window mechanism for sending</span>
+<a name="l00076"></a>00076 <span class="comment"> * messages to the server.</span>
+<a name="l00077"></a>00077 <span class="comment"> *</span>
+<a name="l00078"></a>00078 <span class="comment"> * Given a max number of msgs, it creates an array to track</span>
+<a name="l00079"></a>00079 <span class="comment"> * the status of the msgs that have been sent to the server</span>
+<a name="l00080"></a>00080 <span class="comment"> *</span>
+<a name="l00081"></a>00081 <span class="comment"> * It provides a monitor based wait mechanism for the client</span>
+<a name="l00082"></a>00082 <span class="comment"> * which can wait till the server responds back to a particular</span>
+<a name="l00083"></a>00083 <span class="comment"> * msg. We take the liberty of making a fcfs assumption on the</span>
+<a name="l00084"></a>00084 <span class="comment"> * server side processing for keeping things simple.</span>
+<a name="l00085"></a>00085 <span class="comment"> */</span>
+<a name="l00086"></a><a class="code" href="class_p_n_g_callback.html">00086</a> <span class="keyword">class </span><a class="code" href="class_p_n_g_callback.html" title="The call back object for the Put and Get AMI.">PNGCallback</a>: <span class="keyword">public</span> IceUtil::Shared {
+<a name="l00087"></a>00087 <span class="keyword">public</span>:<span class="comment"></span>
+<a name="l00088"></a>00088 <span class="comment"> //!The sync_helper and the max num of msgs to track</span>
+<a name="l00089"></a><a class="code" href="class_p_n_g_callback.html#a5171eeb1412a198a7645858067ee0e32">00089</a> <span class="comment"></span> <a class="code" href="class_p_n_g_callback.html#a5171eeb1412a198a7645858067ee0e32" title="The sync_helper and the max num of msgs to track.">PNGCallback</a>(<a class="code" href="class_synchronizer___helper.html" title="A helper class for the synchronizer.">Synchronizer_Helper</a>&amp; sync_helper, <span class="keywordtype">int</span> num_msgs) :
+<a name="l00090"></a>00090 _sync_helper(sync_helper), _num_msgs(num_msgs) {
+<a name="l00091"></a>00091 _num_synchs = 0;
+<a name="l00092"></a>00092 _waiting = -1;
+<a name="l00093"></a>00093 _status = <span class="keyword">new</span> <span class="keywordtype">bool</span>[_num_msgs];
+<a name="l00094"></a>00094 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; _num_msgs; i++) {
+<a name="l00095"></a>00095 _status[i] = <span class="keyword">true</span>;
+<a name="l00096"></a>00096 }
+<a name="l00097"></a>00097 }
+<a name="l00098"></a>00098
+<a name="l00099"></a><a class="code" href="class_p_n_g_callback.html#ac3e33d408123c2cfafef78a38652fdaa">00099</a> <a class="code" href="class_p_n_g_callback.html#ac3e33d408123c2cfafef78a38652fdaa">~PNGCallback</a>() {
+<a name="l00100"></a>00100 <span class="keyword">delete</span>[] _status;
+<a name="l00101"></a>00101 }
+<a name="l00102"></a>00102 <span class="comment"></span>
+<a name="l00103"></a>00103 <span class="comment"> //!Wait till the server responds to msg with id msg_id</span>
+<a name="l00104"></a><a class="code" href="class_p_n_g_callback.html#ad596e1f14c89d03e3f18cb71833d02c5">00104</a> <span class="comment"></span> <span class="keywordtype">bool</span> <a class="code" href="class_p_n_g_callback.html#ad596e1f14c89d03e3f18cb71833d02c5" title="Wait till the server responds to msg with id msg_id.">wait_till_done</a>(<span class="keywordtype">int</span> msg_id) {
+<a name="l00105"></a>00105 <span class="keywordflow">if</span> (_status[msg_id])
+<a name="l00106"></a>00106 <span class="keywordflow">return</span> <span class="keyword">true</span>;
+<a name="l00107"></a>00107 IceUtil::Monitor&lt;IceUtil::Mutex&gt;::Lock lock(_monitor);
+<a name="l00108"></a>00108 <span class="keywordflow">while</span> (!_status[msg_id]) {
+<a name="l00109"></a>00109 <span class="keywordflow">try</span> {
+<a name="l00110"></a>00110 _waiting = msg_id;
+<a name="l00111"></a>00111 _monitor.wait();
+<a name="l00112"></a>00112 _waiting = -1;
+<a name="l00113"></a>00113 } <span class="keywordflow">catch</span> (<span class="keyword">const</span> Ice::Exception&amp; ex) {
+<a name="l00114"></a>00114 _waiting = -1;
+<a name="l00115"></a>00115 <span class="keywordflow">throw</span> ex;
+<a name="l00116"></a>00116 }
+<a name="l00117"></a>00117 }
+<a name="l00118"></a>00118 <span class="keywordflow">return</span> <span class="keyword">true</span>;
+<a name="l00119"></a>00119 }
+<a name="l00120"></a>00120 <span class="comment"></span>
+<a name="l00121"></a>00121 <span class="comment"> //!set or clear the status flag for a particular msg_id</span>
+<a name="l00122"></a><a class="code" href="class_p_n_g_callback.html#acdc65eaca43bead9c0f08cfe5e9e5338">00122</a> <span class="comment"></span> <span class="keywordtype">void</span> <a class="code" href="class_p_n_g_callback.html#acdc65eaca43bead9c0f08cfe5e9e5338" title="set or clear the status flag for a particular msg_id">set_done</a>(<span class="keywordtype">int</span> msg_id, <span class="keywordtype">bool</span> status) {
+<a name="l00123"></a>00123 _status[msg_id] = status;
+<a name="l00124"></a>00124 }
+<a name="l00125"></a>00125 <span class="comment"></span>
+<a name="l00126"></a>00126 <span class="comment"> //!Provides the number of completed AMI callbacks</span>
+<a name="l00127"></a><a class="code" href="class_p_n_g_callback.html#a29f77829fce8f6a82032ece93fc8226e">00127</a> <span class="comment"></span> <span class="keywordtype">int</span> <a class="code" href="class_p_n_g_callback.html#a29f77829fce8f6a82032ece93fc8226e" title="Provides the number of completed AMI callbacks.">num_synchs</a>() {
+<a name="l00128"></a>00128 <span class="keywordflow">return</span> _num_synchs;
+<a name="l00129"></a>00129 }
+<a name="l00130"></a>00130 <span class="comment"></span>
+<a name="l00131"></a>00131 <span class="comment"> /**</span>
+<a name="l00132"></a>00132 <span class="comment"> * This method is called by Ice run time when the server</span>
+<a name="l00133"></a>00133 <span class="comment"> * responds. We do some bookkeeping and delegate the</span>
+<a name="l00134"></a>00134 <span class="comment"> * task of actually completing the AMI by calling</span>
+<a name="l00135"></a>00135 <span class="comment"> * sync_helper.end method</span>
+<a name="l00136"></a>00136 <span class="comment"> */</span>
+<a name="l00137"></a><a class="code" href="class_p_n_g_callback.html#a568d03d9ea319a1b2d7207b25a3847a5">00137</a> <span class="keywordtype">void</span> <a class="code" href="class_p_n_g_callback.html#a568d03d9ea319a1b2d7207b25a3847a5">finished</a>(<span class="keyword">const</span> Ice::AsyncResultPtr&amp; r) {
+<a name="l00138"></a>00138 DistributedMapPrx dist_map = DistributedMapPrx::uncheckedCast(
+<a name="l00139"></a>00139 r-&gt;getProxy());
+<a name="l00140"></a>00140 <span class="keywordtype">string</span> global_cnts;
+<a name="l00141"></a>00141 <a class="code" href="_d_m___client_8h.html#aa1b3c782db5b0bc73e294ec95ebd43c6">CookiePtr</a> cookie = CookiePtr::dynamicCast(r-&gt;getCookie());
+<a name="l00142"></a>00142 <span class="keywordtype">int</span> msg_id = cookie-&gt;msg_id;
+<a name="l00143"></a>00143 <span class="keywordtype">string</span> entity = cookie-&gt;entity;
+<a name="l00144"></a>00144 <span class="keywordflow">try</span> {
+<a name="l00145"></a>00145 dist_map-&gt;end_putNget(global_cnts, r);
+<a name="l00146"></a>00146 } <span class="keywordflow">catch</span> (<span class="keyword">const</span> Ice::Exception&amp; ex) {
+<a name="l00147"></a>00147 <span class="keywordflow">throw</span> ex;
+<a name="l00148"></a>00148 }
+<a name="l00149"></a>00149 _sync_helper.<a class="code" href="class_synchronizer___helper.html#a29ac0b4b630f56e59e6587bb6275d97e">end_putNget</a>(entity, global_cnts);
+<a name="l00150"></a>00150 ++_num_synchs;
+<a name="l00151"></a>00151 IceUtil::Monitor&lt;IceUtil::Mutex&gt;::Lock lock(_monitor);
+<a name="l00152"></a>00152 _status[msg_id] = <span class="keyword">true</span>;
+<a name="l00153"></a>00153 <