regenerate_thrift.sh 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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 thrift/beeswax.thrift
  22. # We don't need to have generated code for the metastore, since that's
  23. # in one of the hive jars that we include
  24. rm -Rf java/gen-java/com/facebook java/gen-java/org/apache
  25. cat <<EOF
  26. ======================================================================
  27. NOTE:
  28. ======================================================================
  29. This script does *not* remove old generated files that may not be necessary anymore.
  30. You should probably do something like:
  31. > git rm -Rf java/gen-java
  32. > ./regenerate_thrift.sh
  33. > git add java/gen-java
  34. ======================================================================
  35. EOF
  36. # This is based on thirdparty.
  37. # thrift -r --gen py:new_style -o ../ ../../../../ext/thirdparty/py/thrift/contrib/fb303/if/fb303.thrift