Skip to content
This repository
Browse code

initial commit

  • Loading branch information...
commit ac19017399932d9192b731b7f99a696aea86a0b0 0 parents
cloudata cloudata authored

Showing 1,318 changed files with 23,279 additions and 0 deletions. Show diff stats Hide diff stats

  1. +202 0 LICENSE.txt
  2. +6 0 NOTICE.txt
  3. +1 0  README.txt
  4. +14 0 bin/all_restart_test.sh
  5. +16 0 bin/blobmanager-start.sh
  6. +10 0 bin/blobmanager-stop.sh
  7. +80 0 bin/cconf.py
  8. +169 0 bin/cloudata
  9. +69 0 bin/cloudata-config.sh
  10. +115 0 bin/cloudata-daemon.sh
  11. +11 0 bin/cloudata-start.sh
  12. +14 0 bin/cloudata-stop.sh
  13. +29 0 bin/cloudata.bat
  14. +16 0 bin/cloudatafs-start.sh
  15. +10 0 bin/cloudatafs-stop.sh
  16. +35 0 bin/collect_logs.sh
  17. +10 0 bin/commitlog-start.sh
  18. +10 0 bin/commitlog-stop.sh
  19. +48 0 bin/commitlogserver.sh
  20. +17 0 bin/compact_mon.sh
  21. +19 0 bin/copy.sh
  22. +18 0 bin/exec.sh
  23. +10 0 bin/rest-start.sh
  24. +10 0 bin/rest-stop.sh
  25. +48 0 bin/restserver.sh
  26. +26 0 bin/rmlog.sh
  27. +42 0 bin/start.sh
  28. +11 0 bin/stop.sh
  29. +52 0 bin/tabletservers.sh
  30. +11 0 bin/thrift-start.sh
  31. +10 0 bin/thrift-stop.sh
  32. +48 0 bin/thriftserver.sh
  33. +16 0 bin/zookeeper-start.sh
  34. +10 0 bin/zookeeper-stop.sh
  35. +3 0  build.properties
  36. +281 0 build.xml
  37. +17 0 conf/classInfo.xml
  38. +424 0 conf/cloudata-default.xml
  39. +51 0 conf/cloudata-env.sh
  40. +88 0 conf/cloudata-metrics.properties
  41. +39 0 conf/cloudata-site.xml
  42. +1 0  conf/commitlog_servers
  43. +44 0 conf/log4j.properties
  44. +1 0  conf/rest_servers
  45. +1 0  conf/tablet_servers
  46. +1 0  conf/thrift_servers
  47. +12 0 conf/zoo.cfg
  48. +101 0 doc/.svn/all-wcprops
  49. +578 0 doc/.svn/entries
  50. +5 0 doc/.svn/prop-base/Neptune_DistributedDataStorage.pdf.svn-base
  51. +5 0 doc/.svn/prop-base/Neptune_Programmers_Manual.pdf.svn-base
  52. BIN  doc/.svn/text-base/Neptune_DistributedDataStorage.pdf.svn-base
  53. BIN  doc/.svn/text-base/Neptune_Programmers_Manual.pdf.svn-base
  54. +89 0 doc/.svn/text-base/components.html.svn-base
  55. +103 0 doc/.svn/text-base/datamodel.html.svn-base
  56. +91 0 doc/.svn/text-base/download.html.svn-base
  57. +79 0 doc/.svn/text-base/failover.html.svn-base
  58. +93 0 doc/.svn/text-base/faq.html.svn-base
  59. +201 0 doc/.svn/text-base/getting_start.html.svn-base
  60. +147 0 doc/.svn/text-base/index.html.svn-base
  61. +339 0 doc/.svn/text-base/install.html.svn-base
  62. +79 0 doc/.svn/text-base/license.html.svn-base
  63. +230 0 doc/.svn/text-base/mapreduce.html.svn-base
  64. +130 0 doc/.svn/text-base/neptune_query.html.svn-base
  65. +89 0 doc/.svn/text-base/news.html.svn-base
  66. +91 0 doc/.svn/text-base/performance.html.svn-base
  67. +242 0 doc/.svn/text-base/simple_examples.html.svn-base
  68. +126 0 doc/cloudata_query.html
  69. +85 0 doc/components.html
  70. +23 0 doc/css/.svn/all-wcprops
  71. +130 0 doc/css/.svn/entries
  72. +147 0 doc/css/.svn/text-base/maven-base.css.svn-base
  73. +293 0 doc/css/.svn/text-base/maven-theme.css.svn-base
  74. +7 0 doc/css/.svn/text-base/print.css.svn-base
  75. +147 0 doc/css/maven-base.css
  76. +293 0 doc/css/maven-theme.css
  77. +7 0 doc/css/print.css
  78. +99 0 doc/datamodel.html
  79. +87 0 doc/download.html
  80. +76 0 doc/failover.html
  81. +89 0 doc/faq.html
  82. +197 0 doc/getting_start.html
  83. +53 0 doc/images/.svn/all-wcprops
  84. +300 0 doc/images/.svn/entries
  85. +5 0 doc/images/.svn/prop-base/breadcrumbs.jpg.svn-base
  86. +5 0 doc/images/.svn/prop-base/h5.jpg.svn-base
  87. +5 0 doc/images/.svn/prop-base/neptune.gif.svn-base
  88. +5 0 doc/images/.svn/prop-base/neptune_architecture.gif.svn-base
  89. +5 0 doc/images/.svn/prop-base/neptune_datamodel.gif.svn-base
  90. +5 0 doc/images/.svn/prop-base/neptune_pleiades.jpg.svn-base
  91. +5 0 doc/images/.svn/prop-base/neptune_row_cell.gif.svn-base
  92. +5 0 doc/images/.svn/prop-base/neptune_shell.jpg.svn-base
  93. BIN  doc/images/.svn/text-base/breadcrumbs.jpg.svn-base
  94. BIN  doc/images/.svn/text-base/h5.jpg.svn-base
  95. BIN  doc/images/.svn/text-base/neptune.gif.svn-base
  96. BIN  doc/images/.svn/text-base/neptune_architecture.gif.svn-base
  97. BIN  doc/images/.svn/text-base/neptune_datamodel.gif.svn-base
  98. BIN  doc/images/.svn/text-base/neptune_pleiades.jpg.svn-base
  99. BIN  doc/images/.svn/text-base/neptune_row_cell.gif.svn-base
  100. BIN  doc/images/.svn/text-base/neptune_shell.jpg.svn-base
  101. BIN  doc/images/breadcrumbs.jpg
  102. BIN  doc/images/cloudata.gif
  103. BIN  doc/images/cloudata_architecture.gif
  104. BIN  doc/images/cloudata_datamodel.gif
  105. BIN  doc/images/cloudata_row_cell.gif
  106. BIN  doc/images/cloudata_shell.jpg
  107. BIN  doc/images/h5.jpg
  108. +143 0 doc/index.html
  109. +335 0 doc/install.html
  110. +124 0 doc/javadoc/allclasses-frame.html
  111. +124 0 doc/javadoc/allclasses-noframe.html
  112. +307 0 doc/javadoc/constant-values.html
  113. +192 0 doc/javadoc/deprecated-list.html
  114. +224 0 doc/javadoc/help-doc.html
  115. +203 0 doc/javadoc/index-files/index-1.html
  116. +146 0 doc/javadoc/index-files/index-10.html
  117. +176 0 doc/javadoc/index-files/index-11.html
  118. +191 0 doc/javadoc/index-files/index-12.html
  119. +171 0 doc/javadoc/index-files/index-13.html
  120. +203 0 doc/javadoc/index-files/index-14.html
  121. +194 0 doc/javadoc/index-files/index-15.html
  122. +306 0 doc/javadoc/index-files/index-16.html
  123. +389 0 doc/javadoc/index-files/index-17.html
  124. +248 0 doc/javadoc/index-files/index-18.html
  125. +152 0 doc/javadoc/index-files/index-19.html
  126. +149 0 doc/javadoc/index-files/index-2.html
  127. +194 0 doc/javadoc/index-files/index-20.html
  128. +379 0 doc/javadoc/index-files/index-3.html
  129. +176 0 doc/javadoc/index-files/index-4.html
  130. +191 0 doc/javadoc/index-files/index-5.html
  131. +146 0 doc/javadoc/index-files/index-6.html
  132. +655 0 doc/javadoc/index-files/index-7.html
  133. +169 0 doc/javadoc/index-files/index-8.html
  134. +192 0 doc/javadoc/index-files/index-9.html
  135. +40 0 doc/javadoc/index.html
  136. +362 0 doc/javadoc/org/cloudata/core/client/AbstractKey.html
  137. +282 0 doc/javadoc/org/cloudata/core/client/AsyncCall.html
  138. +263 0 doc/javadoc/org/cloudata/core/client/AsyncDataReceiver.html
  139. +1,733 0 doc/javadoc/org/cloudata/core/client/CTable.html
  140. +396 0 doc/javadoc/org/cloudata/core/client/CTableManager.html
  141. +360 0 doc/javadoc/org/cloudata/core/client/Cell.Key.html
  142. +702 0 doc/javadoc/org/cloudata/core/client/Cell.Value.html
  143. +725 0 doc/javadoc/org/cloudata/core/client/Cell.html
  144. +500 0 doc/javadoc/org/cloudata/core/client/CellFilter.CellPage.html
  145. +935 0 doc/javadoc/org/cloudata/core/client/CellFilter.html
  146. +216 0 doc/javadoc/org/cloudata/core/client/CellValueMatcher.html
  147. +474 0 doc/javadoc/org/cloudata/core/client/CellValueMatcherInfo.html
  148. +291 0 doc/javadoc/org/cloudata/core/client/DefaultDirectUploader.html
  149. +301 0 doc/javadoc/org/cloudata/core/client/DirectUploader.html
  150. +269 0 doc/javadoc/org/cloudata/core/client/LeaseToucher.html
  151. +416 0 doc/javadoc/org/cloudata/core/client/Row.Key.html
  152. +949 0 doc/javadoc/org/cloudata/core/client/Row.html
  153. +919 0 doc/javadoc/org/cloudata/core/client/RowFilter.html
Sorry, we could not display the entire diff because too many files (1,318) changed.
202 LICENSE.txt
... ... @@ -0,0 +1,202 @@
  1 +
  2 + Apache License
  3 + Version 2.0, January 2004
  4 + http://www.apache.org/licenses/
  5 +
  6 + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
  7 +
  8 + 1. Definitions.
  9 +
  10 + "License" shall mean the terms and conditions for use, reproduction,
  11 + and distribution as defined by Sections 1 through 9 of this document.
  12 +
  13 + "Licensor" shall mean the copyright owner or entity authorized by
  14 + the copyright owner that is granting the License.
  15 +
  16 + "Legal Entity" shall mean the union of the acting entity and all
  17 + other entities that control, are controlled by, or are under common
  18 + control with that entity. For the purposes of this definition,
  19 + "control" means (i) the power, direct or indirect, to cause the
  20 + direction or management of such entity, whether by contract or
  21 + otherwise, or (ii) ownership of fifty percent (50%) or more of the
  22 + outstanding shares, or (iii) beneficial ownership of such entity.
  23 +
  24 + "You" (or "Your") shall mean an individual or Legal Entity
  25 + exercising permissions granted by this License.
  26 +
  27 + "Source" form shall mean the preferred form for making modifications,
  28 + including but not limited to software source code, documentation
  29 + source, and configuration files.
  30 +
  31 + "Object" form shall mean any form resulting from mechanical
  32 + transformation or translation of a Source form, including but
  33 + not limited to compiled object code, generated documentation,
  34 + and conversions to other media types.
  35 +
  36 + "Work" shall mean the work of authorship, whether in Source or
  37 + Object form, made available under the License, as indicated by a
  38 + copyright notice that is included in or attached to the work
  39 + (an example is provided in the Appendix below).
  40 +
  41 + "Derivative Works" shall mean any work, whether in Source or Object
  42 + form, that is based on (or derived from) the Work and for which the
  43 + editorial revisions, annotations, elaborations, or other modifications
  44 + represent, as a whole, an original work of authorship. For the purposes
  45 + of this License, Derivative Works shall not include works that remain
  46 + separable from, or merely link (or bind by name) to the interfaces of,
  47 + the Work and Derivative Works thereof.
  48 +
  49 + "Contribution" shall mean any work of authorship, including
  50 + the original version of the Work and any modifications or additions
  51 + to that Work or Derivative Works thereof, that is intentionally
  52 + submitted to Licensor for inclusion in the Work by the copyright owner
  53 + or by an individual or Legal Entity authorized to submit on behalf of
  54 + the copyright owner. For the purposes of this definition, "submitted"
  55 + means any form of electronic, verbal, or written communication sent
  56 + to the Licensor or its representatives, including but not limited to
  57 + communication on electronic mailing lists, source code control systems,
  58 + and issue tracking systems that are managed by, or on behalf of, the
  59 + Licensor for the purpose of discussing and improving the Work, but
  60 + excluding communication that is conspicuously marked or otherwise
  61 + designated in writing by the copyright owner as "Not a Contribution."
  62 +
  63 + "Contributor" shall mean Licensor and any individual or Legal Entity
  64 + on behalf of whom a Contribution has been received by Licensor and
  65 + subsequently incorporated within the Work.
  66 +
  67 + 2. Grant of Copyright License. Subject to the terms and conditions of
  68 + this License, each Contributor hereby grants to You a perpetual,
  69 + worldwide, non-exclusive, no-charge, royalty-free, irrevocable
  70 + copyright license to reproduce, prepare Derivative Works of,
  71 + publicly display, publicly perform, sublicense, and distribute the
  72 + Work and such Derivative Works in Source or Object form.
  73 +
  74 + 3. Grant of Patent License. Subject to the terms and conditions of
  75 + this License, each Contributor hereby grants to You a perpetual,
  76 + worldwide, non-exclusive, no-charge, royalty-free, irrevocable
  77 + (except as stated in this section) patent license to make, have made,
  78 + use, offer to sell, sell, import, and otherwise transfer the Work,
  79 + where such license applies only to those patent claims licensable
  80 + by such Contributor that are necessarily infringed by their
  81 + Contribution(s) alone or by combination of their Contribution(s)
  82 + with the Work to which such Contribution(s) was submitted. If You
  83 + institute patent litigation against any entity (including a
  84 + cross-claim or counterclaim in a lawsuit) alleging that the Work
  85 + or a Contribution incorporated within the Work constitutes direct
  86 + or contributory patent infringement, then any patent licenses
  87 + granted to You under this License for that Work shall terminate
  88 + as of the date such litigation is filed.
  89 +
  90 + 4. Redistribution. You may reproduce and distribute copies of the
  91 + Work or Derivative Works thereof in any medium, with or without
  92 + modifications, and in Source or Object form, provided that You
  93 + meet the following conditions:
  94 +
  95 + (a) You must give any other recipients of the Work or
  96 + Derivative Works a copy of this License; and
  97 +
  98 + (b) You must cause any modified files to carry prominent notices
  99 + stating that You changed the files; and
  100 +
  101 + (c) You must retain, in the Source form of any Derivative Works
  102 + that You distribute, all copyright, patent, trademark, and
  103 + attribution notices from the Source form of the Work,
  104 + excluding those notices that do not pertain to any part of
  105 + the Derivative Works; and
  106 +
  107 + (d) If the Work includes a "NOTICE" text file as part of its
  108 + distribution, then any Derivative Works that You distribute must
  109 + include a readable copy of the attribution notices contained
  110 + within such NOTICE file, excluding those notices that do not
  111 + pertain to any part of the Derivative Works, in at least one
  112 + of the following places: within a NOTICE text file distributed
  113 + as part of the Derivative Works; within the Source form or
  114 + documentation, if provided along with the Derivative Works; or,
  115 + within a display generated by the Derivative Works, if and
  116 + wherever such third-party notices normally appear. The contents
  117 + of the NOTICE file are for informational purposes only and
  118 + do not modify the License. You may add Your own attribution
  119 + notices within Derivative Works that You distribute, alongside
  120 + or as an addendum to the NOTICE text from the Work, provided
  121 + that such additional attribution notices cannot be construed
  122 + as modifying the License.
  123 +
  124 + You may add Your own copyright statement to Your modifications and
  125 + may provide additional or different license terms and conditions
  126 + for use, reproduction, or distribution of Your modifications, or
  127 + for any such Derivative Works as a whole, provided Your use,
  128 + reproduction, and distribution of the Work otherwise complies with
  129 + the conditions stated in this License.
  130 +
  131 + 5. Submission of Contributions. Unless You explicitly state otherwise,
  132 + any Contribution intentionally submitted for inclusion in the Work
  133 + by You to the Licensor shall be under the terms and conditions of
  134 + this License, without any additional terms or conditions.
  135 + Notwithstanding the above, nothing herein shall supersede or modify
  136 + the terms of any separate license agreement you may have executed
  137 + with Licensor regarding such Contributions.
  138 +
  139 + 6. Trademarks. This License does not grant permission to use the trade
  140 + names, trademarks, service marks, or product names of the Licensor,
  141 + except as required for reasonable and customary use in describing the
  142 + origin of the Work and reproducing the content of the NOTICE file.
  143 +
  144 + 7. Disclaimer of Warranty. Unless required by applicable law or
  145 + agreed to in writing, Licensor provides the Work (and each
  146 + Contributor provides its Contributions) on an "AS IS" BASIS,
  147 + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
  148 + implied, including, without limitation, any warranties or conditions
  149 + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
  150 + PARTICULAR PURPOSE. You are solely responsible for determining the
  151 + appropriateness of using or redistributing the Work and assume any
  152 + risks associated with Your exercise of permissions under this License.
  153 +
  154 + 8. Limitation of Liability. In no event and under no legal theory,
  155 + whether in tort (including negligence), contract, or otherwise,
  156 + unless required by applicable law (such as deliberate and grossly
  157 + negligent acts) or agreed to in writing, shall any Contributor be
  158 + liable to You for damages, including any direct, indirect, special,
  159 + incidental, or consequential damages of any character arising as a
  160 + result of this License or out of the use or inability to use the
  161 + Work (including but not limited to damages for loss of goodwill,
  162 + work stoppage, computer failure or malfunction, or any and all
  163 + other commercial damages or losses), even if such Contributor
  164 + has been advised of the possibility of such damages.
  165 +
  166 + 9. Accepting Warranty or Additional Liability. While redistributing
  167 + the Work or Derivative Works thereof, You may choose to offer,
  168 + and charge a fee for, acceptance of support, warranty, indemnity,
  169 + or other liability obligations and/or rights consistent with this
  170 + License. However, in accepting such obligations, You may act only
  171 + on Your own behalf and on Your sole responsibility, not on behalf
  172 + of any other Contributor, and only if You agree to indemnify,
  173 + defend, and hold each Contributor harmless for any liability
  174 + incurred by, or claims asserted against, such Contributor by reason
  175 + of your accepting any such warranty or additional liability.
  176 +
  177 + END OF TERMS AND CONDITIONS
  178 +
  179 + APPENDIX: How to apply the Apache License to your work.
  180 +
  181 + To apply the Apache License to your work, attach the following
  182 + boilerplate notice, with the fields enclosed by brackets "[]"
  183 + replaced with your own identifying information. (Don't include
  184 + the brackets!) The text should be enclosed in the appropriate
  185 + comment syntax for the file format. We also recommend that a
  186 + file or class name and description of purpose be included on the
  187 + same "printed page" as the copyright notice for easier
  188 + identification within third-party archives.
  189 +
  190 + Copyright [yyyy] [name of copyright owner]
  191 +
  192 + Licensed under the Apache License, Version 2.0 (the "License");
  193 + you may not use this file except in compliance with the License.
  194 + You may obtain a copy of the License at
  195 +
  196 + http://www.apache.org/licenses/LICENSE-2.0
  197 +
  198 + Unless required by applicable law or agreed to in writing, software
  199 + distributed under the License is distributed on an "AS IS" BASIS,
  200 + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  201 + See the License for the specific language governing permissions and
  202 + limitations under the License.
6 NOTICE.txt
... ... @@ -0,0 +1,6 @@
  1 +In addition, this product includes software developed by:
  2 +
  3 +Hadoop(http://hadoop.apache.org)
  4 +ZooKeeper(http://hadoop.apache.org/zookeeper)
  5 +JUnit (http://www.junit.org/)
  6 +Apache Commons
1  README.txt
... ... @@ -0,0 +1 @@
  1 +See the docs directory or http://www.cloudata.org
14 bin/all_restart_test.sh
... ... @@ -0,0 +1,14 @@
  1 +#!/usr/bin/env bash
  2 +
  3 +## This script is just for Hudson test
  4 +
  5 +echo "KILL ALL THE JAVA PROCESSES EXCEPT HUDSON PROCESS"
  6 +ps -ef | grep "java" | grep -v "hudson" | grep -v "grep" | awk '{print $2}' | xargs kill -9
  7 +
  8 +echo "SLEEP 2 SEC"
  9 +sleep 2
  10 +
  11 +echo "RUN PLEIADES"
  12 +./bin/start-all.sh
  13 +
  14 +echo "TEST IS READY..."
16 bin/blobmanager-start.sh
... ... @@ -0,0 +1,16 @@
  1 +#!/usr/bin/env bash
  2 +
  3 +# Start cloudataloudata-fs web server.
  4 +
  5 +bin=`dirname "$0"`
  6 +bin=`cd "$bin"; pwd`
  7 +
  8 +. "$bin"/cloudata-config.sh
  9 +
  10 +if [ -f "${CLOUDATA_CONF_DIR}/cloudata-env.sh" ]; then
  11 + . "${CLOUDATA_CONF_DIR}/cloudata-env.sh"
  12 +fi
  13 +
  14 +. "$bin"/cloudata-config.sh
  15 +
  16 +"$bin"/cloudata-daemon.sh start blobmanager
10 bin/blobmanager-stop.sh
... ... @@ -0,0 +1,10 @@
  1 +#!/usr/bin/env bash
  2 +
  3 +# Stop cloudata-fs web server.
  4 +
  5 +bin=`dirname "$0"`
  6 +bin=`cd "$bin"; pwd`
  7 +
  8 +. "$bin"/cloudata-config.sh
  9 +
  10 +"$bin"/cloudata-daemon.sh stop blobmanager
80 bin/cconf.py
... ... @@ -0,0 +1,80 @@
  1 +#!/usr/bin/python
  2 +
  3 +import sys
  4 +import os.path
  5 +import xml.parsers.expat
  6 +
  7 +class Configuration:
  8 + map={}
  9 +
  10 + def __init__(self, parentDir, defaultFileName, siteFileName):
  11 + self.parse(parentDir, defaultFileName)
  12 + self.parse(parentDir, siteFileName)
  13 +
  14 + def parse(self, parentDir, fileName):
  15 + file = open(parentDir + '/' + fileName, 'r')
  16 +
  17 + parser = xml.parsers.expat.ParserCreate()
  18 + parser.StartElementHandler = self.start_element
  19 + parser.EndElementHandler = self.end_element
  20 + parser.CharacterDataHandler = self.char_data
  21 +
  22 + parser.ParseFile(file)
  23 +
  24 + def start_element(self, name, attrs):
  25 + self.currentTagName = name
  26 +
  27 + def end_element(self, name):
  28 + if self.currentTagName == 'value':
  29 + self.currentConfName=None
  30 +
  31 + self.currentTagName=None
  32 +
  33 + def char_data(self, data):
  34 + if self.currentTagName == 'name':
  35 + self.currentConfName = data
  36 + elif self.currentTagName == 'value':
  37 + if self.currentConfName == None:
  38 + print "shit : ", data
  39 + exit(1)
  40 +
  41 + self.map[self.currentConfName] = data
  42 +
  43 + def get(self, name):
  44 + return self.map[name]
  45 +
  46 +
  47 + def print_all(self):
  48 + maxLen=0
  49 + keyList=self.map.keys()
  50 + keyList.sort()
  51 + for k in keyList:
  52 + if len(k) > maxLen:
  53 + maxLen=len(k)
  54 +
  55 + maxTabCount= maxLen / 8 + 1
  56 + #print "KEY%sVALUE" % self.get_tabs(maxTabCount)
  57 + #print ""
  58 +
  59 + for k in keyList:
  60 + tabCount = maxTabCount - (len(k) / 8)
  61 + print '%s%s%s' % (k, self.get_tabs(tabCount), self.map[k])
  62 +
  63 + def get_tabs(self, tabCount):
  64 + tabs=''
  65 + i=0
  66 + while(i < tabCount):
  67 + i=i+1
  68 + tabs +='\t'
  69 +
  70 + return tabs;
  71 +
  72 +
  73 +if __name__ == "__main__":
  74 + confPath = os.path.abspath(os.path.dirname(sys.argv[0])) + '/../conf'
  75 +
  76 + conf = Configuration(confPath, "cloudata-default.xml", "cloudata-site.xml")
  77 + if len(sys.argv) == 1:
  78 + conf.print_all()
  79 + elif len(sys.argv) > 1:
  80 + map(lambda f: sys.stdout.write(f + '\n'), map(lambda f: conf.get(f), sys.argv[1:]))
169 bin/cloudata
... ... @@ -0,0 +1,169 @@
  1 +#!/usr/bin/env bash
  2 +#
  3 +# The Cloudata command script
  4 +#
  5 +# Environment Variables
  6 +#
  7 +# JAVA_HOME The java implementation to use. Overrides JAVA_HOME.
  8 +#
  9 +# CLOUDATA_HEAPSIZE The maximum amount of heap to use, in MB.
  10 +# Default is 2000.
  11 +#
  12 +# CLOUDATA_OPTS Extra Java runtime options.
  13 +#
  14 +# CLOUDATA_CONF_DIR Alternate conf dir. Default is ${CLOUDATA_HOME}/conf.
  15 +#
  16 +# CLOUDATA_ROOT_LOGGER The root appender. Default is INFO,console
  17 +#
  18 +
  19 +bin=`dirname "$0"`
  20 +bin=`cd "$bin"; pwd`
  21 +
  22 +. "$bin"/cloudata-config.sh
  23 +
  24 +# if no args specified, show usage
  25 +if [ $# = 0 ]; then
  26 + echo "Usage: cloudata COMMAND"
  27 + echo "where COMMAND is one of:"
  28 + echo " localcluster run a all in one server for testing"
  29 + echo " cloudatamaster run a cloudata master"
  30 + echo " commitlogserver run a commitlogserver"
  31 + echo " tabletserver run a tabletserver"
  32 + echo " restserver run a RESTful HTTP server"
  33 + echo " thriftserver run a thrift server"
  34 + echo " blobmanager run a blob manager"
  35 + echo " balancer run a balancer"
  36 + echo " cloudatafs run a cloudata-fs"
  37 + echo " shell run a shell"
  38 + echo " fshell run cloudata-fs shell"
  39 + echo " zshell run a zookeeper client <hostname:port> <command(help, ls, ...)>"
  40 + echo " scan scan data"
  41 + echo " zookeeper run a zookeeper server"
  42 + exit 1
  43 +fi
  44 +
  45 +# get arguments
  46 +COMMAND=$1
  47 +shift
  48 +
  49 +if [ -f "${CLOUDATA_CONF_DIR}/cloudata-env.sh" ]; then
  50 + . "${CLOUDATA_CONF_DIR}/cloudata-env.sh"
  51 +fi
  52 +
  53 +# some Java parameters
  54 +if [ "$JAVA_HOME" != "" ]; then
  55 + #echo "run java in $JAVA_HOME"
  56 + JAVA_HOME=$JAVA_HOME
  57 +fi
  58 +
  59 +if [ "$JAVA_HOME" = "" ]; then
  60 + echo "Error: JAVA_HOME is not set."
  61 + exit 1
  62 +fi
  63 +
  64 +JAVA=$JAVA_HOME/bin/java
  65 +
  66 +# CLASSPATH initially contains $CLOUDATA_CONF_DIR
  67 +CLASSPATH="${CLOUDATA_CONF_DIR}"
  68 +CLASSPATH=${CLASSPATH}:"${HADOOP_CONF_DIR}"
  69 +CLASSPATH=${CLASSPATH}:$JAVA_HOME/lib/tools.jar
  70 +
  71 +# for developers, add Cloudata classes to CLASSPATH
  72 +#if [ -d "$CLOUDATA_HOME/build/classes" ]; then
  73 +# CLASSPATH=${CLASSPATH}:$CLOUDATA_HOME/build/classes
  74 +#fi
  75 +
  76 +# so that filenames w/ spaces are handled correctly in loops below
  77 +IFS=
  78 +
  79 +for f in $CLOUDATA_HOME/cloudata-*core.jar; do
  80 + CLASSPATH=${CLASSPATH}:$f;
  81 +done
  82 +
  83 +# add libs to CLASSPATH
  84 +for f in $CLOUDATA_HOME/lib/*.jar; do
  85 + CLASSPATH=${CLASSPATH}:$f;
  86 +done
  87 +
  88 +for f in $CLOUDATA_HOME/lib/jetty-ext/*.jar; do
  89 + CLASSPATH=${CLASSPATH}:$f;
  90 +done
  91 +
  92 +#add hadoop CLASSPATH
  93 +for f in $HADOOP_HOME/hadoop-*.jar; do
  94 + CLASSPATH=${CLASSPATH}:$f;
  95 +done
  96 +
  97 +# add libs to CLASSPATH
  98 +#for f in $HADOOP_HOME/lib/*.jar; do
  99 +# CLASSPATH=${CLASSPATH}:$f;
  100 +#done
  101 +
  102 +#for f in $HADOOP_HOME/lib/jetty-ext/*.jar; do
  103 +# CLASSPATH=${CLASSPATH}:$f;
  104 +#done
  105 +
  106 +# add user-specified CLASSPATH last
  107 +if [ "$CLOUDATA_CLASSPATH" != "" ]; then
  108 + CLASSPATH=${CLASSPATH}:${CLOUDATA_CLASSPATH}
  109 +fi
  110 +
  111 +# default log directory & file
  112 +if [ "$CLOUDATA_LOG_DIR" = "" ]; then
  113 + CLOUDATA_LOG_DIR="$CLOUDATA_HOME/logs"
  114 +fi
  115 +if [ "$CLOUDATA_LOGFILE" = "" ]; then
  116 + CLOUDATA_LOGFILE='cloudata.log'
  117 +fi
  118 +
  119 +# restore ordinary behaviour
  120 +unset IFS
  121 +
  122 +# figure out which class to run
  123 +if [ "$COMMAND" = "cloudatamaster" ] ; then
  124 + CLASS='org.cloudata.core.master.CloudataMaster'
  125 + CLOUDATA_OPTS="$CLOUDATA_OPTS $CLOUDATA_MASTERNODE_OPTS"
  126 +elif [ "$COMMAND" = "tabletserver" ] ; then
  127 + CLASS='org.cloudata.core.tabletserver.TabletServer'
  128 + CLOUDATA_OPTS="$CLOUDATA_OPTS $CLOUDATA_TABLETSERVER_OPTS"
  129 +elif [ "$COMMAND" = "commitlogserver" ] ; then
  130 + CLASS='org.cloudata.core.commitlog.CommitLogServer'
  131 + CLOUDATA_OPTS="$CLOUDATA_OPTS $CLOUDATA_COMMITLOG_OPTS"
  132 +elif [ "$COMMAND" = "thriftserver" ] ; then
  133 + CLASS='org.cloudata.core.thrift.CloudataThriftServer'
  134 +elif [ "$COMMAND" = "restserver" ] ; then
  135 + CLASS='org.cloudata.core.rest.RestWebServer'
  136 +elif [ "$COMMAND" = "blobmanager" ] ; then
  137 + CLASS='org.cloudata.core.client.blob.BlobManager'
  138 +elif [ "$COMMAND" = "balancer" ] ; then
  139 + CLASS='org.cloudata.core.master.TabletBalancer'
  140 +elif [ "$COMMAND" = "cloudatafs" ] ; then
  141 + CLASS='org.cloudata.tools.cloudatafs.CloudataFSWebServer'
  142 +elif [ "$COMMAND" = "shell" ] ; then
  143 + CLASS='org.cloudata.core.client.Shell'
  144 + CLOUDATA_OPTS="$CLOUDATA_OPTS -Dfile.encoding=EUC-KR"
  145 +elif [ "$COMMAND" = "fshell" ] ; then
  146 + CLASS='org.cloudata.tools.cloudatafs.CloudataFSShell'
  147 +elif [ "$COMMAND" = "scan" ] ; then
  148 + CLASS='org.cloudata.core.client.scanner.SingleTabletMultiColumnScanner'
  149 +elif [ "$COMMAND" = "zookeeper" ] ; then
  150 + CLASS='org.apache.zookeeper.server.quorum.QuorumPeerMain'
  151 +elif [ "$COMMAND" = "zshell" ] ; then
  152 + CLASS='org.apache.zookeeper.ZooKeeperMain'
  153 +elif [ "$COMMAND" = "jar" ] ; then
  154 + CLASS='org.cloudata.core.common.util.CRunJar'
  155 +elif [ "$COMMAND" = "localcluster" ] ; then
  156 + CLASS='org.cloudata.core.AllInOneServer'
  157 +else
  158 + CLASS=$COMMAND
  159 +fi
  160 +
  161 +CLOUDATA_OPTS="$CLOUDATA_OPTS -Dcloudata.log.dir=$CLOUDATA_LOG_DIR"
  162 +CLOUDATA_OPTS="$CLOUDATA_OPTS -Dcloudata.log.file=$CLOUDATA_LOGFILE"
  163 +CLOUDATA_OPTS="$CLOUDATA_OPTS -Dcloudata.home.dir=$CLOUDATA_HOME"
  164 +CLOUDATA_OPTS="$CLOUDATA_OPTS -Dcloudata.id.str=$CLOUDATA_IDENT_STRING"
  165 +CLOUDATA_OPTS="$CLOUDATA_OPTS -Dcloudata.root.logger=${CLOUDATA_ROOT_LOGGER:-INFO,console}"
  166 +
  167 +# run it
  168 +exec "$JAVA" $CLOUDATA_OPTS -Djava.security.policy=$CLOUDATA_HOME/conf/policy.all -classpath "$CLASSPATH" $CLASS "$@"
  169 +
69 bin/cloudata-config.sh
... ... @@ -0,0 +1,69 @@
  1 +# Licensed to the Apache Software Foundation (ASF) under one or more
  2 +# contributor license agreements. See the NOTICE file distributed with
  3 +# this work for additional information regarding copyright ownership.
  4 +# The ASF licenses this file to You under the Apache License, Version 2.0
  5 +# (the "License"); you may not use this file except in compliance with
  6 +# the License. You may obtain a copy of the License at
  7 +#
  8 +# http://www.apache.org/licenses/LICENSE-2.0
  9 +#
  10 +# Unless required by applicable law or agreed to in writing, software
  11 +# distributed under the License is distributed on an "AS IS" BASIS,
  12 +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13 +# See the License for the specific language governing permissions and
  14 +# limitations under the License.
  15 +
  16 +# included in all the cloudata scripts with source command
  17 +# should not be executable directly
  18 +# also should not be passed any arguments, since we need original $*
  19 +
  20 +# resolve links - $0 may be a softlink
  21 +
  22 +this="$0"
  23 +while [ -h "$this" ]; do
  24 + ls=`ls -ld "$this"`
  25 + link=`expr "$ls" : '.*-> \(.*\)$'`
  26 + if expr "$link" : '.*/.*' > /dev/null; then
  27 + this="$link"
  28 + else
  29 + this=`dirname "$this"`/"$link"
  30 + fi
  31 +done
  32 +
  33 +# convert relative path to absolute path
  34 +bin=`dirname "$this"`
  35 +
  36 +script=`basename "$this"`
  37 +bin=`cd "$bin"; pwd`
  38 +this="$bin/$script"
  39 +
  40 +# the root of the Cloudata installation
  41 +export CLOUDATA_HOME=`dirname "$this"`/..
  42 +
  43 +#check to see if the conf dir is given as an optional argument
  44 +if [ $# -gt 1 ]
  45 +then
  46 + if [ "--config" = "$1" ]
  47 + then
  48 + shift
  49 + confdir=$1
  50 + shift
  51 + CLOUDATA_CONF_DIR=$confdir
  52 + fi
  53 +fi
  54 +
  55 +# Allow alternate conf dir location.
  56 +CLOUDATA_CONF_DIR="${CLOUDATA_CONF_DIR:-$CLOUDATA_HOME/conf}"
  57 +
  58 +#check to see it is specified whether to use the slaves or the
  59 +# masters file
  60 +if [ $# -gt 1 ]
  61 +then
  62 + if [ "--hosts" = "$1" ]
  63 + then
  64 + shift
  65 + slavesfile=$1
  66 + shift
  67 + export CLOUDATA_SLAVES="${CLOUDATA_CONF_DIR}/$slavesfile"
  68 + fi
  69 +fi
115 bin/cloudata-daemon.sh
... ... @@ -0,0 +1,115 @@
  1 +#!/usr/bin/env bash
  2 +#
  3 +# Runs a Cloudata command as a daemon.
  4 +#
  5 +# Environment Variables
  6 +#
  7 +# CLOUDATA_CONF_DIR Alternate conf dir. Default is ${CLOUDATA_HOME}/conf.
  8 +# CLOUDATA_LOG_DIR Where log files are stored. PWD by default.
  9 +##
  10 +
  11 +usage="Usage: cloudata-daemon.sh (start|stop) <command>"
  12 +
  13 +# if no args specified, show usage
  14 +if [ $# -le 1 ]; then
  15 + echo $usage
  16 + exit 1
  17 +fi
  18 +
  19 +bin=`dirname "$0"`
  20 +bin=`cd "$bin"; pwd`
  21 +
  22 +. "$bin"/cloudata-config.sh
  23 +
  24 +if [ -f "${CLOUDATA_CONF_DIR}/cloudata-env.sh" ]; then
  25 + . "${CLOUDATA_CONF_DIR}/cloudata-env.sh"
  26 +fi
  27 +
  28 +startStop=$1
  29 +shift
  30 +command=$1
  31 +shift
  32 +
  33 +cloudata_rotate_log ()
  34 +{
  35 + log=$1;
  36 + num=5;
  37 + if [ -n "$2" ]; then
  38 + num=$2
  39 + fi
  40 + if [ -f "$log" ]; then # rotate logs
  41 + while [ $num -gt 1 ]; do
  42 + prev=`expr $num - 1`
  43 + [ -f "$log.$prev" ] && mv "$log.$prev" "$log.$num"
  44 + num=$prev
  45 + done
  46 + mv "$log" "$log.$num";
  47 + fi
  48 +}
  49 +
  50 +if [ "$CLOUDATA_LOG_DIR" = "" ]; then
  51 + export CLOUDATA_LOG_DIR="$CLOUDATA_HOME/logs"
  52 +fi
  53 +mkdir -p "$CLOUDATA_LOG_DIR"
  54 +
  55 +if [ "$CLOUDATA_PID_DIR" = "" ]; then
  56 + CLOUDATA_PID_DIR=/tmp
  57 +fi
  58 +
  59 +if [ "$CLOUDATA_IDENT_STRING" = "" ]; then
  60 + export CLOUDATA_IDENT_STRING="$USER"
  61 +fi
  62 +
  63 +# some variables
  64 +export CLOUDATA_LOGFILE=cloudata-$CLOUDATA_IDENT_STRING-$command-`hostname`.log
  65 +export CLOUDATA_ROOT_LOGGER="INFO,DRFA"
  66 +log=$CLOUDATA_LOG_DIR/cloudata-$CLOUDATA_IDENT_STRING-$command-`hostname`.out
  67 +pid=$CLOUDATA_PID_DIR/cloudata-$CLOUDATA_IDENT_STRING-$command.pid
  68 +
  69 +if [ ! -e $CLOUDATA_PID_DIR ]; then
  70 + mkdir $CLOUDATA_PID_DIR
  71 +fi
  72 +
  73 +# Set default scheduling priority
  74 +if [ "$CLOUDATA_NICENESS" = "" ]; then
  75 + export CLOUDATA_NICENESS=0
  76 +fi
  77 +
  78 +case $startStop in
  79 +
  80 + (start)
  81 +
  82 + if [ -f $pid ]; then
  83 + if kill -0 `cat $pid` > /dev/null 2>&1; then
  84 + echo $command running as process `cat $pid`. Stop it first.
  85 + exit 1
  86 + fi
  87 + fi
  88 +
  89 + cloudata_rotate_log $log
  90 + echo starting $command, logging to $log
  91 + nohup nice -n $CLOUDATA_NICENESS "$CLOUDATA_HOME"/bin/cloudata $command "$@" > "$log" 2>&1 < /dev/null &
  92 + echo $! > $pid
  93 + sleep 1; head "$log"
  94 + ;;
  95 +
  96 + (stop)
  97 +
  98 + if [ -f $pid ]; then
  99 + if kill -0 `cat $pid` > /dev/null 2>&1; then
  100 + echo stopping $command
  101 + kill `cat $pid`
  102 + else
  103 + echo no $command to stop
  104 + fi
  105 + else
  106 + echo no $command to stop
  107 + fi
  108 + ;;
  109 +
  110 + (*)
  111 + echo $usage
  112 + exit 1
  113 + ;;
  114 +
  115 +esac
11 bin/cloudata-start.sh
... ... @@ -0,0 +1,11 @@
  1 +#!/usr/bin/env bash
  2 +
  3 +# Start cloudata daemons. Run this on master node.
  4 +
  5 +bin=`dirname "$0"`
  6 +bin=`cd "$bin"; pwd`
  7 +
  8 +. "$bin"/cloudata-config.sh
  9 +
  10 +"$bin"/cloudata-daemon.sh start cloudatamaster
  11 +exec "$bin/tabletservers.sh" cd "$CLOUDATA_HOME" \; "$bin/cloudata-daemon.sh" start tabletserver
14 bin/cloudata-stop.sh
... ... @@ -0,0 +1,14 @@
  1 +#!/usr/bin/env bash
  2 +
  3 +# Start cloudata daemons. Run this on master node.
  4 +
  5 +bin=`dirname "$0"`
  6 +bin=`cd "$bin"; pwd`
  7 +
  8 +. "$bin"/cloudata-config.sh
  9 +
  10 +# start cloudata daemons
  11 +# start namenode after datanodes, to minimize time namenode is up w/o data
  12 +# note: datanodes will log connection errors until namenode starts
  13 +"$bin"/cloudata-daemon.sh stop cloudatamaster
  14 +exec "$bin/tabletservers.sh" cd "$CLOUDATA_HOME" \; "$bin/cloudata-daemon.sh" stop tabletserver
29 bin/cloudata.bat
... ... @@ -0,0 +1,29 @@
  1 +@echo off
  2 +set JAVA_HOME="C:\Program Files\Java\jdk1.5.0_07"
  3 +set HADOOP_HOME=D:\temp
  4 +set CLOUDATA_HOME=%~f0\..\..
  5 +
  6 +set CLASSPATH=%CLOUDATA_HOME%;%CLOUDATA_HOME%\conf
  7 +
  8 +for %%f in (%CLOUDATA_HOME%\cloudata*.jar) do call :oneStep %%f
  9 +
  10 +for %%f in (%CLOUDATA_HOME%\lib\*.jar) do call :oneStep %%f
  11 +
  12 +for %%f in (%CLOUDATA_HOME%\lib\jetty-ext\*.jar) do call :oneStep %%f
  13 +
  14 +for %%f in (%HADOOP_HOME%\hadoop*.jar) do call :oneStep %%f
  15 +
  16 +
  17 +goto :theEnd1
  18 +
  19 +:oneStep
  20 +REM echo "ARG: %1"
  21 +if "%CLASSPATH%" == "" (set CLASSPATH=%1) else (set CLASSPATH=%CLASSPATH%;%1)
  22 +exit /B
  23 +
  24 +:theEnd1
  25 +
  26 +for %%f in (%HADOOP_HOME%\hadoop*.jar) do call :oneStep %%f
  27 +
  28 +rem echo %CLASSPATH%
  29 +call java -Xms256m -Xmx512m -Duser.dir=%CLOUDATA_HOME% -cp %CLASSPATH% %1 %2 %3 %4 %5 %6 %7
16 bin/cloudatafs-start.sh
... ... @@ -0,0 +1,16 @@
  1 +#!/usr/bin/env bash
  2 +
  3 +# Start cloudata-fs web server.
  4 +
  5 +bin=`dirname "$0"`
  6 +bin=`cd "$bin"; pwd`
  7 +
  8 +. "$bin"/cloudata-config.sh
  9 +
  10 +if [ -f "${CLOUDATA_CONF_DIR}/cloudata-env.sh" ]; then
  11 + . "${CLOUDATA_CONF_DIR}/cloudata-env.sh"
  12 +fi
  13 +
  14 +. "$bin"/cloudata-config.sh
  15 +
  16 +"$bin"/cloudata-daemon.sh start cloudatafs
10 bin/cloudatafs-stop.sh
... ... @@ -0,0 +1,10 @@
  1 +#!/usr/bin/env bash
  2 +
  3 +# Stop blobmerger
  4 +
  5 +bin=`dirname "$0"`
  6 +bin=`cd "$bin"; pwd`
  7 +
  8 +. "$bin"/cloudata-config.sh
  9 +
  10 +"$bin"/cloudata-daemon.sh stop cloudatafs
35 bin/collect_logs.sh
... ... @@ -0,0 +1,35 @@
  1 +#!/usr/bin/env bash
  2 +
  3 +BIN=`dirname "$0"`
  4 +CONF=`cd "$BIN/../conf"; pwd`
  5 +
  6 +DIR_NAME="./slave_logs"
  7 +
  8 +if [ ! -e $DIR_NAME ]
  9 +then
  10 + mkdir $DIR_NAME
  11 +else
  12 + rm -rf $DIR_NAME/*
  13 +fi
  14 +
  15 +SLAVE_LIST=`cat $CONF/tablet_servers`
  16 +COMMITLOGSERVER_LIST=`cat $CONF/commitlog_servers`
  17 +
  18 +LOG_PATH=$CLOUDATA_LOG_DIR
  19 +
  20 +if [ "$LOG_PATH" = "" ]
  21 +then
  22 + LOG_PATH=`cd "$BIN/../logs"; pwd`
  23 +fi
  24 +
  25 +for HOST in $SLAVE_LIST
  26 +do
  27 + scp $HOST:$LOG_PATH/*tabletserver*.log ./$DIR_NAME/
  28 + scp $HOST:$LOG_PATH/*tabletserver*.out ./$DIR_NAME/
  29 +done
  30 +
  31 +for HOST in $COMMITLOGSERVER_LIST
  32 +do
  33 + scp $HOST:$LOG_PATH/*commitlogserver*.log ./$DIR_NAME/
  34 + scp $HOST:$LOG_PATH/*commitlogserver*.out ./$DIR_NAME/
  35 +done
10 bin/commitlog-start.sh
... ... @@ -0,0 +1,10 @@
  1 +#!/usr/bin/env bash
  2 +
  3 +# Start cloudata daemons. Run this on master node.
  4 +
  5 +bin=`dirname "$0"`
  6 +bin=`cd "$bin"; pwd`
  7 +
  8 +. "$bin"/cloudata-config.sh
  9 +
  10 +exec "$bin/commitlogserver.sh" cd "$CLOUDATA_HOME" \; "$bin/cloudata-daemon.sh" start commitlogserver
10 bin/commitlog-stop.sh
... ... @@ -0,0 +1,10 @@
  1 +#!/usr/bin/env bash
  2 +
  3 +# Start cloudata daemons. Run this on master node.
  4 +
  5 +bin=`dirname "$0"`
  6 +bin=`cd "$bin"; pwd`
  7 +
  8 +. "$bin"/cloudata-config.sh
  9 +
  10 +exec "$bin/commitlogserver.sh" cd "$CLOUDATA_HOME" \; "$bin/cloudata-daemon.sh" stop commitlogserver
48 bin/commitlogserver.sh
... ... @@ -0,0 +1,48 @@
  1 +#!/usr/bin/env bash
  2 +#
  3 +# Run a shell command on all slave hosts.
  4 +#
  5 +# Environment Variables
  6 +#
  7 +# CLOUDATA_SLAVES File naming remote hosts.
  8 +# Default is ${CLOUDATA_CONF_DIR}/tablet_servers.
  9 +# CLOUDATA_CONF_DIR Alternate conf dir. Default is ${CLOUDATA_HOME}/conf.
  10 +# CLOUDATA_SLAVE_SLEEP Seconds to sleep between spawning remote commands.
  11 +# CLOUDATA_SSH_OPTS Options passed to ssh when running remote commands.
  12 +##
  13 +
  14 +usage="Usage: commitlogserver.sh command..."
  15 +
  16 +# if no args specified, show usage
  17 +if [ $# -le 0 ]; then
  18 + echo $usage
  19 + exit 1
  20 +fi
  21 +
  22 +bin=`dirname "$0"`
  23 +bin=`cd "$bin"; pwd`
  24 +
  25 +. "$bin"/cloudata-config.sh
  26 +
  27 +# If the slaves file is specified in the command line,
  28 +# then it takes precedence over the definition in
  29 +# cloudata-env.sh. Save it here.
  30 +HOSTLIST=$CLOUDATA_SLAVES
  31 +
  32 +if [ "$HOSTLIST" = "" ]; then
  33 + if [ "$CLOUDATA_SLAVES" = "" ]; then
  34 + export HOSTLIST="${CLOUDATA_CONF_DIR}/commitlog_servers"
  35 + else
  36 + export HOSTLIST="${CLOUDATA_SLAVES}"
  37 + fi
  38 +fi
  39 +
  40 +for slave in `cat "$HOSTLIST"`; do
  41 + ssh $CLOUDATA_SSH_OPTS $slave $"${@// /\\ }" \
  42 + 2>&1 | sed "s/^/$slave: /" &
  43 + if [ "$CLOUDATA_SLAVE_SLEEP" != "" ]; then
  44 + sleep $CLOUDATA_SLAVE_SLEEP
  45 + fi
  46 +done
  47 +
  48 +wait
17 bin/compact_mon.sh
... ... @@ -0,0 +1,17 @@
  1 +bin=`dirname "$0"`
  2 +bin=`cd "$bin"; pwd`
  3 +
  4 +SLEEP=5
  5 +
  6 +if [ $# -gt 0 ]
  7 +then
  8 + SLEEP=$1
  9 +fi
  10 +
  11 +while(true)
  12 +do
  13 +DATE=`date +%R:%S`
  14 + $bin/cloudata pshell -listAll | awk -v date_var="$DATE" 'BEGIN{mc=0;sc=0;} /minor-compaction-lock/{mc++} /split-compaction-lock/{sc++} END{print date_var, ", minor compaction:", mc, ", split&major compaction:", sc}'
  15 + sleep $SLEEP
  16 +done
  17 +
19 bin/copy.sh
... ... @@ -0,0 +1,19 @@
  1 +#!/usr/bin/env bash
  2 +bin=`dirname "$0"`
  3 +bin=`cd "$bin"; pwd`
  4 +
  5 +. "$bin"/cloudata-config.sh
  6 +
  7 +HOSTLIST=${CLOUDATA_CONF_DIR}/tablet_servers
  8 +if [ 2 -gt "$#" ]
  9 +then
  10 + echo "usage: $0 \"local_file remote_file\""
  11 + exit 1
  12 +fi
  13 +
  14 +
  15 +for i in `cat $HOSTLIST`
  16 +do
  17 + echo $i
  18 + scp "$1" $i:"$2"
  19 +done
18 bin/exec.sh
... ... @@ -0,0 +1,18 @@
  1 +#!/usr/bin/env bash
  2 +bin=`dirname "$0"`
  3 +bin=`cd "$bin"; pwd`
  4 +
  5 +. "$bin"/cloudata-config.sh
  6 +
  7 +HOSTLIST=${CLOUDATA_CONF_DIR}/tablet_servers
  8 +if [ ! -n "$1" ]
  9 +then
  10 + echo "usage: $0 \"command arg1 arg2 \""
  11 + exit 1
  12 +fi
  13 +
  14 +for i in `cat $HOSTLIST`
  15 +do
  16 + echo "exec" $i "$*"
  17 + ssh $i "$*"
  18 +done
10 bin/rest-start.sh
... ... @@ -0,0 +1,10 @@
  1 +#!/usr/bin/env bash
  2 +
  3 +# Start cloudata daemons. Run this on master node.
  4 +
  5 +bin=`dirname "$0"`
  6 +bin=`cd "$bin"; pwd`
  7 +
  8 +. "$bin"/cloudata-config.sh
  9 +
  10 +exec "$bin/restserver.sh" cd "$CLOUDATA_HOME" \; "$bin/cloudata-daemon.sh" start restserver
10 bin/rest-stop.sh
... ... @@ -0,0 +1,10 @@
  1 +#!/usr/bin/env bash
  2 +
  3 +# Start cloudata daemons. Run this on master node.
  4 +
  5 +bin=`dirname "$0"`
  6 +bin=`cd "$bin"; pwd`
  7 +
  8 +. "$bin"/cloudata-config.sh
  9 +
  10 +exec "$bin/restserver.sh" cd "$CLOUDATA_HOME" \; "$bin/cloudata-daemon.sh" stop restserver
48 bin/restserver.sh
... ... @@ -0,0 +1,48 @@
  1 +#!/usr/bin/env bash
  2 +#
  3 +# Run a shell command on all slave hosts.
  4 +#
  5 +# Environment Variables
  6 +#
  7 +# CLOUDATA_REST_SLAVES File naming remote hosts.
  8 +# Default is ${CLOUDATA_CONF_DIR}/rest_servers.
  9 +# CLOUDATA_CONF_DIR Alternate conf dir. Default is ${CLOUDATA_HOME}/conf.
  10 +# CLOUDATA_SLAVE_SLEEP Seconds to sleep between spawning remote commands.
  11 +# CLOUDATA_SSH_OPTS Options passed to ssh when running remote commands.
  12 +##
  13 +
  14 +usage="Usage: restserver.sh command..."
  15 +
  16 +# if no args specified, show usage
  17 +if [ $# -le 0 ]; then
  18 + echo $usage
  19 + exit 1
  20 +fi
  21 +
  22 +bin=`dirname "$0"`
  23 +bin=`cd "$bin"; pwd`
  24 +
  25 +. "$bin"/cloudata-config.sh
  26 +
  27 +# If the slaves file is specified in the command line,
  28 +# then it takes precedence over the definition in
  29 +# cloudata-env.sh. Save it here.
  30 +HOSTLIST=$CLOUDATA_REST_SLAVES
  31 +
  32 +if [ "$HOSTLIST" = "" ]; then
  33 + if [ "$CLOUDATA_REST_SLAVES" = "" ]; then
  34 + export HOSTLIST="${CLOUDATA_CONF_DIR}/rest_servers"
  35 + else
  36 + export HOSTLIST="${CLOUDATA_REST_SLAVES}"
  37 + fi
  38 +fi
  39 +
  40 +for slave in `cat "$HOSTLIST"`; do
  41 + ssh $CLOUDATA_SSH_OPTS $slave $"${@// /\\ }" \
  42 + 2>&1 | sed "s/^/$slave: /" &
  43 + if [ "$CLOUDATA_SLAVE_SLEEP" != "" ]; then
  44 + sleep $CLOUDATA_SLAVE_SLEEP
  45 + fi
  46 +done
  47 +
  48 +wait
26 bin/rmlog.sh
... ... @@ -0,0 +1,26 @@
  1 +#!/usr/bin/env bash
  2 +
  3 +BIN=`dirname "$0"`
  4 +CONF=`cd "$BIN/../conf"; pwd`
  5 +
  6 +SLAVE_LIST=`cat $CONF/tablet_servers`
  7 +COMMITLOGSERVER_LIST=`cat $CONF/commitlog_servers`
  8 +
  9 +LOG_PATH=$CLOUDATA_LOG_DIR
  10 +
  11 +if [ "$LOG_PATH" = "" ]
  12 +then
  13 + LOG_PATH=`cd "$BIN/../logs"; pwd`
  14 +fi
  15 +
  16 +for HOST in $SLAVE_LIST
  17 +do
  18 + echo ssh $HOST "rm -rf $LOG_PATH/*"
  19 + ssh $HOST "rm -rf $LOG_PATH/*"
  20 +done
  21 +
  22 +for HOST in $COMMITLOGSERVER_LIST
  23 +do
  24 + echo ssh $HOST "rm -rf $LOG_PATH/*"
  25 + ssh $HOST "rm -rf $LOG_PATH/*"
  26 +done
42 bin/start.sh
... ... @@ -0,0 +1,42 @@
  1 +#!/usr/bin/env bash
  2 +
  3 +bin=`dirname "$0"`
  4 +bin=`cd "$bin"; pwd`
  5 +
  6 +. "$bin"/cloudata-config.sh
  7 +
  8 +# run zookeeper
  9 +#"$bin"/zookeeper-start.sh
  10 +
  11 +# release zk memory lock
  12 +"$bin"/cloudata cloudatamaster -releaseLock
  13 +
  14 +if [ -f "${CLOUDATA_CONF_DIR}/cloudata-env.sh" ]; then
  15 + . "${CLOUDATA_CONF_DIR}/cloudata-env.sh"
  16 +fi
  17 +
  18 +#delete all lock
  19 +if [ "$#" != "0" ]; then
  20 + if [ $1 = "-format" ]; then
  21 + "$bin"/cloudata cloudatamaster -formatLock
  22 + elif [ $1 = "-format-f" ]; then
  23 + "$bin"/cloudata cloudatamaster -formatLock -noPrompt
  24 + fi
  25 +else
  26 + sleep 10
  27 +fi
  28 +
  29 +#run commit logs servers
  30 +"$bin"/commitlog-start.sh
  31 +
  32 +sleep 2
  33 +
  34 +#delete commitlog/data file
  35 +if [ "$#" != "0" ]; then
  36 + if [ $1 = "-format" -o $1 = "-format-f" ]; then
  37 + "$bin"/cloudata cloudatamaster -formatFile -noPrompt
  38 + fi
  39 +fi
  40 +
  41 +#run CloudataMaster, TabletServer
  42 +"$bin"/cloudata-start.sh
11 bin/stop.sh
... ... @@ -0,0 +1,11 @@
  1 +#!/usr/bin/env bash
  2 +bin=`dirname "$0"`
  3 +bin=`cd "$bin"; pwd`
  4 +
  5 +. "$bin"/cloudata-config.sh
  6 +
  7 +"$bin"/blobmanager-stop.sh
  8 +"$bin"/cloudatafs-stop.sh
  9 +"$bin"/commitlog-stop.sh
  10 +"$bin"/cloudata-stop.sh
  11 +#"$bin"/zookeeper-stop.sh
52 bin/tabletservers.sh
... ... @@ -0,0 +1,52 @@
  1 +#!/usr/bin/env bash
  2 +#
  3 +# Run a shell command on all slave hosts.
  4 +#
  5 +# Environment Variables
  6 +#
  7 +# CLOUDATA_SLAVES File naming remote hosts.
  8 +# Default is ${CLOUDATA_CONF_DIR}/tablet_servers.
  9 +# CLOUDATA_CONF_DIR Alternate conf dir. Default is ${CLOUDATA_HOME}/conf.
  10 +# CLOUDATA_SLAVE_SLEEP Seconds to sleep between spawning remote commands.
  11 +# CLOUDATA_SSH_OPTS Options passed to ssh when running remote commands.