regenerate_thrift.sh 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #!/usr/bin/env bash
  2. # Licensed to Cloudera, Inc. under one
  3. # or more contributor license agreements. See the NOTICE file
  4. # distributed with this work for additional information
  5. # regarding copyright ownership. Cloudera, Inc. licenses this file
  6. # to you under the Apache License, Version 2.0 (the
  7. # "License"); you may not use this file except in compliance
  8. # with the License. You may obtain a copy of the License at
  9. #
  10. # http://www.apache.org/licenses/LICENSE-2.0
  11. #
  12. # Unless required by applicable law or agreed to in writing, software
  13. # distributed under the License is distributed on an "AS IS" BASIS,
  14. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. # See the License for the specific language governing permissions and
  16. # limitations under the License.
  17. set -o errexit
  18. set -o xtrace
  19. cd $(dirname $0)
  20. thrift -I thrift/include -r --gen py:new_style -o ./ thrift/beeswax.thrift
  21. thrift -I thrift/include -r --gen java:hashcode -o java/src/main thrift/beeswax.thrift
  22. thrift -I thrift/include -r --gen py:new_style -o ./ thrift/TCLIService.thrift
  23. # We don't need to have generated code for the metastore, since that's
  24. # in one of the hive jars that we include
  25. rm -Rf java/src/main/gen-java/com/facebook java/src/main/gen-java/org/apache
  26. cat <<EOF
  27. ======================================================================
  28. NOTE:
  29. ======================================================================
  30. This script does *not* remove old generated files that may not be necessary anymore.
  31. You should probably do something like:
  32. > git rm -rf java/src/main/gen-java gen-py
  33. > ./regenerate_thrift.sh
  34. > git add java/src/main/gen-java gen-py
  35. ======================================================================
  36. EOF
  37. # This is based on thirdparty.
  38. # thrift -r --gen py:new_style -o ../ ../../../../ext/thirdparty/py/thrift/contrib/fb303/if/fb303.thrift
  39. # C++ compilation for ODBC
  40. #thrift -I thrift/include --gen cpp -o ./ thrift/beeswax.thrift