Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

initial commit

  • Loading branch information...
commit 82dd73c0c01a4548c91a22d7babefd124b59227f 0 parents
@jt6211 jt6211 authored
2  .gitignore
@@ -0,0 +1,2 @@
+*.pyc
+
716 LICENSE
@@ -0,0 +1,716 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+
+APACHE ACCUMULO SUBCOMPONENTS:
+
+The Apache Accumulo project contains subcomponents with separate copyright
+notices and license terms. Your use of the source code for the these
+subcomponents is subject to the terms and conditions of the following
+licenses.
+
+For the org.apache.accumulo.core.bloomfilter.* classes:
+
+ The BSD License
+
+ Copyright (c) 2005, European Commission project OneLab under contract
+ 034819 (http://www.one-lab.org)
+ All rights reserved.
+ Redistribution and use in source and binary forms, with or
+ without modification, are permitted provided that the following
+ conditions are met:
+ - Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ - Redistributions in binary form must reproduce the above copyright
+ distribution.
+ - Neither the name of the University Catholique de Louvain - UCL
+ nor the names of its contributors may be used to endorse or
+ promote products derived from this software without specific prior
+ written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+
+For the server/src/main/resources/web/flot/*.js files, except excanvas.js:
+
+ The MIT License
+
+ Copyright (c) 2008, Three Dub Media (http://threedubmedia.com)
+ Copyright (c) 2009 Brandon Aaron (http://brandonaaron.net)
+ Copyright (c) 2010 "Cowboy" Ben Alman
+ Copyright 2011, John Resig
+ Copyright 2011, The Dojo Foundation
+ Copyright (c) 2007-2009 IOLA and Ole Laursen
+
+ Permission is hereby granted, free of charge, to any person
+ obtaining a copy of this software and associated documentation
+ files (the "Software"), to deal in the Software without
+ restriction, including without limitation the rights to use,
+ copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the
+ Software is furnished to do so, subject to the following
+ conditions:
+
+ The above copyright notice and this permission notice shall be
+ included in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ OTHER DEALINGS IN THE SOFTWARE.
+
+For the server/src/main/resources/web/flot/excanvas.js file:
+
+ The Apache License
+
+ Copyright 2006 Google Inc.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+For the jline library:
+
+ The BSD License
+
+ Copyright (c) 2002-2006, Marc Prud'hommeaux <mwp1@cornell.edu>
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or
+ without modification, are permitted provided that the following
+ conditions are met:
+
+ Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer
+ in the documentation and/or other materials provided with
+ the distribution.
+
+ Neither the name of JLine nor the names of its contributors
+ may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
+ BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+ AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+ EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
+ OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ OF THE POSSIBILITY OF SUCH DAMAGE.
+
+For the protobuf library:
+
+ The BSD License
+
+ Copyright 2008 Google Inc. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are
+ met:
+
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following disclaimer
+ in the documentation and/or other materials provided with the
+ distribution.
+ * Neither the name of Google Inc. nor the names of its
+ contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+For the google-collections library:
+
+ The Apache License
+
+ Copyright (C) 2009 Google Inc.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+For the enwiki-20110901-001.xml file in
+examples/wikisearch/ingest/src/test/resources and
+examples/wikisearch/query/src/test/resources:
+
+ The Creative Commons Attribution-Share Alike 3.0 License
+
+ THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE
+ COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY
+ COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS
+ AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED.
+
+ BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE
+ TO BE BOUND BY THE TERMS OF THIS LICENSE. TO THE EXTENT THIS LICENSE MAY
+ BE CONSIDERED TO BE A CONTRACT, THE LICENSOR GRANTS YOU THE RIGHTS
+ CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND
+ CONDITIONS.
+
+ 1. Definitions
+
+ "Collective Work" means a work, such as a periodical issue, anthology or
+ encyclopedia, in which the Work in its entirety in unmodified form,
+ along with one or more other contributions, constituting separate and
+ independent works in themselves, are assembled into a collective whole.
+ A work that constitutes a Collective Work will not be considered a
+ Derivative Work (as defined below) for the purposes of this License.
+
+ "Creative Commons Compatible License" means a license that is listed at
+ http://creativecommons.org/compatiblelicenses that has been approved by
+ Creative Commons as being essentially equivalent to this License,
+ including, at a minimum, because that license: (i) contains terms that
+ have the same purpose, meaning and effect as the License Elements of
+ this License; and, (ii) explicitly permits the relicensing of
+ derivatives of works made available under that license under this
+ License or either a Creative Commons unported license or a Creative
+ Commons jurisdiction license with the same License Elements as this
+ License.
+
+ "Derivative Work" means a work based upon the Work or upon the Work and
+ other pre-existing works, such as a translation, musical arrangement,
+ dramatization, fictionalization, motion picture version, sound
+ recording, art reproduction, abridgment, condensation, or any other form
+ in which the Work may be recast, transformed, or adapted, except that a
+ work that constitutes a Collective Work will not be considered a
+ Derivative Work for the purpose of this License. For the avoidance of
+ doubt, where the Work is a musical composition or sound recording, the
+ synchronization of the Work in timed-relation with a moving image
+ ("synching") will be considered a Derivative Work for the purpose of
+ this License.
+
+ "License Elements" means the following high-level license attributes as
+ selected by Licensor and indicated in the title of this License:
+ Attribution, ShareAlike.
+
+ "Licensor" means the individual, individuals, entity or entities that
+ offers the Work under the terms of this License.
+
+ "Original Author" means the individual, individuals, entity or entities
+ who created the Work.
+
+ "Work" means the copyrightable work of authorship offered under the
+ terms of this License.
+
+ "You" means an individual or entity exercising rights under this License
+ who has not previously violated the terms of this License with respect
+ to the Work, or who has received express permission from the Licensor to
+ exercise rights under this License despite a previous violation.
+
+ 2. Fair Use Rights. Nothing in this license is intended to reduce,
+ limit, or restrict any rights arising from fair use, first sale or other
+ limitations on the exclusive rights of the copyright owner under
+ copyright law or other applicable laws.
+
+ 3. License Grant. Subject to the terms and conditions of this License,
+ Licensor hereby grants You a worldwide, royalty-free, non-exclusive,
+ perpetual (for the duration of the applicable copyright) license to
+ exercise the rights in the Work as stated below:
+
+ to reproduce the Work, to incorporate the Work into one or more
+ Collective Works, and to reproduce the Work as incorporated in the
+ Collective Works;
+
+ to create and reproduce Derivative Works provided that any such
+ Derivative Work, including any translation in any medium, takes
+ reasonable steps to clearly label, demarcate or otherwise identify that
+ changes were made to the original Work. For example, a translation could
+ be marked "The original work was translated from English to Spanish," or
+ a modification could indicate "The original work has been modified.";
+
+ to distribute copies or phonorecords of, display publicly, perform
+ publicly, and perform publicly by means of a digital audio transmission
+ the Work including as incorporated in Collective Works;
+
+ to distribute copies or phonorecords of, display publicly, perform
+ publicly, and perform publicly by means of a digital audio transmission
+ Derivative Works.
+
+ For the avoidance of doubt, where the Work is a musical composition:
+
+ Performance Royalties Under Blanket Licenses. Licensor waives the
+ exclusive right to collect, whether individually or, in the event that
+ Licensor is a member of a performance rights society (e.g. ASCAP, BMI,
+ SESAC), via that society, royalties for the public performance or public
+ digital performance (e.g. webcast) of the Work.
+
+ Mechanical Rights and Statutory Royalties. Licensor waives the exclusive
+ right to collect, whether individually or via a music rights agency or
+ designated agent (e.g. Harry Fox Agency), royalties for any phonorecord
+ You create from the Work ("cover version") and distribute, subject to
+ the compulsory license created by 17 USC Section 115 of the US Copyright
+ Act (or the equivalent in other jurisdictions).
+
+ Webcasting Rights and Statutory Royalties. For the avoidance of doubt,
+ where the Work is a sound recording, Licensor waives the exclusive right
+ to collect, whether individually or via a performance-rights society
+ (e.g. SoundExchange), royalties for the public digital performance (e.g.
+ webcast) of the Work, subject to the compulsory license created by 17
+ USC Section 114 of the US Copyright Act (or the equivalent in other
+ jurisdictions).
+
+ The above rights may be exercised in all media and formats whether now
+ known or hereafter devised. The above rights include the right to make
+ such modifications as are technically necessary to exercise the rights
+ in other media and formats. All rights not expressly granted by Licensor
+ are hereby reserved.
+
+ 4. Restrictions. The license granted in Section 3 above is expressly
+ made subject to and limited by the following restrictions:
+
+ You may distribute, publicly display, publicly perform, or publicly
+ digitally perform the Work only under the terms of this License, and You
+ must include a copy of, or the Uniform Resource Identifier for, this
+ License with every copy or phonorecord of the Work You distribute,
+ publicly display, publicly perform, or publicly digitally perform. You
+ may not offer or impose any terms on the Work that restrict the terms of
+ this License or the ability of a recipient of the Work to exercise of
+ the rights granted to that recipient under the terms of the License. You
+ may not sublicense the Work. You must keep intact all notices that refer
+ to this License and to the disclaimer of warranties. When You
+ distribute, publicly display, publicly perform, or publicly digitally
+ perform the Work, You may not impose any technological measures on the
+ Work that restrict the ability of a recipient of the Work from You to
+ exercise of the rights granted to that recipient under the terms of the
+ License. This Section 4(a) applies to the Work as incorporated in a
+ Collective Work, but this does not require the Collective Work apart
+ from the Work itself to be made subject to the terms of this License. If
+ You create a Collective Work, upon notice from any Licensor You must, to
+ the extent practicable, remove from the Collective Work any credit as
+ required by Section 4(c), as requested. If You create a Derivative Work,
+ upon notice from any Licensor You must, to the extent practicable,
+ remove from the Derivative Work any credit as required by Section 4(c),
+ as requested.
+
+ You may distribute, publicly display, publicly perform, or publicly
+ digitally perform a Derivative Work only under: (i) the terms of this
+ License; (ii) a later version of this License with the same License
+ Elements as this License; (iii) either the Creative Commons (Unported)
+ license or a Creative Commons jurisdiction license (either this or a
+ later license version) that contains the same License Elements as this
+ License (e.g. Attribution-ShareAlike 3.0 (Unported)); (iv) a Creative
+ Commons Compatible License. If you license the Derivative Work under one
+ of the licenses mentioned in (iv), you must comply with the terms of
+ that license. If you license the Derivative Work under the terms of any
+ of the licenses mentioned in (i), (ii) or (iii) (the "Applicable
+ License"), you must comply with the terms of the Applicable License
+ generally and with the following provisions: (I) You must include a copy
+ of, or the Uniform Resource Identifier for, the Applicable License with
+ every copy or phonorecord of each Derivative Work You distribute,
+ publicly display, publicly perform, or publicly digitally perform; (II)
+ You may not offer or impose any terms on the Derivative Works that
+ restrict the terms of the Applicable License or the ability of a
+ recipient of the Work to exercise the rights granted to that recipient
+ under the terms of the Applicable License; (III) You must keep intact
+ all notices that refer to the Applicable License and to the disclaimer
+ of warranties; and, (IV) when You distribute, publicly display, publicly
+ perform, or publicly digitally perform the Work, You may not impose any
+ technological measures on the Derivative Work that restrict the ability
+ of a recipient of the Derivative Work from You to exercise the rights
+ granted to that recipient under the terms of the Applicable License.
+ This Section 4(b) applies to the Derivative Work as incorporated in a
+ Collective Work, but this does not require the Collective Work apart
+ from the Derivative Work itself to be made subject to the terms of the
+ Applicable License.
+
+ If You distribute, publicly display, publicly perform, or publicly
+ digitally perform the Work (as defined in Section 1 above) or any
+ Derivative Works (as defined in Section 1 above) or Collective Works (as
+ defined in Section 1 above), You must, unless a request has been made
+ pursuant to Section 4(a), keep intact all copyright notices for the Work
+ and provide, reasonable to the medium or means You are utilizing: (i)
+ the name of the Original Author (or pseudonym, if applicable) if
+ supplied, and/or (ii) if the Original Author and/or Licensor designate
+ another party or parties (e.g. a sponsor institute, publishing entity,
+ journal) for attribution ("Attribution Parties") in Licensor's copyright
+ notice, terms of service or by other reasonable means, the name of such
+ party or parties; the title of the Work if supplied; to the extent
+ reasonably practicable, the Uniform Resource Identifier, if any, that
+ Licensor specifies to be associated with the Work, unless such URI does
+ not refer to the copyright notice or licensing information for the Work;
+ and, consistent with Section 3(b) in the case of a Derivative Work, a
+ credit identifying the use of the Work in the Derivative Work (e.g.,
+ "French translation of the Work by Original Author," or "Screenplay
+ based on original Work by Original Author"). The credit required by this
+ Section 4(c) may be implemented in any reasonable manner; provided,
+ however, that in the case of a Derivative Work or Collective Work, at a
+ minimum such credit will appear, if a credit for all contributing
+ authors of the Derivative Work or Collective Work appears, then as part
+ of these credits and in a manner at least as prominent as the credits
+ for the other contributing authors. For the avoidance of doubt, You may
+ only use the credit required by this Section for the purpose of
+ attribution in the manner set out above and, by exercising Your rights
+ under this License, You may not implicitly or explicitly assert or imply
+ any connection with, sponsorship or endorsement by the Original Author,
+ Licensor and/or Attribution Parties, as appropriate, of You or Your use
+ of the Work, without the separate, express prior written permission of
+ the Original Author, Licensor and/or Attribution Parties.
+
+ 5. Representations, Warranties and Disclaimer
+
+ UNLESS OTHERWISE MUTUALLY AGREED TO BY THE PARTIES IN WRITING, LICENSOR
+ OFFERS THE WORK AS-IS AND ONLY TO THE EXTENT OF ANY RIGHTS HELD IN THE
+ LICENSED WORK BY THE LICENSOR. THE LICENSOR MAKES NO REPRESENTATIONS OR
+ WARRANTIES OF ANY KIND CONCERNING THE WORK, EXPRESS, IMPLIED, STATUTORY
+ OR OTHERWISE, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE,
+ MARKETABILITY, MERCHANTIBILITY, FITNESS FOR A PARTICULAR PURPOSE,
+ NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR
+ THE PRESENCE OF ABSENCE OF ERRORS, WHETHER OR NOT DISCOVERABLE. SOME
+ JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO SUCH
+ EXCLUSION MAY NOT APPLY TO YOU.
+
+ 6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE
+ LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR
+ ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES
+ ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS
+ BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+ 7. Termination
+
+ This License and the rights granted hereunder will terminate
+ automatically upon any breach by You of the terms of this License.
+ Individuals or entities who have received Derivative Works or Collective
+ Works from You under this License, however, will not have their licenses
+ terminated provided such individuals or entities remain in full
+ compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will
+ survive any termination of this License.
+
+ Subject to the above terms and conditions, the license granted here is
+ perpetual (for the duration of the applicable copyright in the Work).
+ Notwithstanding the above, Licensor reserves the right to release the
+ Work under different license terms or to stop distributing the Work at
+ any time; provided, however that any such election will not serve to
+ withdraw this License (or any other license that has been, or is
+ required to be, granted under the terms of this License), and this
+ License will continue in full force and effect unless terminated as
+ stated above.
+
+ 8. Miscellaneous
+
+ Each time You distribute or publicly digitally perform the Work (as
+ defined in Section 1 above) or a Collective Work (as defined in Section
+ 1 above), the Licensor offers to the recipient a license to the Work on
+ the same terms and conditions as the license granted to You under this
+ License.
+
+ Each time You distribute or publicly digitally perform a Derivative
+ Work, Licensor offers to the recipient a license to the original Work on
+ the same terms and conditions as the license granted to You under this
+ License.
+
+ If any provision of this License is invalid or unenforceable under
+ applicable law, it shall not affect the validity or enforceability of
+ the remainder of the terms of this License, and without further action
+ by the parties to this agreement, such provision shall be reformed to
+ the minimum extent necessary to make such provision valid and
+ enforceable.
+
+ No term or provision of this License shall be deemed waived and no
+ breach consented to unless such waiver or consent shall be in writing
+ and signed by the party to be charged with such waiver or consent.
+
+ This License constitutes the entire agreement between the parties with
+ respect to the Work licensed here. There are no understandings,
+ agreements or representations with respect to the Work not specified
+ here. Licensor shall not be bound by any additional provisions that may
+ appear in any communication from You. This License may not be modified
+ without the mutual written agreement of the Licensor and You.
+
+For Google Gson:
+ The Apache License
+
+ Copyright 2008-2011 Google Inc.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+For Guava:
+ The Apache License
+
+ Copyright 2010-2012 Google Inc.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+For JCommander:
+ The Apache License
+
+ Copyright 2012 Cedric Beust
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
9 README.md
@@ -0,0 +1,9 @@
+pyaccumulo
+==========
+
+A python client library for Apache Accumulo
+
+Licensed under the Apache 2.0 License
+
+This is still a work in progress.
+
61 examples/analytics.py
@@ -0,0 +1,61 @@
+#!/usr/bin/env python
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+from pyaccumulo import Accumulo, Mutation, Range
+from pyaccumulo.iterators import *
+
+conn = Accumulo()
+
+table = "analytics"
+
+if conn.table_exists(table):
+ conn.delete_table(table)
+conn.create_table(table)
+
+summing = SummingCombiner(priority=10)
+summing.add_column("sum")
+summing.add_column("count")
+summing.attach(conn, table)
+
+sumarray = SummingArrayCombiner(priority=11)
+sumarray.add_column("histo")
+sumarray.attach(conn, table)
+
+mincom = MinCombiner(priority=12)
+mincom.add_column("min")
+mincom.attach(conn, table)
+
+maxcom = MaxCombiner(priority=13)
+maxcom.add_column("max")
+maxcom.attach(conn, table)
+
+wr = conn.create_batch_writer(table)
+
+for num in range(0, 1000):
+ m = Mutation("row")
+ m.put(cf="sum", cq="cq", val="%d"%num)
+ m.put(cf="count", cq="cq", val="%d"%1)
+ m.put(cf="min", cq="cq", val="%d"%num)
+ m.put(cf="max", cq="cq", val="%d"%num)
+ m.put(cf="histo", cq="cq", val=",".join( [str(x) for x in [1,2,3,4,5,6,7,8,9]]))
+
+ wr.add_mutation(m)
+wr.close()
+
+for e in conn.scan(table):
+ print e
+
+conn.close()
51 examples/doc_search.py
@@ -0,0 +1,51 @@
+#!/usr/bin/env python
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+from pyaccumulo import Accumulo, Mutation, Range
+from pyaccumulo.iterators import *
+
+from proxy.ttypes import IteratorSetting, IteratorScope
+from util import hashcode
+import hashlib, re
+
+conn = Accumulo()
+
+table = "doc_search"
+if conn.table_exists(table):
+ conn.delete_table(table)
+conn.create_table(table)
+
+wr = conn.create_batch_writer(table)
+
+license_file = "LICENSE"
+linenum = 0
+
+with file(license_file) as infile:
+ for line in infile:
+ linenum += 1
+ line = line.strip()
+ uuid = str(linenum)
+
+ m = Mutation("s%02d"% ((hashcode(uuid) & 0x0ffffffff)%4))
+ m.put(cf="e\0license", cq=uuid, val=line)
+ for tok in set(re.split('[^\w.]+', line.lower())):
+ m.put(cf="i", cq="%s\0license\0%s\0info"%(tok, uuid), val="")
+ wr.add_mutation(m)
+wr.close()
+
+for e in conn.batch_scan(table, scanranges=[Range(srow="s0", erow="s1")], iterators=[IndexedDocIterator(priority=21, terms=["derived", "from"])]):
+ print e
+conn.close()
59 examples/intersecting_iterator.py
@@ -0,0 +1,59 @@
+#!/usr/bin/env python
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+from pyaccumulo import Accumulo, Mutation, Range
+from pyaccumulo.iterators import *
+
+from proxy.ttypes import IteratorSetting, IteratorScope
+from util import hashcode
+import hashlib, re
+
+conn = Accumulo()
+
+table = "search"
+if conn.table_exists(table):
+ conn.delete_table(table)
+conn.create_table(table)
+
+wr = conn.create_batch_writer(table)
+
+license_file = "LICENSE"
+linenum = 0
+
+with file(license_file) as infile:
+ for line in infile:
+ linenum += 1
+ line = line.strip()
+ uuid = str(linenum)
+
+ m = Mutation(uuid)
+ m.put(cf="e", cq="", val=line)
+ wr.add_mutation(m)
+
+ m = Mutation("s%02d"% ((hashcode(uuid) & 0x0ffffffff)%4))
+ for tok in set(re.split('[\W]+', line.lower())):
+ m.put(tok, cq=uuid, val="")
+ wr.add_mutation(m)
+wr.close()
+
+uuids = []
+for e in conn.batch_scan(table, scanranges=[Range(srow="s0", erow="s1")], iterators=[IntersectingIterator(priority=21, terms=["software", "source", "code"])]):
+ uuids.append(e.cq)
+
+for doc in conn.batch_scan(table, scanranges=[Range(srow=uuid, erow=uuid) for uuid in uuids]):
+ print doc
+
+conn.close()
52 examples/regex_search.py
@@ -0,0 +1,52 @@
+#!/usr/bin/env python
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+from pyaccumulo import Accumulo, Mutation, Range
+from pyaccumulo.iterators import *
+
+from proxy.ttypes import IteratorSetting, IteratorScope
+from util import hashcode
+import hashlib, re
+
+conn = Accumulo()
+
+table = "regexes"
+if conn.table_exists(table):
+ conn.delete_table(table)
+conn.create_table(table)
+
+wr = conn.create_batch_writer(table)
+
+license_file = "LICENSE"
+linenum = 0
+
+with file(license_file) as infile:
+ for line in infile:
+ linenum += 1
+
+ m = Mutation(str(linenum))
+ m.put(cf="e", cq="", val=line.strip())
+ wr.add_mutation(m)
+wr.close()
+
+regex1 = RegExFilter(priority=21, val_regex=".*stated.*", match_substring=True, name="RegExFilter1")
+regex2 = RegExFilter(priority=22, val_regex='.*patent', match_substring=True, name="RegExFilter2")
+regex3 = RegExFilter(priority=23, val_regex='have made', match_substring=True, name="RegExFilter3")
+
+for e in conn.batch_scan(table, cols=[["e"]], iterators=[regex1, regex2, regex3]):
+ print e
+
+conn.close()
47 examples/simple.py
@@ -0,0 +1,47 @@
+#!/usr/bin/env python
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+from pyaccumulo import Accumulo, Mutation, Range
+
+table = "pythontest"
+
+conn = Accumulo()
+
+if conn.table_exists(table):
+ conn.delete_table(table)
+
+conn.create_table(table)
+wr = conn.create_batch_writer(table)
+
+print "Ingesting some data ..."
+for num in range(1, 100):
+ label = '%03d'%num
+ mut = Mutation('r_%s'%label)
+ mut.put(cf='cf_%s'%label, cq='cq1', val='value_%s'%label)
+ mut.put(cf='cf_%s'%label, cq='cq2', val='value_%s'%label)
+ wr.add_mutation(mut)
+wr.close()
+
+
+print "Rows 001 through 003 ..."
+for entry in conn.scan(table, scanrange=Range(srow='r_001', erow='r_003'), cols=[]):
+ print entry
+
+print "Rows 001 and 011 ..."
+for entry in conn.batch_scan(table, scanranges=[Range(srow='r_001', erow='r_001'), Range(srow='r_011', erow='r_011')]):
+ print entry
+
+conn.close()
485 ez_setup.py
@@ -0,0 +1,485 @@
+#!python
+"""Bootstrap distribute installation
+
+If you want to use setuptools in your package's setup.py, just include this
+file in the same directory with it, and add this to the top of your setup.py::
+
+ from distribute_setup import use_setuptools
+ use_setuptools()
+
+If you want to require a specific version of setuptools, set a download
+mirror, or use an alternate download directory, you can do so by supplying
+the appropriate options to ``use_setuptools()``.
+
+This file can also be run as a script to install or upgrade setuptools.
+"""
+import os
+import sys
+import time
+import fnmatch
+import tempfile
+import tarfile
+from distutils import log
+
+try:
+ from site import USER_SITE
+except ImportError:
+ USER_SITE = None
+
+try:
+ import subprocess
+
+ def _python_cmd(*args):
+ args = (sys.executable,) + args
+ return subprocess.call(args) == 0
+
+except ImportError:
+ # will be used for python 2.3
+ def _python_cmd(*args):
+ args = (sys.executable,) + args
+ # quoting arguments if windows
+ if sys.platform == 'win32':
+ def quote(arg):
+ if ' ' in arg:
+ return '"%s"' % arg
+ return arg
+ args = [quote(arg) for arg in args]
+ return os.spawnl(os.P_WAIT, sys.executable, *args) == 0
+
+DEFAULT_VERSION = "0.6.14"
+DEFAULT_URL = "http://pypi.python.org/packages/source/d/distribute/"
+SETUPTOOLS_FAKED_VERSION = "0.6c11"
+
+SETUPTOOLS_PKG_INFO = """\
+Metadata-Version: 1.0
+Name: setuptools
+Version: %s
+Summary: xxxx
+Home-page: xxx
+Author: xxx
+Author-email: xxx
+License: xxx
+Description: xxx
+""" % SETUPTOOLS_FAKED_VERSION
+
+
+def _install(tarball):
+ # extracting the tarball
+ tmpdir = tempfile.mkdtemp()
+ log.warn('Extracting in %s', tmpdir)
+ old_wd = os.getcwd()
+ try:
+ os.chdir(tmpdir)
+ tar = tarfile.open(tarball)
+ _extractall(tar)
+ tar.close()
+
+ # going in the directory
+ subdir = os.path.join(tmpdir, os.listdir(tmpdir)[0])
+ os.chdir(subdir)
+ log.warn('Now working in %s', subdir)
+
+ # installing
+ log.warn('Installing Distribute')
+ if not _python_cmd('setup.py', 'install'):
+ log.warn('Something went wrong during the installation.')
+ log.warn('See the error message above.')
+ finally:
+ os.chdir(old_wd)
+
+
+def _build_egg(egg, tarball, to_dir):
+ # extracting the tarball
+ tmpdir = tempfile.mkdtemp()
+ log.warn('Extracting in %s', tmpdir)
+ old_wd = os.getcwd()
+ try:
+ os.chdir(tmpdir)
+ tar = tarfile.open(tarball)
+ _extractall(tar)
+ tar.close()
+
+ # going in the directory
+ subdir = os.path.join(tmpdir, os.listdir(tmpdir)[0])
+ os.chdir(subdir)
+ log.warn('Now working in %s', subdir)
+
+ # building an egg
+ log.warn('Building a Distribute egg in %s', to_dir)
+ _python_cmd('setup.py', '-q', 'bdist_egg', '--dist-dir', to_dir)
+
+ finally:
+ os.chdir(old_wd)
+ # returning the result
+ log.warn(egg)
+ if not os.path.exists(egg):
+ raise IOError('Could not build the egg.')
+
+
+def _do_download(version, download_base, to_dir, download_delay):
+ egg = os.path.join(to_dir, 'distribute-%s-py%d.%d.egg'
+ % (version, sys.version_info[0], sys.version_info[1]))
+ if not os.path.exists(egg):
+ tarball = download_setuptools(version, download_base,
+ to_dir, download_delay)
+ _build_egg(egg, tarball, to_dir)
+ sys.path.insert(0, egg)
+ import setuptools
+ setuptools.bootstrap_install_from = egg
+
+
+def use_setuptools(version=DEFAULT_VERSION, download_base=DEFAULT_URL,
+ to_dir=os.curdir, download_delay=15, no_fake=True):
+ # making sure we use the absolute path
+ to_dir = os.path.abspath(to_dir)
+ was_imported = 'pkg_resources' in sys.modules or \
+ 'setuptools' in sys.modules
+ try:
+ try:
+ import pkg_resources
+ if not hasattr(pkg_resources, '_distribute'):
+ if not no_fake:
+ _fake_setuptools()
+ raise ImportError
+ except ImportError:
+ return _do_download(version, download_base, to_dir, download_delay)
+ try:
+ pkg_resources.require("distribute>="+version)
+ return
+ except pkg_resources.VersionConflict:
+ e = sys.exc_info()[1]
+ if was_imported:
+ sys.stderr.write(
+ "The required version of distribute (>=%s) is not available,\n"
+ "and can't be installed while this script is running. Please\n"
+ "install a more recent version first, using\n"
+ "'easy_install -U distribute'."
+ "\n\n(Currently using %r)\n" % (version, e.args[0]))
+ sys.exit(2)
+ else:
+ del pkg_resources, sys.modules['pkg_resources'] # reload ok
+ return _do_download(version, download_base, to_dir,
+ download_delay)
+ except pkg_resources.DistributionNotFound:
+ return _do_download(version, download_base, to_dir,
+ download_delay)
+ finally:
+ if not no_fake:
+ _create_fake_setuptools_pkg_info(to_dir)
+
+def download_setuptools(version=DEFAULT_VERSION, download_base=DEFAULT_URL,
+ to_dir=os.curdir, delay=15):
+ """Download distribute from a specified location and return its filename
+
+ `version` should be a valid distribute version number that is available
+ as an egg for download under the `download_base` URL (which should end
+ with a '/'). `to_dir` is the directory where the egg will be downloaded.
+ `delay` is the number of seconds to pause before an actual download
+ attempt.
+ """
+ # making sure we use the absolute path
+ to_dir = os.path.abspath(to_dir)
+ try:
+ from urllib.request import urlopen
+ except ImportError:
+ from urllib2 import urlopen
+ tgz_name = "distribute-%s.tar.gz" % version
+ url = download_base + tgz_name
+ saveto = os.path.join(to_dir, tgz_name)
+ src = dst = None
+ if not os.path.exists(saveto): # Avoid repeated downloads
+ try:
+ log.warn("Downloading %s", url)
+ src = urlopen(url)
+ # Read/write all in one block, so we don't create a corrupt file
+ # if the download is interrupted.
+ data = src.read()
+ dst = open(saveto, "wb")
+ dst.write(data)
+ finally:
+ if src:
+ src.close()
+ if dst:
+ dst.close()
+ return os.path.realpath(saveto)
+
+def _no_sandbox(function):
+ def __no_sandbox(*args, **kw):
+ try:
+ from setuptools.sandbox import DirectorySandbox
+ if not hasattr(DirectorySandbox, '_old'):
+ def violation(*args):
+ pass
+ DirectorySandbox._old = DirectorySandbox._violation
+ DirectorySandbox._violation = violation
+ patched = True
+ else:
+ patched = False
+ except ImportError:
+ patched = False
+
+ try:
+ return function(*args, **kw)
+ finally:
+ if patched:
+ DirectorySandbox._violation = DirectorySandbox._old
+ del DirectorySandbox._old
+
+ return __no_sandbox
+
+def _patch_file(path, content):
+ """Will backup the file then patch it"""
+ existing_content = open(path).read()
+ if existing_content == content:
+ # already patched
+ log.warn('Already patched.')
+ return False
+ log.warn('Patching...')
+ _rename_path(path)
+ f = open(path, 'w')
+ try:
+ f.write(content)
+ finally:
+ f.close()
+ return True
+
+_patch_file = _no_sandbox(_patch_file)
+
+def _same_content(path, content):
+ return open(path).read() == content
+
+def _rename_path(path):
+ new_name = path + '.OLD.%s' % time.time()
+ log.warn('Renaming %s into %s', path, new_name)
+ os.rename(path, new_name)
+ return new_name
+
+def _remove_flat_installation(placeholder):
+ if not os.path.isdir(placeholder):
+ log.warn('Unkown installation at %s', placeholder)
+ return False
+ found = False
+ for file in os.listdir(placeholder):
+ if fnmatch.fnmatch(file, 'setuptools*.egg-info'):
+ found = True
+ break
+ if not found:
+ log.warn('Could not locate setuptools*.egg-info')
+ return
+
+ log.warn('Removing elements out of the way...')
+ pkg_info = os.path.join(placeholder, file)
+ if os.path.isdir(pkg_info):
+ patched = _patch_egg_dir(pkg_info)
+ else:
+ patched = _patch_file(pkg_info, SETUPTOOLS_PKG_INFO)
+
+ if not patched:
+ log.warn('%s already patched.', pkg_info)
+ return False
+ # now let's move the files out of the way
+ for element in ('setuptools', 'pkg_resources.py', 'site.py'):
+ element = os.path.join(placeholder, element)
+ if os.path.exists(element):
+ _rename_path(element)
+ else:
+ log.warn('Could not find the %s element of the '
+ 'Setuptools distribution', element)
+ return True
+
+_remove_flat_installation = _no_sandbox(_remove_flat_installation)
+
+def _after_install(dist):
+ log.warn('After install bootstrap.')
+ placeholder = dist.get_command_obj('install').install_purelib
+ _create_fake_setuptools_pkg_info(placeholder)
+
+def _create_fake_setuptools_pkg_info(placeholder):
+ if not placeholder or not os.path.exists(placeholder):
+ log.warn('Could not find the install location')
+ return
+ pyver = '%s.%s' % (sys.version_info[0], sys.version_info[1])
+ setuptools_file = 'setuptools-%s-py%s.egg-info' % \
+ (SETUPTOOLS_FAKED_VERSION, pyver)
+ pkg_info = os.path.join(placeholder, setuptools_file)
+ if os.path.exists(pkg_info):
+ log.warn('%s already exists', pkg_info)
+ return
+
+ log.warn('Creating %s', pkg_info)
+ f = open(pkg_info, 'w')
+ try:
+ f.write(SETUPTOOLS_PKG_INFO)
+ finally:
+ f.close()
+
+ pth_file = os.path.join(placeholder, 'setuptools.pth')
+ log.warn('Creating %s', pth_file)
+ f = open(pth_file, 'w')
+ try:
+ f.write(os.path.join(os.curdir, setuptools_file))
+ finally:
+ f.close()
+
+_create_fake_setuptools_pkg_info = _no_sandbox(_create_fake_setuptools_pkg_info)
+
+def _patch_egg_dir(path):
+ # let's check if it's already patched
+ pkg_info = os.path.join(path, 'EGG-INFO', 'PKG-INFO')
+ if os.path.exists(pkg_info):
+ if _same_content(pkg_info, SETUPTOOLS_PKG_INFO):
+ log.warn('%s already patched.', pkg_info)
+ return False
+ _rename_path(path)
+ os.mkdir(path)
+ os.mkdir(os.path.join(path, 'EGG-INFO'))
+ pkg_info = os.path.join(path, 'EGG-INFO', 'PKG-INFO')
+ f = open(pkg_info, 'w')
+ try:
+ f.write(SETUPTOOLS_PKG_INFO)
+ finally:
+ f.close()
+ return True
+
+_patch_egg_dir = _no_sandbox(_patch_egg_dir)
+
+def _before_install():
+ log.warn('Before install bootstrap.')
+ _fake_setuptools()
+
+
+def _under_prefix(location):
+ if 'install' not in sys.argv:
+ return True
+ args = sys.argv[sys.argv.index('install')+1:]
+ for index, arg in enumerate(args):
+ for option in ('--root', '--prefix'):
+ if arg.startswith('%s=' % option):
+ top_dir = arg.split('root=')[-1]
+ return location.startswith(top_dir)
+ elif arg == option:
+ if len(args) > index:
+ top_dir = args[index+1]
+ return location.startswith(top_dir)
+ if arg == '--user' and USER_SITE is not None:
+ return location.startswith(USER_SITE)
+ return True
+
+
+def _fake_setuptools():
+ log.warn('Scanning installed packages')
+ try:
+ import pkg_resources
+ except ImportError:
+ # we're cool
+ log.warn('Setuptools or Distribute does not seem to be installed.')
+ return
+ ws = pkg_resources.working_set
+ try:
+ setuptools_dist = ws.find(pkg_resources.Requirement.parse('setuptools',
+ replacement=False))
+ except TypeError:
+ # old distribute API
+ setuptools_dist = ws.find(pkg_resources.Requirement.parse('setuptools'))
+
+ if setuptools_dist is None:
+ log.warn('No setuptools distribution found')
+ return
+ # detecting if it was already faked
+ setuptools_location = setuptools_dist.location
+ log.warn('Setuptools installation detected at %s', setuptools_location)
+
+ # if --root or --preix was provided, and if
+ # setuptools is not located in them, we don't patch it
+ if not _under_prefix(setuptools_location):
+ log.warn('Not patching, --root or --prefix is installing Distribute'
+ ' in another location')
+ return
+
+ # let's see if its an egg
+ if not setuptools_location.endswith('.egg'):
+ log.warn('Non-egg installation')
+ res = _remove_flat_installation(setuptools_location)
+ if not res:
+ return
+ else:
+ log.warn('Egg installation')
+ pkg_info = os.path.join(setuptools_location, 'EGG-INFO', 'PKG-INFO')
+ if (os.path.exists(pkg_info) and
+ _same_content(pkg_info, SETUPTOOLS_PKG_INFO)):
+ log.warn('Already patched.')
+ return
+ log.warn('Patching...')
+ # let's create a fake egg replacing setuptools one
+ res = _patch_egg_dir(setuptools_location)
+ if not res:
+ return
+ log.warn('Patched done.')
+ _relaunch()
+
+
+def _relaunch():
+ log.warn('Relaunching...')
+ # we have to relaunch the process
+ # pip marker to avoid a relaunch bug
+ if sys.argv[:3] == ['-c', 'install', '--single-version-externally-managed']:
+ sys.argv[0] = 'setup.py'
+ args = [sys.executable] + sys.argv
+ sys.exit(subprocess.call(args))
+
+
+def _extractall(self, path=".", members=None):
+ """Extract all members from the archive to the current working
+ directory and set owner, modification time and permissions on
+ directories afterwards. `path' specifies a different directory
+ to extract to. `members' is optional and must be a subset of the
+ list returned by getmembers().
+ """
+ import copy
+ import operator
+ from tarfile import ExtractError
+ directories = []
+
+ if members is None:
+ members = self
+
+ for tarinfo in members:
+ if tarinfo.isdir():
+ # Extract directories with a safe mode.
+ directories.append(tarinfo)
+ tarinfo = copy.copy(tarinfo)
+ tarinfo.mode = 448 # decimal for oct 0700
+ self.extract(tarinfo, path)
+
+ # Reverse sort directories.
+ if sys.version_info < (2, 4):
+ def sorter(dir1, dir2):
+ return cmp(dir1.name, dir2.name)
+ directories.sort(sorter)
+ directories.reverse()
+ else:
+ directories.sort(key=operator.attrgetter('name'), reverse=True)
+
+ # Set correct owner, mtime and filemode on directories.
+ for tarinfo in directories:
+ dirpath = os.path.join(path, tarinfo.name)
+ try:
+ self.chown(tarinfo, dirpath)
+ self.utime(tarinfo, dirpath)
+ self.chmod(tarinfo, dirpath)
+ except ExtractError:
+ e = sys.exc_info()[1]
+ if self.errorlevel > 1:
+ raise
+ else:
+ self._dbg(1, "tarfile: %s" % e)
+
+
+def main(argv, version=DEFAULT_VERSION):
+ """Install or upgrade setuptools and EasyInstall"""
+ tarball = download_setuptools()
+ _install(tarball)
+
+
+if __name__ == '__main__':
+ main(sys.argv[1:])
578 proxy/AccumuloProxy-remote
@@ -0,0 +1,578 @@
+#!/usr/bin/env python
+#
+# Autogenerated by Thrift Compiler (0.9.0)
+#
+# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+#
+# options string: py
+#
+
+import sys
+import pprint
+from urlparse import urlparse
+from thrift.transport import TTransport
+from thrift.transport import TSocket
+from thrift.transport import THttpClient
+from thrift.protocol import TBinaryProtocol
+
+import AccumuloProxy
+from ttypes import *
+
+if len(sys.argv) <= 1 or sys.argv[1] == '--help':
+ print ''
+ print 'Usage: ' + sys.argv[0] + ' [-h host[:port]] [-u url] [-f[ramed]] function [arg1 [arg2...]]'
+ print ''
+ print 'Functions:'
+ print ' string login(string principal, loginProperties)'
+ print ' i32 addConstraint(string login, string tableName, string constraintClassName)'
+ print ' void addSplits(string login, string tableName, splits)'
+ print ' void attachIterator(string login, string tableName, IteratorSetting setting, scopes)'
+ print ' void checkIteratorConflicts(string login, string tableName, IteratorSetting setting, scopes)'
+ print ' void clearLocatorCache(string login, string tableName)'
+ print ' void cloneTable(string login, string tableName, string newTableName, bool flush, propertiesToSet, propertiesToExclude)'
+ print ' void compactTable(string login, string tableName, string startRow, string endRow, iterators, bool flush, bool wait)'
+ print ' void cancelCompaction(string login, string tableName)'
+ print ' void createTable(string login, string tableName, bool versioningIter, TimeType type)'
+ print ' void deleteTable(string login, string tableName)'
+ print ' void deleteRows(string login, string tableName, string startRow, string endRow)'
+ print ' void exportTable(string login, string tableName, string exportDir)'
+ print ' void flushTable(string login, string tableName, string startRow, string endRow, bool wait)'
+ print ' getLocalityGroups(string login, string tableName)'
+ print ' IteratorSetting getIteratorSetting(string login, string tableName, string iteratorName, IteratorScope scope)'
+ print ' string getMaxRow(string login, string tableName, auths, string startRow, bool startInclusive, string endRow, bool endInclusive)'
+ print ' getTableProperties(string login, string tableName)'
+ print ' getSplits(string login, string tableName, i32 maxSplits)'
+ print ' void importDirectory(string login, string tableName, string importDir, string failureDir, bool setTime)'
+ print ' void importTable(string login, string tableName, string importDir)'
+ print ' listTables(string login)'
+ print ' listIterators(string login, string tableName)'
+ print ' listConstraints(string login, string tableName)'
+ print ' void mergeTablets(string login, string tableName, string startRow, string endRow)'
+ print ' void offlineTable(string login, string tableName)'
+ print ' void onlineTable(string login, string tableName)'
+ print ' void removeConstraint(string login, string tableName, i32 constraint)'
+ print ' void removeIterator(string login, string tableName, string iterName, scopes)'
+ print ' void removeTableProperty(string login, string tableName, string property)'
+ print ' void renameTable(string login, string oldTableName, string newTableName)'
+ print ' void setLocalityGroups(string login, string tableName, groups)'
+ print ' void setTableProperty(string login, string tableName, string property, string value)'
+ print ' splitRangeByTablets(string login, string tableName, Range range, i32 maxSplits)'
+ print ' bool tableExists(string login, string tableName)'
+ print ' tableIdMap(string login)'
+ print ' void pingTabletServer(string login, string tserver)'
+ print ' getActiveScans(string login, string tserver)'
+ print ' getActiveCompactions(string login, string tserver)'
+ print ' getSiteConfiguration(string login)'
+ print ' getSystemConfiguration(string login)'
+ print ' getTabletServers(string login)'
+ print ' void removeProperty(string login, string property)'
+ print ' void setProperty(string login, string property, string value)'
+ print ' bool testClassLoad(string login, string className, string asTypeName)'
+ print ' bool authenticateUser(string login, string user, properties)'
+ print ' void changeUserAuthorizations(string login, string user, authorizations)'
+ print ' void changeLocalUserPassword(string login, string user, string password)'
+ print ' void createLocalUser(string login, string user, string password)'
+ print ' void dropLocalUser(string login, string user)'
+ print ' getUserAuthorizations(string login, string user)'
+ print ' void grantSystemPermission(string login, string user, SystemPermission perm)'
+ print ' void grantTablePermission(string login, string user, string table, TablePermission perm)'
+ print ' bool hasSystemPermission(string login, string user, SystemPermission perm)'
+ print ' bool hasTablePermission(string login, string user, string table, TablePermission perm)'
+ print ' listLocalUsers(string login)'
+ print ' void revokeSystemPermission(string login, string user, SystemPermission perm)'
+ print ' void revokeTablePermission(string login, string user, string table, TablePermission perm)'
+ print ' string createBatchScanner(string login, string tableName, BatchScanOptions options)'
+ print ' string createScanner(string login, string tableName, ScanOptions options)'
+ print ' bool hasNext(string scanner)'
+ print ' KeyValueAndPeek nextEntry(string scanner)'
+ print ' ScanResult nextK(string scanner, i32 k)'
+ print ' void closeScanner(string scanner)'
+ print ' void updateAndFlush(string login, string tableName, cells)'
+ print ' string createWriter(string login, string tableName, WriterOptions opts)'
+ print ' void update(string writer, cells)'
+ print ' void flush(string writer)'
+ print ' void closeWriter(string writer)'
+ print ' Range getRowRange(string row)'
+ print ' Key getFollowing(Key key, PartialKey part)'
+ print ''
+ sys.exit(0)
+
+pp = pprint.PrettyPrinter(indent = 2)
+host = 'localhost'
+port = 9090
+uri = ''
+framed = False
+http = False
+argi = 1
+
+if sys.argv[argi] == '-h':
+ parts = sys.argv[argi+1].split(':')
+ host = parts[0]
+ if len(parts) > 1:
+ port = int(parts[1])
+ argi += 2
+
+if sys.argv[argi] == '-u':
+ url = urlparse(sys.argv[argi+1])
+ parts = url[1].split(':')
+ host = parts[0]
+ if len(parts) > 1:
+ port = int(parts[1])
+ else:
+ port = 80
+ uri = url[2]
+ if url[4]:
+ uri += '?%s' % url[4]
+ http = True
+ argi += 2
+
+if sys.argv[argi] == '-f' or sys.argv[argi] == '-framed':
+ framed = True
+ argi += 1
+
+cmd = sys.argv[argi]
+args = sys.argv[argi+1:]
+
+if http:
+ transport = THttpClient.THttpClient(host, port, uri)
+else:
+ socket = TSocket.TSocket(host, port)
+ if framed:
+ transport = TTransport.TFramedTransport(socket)
+ else:
+ transport = TTransport.TBufferedTransport(socket)
+protocol = TBinaryProtocol.TBinaryProtocol(transport)
+client = AccumuloProxy.Client(protocol)
+transport.open()
+
+if cmd == 'login':
+ if len(args) != 2:
+ print 'login requires 2 args'
+ sys.exit(1)
+ pp.pprint(client.login(args[0],eval(args[1]),))
+
+elif cmd == 'addConstraint':
+ if len(args) != 3:
+ print 'addConstraint requires 3 args'
+ sys.exit(1)
+ pp.pprint(client.addConstraint(args[0],args[1],args[2],))
+
+elif cmd == 'addSplits':
+ if len(args) != 3:
+ print 'addSplits requires 3 args'
+ sys.exit(1)
+ pp.pprint(client.addSplits(args[0],args[1],eval(args[2]),))
+
+elif cmd == 'attachIterator':
+ if len(args) != 4:
+ print 'attachIterator requires 4 args'
+ sys.exit(1)
+ pp.pprint(client.attachIterator(args[0],args[1],eval(args[2]),eval(args[3]),))
+
+elif cmd == 'checkIteratorConflicts':
+ if len(args) != 4:
+ print 'checkIteratorConflicts requires 4 args'
+ sys.exit(1)
+ pp.pprint(client.checkIteratorConflicts(args[0],args[1],eval(args[2]),eval(args[3]),))
+
+elif cmd == 'clearLocatorCache':
+ if len(args) != 2:
+ print 'clearLocatorCache requires 2 args'
+ sys.exit(1)
+ pp.pprint(client.clearLocatorCache(args[0],args[1],))
+
+elif cmd == 'cloneTable':
+ if len(args) != 6:
+ print 'cloneTable requires 6 args'
+ sys.exit(1)
+ pp.pprint(client.cloneTable(args[0],args[1],args[2],eval(args[3]),eval(args[4]),eval(args[5]),))
+
+elif cmd == 'compactTable':
+ if len(args) != 7:
+ print 'compactTable requires 7 args'
+ sys.exit(1)
+ pp.pprint(client.compactTable(args[0],args[1],args[2],args[3],eval(args[4]),eval(args[5]),eval(args[6]),))
+
+elif cmd == 'cancelCompaction':
+ if len(args) != 2:
+ print 'cancelCompaction requires 2 args'
+ sys.exit(1)
+ pp.pprint(client.cancelCompaction(args[0],args[1],))
+
+elif cmd == 'createTable':
+ if len(args) != 4:
+ print 'createTable requires 4 args'
+ sys.exit(1)
+ pp.pprint(client.createTable(args[0],args[1],eval(args[2]),eval(args[3]),))
+
+elif cmd == 'deleteTable':
+ if len(args) != 2:
+ print 'deleteTable requires 2 args'
+ sys.exit(1)
+ pp.pprint(client.deleteTable(args[0],args[1],))
+
+elif cmd == 'deleteRows':
+ if len(args) != 4:
+ print 'deleteRows requires 4 args'
+ sys.exit(1)
+ pp.pprint(client.deleteRows(args[0],args[1],args[2],args[3],))
+
+elif cmd == 'exportTable':
+ if len(args) != 3:
+ print 'exportTable requires 3 args'
+ sys.exit(1)
+ pp.pprint(client.exportTable(args[0],args[1],args[2],))
+
+elif cmd == 'flushTable':
+ if len(args) != 5:
+ print 'flushTable requires 5 args'
+ sys.exit(1)
+ pp.pprint(client.flushTable(args[0],args[1],args[2],args[3],eval(args[4]),))
+
+elif cmd == 'getLocalityGroups':
+ if len(args) != 2:
+ print 'getLocalityGroups requires 2 args'
+ sys.exit(1)
+ pp.pprint(client.getLocalityGroups(args[0],args[1],))
+
+elif cmd == 'getIteratorSetting':
+ if len(args) != 4:
+ print 'getIteratorSetting requires 4 args'
+ sys.exit(1)
+ pp.pprint(client.getIteratorSetting(args[0],args[1],args[2],eval(args[3]),))
+
+elif cmd == 'getMaxRow':
+ if len(args) != 7:
+ print 'getMaxRow requires 7 args'
+ sys.exit(1)
+ pp.pprint(client.getMaxRow(args[0],args[1],eval(args[2]),args[3],eval(args[4]),args[5],eval(args[6]),))
+
+elif cmd == 'getTableProperties':
+ if len(args) != 2:
+ print 'getTableProperties requires 2 args'
+ sys.exit(1)
+ pp.pprint(client.getTableProperties(args[0],args[1],))
+
+elif cmd == 'getSplits':
+ if len(args) != 3:
+ print 'getSplits requires 3 args'
+ sys.exit(1)
+ pp.pprint(client.getSplits(args[0],args[1],eval(args[2]),))
+
+elif cmd == 'importDirectory':
+ if len(args) != 5:
+ print 'importDirectory requires 5 args'
+ sys.exit(1)
+ pp.pprint(client.importDirectory(args[0],args[1],args[2],args[3],eval(args[4]),))
+
+elif cmd == 'importTable':
+ if len(args) != 3:
+ print 'importTable requires 3 args'
+ sys.exit(1)
+ pp.pprint(client.importTable(args[0],args[1],args[2],))
+
+elif cmd == 'listTables':
+ if len(args) != 1:
+ print 'listTables requires 1 args'
+ sys.exit(1)
+ pp.pprint(client.listTables(args[0],))
+
+elif cmd == 'listIterators':
+ if len(args) != 2:
+ print 'listIterators requires 2 args'
+ sys.exit(1)
+ pp.pprint(client.listIterators(args[0],args[1],))
+
+elif cmd == 'listConstraints':
+ if len(args) != 2:
+ print 'listConstraints requires 2 args'
+ sys.exit(1)
+ pp.pprint(client.listConstraints(args[0],args[1],))
+
+elif cmd == 'mergeTablets':
+ if len(args) != 4:
+ print 'mergeTablets requires 4 args'
+ sys.exit(1)
+ pp.pprint(client.mergeTablets(args[0],args[1],args[2],args[3],))
+
+elif cmd == 'offlineTable':
+ if len(args) != 2:
+ print 'offlineTable requires 2 args'
+ sys.exit(1)
+ pp.pprint(client.offlineTable(args[0],args[1],))
+
+elif cmd == 'onlineTable':
+ if len(args) != 2:
+ print 'onlineTable requires 2 args'
+ sys.exit(1)
+ pp.pprint(client.onlineTable(args[0],args[1],))
+
+elif cmd == 'removeConstraint':
+ if len(args) != 3:
+ print 'removeConstraint requires 3 args'
+ sys.exit(1)
+ pp.pprint(client.removeConstraint(args[0],args[1],eval(args[2]),))
+
+elif cmd == 'removeIterator':
+ if len(args) != 4:
+ print 'removeIterator requires 4 args'
+ sys.exit(1)
+ pp.pprint(client.removeIterator(args[0],args[1],args[2],eval(args[3]),))
+
+elif cmd == 'removeTableProperty':
+ if len(args) != 3:
+ print 'removeTableProperty requires 3 args'
+ sys.exit(1)
+ pp.pprint(client.removeTableProperty(args[0],args[1],args[2],))
+
+elif cmd == 'renameTable':
+ if len(args) != 3:
+ print 'renameTable requires 3 args'
+ sys.exit(1)
+ pp.pprint(client.renameTable(args[0],args[1],args[2],))
+
+elif cmd == 'setLocalityGroups':
+ if len(args) != 3:
+ print 'setLocalityGroups requires 3 args'
+ sys.exit(1)
+ pp.pprint(client.setLocalityGroups(args[0],args[1],eval(args[2]),))
+
+elif cmd == 'setTableProperty':
+ if len(args) != 4:
+ print 'setTableProperty requires 4 args'
+ sys.exit(1)
+ pp.pprint(client.setTableProperty(args[0],args[1],args[2],args[3],))
+
+elif cmd == 'splitRangeByTablets':
+ if len(args) != 4:
+ print 'splitRangeByTablets requires 4 args'
+ sys.exit(1)
+ pp.pprint(client.splitRangeByTablets(args[0],args[1],eval(args[2]),eval(args[3]),))
+
+elif cmd == 'tableExists':
+ if len(args) != 2:
+ print 'tableExists requires 2 args'
+ sys.exit(1)
+ pp.pprint(client.tableExists(args[0],args[1],))
+
+elif cmd == 'tableIdMap':
+ if len(args) != 1:
+ print 'tableIdMap requires 1 args'
+ sys.exit(1)
+ pp.pprint(client.tableIdMap(args[0],))
+
+elif cmd == 'pingTabletServer':
+ if len(args) != 2:
+ print 'pingTabletServer requires 2 args'
+ sys.exit(1)
+ pp.pprint(client.pingTabletServer(args[0],args[1],))
+
+elif cmd == 'getActiveScans':
+ if len(args) != 2:
+ print 'getActiveScans requires 2 args'
+ sys.exit(1)
+ pp.pprint(client.getActiveScans(args[0],args[1],))
+
+elif cmd == 'getActiveCompactions':
+ if len(args) != 2:
+ print 'getActiveCompactions requires 2 args'
+ sys.exit(1)
+ pp.pprint(client.getActiveCompactions(args[0],args[1],))
+
+elif cmd == 'getSiteConfiguration':
+ if len(args) != 1:
+ print 'getSiteConfiguration requires 1 args'
+ sys.exit(1)
+ pp.pprint(client.getSiteConfiguration(args[0],))
+
+elif cmd == 'getSystemConfiguration':
+ if len(args) != 1:
+ print 'getSystemConfiguration requires 1 args'
+ sys.exit(1)
+ pp.pprint(client.getSystemConfiguration(args[0],))
+
+elif cmd == 'getTabletServers':
+ if len(args) != 1:
+ print 'getTabletServers requires 1 args'
+ sys.exit(1)
+ pp.pprint(client.getTabletServers(args[0],))
+
+elif cmd == 'removeProperty':
+ if len(args) != 2:
+ print 'removeProperty requires 2 args'
+ sys.exit(1)
+ pp.pprint(client.removeProperty(args[0],args[1],))
+
+elif cmd == 'setProperty':
+ if len(args) != 3:
+ print 'setProperty requires 3 args'
+ sys.exit(1)
+ pp.pprint(client.setProperty(args[0],args[1],args[2],))
+
+elif cmd == 'testClassLoad':
+ if len(args) != 3:
+ print 'testClassLoad requires 3 args'
+ sys.exit(1)
+ pp.pprint(client.testClassLoad(args[0],args[1],args[2],))
+
+elif cmd == 'authenticateUser':
+ if len(args) != 3:
+ print 'authenticateUser requires 3 args'
+ sys.exit(1)
+ pp.pprint(client.authenticateUser(args[0],args[1],eval(args[2]),))
+
+elif cmd == 'changeUserAuthorizations':
+ if len(args) != 3:
+ print 'changeUserAuthorizations requires 3 args'
+ sys.exit(1)
+ pp.pprint(client.changeUserAuthorizations(args[0],args[1],eval(args[2]),))
+
+elif cmd == 'changeLocalUserPassword':
+ if len(args) != 3:
+ print 'changeLocalUserPassword requires 3 args'
+ sys.exit(1)
+ pp.pprint(client.changeLocalUserPassword(args[0],args[1],args[2],))
+
+elif cmd == 'createLocalUser':
+ if len(args) != 3:
+ print 'createLocalUser requires 3 args'
+ sys.exit(1)
+ pp.pprint(client.createLocalUser(args[0],args[1],args[2],))
+
+elif cmd == 'dropLocalUser':
+ if len(args) != 2:
+ print 'dropLocalUser requires 2 args'
+ sys.exit(1)
+ pp.pprint(client.dropLocalUser(args[0],args[1],))
+
+elif cmd == 'getUserAuthorizations':
+ if len(args) != 2:
+ print 'getUserAuthorizations requires 2 args'
+ sys.exit(1)
+ pp.pprint(client.getUserAuthorizations(args[0],args[1],))
+
+elif cmd == 'grantSystemPermission':
+ if len(args) != 3:
+ print 'grantSystemPermission requires 3 args'
+ sys.exit(1)
+ pp.pprint(client.grantSystemPermission(args[0],args[1],eval(args[2]),))
+
+elif cmd == 'grantTablePermission':
+ if len(args) != 4:
+ print 'grantTablePermission requires 4 args'
+ sys.exit(1)
+ pp.pprint(client.grantTablePermission(args[0],args[1],args[2],eval(args[3]),))
+
+elif cmd == 'hasSystemPermission':
+ if len(args) != 3:
+ print 'hasSystemPermission requires 3 args'
+ sys.exit(1)
+ pp.pprint(client.hasSystemPermission(args[0],args[1],eval(args[2]),))
+
+elif cmd == 'hasTablePermission':
+ if len(args) != 4:
+ print 'hasTablePermission requires 4 args'
+ sys.exit(1)
+ pp.pprint(client.hasTablePermission(args[0],args[1],args[2],eval(args[3]),))
+
+elif cmd == 'listLocalUsers':
+ if len(args) != 1:
+ print 'listLocalUsers requires 1 args'
+ sys.exit(1)
+ pp.pprint(client.listLocalUsers(args[0],))
+
+elif cmd == 'revokeSystemPermission':
+ if len(args) != 3:
+ print 'revokeSystemPermission requires 3 args'
+ sys.exit(1)
+ pp.pprint(client.revokeSystemPermission(args[0],args[1],eval(args[2]),))
+
+elif cmd == 'revokeTablePermission':
+ if len(args) != 4:
+ print 'revokeTablePermission requires 4 args'
+ sys.exit(1)
+ pp.pprint(client.revokeTablePermission(args[0],args[1],args[2],eval(args[3]),))
+
+elif cmd == 'createBatchScanner':
+ if len(args) != 3:
+ print 'createBatchScanner requires 3 args'
+ sys.exit(1)
+ pp.pprint(client.createBatchScanner(args[0],args[1],eval(args[2]),))
+
+elif cmd == 'createScanner':
+ if len(args) != 3:
+ print 'createScanner requires 3 args'
+ sys.exit(1)
+ pp.pprint(client.createScanner(args[0],args[1],eval(args[2]),))
+
+elif cmd == 'hasNext':
+ if len(args) != 1:
+ print 'hasNext requires 1 args'
+ sys.exit(1)
+ pp.pprint(client.hasNext(args[0],))
+
+elif cmd == 'nextEntry':
+ if len(args) != 1:
+ print 'nextEntry requires 1 args'
+ sys.exit(1)
+ pp.pprint(client.nextEntry(args[0],))
+
+elif cmd == 'nextK':
+ if len(args) != 2:
+ print 'nextK requires 2 args'
+ sys.exit(1)
+ pp.pprint(client.nextK(args[0],eval(args[1]),))
+
+elif cmd == 'closeScanner':
+ if len(args) != 1:
+ print 'closeScanner requires 1 args'
+ sys.exit(1)
+ pp.pprint(client.closeScanner(args[0],))
+
+elif cmd == 'updateAndFlush':
+ if len(args) != 3:
+ print 'updateAndFlush requires 3 args'
+ sys.exit(1)
+ pp.pprint(client.updateAndFlush(args[0],args[1],eval(args[2]),))
+
+elif cmd == 'createWriter':
+ if len(args) != 3:
+ print 'createWriter requires 3 args'
+ sys.exit(1)
+ pp.pprint(client.createWriter(args[0],args[1],eval(args[2]),))
+
+elif cmd == 'update':
+ if len(args) != 2:
+ print 'update requires 2 args'
+ sys.exit(1)
+ pp.pprint(client.update(args[0],eval(args[1]),))
+
+elif cmd == 'flush':
+ if len(args) != 1:
+ print 'flush requires 1 args'
+ sys.exit(1)
+ pp.pprint(client.flush(args[0],))
+
+elif cmd == 'closeWriter':
+ if len(args) != 1:
+ print 'closeWriter requires 1 args'
+ sys.exit(1)
+ pp.pprint(client.closeWriter(args[0],))
+
+elif cmd == 'getRowRange':
+ if len(args) != 1:
+ print 'getRowRange requires 1 args'
+ sys.exit(1)
+ pp.pprint(client.getRowRange(args[0],))
+
+elif cmd == 'getFollowing':
+ if len(args) != 2:
+ print 'getFollowing requires 2 args'
+ sys.exit(1)
+ pp.pprint(client.getFollowing(eval(args[0]),eval(args[1]),))
+
+else:
+ print 'Unrecognized method %s' % cmd
+ sys.exit(1)
+
+transport.close()
16,194 proxy/AccumuloProxy.py
16,194 additions, 0 deletions not shown
1  proxy/__init__.py
@@ -0,0 +1 @@
+__all__ = ['ttypes', 'constants', 'AccumuloProxy']
11 proxy/constants.py
@@ -0,0 +1,11 @@
+#
+# Autogenerated by Thrift Compiler (0.9.0)
+#
+# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+#
+# options string: py
+#
+
+from thrift.Thrift import TType, TMessageType, TException, TApplicationException
+from ttypes import *
+
2,314 proxy/ttypes.py
@@ -0,0 +1,2314 @@
+#
+# Autogenerated by Thrift Compiler (0.9.0)
+#
+# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+#
+# options string: py
+#
+
+from thrift.Thrift import TType, TMessageType, TException, TApplicationException
+
+from thrift.transport import TTransport
+from thrift.protocol import TBinaryProtocol, TProtocol
+try:
+ from thrift.protocol import fastbinary
+except:
+ fastbinary = None
+
+
+class PartialKey:
+ ROW = 0
+ ROW_COLFAM = 1
+ ROW_COLFAM_COLQUAL = 2
+ ROW_COLFAM_COLQUAL_COLVIS = 3
+ ROW_COLFAM_COLQUAL_COLVIS_TIME = 4
+ ROW_COLFAM_COLQUAL_COLVIS_TIME_DEL = 5
+
+ _VALUES_TO_NAMES = {
+ 0: "ROW",
+ 1: "ROW_COLFAM",
+ 2: "ROW_COLFAM_COLQUAL",
+ 3: "ROW_COLFAM_COLQUAL_COLVIS",
+ 4: "ROW_COLFAM_COLQUAL_COLVIS_TIME",
+ 5: "ROW_COLFAM_COLQUAL_COLVIS_TIME_DEL",
+ }
+
+ _NAMES_TO_VALUES = {
+ "ROW": 0,
+ "ROW_COLFAM": 1,
+ "ROW_COLFAM_COLQUAL": 2,
+ "ROW_COLFAM_COLQUAL_COLVIS": 3,
+ "ROW_COLFAM_COLQUAL_COLVIS_TIME": 4,
+ "ROW_COLFAM_COLQUAL_COLVIS_TIME_DEL": 5,
+ }
+
+class TablePermission:
+ READ = 2
+ WRITE = 3
+ BULK_IMPORT = 4
+ ALTER_TABLE = 5
+ GRANT = 6
+ DROP_TABLE = 7
+
+ _VALUES_TO_NAMES = {
+ 2: "READ",
+ 3: "WRITE",
+ 4: "BULK_IMPORT",
+ 5: "ALTER_TABLE",
+ 6: "GRANT",
+ 7: "DROP_TABLE",
+ }
+
+ _NAMES_TO_VALUES = {
+ "READ": 2,
+ "WRITE": 3,
+ "BULK_IMPORT": 4,
+ "ALTER_TABLE": 5,
+ "GRANT": 6,
+ "DROP_TABLE": 7,
+ }
+
+class SystemPermission:
+ GRANT = 0
+ CREATE_TABLE = 1
+ DROP_TABLE = 2
+ ALTER_TABLE = 3
+ CREATE_USER = 4
+ DROP_USER = 5
+ ALTER_USER = 6
+ SYSTEM = 7
+
+ _VALUES_TO_NAMES = {
+ 0: "GRANT",
+ 1: "CREATE_TABLE",
+ 2: "DROP_TABLE",
+ 3: "ALTER_TABLE",
+ 4: "CREATE_USER",
+ 5: "DROP_USER",
+ 6: "ALTER_USER",
+ 7: "SYSTEM",
+ }
+
+ _NAMES_TO_VALUES = {
+ "GRANT": 0,
+ "CREATE_TABLE": 1,
+ "DROP_TABLE": 2,
+ "ALTER_TABLE": 3,
+ "CREATE_USER": 4,
+ "DROP_USER": 5,
+ "ALTER_USER": 6,
+ "SYSTEM": 7,
+ }
+
+class ScanType:
+ SINGLE = 0
+ BATCH = 1
+
+ _VALUES_TO_NAMES = {
+ 0: "SINGLE",
+ 1: "BATCH",
+ }
+
+ _NAMES_TO_VALUES = {
+ "SINGLE": 0,
+ "BATCH": 1,
+ }
+
+class ScanState:
+ IDLE = 0
+ RUNNING = 1
+ QUEUED = 2
+
+ _VALUES_TO_NAMES = {
+ 0: "IDLE",
+ 1: "RUNNING",
+ 2: "QUEUED",
+ }
+
+ _NAMES_TO_VALUES = {
+ "IDLE": 0,
+ "RUNNING": 1,
+ "QUEUED": 2,
+ }
+
+class CompactionType:
+ MINOR = 0
+ MERGE = 1
+ MAJOR = 2
+ FULL = 3
+
+ _VALUES_TO_NAMES = {
+ 0: "MINOR",
+ 1: "MERGE",
+ 2: "MAJOR",
+ 3: "FULL",
+ }
+
+ _NAMES_TO_VALUES = {
+ "MINOR": 0,
+ "MERGE": 1,
+ "MAJOR": 2,
+ "FULL": 3,
+ }
+
+class CompactionReason:
+ USER = 0
+ SYSTEM = 1
+ CHOP = 2
+ IDLE = 3
+ CLOSE = 4
+
+ _VALUES_TO_NAMES = {
+ 0: "USER",
+ 1: "SYSTEM",
+ 2: "CHOP",
+ 3: "IDLE",
+ 4: "CLOSE",
+ }
+
+ _NAMES_TO_VALUES = {
+ "USER": 0,
+ "SYSTEM": 1,
+ "CHOP": 2,
+ "IDLE": 3,
+ "CLOSE": 4,
+ }
+
+class IteratorScope:
+ MINC = 0
+ MAJC = 1
+ SCAN = 2
+
+ _VALUES_TO_NAMES = {
+ 0: "MINC",
+ 1: "MAJC",
+ 2: "SCAN",
+ }
+
+ _NAMES_TO_VALUES = {
+ "MINC": 0,
+ "MAJC": 1,
+ "SCAN": 2,
+ }
+
+class TimeType:
+ LOGICAL = 0
+ MILLIS = 1
+
+ _VALUES_TO_NAMES = {
+ 0: "LOGICAL",
+ 1: "MILLIS",
+ }
+
+ _NAMES_TO_VALUES = {
+ "LOGICAL": 0,
+ "MILLIS": 1,
+ }
+
+
+class Key:
+ """
+ Attributes:
+ - row
+ - colFamily
+ - colQualifier
+ - colVisibility
+ - timestamp
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.STRING, 'row', None, None, ), # 1
+ (2, TType.STRING, 'colFamily', None, None, ), # 2
+ (3, TType.STRING, 'colQualifier', None, None, ), # 3
+ (4, TType.STRING, 'colVisibility', None, None, ), # 4
+ (5, TType.I64, 'timestamp', None, None, ), # 5
+ )
+
+ def __init__(self, row=None, colFamily=None, colQualifier=None, colVisibility=None, timestamp=None,):
+ self.row = row
+ self.colFamily = colFamily
+ self.colQualifier = colQualifier
+ self.colVisibility = colVisibility
+ self.timestamp = timestamp
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.STRING:
+ self.row = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ elif fid == 2:
+ if ftype == TType.STRING:
+ self.colFamily = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ elif fid == 3:
+ if ftype == TType.STRING:
+ self.colQualifier = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ elif fid == 4:
+ if ftype == TType.STRING:
+ self.colVisibility = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ elif fid == 5:
+ if ftype == TType.I64:
+ self.timestamp = iprot.readI64();
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('Key')
+ if self.row is not None:
+ oprot.writeFieldBegin('row', TType.STRING, 1)
+ oprot.writeString(self.row)
+ oprot.writeFieldEnd()
+ if self.colFamily is not None:
+ oprot.writeFieldBegin('colFamily', TType.STRING, 2)
+ oprot.writeString(self.colFamily)
+ oprot.writeFieldEnd()
+ if self.colQualifier is not None:
+ oprot.writeFieldBegin('colQualifier', TType.STRING, 3)
+ oprot.writeString(self.colQualifier)
+ oprot.writeFieldEnd()
+ if self.colVisibility is not None:
+ oprot.writeFieldBegin('colVisibility', TType.STRING, 4)
+ oprot.writeString(self.colVisibility)
+ oprot.writeFieldEnd()
+ if self.timestamp is not None:
+ oprot.writeFieldBegin('timestamp', TType.I64, 5)
+ oprot.writeI64(self.timestamp)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+
+ def validate(self):
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class ColumnUpdate:
+ """