Kaynağa Gözat

[sentry] Add sentry client and API

[sentry] Add syntax highlighting and autocomplete
Abraham Elmahrek 11 yıl önce
ebeveyn
işleme
415ec1eed2
42 değiştirilmiş dosya ile 7796 ekleme ve 53 silme
  1. 116 44
      apps/beeswax/src/beeswax/templates/execute.mako
  2. 6 0
      apps/beeswax/src/beeswax/urls.py
  3. 2 1
      apps/beeswax/src/beeswax/views.py
  4. 91 1
      apps/beeswax/static/js/autocomplete.utils.js
  5. 2 0
      desktop/Makefile
  6. 55 7
      desktop/core/static/js/codemirror-hql-hint.js
  7. 36 0
      desktop/libs/libsentry/Makefile
  8. 1 0
      desktop/libs/libsentry/babel.cfg
  9. 0 0
      desktop/libs/libsentry/gen-py/__init__.py
  10. 172 0
      desktop/libs/libsentry/gen-py/fb303/FacebookService-remote
  11. 1930 0
      desktop/libs/libsentry/gen-py/fb303/FacebookService.py
  12. 1 0
      desktop/libs/libsentry/gen-py/fb303/__init__.py
  13. 11 0
      desktop/libs/libsentry/gen-py/fb303/constants.py
  14. 47 0
      desktop/libs/libsentry/gen-py/fb303/ttypes.py
  15. 1 0
      desktop/libs/libsentry/gen-py/sentry_common_service/__init__.py
  16. 18 0
      desktop/libs/libsentry/gen-py/sentry_common_service/constants.py
  17. 108 0
      desktop/libs/libsentry/gen-py/sentry_common_service/ttypes.py
  18. 144 0
      desktop/libs/libsentry/gen-py/sentry_policy_service/SentryPolicyService-remote
  19. 1581 0
      desktop/libs/libsentry/gen-py/sentry_policy_service/SentryPolicyService.py
  20. 1 0
      desktop/libs/libsentry/gen-py/sentry_policy_service/__init__.py
  21. 11 0
      desktop/libs/libsentry/gen-py/sentry_policy_service/constants.py
  22. 2132 0
      desktop/libs/libsentry/gen-py/sentry_policy_service/ttypes.py
  23. 19 0
      desktop/libs/libsentry/regenerate_thrift.sh
  24. 30 0
      desktop/libs/libsentry/setup.py
  25. 15 0
      desktop/libs/libsentry/src/libsentry/__init__.py
  26. 50 0
      desktop/libs/libsentry/src/libsentry/api.py
  27. 105 0
      desktop/libs/libsentry/src/libsentry/client.py
  28. 34 0
      desktop/libs/libsentry/src/libsentry/conf.py
  29. 89 0
      desktop/libs/libsentry/src/libsentry/locale/de/LC_MESSAGES/django.po
  30. 41 0
      desktop/libs/libsentry/src/libsentry/locale/en/LC_MESSAGES/django.po
  31. 41 0
      desktop/libs/libsentry/src/libsentry/locale/en_US.pot
  32. 89 0
      desktop/libs/libsentry/src/libsentry/locale/es/LC_MESSAGES/django.po
  33. 89 0
      desktop/libs/libsentry/src/libsentry/locale/fr/LC_MESSAGES/django.po
  34. 89 0
      desktop/libs/libsentry/src/libsentry/locale/ja/LC_MESSAGES/django.po
  35. 89 0
      desktop/libs/libsentry/src/libsentry/locale/ko/LC_MESSAGES/django.po
  36. 89 0
      desktop/libs/libsentry/src/libsentry/locale/pt/LC_MESSAGES/django.po
  37. 89 0
      desktop/libs/libsentry/src/libsentry/locale/pt_BR/LC_MESSAGES/django.po
  38. 89 0
      desktop/libs/libsentry/src/libsentry/locale/zh_CN/LC_MESSAGES/django.po
  39. 16 0
      desktop/libs/libsentry/src/libsentry/models.py
  40. 39 0
      desktop/libs/libsentry/src/libsentry/views.py
  41. 41 0
      desktop/libs/libsentry/thrift/sentry_common_service.thrift
  42. 187 0
      desktop/libs/libsentry/thrift/sentry_policy_service.thrift

+ 116 - 44
apps/beeswax/src/beeswax/templates/execute.mako

@@ -935,9 +935,12 @@ ${layout.menubar(section='query')}
 <script type="text/javascript" charset="utf-8">
 var codeMirror, renderNavigator, resetNavigator, resizeNavigator, dataTable, renderRecent;
 
-var HIVE_AUTOCOMPLETE_BASE_URL = "${ autocomplete_base_url | n,unicode }";
+var HIVE_AUTOCOMPLETE_BASE_URL = "${ hive_autocomplete_base_url | n,unicode }";
 var HIVE_AUTOCOMPLETE_FAILS_QUIETLY_ON = [500]; // error codes from beeswax/views.py - autocomplete
 var HIVE_AUTOCOMPLETE_USER = "${ user }";
+var SENTRY_AUTOCOMPLETE_BASE_URL = "${ sentry_autocomplete_base_url | n,unicode }";
+var SENTRY_AUTOCOMPLETE_FAILS_QUIETLY_ON = [500]; // error codes from beeswax/views.py - autocomplete
+var SENTRY_AUTOCOMPLETE_USER = "${ user }";
 
 var HIVE_AUTOCOMPLETE_GLOBAL_CALLBACK = function (data) {
   if (data != null && data.error) {
@@ -1387,60 +1390,129 @@ $(document).ready(function () {
     }
     $(".CodeMirror-spinner").css("top", pos.top + "px").css("left", (pos.left - 4) + "px").show();
 
-    if ($.totalStorage(hac_getTotalStorageUserPrefix() + 'tables_' + viewModel.database()) == null) {
-      CodeMirror.showHint(cm, AUTOCOMPLETE_SET);
-      hac_getTables(viewModel.database(), function () {
-      }); // if preload didn't work, tries again
-    }
-    else {
-      hac_getTables(viewModel.database(), function (tables) {
-        CodeMirror.catalogTables = tables;
-        var _statementAtCursor = getStatementAtCursor();
-        var _before = _statementAtCursor.statement.substr(0, _statementAtCursor.relativeIndex).replace(/;+$/, "");
-        var _after = _statementAtCursor.statement.substr(_statementAtCursor.relativeIndex).replace(/;+$/, "");
-        if ($.trim(_before).substr(-1) == ".") {
-          var _statement = _statementAtCursor.statement;
-          var _line = codeMirror.getLine(codeMirror.getCursor().line);
-          var _partial = _line.substring(0, codeMirror.getCursor().ch);
-          var _table = _partial.substring(_partial.lastIndexOf(" ") + 1, _partial.length - 1);
-          if (_statement.indexOf("FROM") > -1) {
-            hac_getTableColumns(viewModel.database(), _table, _statement, function (columns) {
-              var _cols = columns.split(" ");
-              for (var col in _cols) {
-                _cols[col] = "." + _cols[col];
-              }
-              CodeMirror.catalogFields = _cols.join(" ");
+    var _statementAtCursor = getStatementAtCursor();
+    if (_statementAtCursor.statement.toUpperCase().indexOf("GRANT") != -1 || _statementAtCursor.statement.toUpperCase().indexOf("REVOKE") != -1) {
+      // Not a SELECT/INSERT statement
+      CodeMirror.possibleSoloField = false;
+      CodeMirror.possibleRole = false;
+      CodeMirror.possibleObject = false;
+      CodeMirror.possiblePrivilege = false;
+      CodeMirror.tableMagic = false;
+      CodeMirror.roleMagic = false;
+      CodeMirror.objectMagic = false;
+
+      var _start = _statementAtCursor.statement.toUpperCase().indexOf("ROLE");
+      if ( _start != -1 && _start < 10 ) {
+        // GRANT/REVOKE ROLE
+        sac_getRoles(function (roles) {
+          CodeMirror.roles = Object.keys(roles).join(" ");
+          var _stop = _statementAtCursor.statement.indexOf("TO GROUP");
+          if (_stop == -1) {
+            _stop = _statementAtCursor.statement.indexOf("FROM GROUP");
+          }
+          // Make sure cursor is before "TO GROUP", which naturally follows the ROLES list
+          if (_stop == -1 || _statementAtCursor.relativeIndex <= _stop) {
+            CodeMirror.possibleRole = true;
+            CodeMirror.showHint(cm, AUTOCOMPLETE_SET);
+          } else {
+            CodeMirror.possibleRole = false;
+            CodeMirror.showHint(cm, AUTOCOMPLETE_SET);
+          }
+        });
+      } else {
+        // GRANT/REVOKE privileges
+        var _stop = _statementAtCursor.statement.indexOf("ON");
+        if (_stop == -1 || _statementAtCursor.relativeIndex <= _stop) {
+          // Choosing privilege
+          CodeMirror.possiblePrivilege = true;
+          CodeMirror.showHint(cm, AUTOCOMPLETE_SET);
+        } else {
+          // Choosing object or role
+          _stop = _statementAtCursor.statement.indexOf("TO");
+          if (_stop == -1) {
+            _stop = _statementAtCursor.statement.indexOf("FROM");
+          }
+
+          if (_stop == -1 || _statementAtCursor.relativeIndex <= _stop) {
+            // Choose object
+            CodeMirror.possibleObject = true;
+            CodeMirror.objectMagic = true;
+            hac_getTables(viewModel.database(), function (tables) {
+              CodeMirror.catalogTables = tables;
+              CodeMirror.showHint(cm, AUTOCOMPLETE_SET);
+            });
+          } else {
+            // Choose role
+            sac_getRoles(function (roles) {
+              CodeMirror.roles = Object.keys(roles).join(" ");
+              CodeMirror.possibleRole = true;
+              CodeMirror.roleMagic = true;
               CodeMirror.showHint(cm, AUTOCOMPLETE_SET);
             });
           }
+
+          CodeMirror.showHint(cm, AUTOCOMPLETE_SET);
         }
-        else {
-          CodeMirror.possibleTable = false;
-          CodeMirror.tableFieldMagic = false;
-          if ((_before.toUpperCase().indexOf(" FROM ") > -1 || _before.toUpperCase().indexOf(" TABLE ") > -1 || _before.toUpperCase().indexOf(" STATS ") > -1) && _before.toUpperCase().indexOf(" ON ") == -1 && _before.toUpperCase().indexOf(" ORDER BY ") == -1 && _before.toUpperCase().indexOf(" WHERE ") == -1 ||
-              _before.toUpperCase().indexOf("REFRESH") > -1 || _before.toUpperCase().indexOf("METADATA") > -1 || _before.toUpperCase().indexOf("DESCRIBE") > -1) {
-            CodeMirror.possibleTable = true;
-          }
-          CodeMirror.possibleSoloField = false;
-          if (_before.toUpperCase().indexOf("SELECT ") > -1 && _before.toUpperCase().indexOf(" FROM ") == -1 && !CodeMirror.fromDot) {
-            if (_after.toUpperCase().indexOf("FROM ") > -1 || $.trim(_before).substr(-1) == "(") {
-              fieldsAutocomplete(cm);
-            }
-            else {
-              CodeMirror.tableFieldMagic = true;
-              CodeMirror.showHint(cm, AUTOCOMPLETE_SET);
+      }
+    } else {
+      // Not a GRANT/REVOKE statement
+      CodeMirror.possibleRole = false;
+      CodeMirror.possiblePrivilege = false;
+
+      if ($.totalStorage(hac_getTotalStorageUserPrefix() + 'tables_' + viewModel.database()) == null) {
+        CodeMirror.showHint(cm, AUTOCOMPLETE_SET);
+        hac_getTables(viewModel.database(), function () {
+        }); // if preload didn't work, tries again
+      } else {
+        hac_getTables(viewModel.database(), function (tables) {
+          CodeMirror.catalogTables = tables;
+          var _statementAtCursor = getStatementAtCursor();
+          var _before = _statementAtCursor.statement.substr(0, _statementAtCursor.relativeIndex).replace(/;+$/, "");
+          var _after = _statementAtCursor.statement.substr(_statementAtCursor.relativeIndex).replace(/;+$/, "");
+          if ($.trim(_before).substr(-1) == ".") {
+            var _statement = _statementAtCursor.statement;
+            var _line = codeMirror.getLine(codeMirror.getCursor().line);
+            var _partial = _line.substring(0, codeMirror.getCursor().ch);
+            var _table = _partial.substring(_partial.lastIndexOf(" ") + 1, _partial.length - 1);
+            if (_statement.indexOf("FROM") > -1) {
+              hac_getTableColumns(viewModel.database(), _table, _statement, function (columns) {
+                var _cols = columns.split(" ");
+                for (var col in _cols) {
+                  _cols[col] = "." + _cols[col];
+                }
+                CodeMirror.catalogFields = _cols.join(" ");
+                CodeMirror.showHint(cm, AUTOCOMPLETE_SET);
+              });
             }
           }
           else {
-            if ((_before.toUpperCase().indexOf("WHERE ") > -1 || _before.toUpperCase().indexOf("ORDER BY ") > -1) && !CodeMirror.fromDot && _before.toUpperCase().match(/ ON| LIMIT| GROUP| SORT/) == null) {
-              fieldsAutocomplete(cm);
+            CodeMirror.possibleTable = false;
+            CodeMirror.tableFieldMagic = false;
+            if ((_before.toUpperCase().indexOf(" FROM ") > -1 || _before.toUpperCase().indexOf(" TABLE ") > -1 || _before.toUpperCase().indexOf(" STATS ") > -1) && _before.toUpperCase().indexOf(" ON ") == -1 && _before.toUpperCase().indexOf(" ORDER BY ") == -1 && _before.toUpperCase().indexOf(" WHERE ") == -1 ||
+                _before.toUpperCase().indexOf("REFRESH") > -1 || _before.toUpperCase().indexOf("METADATA") > -1 || _before.toUpperCase().indexOf("DESCRIBE") > -1) {
+              CodeMirror.possibleTable = true;
+            }
+            CodeMirror.possibleSoloField = false;
+            if (_before.toUpperCase().indexOf("SELECT ") > -1 && _before.toUpperCase().indexOf(" FROM ") == -1 && !CodeMirror.fromDot) {
+              if (_after.toUpperCase().indexOf("FROM ") > -1 || $.trim(_before).substr(-1) == "(") {
+                fieldsAutocomplete(cm);
+              }
+              else {
+                CodeMirror.tableFieldMagic = true;
+                CodeMirror.showHint(cm, AUTOCOMPLETE_SET);
+              }
             }
             else {
-              CodeMirror.showHint(cm, AUTOCOMPLETE_SET);
+              if ((_before.toUpperCase().indexOf("WHERE ") > -1 || _before.toUpperCase().indexOf("ORDER BY ") > -1) && !CodeMirror.fromDot && _before.toUpperCase().match(/ ON| LIMIT| GROUP| SORT/) == null) {
+                fieldsAutocomplete(cm);
+              }
+              else {
+                CodeMirror.showHint(cm, AUTOCOMPLETE_SET);
+              }
             }
           }
-        }
-      });
+        });
+      }
     }
   }
 

+ 6 - 0
apps/beeswax/src/beeswax/urls.py

@@ -74,3 +74,9 @@ urlpatterns += patterns(
 
   url(r'^api/table/(?P<database>\w+)/(?P<table>\w+)$', 'describe_table', name='describe_table'),
 )
+
+urlpatterns += patterns(
+  'libsentry.views',
+
+  url(r'^api/sentry/autocomplete/roles$', 'roles', name='api_sentry_roles')
+)

+ 2 - 1
apps/beeswax/src/beeswax/views.py

@@ -405,7 +405,8 @@ def execute_query(request, design_id=None, query_history_id=None):
     'design': design,
     'query': query_history, # Backward
     'query_history': query_history,
-    'autocomplete_base_url': reverse(get_app_name(request) + ':api_autocomplete_databases', kwargs={}),
+    'hive_autocomplete_base_url': reverse(get_app_name(request) + ':api_autocomplete_databases', kwargs={}),
+    'sentry_autocomplete_base_url': ('/%s/api/sentry/autocomplete' % get_app_name(request)),
     'can_edit_name': design and design.id and not design.is_auto,
     'can_edit': design and design.id and design.doc.get().can_write(request.user),
     'action': action,

+ 91 - 1
apps/beeswax/static/js/autocomplete.utils.js

@@ -14,6 +14,9 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+
+// Hive
+
 function hac_jsoncalls(options) {
   if (typeof HIVE_AUTOCOMPLETE_BASE_URL != "undefined") {
     if (options.database == null) {
@@ -228,4 +231,91 @@ function hac_errorHandler(data) {
       $(document).trigger('error', data.error);
     }
   }
-}
+}
+
+
+// Sentry
+
+function sac_getTotalStorageUserPrefix(){
+  if (typeof SENTRY_AUTOCOMPLETE_USER != "undefined") {
+    return SENTRY_AUTOCOMPLETE_USER + "_";
+  }
+  return "";
+}
+
+function sac_jsoncalls(options) {
+  if (typeof SENTRY_AUTOCOMPLETE_BASE_URL != "undefined") {
+    $.getJSON(SENTRY_AUTOCOMPLETE_BASE_URL + '/roles', options.onDataReceived);
+  }
+  else {
+    try {
+      console.error("You need to specify a SENTRY_AUTOCOMPLETE_BASE_URL to use the autocomplete");
+    }
+    catch (e) {
+    }
+  }
+}
+
+function sac_hasExpired(timestamp){
+  var TIME_TO_LIVE_IN_MILLIS = 600000; // 10 minutes
+  return (new Date()).getTime() - timestamp > TIME_TO_LIVE_IN_MILLIS;
+}
+
+function sac_errorHandler(data) {
+  $(document).trigger('error.autocomplete');
+  if (typeof SENTRY_AUTOCOMPLETE_FAILS_QUIETLY_ON == "undefined" || data.code == null || SENTRY_AUTOCOMPLETE_FAILS_QUIETLY_ON.indexOf(data.code) == -1){
+    if (typeof SENTRY_AUTOCOMPLETE_FAILS_QUIETLY_ON != "undefined" && SENTRY_AUTOCOMPLETE_FAILS_QUIETLY_ON.indexOf(data.code) > -1){
+      $(document).trigger('info', data.error);
+    }
+    else {
+      $(document).trigger('error', data.error);
+    }
+  }
+}
+
+function sac_getRoles(callback) {
+  var key = sac_getTotalStorageUserPrefix() + 'roles';
+  var timestamp_key = sac_getTotalStorageUserPrefix() + 'timestamp_roles';
+
+  if ($.totalStorage(key) != null) {
+    if ($.totalStorage(timestamp_key) == null || sac_hasExpired($.totalStorage(timestamp_key))){
+      sac_jsoncalls({
+        onDataReceived: function (data) {
+          if (typeof SENTRY_AUTOCOMPLETE_GLOBAL_CALLBACK == "function") {
+            SENTRY_AUTOCOMPLETE_GLOBAL_CALLBACK(data);
+          }
+          if (data.error) {
+            sac_errorHandler(data);
+          }
+          else {
+            if (data.roles) {
+              $.totalStorage(key, JSON.stringify(data.roles));
+              $.totalStorage(timestamp_key, (new Date()).getTime());
+              callback($.parseJSON($.totalStorage(key)));
+            }
+          }
+        }
+      });
+    } else {
+      callback($.parseJSON($.totalStorage(key)));
+    }
+  } else {
+    console.log('here4');
+    sac_jsoncalls({
+      onDataReceived: function (data) {
+        if (typeof SENTRY_AUTOCOMPLETE_GLOBAL_CALLBACK == "function") {
+          SENTRY_AUTOCOMPLETE_GLOBAL_CALLBACK(data);
+        }
+        if (data.error) {
+          sac_errorHandler(data);
+        } else {
+          if (data.roles) {
+            $.totalStorage(key, JSON.stringify(data.roles));
+            $.totalStorage(timestamp_key, (new Date()).getTime());
+            callback($.parseJSON($.totalStorage(key)));
+          }
+        }
+      }
+    });
+  }
+}

+ 2 - 0
desktop/Makefile

@@ -47,7 +47,9 @@ APPS := core \
 	libs/libopenid \
 	libs/liboauth \
 	libs/libsolr \
+	libs/libsentry \
 	libs/indexer
+>>>>>>> [sentry] Add sentry client and API
 
 .PHONY: default
 default:: hue syncdb

+ 55 - 7
desktop/core/static/js/codemirror-hql-hint.js

@@ -58,9 +58,14 @@
 
   CodeMirror.catalogTables = "";
   CodeMirror.catalogFields = "";
+  CodeMirror.roles = "";
   CodeMirror.possibleTable = false;
   CodeMirror.possibleSoloField = false;
+  CodeMirror.possibleRole = false;
+  CodeMirror.possibleObject = false;
   CodeMirror.tableFieldMagic = false;
+  CodeMirror.roleMagic = false;
+  CodeMirror.objectMagic = false;
 
   CodeMirror.hiveQLHint = function (editor) {
     return scriptHint(editor, hiveQLKeywordsU, function (e, cur) {
@@ -84,9 +89,26 @@
   var hiveQLBuiltinsU = hiveQLBuiltins.split(" ").join("() ").split(" ");
   var hiveQLBuiltinsL = hiveQLBuiltins.toLowerCase().split(" ").join("() ").split(" ");
 
+  var hiveQLGrantables = "ROLE";
+  var hiveQLGrantablesU = hiveQLGrantables.split(" ");
+  var hiveQLGrantablesL = hiveQLGrantables.toLowerCase().split(" ");
+
+  var hiveQLGrantablePrivileges = "ROLE SELECT INSERT ALL";
+  var hiveQLGrantablePrivilegesU = hiveQLGrantablePrivileges.split(" ");
+  var hiveQLGrantablePrivilegesL = hiveQLGrantablePrivileges.toLowerCase().split(" ");
+
+  var hiveQLKeywordsAfterGrants = "TO GROUP FROM ON";
+  var hiveQLKeywordsAfterGrantsU = hiveQLKeywordsAfterGrants.split(" ");
+  var hiveQLKeywordsAfterGrantsL = hiveQLKeywordsAfterGrants.toLowerCase().split(" ");
+
+  var hiveQLKeywordsAfterPrivileges = "DATABASE TABLE FROM TO";
+  var hiveQLKeywordsAfterPrivilegesU = hiveQLKeywordsAfterPrivileges.split(" ");
+  var hiveQLKeywordsAfterPrivilegesL = hiveQLKeywordsAfterPrivileges.toLowerCase().split(" ");
+
   function getCompletions(token, context) {
     var catalogTablesL = CodeMirror.catalogTables.toLowerCase().split(" ");
     var catalogFieldsL = CodeMirror.catalogFields.toLowerCase().split(" ");
+    var rolesL = CodeMirror.roles.split(" ");
 
     var found = [], start = token.string, extraFound = [];
 
@@ -107,7 +129,39 @@
         forEach(catalogFieldsL, maybeAdd);
       }
       else {
-        if (!CodeMirror.possibleTable) {
+        if (CodeMirror.possibleRole) {
+          if (CodeMirror.roleMagic) {
+            var _specialRoleTablesL = CodeMirror.roles.toLowerCase().split(" ");
+            for (var i = 0; i < _specialRoleTablesL.length; i++) {
+              _specialRoleTablesL[i] = "<i class='fa fa-magic'></i> ROLE " + _specialRoleTablesL[i];
+            }
+            forEach(_specialRoleTablesL, maybeAddToExtra);
+          }
+          forEach(rolesL, maybeAddToExtra);
+          forEach(hiveQLKeywordsAfterGrantsU, maybeAdd);
+          forEach(hiveQLKeywordsAfterGrantsL, maybeAdd);
+        } else if (CodeMirror.possiblePrivilege) {
+          forEach(hiveQLGrantablesL, maybeAdd);
+          forEach(hiveQLGrantablesU, maybeAdd);
+          forEach(hiveQLGrantablePrivilegesL, maybeAddToExtra);
+          forEach(hiveQLGrantablePrivilegesU, maybeAddToExtra);
+          forEach(hiveQLKeywordsAfterGrantsL, maybeAdd);
+          forEach(hiveQLKeywordsAfterGrantsU, maybeAdd);
+        } else if (CodeMirror.possibleObject) {
+          if (CodeMirror.objectMagic) {
+            var _specialCatalogTablesL = CodeMirror.catalogTables.toLowerCase().split(" ");
+            for (var i = 0; i < _specialCatalogTablesL.length; i++) {
+              _specialCatalogTablesL[i] = "<i class='fa fa-magic'></i> TABLE " + _specialCatalogTablesL[i];
+            }
+            forEach(_specialCatalogTablesL, maybeAddToExtra);
+          }
+          forEach(hiveQLKeywordsAfterPrivilegesL, maybeAddToExtra);
+          forEach(hiveQLKeywordsAfterPrivilegesU, maybeAddToExtra);
+        } else if (CodeMirror.possibleTable) {
+          forEach(catalogTablesL, maybeAddToExtra);
+          forEach(hiveQLKeywordsAfterTablesU, maybeAdd);
+          forEach(hiveQLKeywordsAfterTablesL, maybeAdd);
+        } else {
           if (CodeMirror.tableFieldMagic) {
             var _specialCatalogTablesL = CodeMirror.catalogTables.toLowerCase().split(" ");
             for (var i = 0; i < _specialCatalogTablesL.length; i++) {
@@ -124,12 +178,6 @@
           forEach(hiveQLTypesL, maybeAdd);
           forEach(hiveQLKeywordsU, maybeAdd);
           forEach(hiveQLKeywordsL, maybeAdd);
-
-        }
-        else {
-          forEach(catalogTablesL, maybeAddToExtra);
-          forEach(hiveQLKeywordsAfterTablesU, maybeAdd);
-          forEach(hiveQLKeywordsAfterTablesL, maybeAdd);
         }
       }
     }

+ 36 - 0
desktop/libs/libsentry/Makefile

@@ -0,0 +1,36 @@
+#
+# Licensed to Cloudera, Inc. under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  Cloudera, Inc. 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.
+#
+
+
+ifeq ($(ROOT),)
+  $(error "Error: Expect the environment variable $$ROOT to point to the Desktop installation")
+endif
+
+include $(ROOT)/Makefile.sdk
+
+default::
+	@echo '  env-install    : Install into virtual-env'
+
+#
+# env-install
+#   Install app into the virtual environment.
+#
+.PHONY: env-install
+env-install: compile ext-env-install
+	@echo '--- Installing $(APP_NAME) into virtual-env'
+	@$(ENV_PYTHON) setup.py develop -N -q

+ 1 - 0
desktop/libs/libsentry/babel.cfg

@@ -0,0 +1 @@
+[python: src/librdbms/**.py]

+ 0 - 0
desktop/libs/libsentry/gen-py/__init__.py


+ 172 - 0
desktop/libs/libsentry/gen-py/fb303/FacebookService-remote

@@ -0,0 +1,172 @@
+#!/usr/bin/env python
+#
+# Autogenerated by Thrift Compiler (0.9.1)
+#
+# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+#
+#  options string: py:new_style
+#
+
+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
+
+from fb303 import FacebookService
+from fb303.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 getName()'
+  print '  string getVersion()'
+  print '  fb_status getStatus()'
+  print '  string getStatusDetails()'
+  print '   getCounters()'
+  print '  i64 getCounter(string key)'
+  print '  void setOption(string key, string value)'
+  print '  string getOption(string key)'
+  print '   getOptions()'
+  print '  string getCpuProfile(i32 profileDurationInSec)'
+  print '  i64 aliveSince()'
+  print '  void reinitialize()'
+  print '  void shutdown()'
+  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 = FacebookService.Client(protocol)
+transport.open()
+
+if cmd == 'getName':
+  if len(args) != 0:
+    print 'getName requires 0 args'
+    sys.exit(1)
+  pp.pprint(client.getName())
+
+elif cmd == 'getVersion':
+  if len(args) != 0:
+    print 'getVersion requires 0 args'
+    sys.exit(1)
+  pp.pprint(client.getVersion())
+
+elif cmd == 'getStatus':
+  if len(args) != 0:
+    print 'getStatus requires 0 args'
+    sys.exit(1)
+  pp.pprint(client.getStatus())
+
+elif cmd == 'getStatusDetails':
+  if len(args) != 0:
+    print 'getStatusDetails requires 0 args'
+    sys.exit(1)
+  pp.pprint(client.getStatusDetails())
+
+elif cmd == 'getCounters':
+  if len(args) != 0:
+    print 'getCounters requires 0 args'
+    sys.exit(1)
+  pp.pprint(client.getCounters())
+
+elif cmd == 'getCounter':
+  if len(args) != 1:
+    print 'getCounter requires 1 args'
+    sys.exit(1)
+  pp.pprint(client.getCounter(args[0],))
+
+elif cmd == 'setOption':
+  if len(args) != 2:
+    print 'setOption requires 2 args'
+    sys.exit(1)
+  pp.pprint(client.setOption(args[0],args[1],))
+
+elif cmd == 'getOption':
+  if len(args) != 1:
+    print 'getOption requires 1 args'
+    sys.exit(1)
+  pp.pprint(client.getOption(args[0],))
+
+elif cmd == 'getOptions':
+  if len(args) != 0:
+    print 'getOptions requires 0 args'
+    sys.exit(1)
+  pp.pprint(client.getOptions())
+
+elif cmd == 'getCpuProfile':
+  if len(args) != 1:
+    print 'getCpuProfile requires 1 args'
+    sys.exit(1)
+  pp.pprint(client.getCpuProfile(eval(args[0]),))
+
+elif cmd == 'aliveSince':
+  if len(args) != 0:
+    print 'aliveSince requires 0 args'
+    sys.exit(1)
+  pp.pprint(client.aliveSince())
+
+elif cmd == 'reinitialize':
+  if len(args) != 0:
+    print 'reinitialize requires 0 args'
+    sys.exit(1)
+  pp.pprint(client.reinitialize())
+
+elif cmd == 'shutdown':
+  if len(args) != 0:
+    print 'shutdown requires 0 args'
+    sys.exit(1)
+  pp.pprint(client.shutdown())
+
+else:
+  print 'Unrecognized method %s' % cmd
+  sys.exit(1)
+
+transport.close()

+ 1930 - 0
desktop/libs/libsentry/gen-py/fb303/FacebookService.py

@@ -0,0 +1,1930 @@
+#
+# Autogenerated by Thrift Compiler (0.9.1)
+#
+# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+#
+#  options string: py:new_style
+#
+
+from thrift.Thrift import TType, TMessageType, TException, TApplicationException
+from ttypes import *
+from thrift.Thrift import TProcessor
+from thrift.transport import TTransport
+from thrift.protocol import TBinaryProtocol, TProtocol
+try:
+  from thrift.protocol import fastbinary
+except:
+  fastbinary = None
+
+
+class Iface(object):
+  """
+  Standard base service
+  """
+  def getName(self):
+    """
+    Returns a descriptive name of the service
+    """
+    pass
+
+  def getVersion(self):
+    """
+    Returns the version of the service
+    """
+    pass
+
+  def getStatus(self):
+    """
+    Gets the status of this service
+    """
+    pass
+
+  def getStatusDetails(self):
+    """
+    User friendly description of status, such as why the service is in
+    the dead or warning state, or what is being started or stopped.
+    """
+    pass
+
+  def getCounters(self):
+    """
+    Gets the counters for this service
+    """
+    pass
+
+  def getCounter(self, key):
+    """
+    Gets the value of a single counter
+
+    Parameters:
+     - key
+    """
+    pass
+
+  def setOption(self, key, value):
+    """
+    Sets an option
+
+    Parameters:
+     - key
+     - value
+    """
+    pass
+
+  def getOption(self, key):
+    """
+    Gets an option
+
+    Parameters:
+     - key
+    """
+    pass
+
+  def getOptions(self):
+    """
+    Gets all options
+    """
+    pass
+
+  def getCpuProfile(self, profileDurationInSec):
+    """
+    Returns a CPU profile over the given time interval (client and server
+    must agree on the profile format).
+
+    Parameters:
+     - profileDurationInSec
+    """
+    pass
+
+  def aliveSince(self):
+    """
+    Returns the unix time that the server has been running since
+    """
+    pass
+
+  def reinitialize(self):
+    """
+    Tell the server to reload its configuration, reopen log files, etc
+    """
+    pass
+
+  def shutdown(self):
+    """
+    Suggest a shutdown to the server
+    """
+    pass
+
+
+class Client(Iface):
+  """
+  Standard base service
+  """
+  def __init__(self, iprot, oprot=None):
+    self._iprot = self._oprot = iprot
+    if oprot is not None:
+      self._oprot = oprot
+    self._seqid = 0
+
+  def getName(self):
+    """
+    Returns a descriptive name of the service
+    """
+    self.send_getName()
+    return self.recv_getName()
+
+  def send_getName(self):
+    self._oprot.writeMessageBegin('getName', TMessageType.CALL, self._seqid)
+    args = getName_args()
+    args.write(self._oprot)
+    self._oprot.writeMessageEnd()
+    self._oprot.trans.flush()
+
+  def recv_getName(self):
+    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
+    if mtype == TMessageType.EXCEPTION:
+      x = TApplicationException()
+      x.read(self._iprot)
+      self._iprot.readMessageEnd()
+      raise x
+    result = getName_result()
+    result.read(self._iprot)
+    self._iprot.readMessageEnd()
+    if result.success is not None:
+      return result.success
+    raise TApplicationException(TApplicationException.MISSING_RESULT, "getName failed: unknown result");
+
+  def getVersion(self):
+    """
+    Returns the version of the service
+    """
+    self.send_getVersion()
+    return self.recv_getVersion()
+
+  def send_getVersion(self):
+    self._oprot.writeMessageBegin('getVersion', TMessageType.CALL, self._seqid)
+    args = getVersion_args()
+    args.write(self._oprot)
+    self._oprot.writeMessageEnd()
+    self._oprot.trans.flush()
+
+  def recv_getVersion(self):
+    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
+    if mtype == TMessageType.EXCEPTION:
+      x = TApplicationException()
+      x.read(self._iprot)
+      self._iprot.readMessageEnd()
+      raise x
+    result = getVersion_result()
+    result.read(self._iprot)
+    self._iprot.readMessageEnd()
+    if result.success is not None:
+      return result.success
+    raise TApplicationException(TApplicationException.MISSING_RESULT, "getVersion failed: unknown result");
+
+  def getStatus(self):
+    """
+    Gets the status of this service
+    """
+    self.send_getStatus()
+    return self.recv_getStatus()
+
+  def send_getStatus(self):
+    self._oprot.writeMessageBegin('getStatus', TMessageType.CALL, self._seqid)
+    args = getStatus_args()
+    args.write(self._oprot)
+    self._oprot.writeMessageEnd()
+    self._oprot.trans.flush()
+
+  def recv_getStatus(self):
+    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
+    if mtype == TMessageType.EXCEPTION:
+      x = TApplicationException()
+      x.read(self._iprot)
+      self._iprot.readMessageEnd()
+      raise x
+    result = getStatus_result()
+    result.read(self._iprot)
+    self._iprot.readMessageEnd()
+    if result.success is not None:
+      return result.success
+    raise TApplicationException(TApplicationException.MISSING_RESULT, "getStatus failed: unknown result");
+
+  def getStatusDetails(self):
+    """
+    User friendly description of status, such as why the service is in
+    the dead or warning state, or what is being started or stopped.
+    """
+    self.send_getStatusDetails()
+    return self.recv_getStatusDetails()
+
+  def send_getStatusDetails(self):
+    self._oprot.writeMessageBegin('getStatusDetails', TMessageType.CALL, self._seqid)
+    args = getStatusDetails_args()
+    args.write(self._oprot)
+    self._oprot.writeMessageEnd()
+    self._oprot.trans.flush()
+
+  def recv_getStatusDetails(self):
+    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
+    if mtype == TMessageType.EXCEPTION:
+      x = TApplicationException()
+      x.read(self._iprot)
+      self._iprot.readMessageEnd()
+      raise x
+    result = getStatusDetails_result()
+    result.read(self._iprot)
+    self._iprot.readMessageEnd()
+    if result.success is not None:
+      return result.success
+    raise TApplicationException(TApplicationException.MISSING_RESULT, "getStatusDetails failed: unknown result");
+
+  def getCounters(self):
+    """
+    Gets the counters for this service
+    """
+    self.send_getCounters()
+    return self.recv_getCounters()
+
+  def send_getCounters(self):
+    self._oprot.writeMessageBegin('getCounters', TMessageType.CALL, self._seqid)
+    args = getCounters_args()
+    args.write(self._oprot)
+    self._oprot.writeMessageEnd()
+    self._oprot.trans.flush()
+
+  def recv_getCounters(self):
+    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
+    if mtype == TMessageType.EXCEPTION:
+      x = TApplicationException()
+      x.read(self._iprot)
+      self._iprot.readMessageEnd()
+      raise x
+    result = getCounters_result()
+    result.read(self._iprot)
+    self._iprot.readMessageEnd()
+    if result.success is not None:
+      return result.success
+    raise TApplicationException(TApplicationException.MISSING_RESULT, "getCounters failed: unknown result");
+
+  def getCounter(self, key):
+    """
+    Gets the value of a single counter
+
+    Parameters:
+     - key
+    """
+    self.send_getCounter(key)
+    return self.recv_getCounter()
+
+  def send_getCounter(self, key):
+    self._oprot.writeMessageBegin('getCounter', TMessageType.CALL, self._seqid)
+    args = getCounter_args()
+    args.key = key
+    args.write(self._oprot)
+    self._oprot.writeMessageEnd()
+    self._oprot.trans.flush()
+
+  def recv_getCounter(self):
+    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
+    if mtype == TMessageType.EXCEPTION:
+      x = TApplicationException()
+      x.read(self._iprot)
+      self._iprot.readMessageEnd()
+      raise x
+    result = getCounter_result()
+    result.read(self._iprot)
+    self._iprot.readMessageEnd()
+    if result.success is not None:
+      return result.success
+    raise TApplicationException(TApplicationException.MISSING_RESULT, "getCounter failed: unknown result");
+
+  def setOption(self, key, value):
+    """
+    Sets an option
+
+    Parameters:
+     - key
+     - value
+    """
+    self.send_setOption(key, value)
+    self.recv_setOption()
+
+  def send_setOption(self, key, value):
+    self._oprot.writeMessageBegin('setOption', TMessageType.CALL, self._seqid)
+    args = setOption_args()
+    args.key = key
+    args.value = value
+    args.write(self._oprot)
+    self._oprot.writeMessageEnd()
+    self._oprot.trans.flush()
+
+  def recv_setOption(self):
+    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
+    if mtype == TMessageType.EXCEPTION:
+      x = TApplicationException()
+      x.read(self._iprot)
+      self._iprot.readMessageEnd()
+      raise x
+    result = setOption_result()
+    result.read(self._iprot)
+    self._iprot.readMessageEnd()
+    return
+
+  def getOption(self, key):
+    """
+    Gets an option
+
+    Parameters:
+     - key
+    """
+    self.send_getOption(key)
+    return self.recv_getOption()
+
+  def send_getOption(self, key):
+    self._oprot.writeMessageBegin('getOption', TMessageType.CALL, self._seqid)
+    args = getOption_args()
+    args.key = key
+    args.write(self._oprot)
+    self._oprot.writeMessageEnd()
+    self._oprot.trans.flush()
+
+  def recv_getOption(self):
+    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
+    if mtype == TMessageType.EXCEPTION:
+      x = TApplicationException()
+      x.read(self._iprot)
+      self._iprot.readMessageEnd()
+      raise x
+    result = getOption_result()
+    result.read(self._iprot)
+    self._iprot.readMessageEnd()
+    if result.success is not None:
+      return result.success
+    raise TApplicationException(TApplicationException.MISSING_RESULT, "getOption failed: unknown result");
+
+  def getOptions(self):
+    """
+    Gets all options
+    """
+    self.send_getOptions()
+    return self.recv_getOptions()
+
+  def send_getOptions(self):
+    self._oprot.writeMessageBegin('getOptions', TMessageType.CALL, self._seqid)
+    args = getOptions_args()
+    args.write(self._oprot)
+    self._oprot.writeMessageEnd()
+    self._oprot.trans.flush()
+
+  def recv_getOptions(self):
+    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
+    if mtype == TMessageType.EXCEPTION:
+      x = TApplicationException()
+      x.read(self._iprot)
+      self._iprot.readMessageEnd()
+      raise x
+    result = getOptions_result()
+    result.read(self._iprot)
+    self._iprot.readMessageEnd()
+    if result.success is not None:
+      return result.success
+    raise TApplicationException(TApplicationException.MISSING_RESULT, "getOptions failed: unknown result");
+
+  def getCpuProfile(self, profileDurationInSec):
+    """
+    Returns a CPU profile over the given time interval (client and server
+    must agree on the profile format).
+
+    Parameters:
+     - profileDurationInSec
+    """
+    self.send_getCpuProfile(profileDurationInSec)
+    return self.recv_getCpuProfile()
+
+  def send_getCpuProfile(self, profileDurationInSec):
+    self._oprot.writeMessageBegin('getCpuProfile', TMessageType.CALL, self._seqid)
+    args = getCpuProfile_args()
+    args.profileDurationInSec = profileDurationInSec
+    args.write(self._oprot)
+    self._oprot.writeMessageEnd()
+    self._oprot.trans.flush()
+
+  def recv_getCpuProfile(self):
+    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
+    if mtype == TMessageType.EXCEPTION:
+      x = TApplicationException()
+      x.read(self._iprot)
+      self._iprot.readMessageEnd()
+      raise x
+    result = getCpuProfile_result()
+    result.read(self._iprot)
+    self._iprot.readMessageEnd()
+    if result.success is not None:
+      return result.success
+    raise TApplicationException(TApplicationException.MISSING_RESULT, "getCpuProfile failed: unknown result");
+
+  def aliveSince(self):
+    """
+    Returns the unix time that the server has been running since
+    """
+    self.send_aliveSince()
+    return self.recv_aliveSince()
+
+  def send_aliveSince(self):
+    self._oprot.writeMessageBegin('aliveSince', TMessageType.CALL, self._seqid)
+    args = aliveSince_args()
+    args.write(self._oprot)
+    self._oprot.writeMessageEnd()
+    self._oprot.trans.flush()
+
+  def recv_aliveSince(self):
+    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
+    if mtype == TMessageType.EXCEPTION:
+      x = TApplicationException()
+      x.read(self._iprot)
+      self._iprot.readMessageEnd()
+      raise x
+    result = aliveSince_result()
+    result.read(self._iprot)
+    self._iprot.readMessageEnd()
+    if result.success is not None:
+      return result.success
+    raise TApplicationException(TApplicationException.MISSING_RESULT, "aliveSince failed: unknown result");
+
+  def reinitialize(self):
+    """
+    Tell the server to reload its configuration, reopen log files, etc
+    """
+    self.send_reinitialize()
+
+  def send_reinitialize(self):
+    self._oprot.writeMessageBegin('reinitialize', TMessageType.CALL, self._seqid)
+    args = reinitialize_args()
+    args.write(self._oprot)
+    self._oprot.writeMessageEnd()
+    self._oprot.trans.flush()
+  def shutdown(self):
+    """
+    Suggest a shutdown to the server
+    """
+    self.send_shutdown()
+
+  def send_shutdown(self):
+    self._oprot.writeMessageBegin('shutdown', TMessageType.CALL, self._seqid)
+    args = shutdown_args()
+    args.write(self._oprot)
+    self._oprot.writeMessageEnd()
+    self._oprot.trans.flush()
+
+class Processor(Iface, TProcessor):
+  def __init__(self, handler):
+    self._handler = handler
+    self._processMap = {}
+    self._processMap["getName"] = Processor.process_getName
+    self._processMap["getVersion"] = Processor.process_getVersion
+    self._processMap["getStatus"] = Processor.process_getStatus
+    self._processMap["getStatusDetails"] = Processor.process_getStatusDetails
+    self._processMap["getCounters"] = Processor.process_getCounters
+    self._processMap["getCounter"] = Processor.process_getCounter
+    self._processMap["setOption"] = Processor.process_setOption
+    self._processMap["getOption"] = Processor.process_getOption
+    self._processMap["getOptions"] = Processor.process_getOptions
+    self._processMap["getCpuProfile"] = Processor.process_getCpuProfile
+    self._processMap["aliveSince"] = Processor.process_aliveSince
+    self._processMap["reinitialize"] = Processor.process_reinitialize
+    self._processMap["shutdown"] = Processor.process_shutdown
+
+  def process(self, iprot, oprot):
+    (name, type, seqid) = iprot.readMessageBegin()
+    if name not in self._processMap:
+      iprot.skip(TType.STRUCT)
+      iprot.readMessageEnd()
+      x = TApplicationException(TApplicationException.UNKNOWN_METHOD, 'Unknown function %s' % (name))
+      oprot.writeMessageBegin(name, TMessageType.EXCEPTION, seqid)
+      x.write(oprot)
+      oprot.writeMessageEnd()
+      oprot.trans.flush()
+      return
+    else:
+      self._processMap[name](self, seqid, iprot, oprot)
+    return True
+
+  def process_getName(self, seqid, iprot, oprot):
+    args = getName_args()
+    args.read(iprot)
+    iprot.readMessageEnd()
+    result = getName_result()
+    result.success = self._handler.getName()
+    oprot.writeMessageBegin("getName", TMessageType.REPLY, seqid)
+    result.write(oprot)
+    oprot.writeMessageEnd()
+    oprot.trans.flush()
+
+  def process_getVersion(self, seqid, iprot, oprot):
+    args = getVersion_args()
+    args.read(iprot)
+    iprot.readMessageEnd()
+    result = getVersion_result()
+    result.success = self._handler.getVersion()
+    oprot.writeMessageBegin("getVersion", TMessageType.REPLY, seqid)
+    result.write(oprot)
+    oprot.writeMessageEnd()
+    oprot.trans.flush()
+
+  def process_getStatus(self, seqid, iprot, oprot):
+    args = getStatus_args()
+    args.read(iprot)
+    iprot.readMessageEnd()
+    result = getStatus_result()
+    result.success = self._handler.getStatus()
+    oprot.writeMessageBegin("getStatus", TMessageType.REPLY, seqid)
+    result.write(oprot)
+    oprot.writeMessageEnd()
+    oprot.trans.flush()
+
+  def process_getStatusDetails(self, seqid, iprot, oprot):
+    args = getStatusDetails_args()
+    args.read(iprot)
+    iprot.readMessageEnd()
+    result = getStatusDetails_result()
+    result.success = self._handler.getStatusDetails()
+    oprot.writeMessageBegin("getStatusDetails", TMessageType.REPLY, seqid)
+    result.write(oprot)
+    oprot.writeMessageEnd()
+    oprot.trans.flush()
+
+  def process_getCounters(self, seqid, iprot, oprot):
+    args = getCounters_args()
+    args.read(iprot)
+    iprot.readMessageEnd()
+    result = getCounters_result()
+    result.success = self._handler.getCounters()
+    oprot.writeMessageBegin("getCounters", TMessageType.REPLY, seqid)
+    result.write(oprot)
+    oprot.writeMessageEnd()
+    oprot.trans.flush()
+
+  def process_getCounter(self, seqid, iprot, oprot):
+    args = getCounter_args()
+    args.read(iprot)
+    iprot.readMessageEnd()
+    result = getCounter_result()
+    result.success = self._handler.getCounter(args.key)
+    oprot.writeMessageBegin("getCounter", TMessageType.REPLY, seqid)
+    result.write(oprot)
+    oprot.writeMessageEnd()
+    oprot.trans.flush()
+
+  def process_setOption(self, seqid, iprot, oprot):
+    args = setOption_args()
+    args.read(iprot)
+    iprot.readMessageEnd()
+    result = setOption_result()
+    self._handler.setOption(args.key, args.value)
+    oprot.writeMessageBegin("setOption", TMessageType.REPLY, seqid)
+    result.write(oprot)
+    oprot.writeMessageEnd()
+    oprot.trans.flush()
+
+  def process_getOption(self, seqid, iprot, oprot):
+    args = getOption_args()
+    args.read(iprot)
+    iprot.readMessageEnd()
+    result = getOption_result()
+    result.success = self._handler.getOption(args.key)
+    oprot.writeMessageBegin("getOption", TMessageType.REPLY, seqid)
+    result.write(oprot)
+    oprot.writeMessageEnd()
+    oprot.trans.flush()
+
+  def process_getOptions(self, seqid, iprot, oprot):
+    args = getOptions_args()
+    args.read(iprot)
+    iprot.readMessageEnd()
+    result = getOptions_result()
+    result.success = self._handler.getOptions()
+    oprot.writeMessageBegin("getOptions", TMessageType.REPLY, seqid)
+    result.write(oprot)
+    oprot.writeMessageEnd()
+    oprot.trans.flush()
+
+  def process_getCpuProfile(self, seqid, iprot, oprot):
+    args = getCpuProfile_args()
+    args.read(iprot)
+    iprot.readMessageEnd()
+    result = getCpuProfile_result()
+    result.success = self._handler.getCpuProfile(args.profileDurationInSec)
+    oprot.writeMessageBegin("getCpuProfile", TMessageType.REPLY, seqid)
+    result.write(oprot)
+    oprot.writeMessageEnd()
+    oprot.trans.flush()
+
+  def process_aliveSince(self, seqid, iprot, oprot):
+    args = aliveSince_args()
+    args.read(iprot)
+    iprot.readMessageEnd()
+    result = aliveSince_result()
+    result.success = self._handler.aliveSince()
+    oprot.writeMessageBegin("aliveSince", TMessageType.REPLY, seqid)
+    result.write(oprot)
+    oprot.writeMessageEnd()
+    oprot.trans.flush()
+
+  def process_reinitialize(self, seqid, iprot, oprot):
+    args = reinitialize_args()
+    args.read(iprot)
+    iprot.readMessageEnd()
+    self._handler.reinitialize()
+    return
+
+  def process_shutdown(self, seqid, iprot, oprot):
+    args = shutdown_args()
+    args.read(iprot)
+    iprot.readMessageEnd()
+    self._handler.shutdown()
+    return
+
+
+# HELPER FUNCTIONS AND STRUCTURES
+
+class getName_args(object):
+
+  thrift_spec = (
+  )
+
+  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
+      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('getName_args')
+    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 getName_result(object):
+  """
+  Attributes:
+   - success
+  """
+
+  thrift_spec = (
+    (0, TType.STRING, 'success', None, None, ), # 0
+  )
+
+  def __init__(self, success=None,):
+    self.success = success
+
+  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 == 0:
+        if ftype == TType.STRING:
+          self.success = iprot.readString();
+        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('getName_result')
+    if self.success is not None:
+      oprot.writeFieldBegin('success', TType.STRING, 0)
+      oprot.writeString(self.success)
+      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 getVersion_args(object):
+
+  thrift_spec = (
+  )
+
+  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
+      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('getVersion_args')
+    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 getVersion_result(object):
+  """
+  Attributes:
+   - success
+  """
+
+  thrift_spec = (
+    (0, TType.STRING, 'success', None, None, ), # 0
+  )
+
+  def __init__(self, success=None,):
+    self.success = success
+
+  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 == 0:
+        if ftype == TType.STRING:
+          self.success = iprot.readString();
+        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('getVersion_result')
+    if self.success is not None:
+      oprot.writeFieldBegin('success', TType.STRING, 0)
+      oprot.writeString(self.success)
+      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 getStatus_args(object):
+
+  thrift_spec = (
+  )
+
+  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
+      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('getStatus_args')
+    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 getStatus_result(object):
+  """
+  Attributes:
+   - success
+  """
+
+  thrift_spec = (
+    (0, TType.I32, 'success', None, None, ), # 0
+  )
+
+  def __init__(self, success=None,):
+    self.success = success
+
+  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 == 0:
+        if ftype == TType.I32:
+          self.success = iprot.readI32();
+        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('getStatus_result')
+    if self.success is not None:
+      oprot.writeFieldBegin('success', TType.I32, 0)
+      oprot.writeI32(self.success)
+      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 getStatusDetails_args(object):
+
+  thrift_spec = (
+  )
+
+  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
+      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('getStatusDetails_args')
+    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 getStatusDetails_result(object):
+  """
+  Attributes:
+   - success
+  """
+
+  thrift_spec = (
+    (0, TType.STRING, 'success', None, None, ), # 0
+  )
+
+  def __init__(self, success=None,):
+    self.success = success
+
+  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 == 0:
+        if ftype == TType.STRING:
+          self.success = iprot.readString();
+        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('getStatusDetails_result')
+    if self.success is not None:
+      oprot.writeFieldBegin('success', TType.STRING, 0)
+      oprot.writeString(self.success)
+      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 getCounters_args(object):
+
+  thrift_spec = (
+  )
+
+  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
+      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('getCounters_args')
+    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 getCounters_result(object):
+  """
+  Attributes:
+   - success
+  """
+
+  thrift_spec = (
+    (0, TType.MAP, 'success', (TType.STRING,None,TType.I64,None), None, ), # 0
+  )
+
+  def __init__(self, success=None,):
+    self.success = success
+
+  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 == 0:
+        if ftype == TType.MAP:
+          self.success = {}
+          (_ktype1, _vtype2, _size0 ) = iprot.readMapBegin()
+          for _i4 in xrange(_size0):
+            _key5 = iprot.readString();
+            _val6 = iprot.readI64();
+            self.success[_key5] = _val6
+          iprot.readMapEnd()
+        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('getCounters_result')
+    if self.success is not None:
+      oprot.writeFieldBegin('success', TType.MAP, 0)
+      oprot.writeMapBegin(TType.STRING, TType.I64, len(self.success))
+      for kiter7,viter8 in self.success.items():
+        oprot.writeString(kiter7)
+        oprot.writeI64(viter8)
+      oprot.writeMapEnd()
+      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 getCounter_args(object):
+  """
+  Attributes:
+   - key
+  """
+
+  thrift_spec = (
+    None, # 0
+    (1, TType.STRING, 'key', None, None, ), # 1
+  )
+
+  def __init__(self, key=None,):
+    self.key = key
+
+  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.key = iprot.readString();
+        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('getCounter_args')
+    if self.key is not None:
+      oprot.writeFieldBegin('key', TType.STRING, 1)
+      oprot.writeString(self.key)
+      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 getCounter_result(object):
+  """
+  Attributes:
+   - success
+  """
+
+  thrift_spec = (
+    (0, TType.I64, 'success', None, None, ), # 0
+  )
+
+  def __init__(self, success=None,):
+    self.success = success
+
+  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 == 0:
+        if ftype == TType.I64:
+          self.success = 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('getCounter_result')
+    if self.success is not None:
+      oprot.writeFieldBegin('success', TType.I64, 0)
+      oprot.writeI64(self.success)
+      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 setOption_args(object):
+  """
+  Attributes:
+   - key
+   - value
+  """
+
+  thrift_spec = (
+    None, # 0
+    (1, TType.STRING, 'key', None, None, ), # 1
+    (2, TType.STRING, 'value', None, None, ), # 2
+  )
+
+  def __init__(self, key=None, value=None,):
+    self.key = key
+    self.value = value
+
+  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.key = iprot.readString();
+        else:
+          iprot.skip(ftype)
+      elif fid == 2:
+        if ftype == TType.STRING:
+          self.value = iprot.readString();
+        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('setOption_args')
+    if self.key is not None:
+      oprot.writeFieldBegin('key', TType.STRING, 1)
+      oprot.writeString(self.key)
+      oprot.writeFieldEnd()
+    if self.value is not None:
+      oprot.writeFieldBegin('value', TType.STRING, 2)
+      oprot.writeString(self.value)
+      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 setOption_result(object):
+
+  thrift_spec = (
+  )
+
+  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
+      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('setOption_result')
+    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 getOption_args(object):
+  """
+  Attributes:
+   - key
+  """
+
+  thrift_spec = (
+    None, # 0
+    (1, TType.STRING, 'key', None, None, ), # 1
+  )
+
+  def __init__(self, key=None,):
+    self.key = key
+
+  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.key = iprot.readString();
+        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('getOption_args')
+    if self.key is not None:
+      oprot.writeFieldBegin('key', TType.STRING, 1)
+      oprot.writeString(self.key)
+      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 getOption_result(object):
+  """
+  Attributes:
+   - success
+  """
+
+  thrift_spec = (
+    (0, TType.STRING, 'success', None, None, ), # 0
+  )
+
+  def __init__(self, success=None,):
+    self.success = success
+
+  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 == 0:
+        if ftype == TType.STRING:
+          self.success = iprot.readString();
+        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('getOption_result')
+    if self.success is not None:
+      oprot.writeFieldBegin('success', TType.STRING, 0)
+      oprot.writeString(self.success)
+      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 getOptions_args(object):
+
+  thrift_spec = (
+  )
+
+  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
+      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('getOptions_args')
+    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 getOptions_result(object):
+  """
+  Attributes:
+   - success
+  """
+
+  thrift_spec = (
+    (0, TType.MAP, 'success', (TType.STRING,None,TType.STRING,None), None, ), # 0
+  )
+
+  def __init__(self, success=None,):
+    self.success = success
+
+  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 == 0:
+        if ftype == TType.MAP:
+          self.success = {}
+          (_ktype10, _vtype11, _size9 ) = iprot.readMapBegin()
+          for _i13 in xrange(_size9):
+            _key14 = iprot.readString();
+            _val15 = iprot.readString();
+            self.success[_key14] = _val15
+          iprot.readMapEnd()
+        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('getOptions_result')
+    if self.success is not None:
+      oprot.writeFieldBegin('success', TType.MAP, 0)
+      oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.success))
+      for kiter16,viter17 in self.success.items():
+        oprot.writeString(kiter16)
+        oprot.writeString(viter17)
+      oprot.writeMapEnd()
+      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 getCpuProfile_args(object):
+  """
+  Attributes:
+   - profileDurationInSec
+  """
+
+  thrift_spec = (
+    None, # 0
+    (1, TType.I32, 'profileDurationInSec', None, None, ), # 1
+  )
+
+  def __init__(self, profileDurationInSec=None,):
+    self.profileDurationInSec = profileDurationInSec
+
+  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.I32:
+          self.profileDurationInSec = iprot.readI32();
+        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('getCpuProfile_args')
+    if self.profileDurationInSec is not None:
+      oprot.writeFieldBegin('profileDurationInSec', TType.I32, 1)
+      oprot.writeI32(self.profileDurationInSec)
+      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 getCpuProfile_result(object):
+  """
+  Attributes:
+   - success
+  """
+
+  thrift_spec = (
+    (0, TType.STRING, 'success', None, None, ), # 0
+  )
+
+  def __init__(self, success=None,):
+    self.success = success
+
+  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 == 0:
+        if ftype == TType.STRING:
+          self.success = iprot.readString();
+        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('getCpuProfile_result')
+    if self.success is not None:
+      oprot.writeFieldBegin('success', TType.STRING, 0)
+      oprot.writeString(self.success)
+      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 aliveSince_args(object):
+
+  thrift_spec = (
+  )
+
+  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
+      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('aliveSince_args')
+    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 aliveSince_result(object):
+  """
+  Attributes:
+   - success
+  """
+
+  thrift_spec = (
+    (0, TType.I64, 'success', None, None, ), # 0
+  )
+
+  def __init__(self, success=None,):
+    self.success = success
+
+  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 == 0:
+        if ftype == TType.I64:
+          self.success = 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('aliveSince_result')
+    if self.success is not None:
+      oprot.writeFieldBegin('success', TType.I64, 0)
+      oprot.writeI64(self.success)
+      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 reinitialize_args(object):
+
+  thrift_spec = (
+  )
+
+  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
+      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('reinitialize_args')
+    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 shutdown_args(object):
+
+  thrift_spec = (
+  )
+
+  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
+      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('shutdown_args')
+    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)

+ 1 - 0
desktop/libs/libsentry/gen-py/fb303/__init__.py

@@ -0,0 +1 @@
+__all__ = ['ttypes', 'constants', 'FacebookService']

+ 11 - 0
desktop/libs/libsentry/gen-py/fb303/constants.py

@@ -0,0 +1,11 @@
+#
+# Autogenerated by Thrift Compiler (0.9.1)
+#
+# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+#
+#  options string: py:new_style
+#
+
+from thrift.Thrift import TType, TMessageType, TException, TApplicationException
+from ttypes import *
+

+ 47 - 0
desktop/libs/libsentry/gen-py/fb303/ttypes.py

@@ -0,0 +1,47 @@
+#
+# Autogenerated by Thrift Compiler (0.9.1)
+#
+# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+#
+#  options string: py:new_style
+#
+
+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 fb_status(object):
+  """
+  Common status reporting mechanism across all services
+  """
+  DEAD = 0
+  STARTING = 1
+  ALIVE = 2
+  STOPPING = 3
+  STOPPED = 4
+  WARNING = 5
+
+  _VALUES_TO_NAMES = {
+    0: "DEAD",
+    1: "STARTING",
+    2: "ALIVE",
+    3: "STOPPING",
+    4: "STOPPED",
+    5: "WARNING",
+  }
+
+  _NAMES_TO_VALUES = {
+    "DEAD": 0,
+    "STARTING": 1,
+    "ALIVE": 2,
+    "STOPPING": 3,
+    "STOPPED": 4,
+    "WARNING": 5,
+  }
+

+ 1 - 0
desktop/libs/libsentry/gen-py/sentry_common_service/__init__.py

@@ -0,0 +1 @@
+__all__ = ['ttypes', 'constants']

+ 18 - 0
desktop/libs/libsentry/gen-py/sentry_common_service/constants.py

@@ -0,0 +1,18 @@
+#
+# Autogenerated by Thrift Compiler (0.9.1)
+#
+# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+#
+#  options string: py:new_style
+#
+
+from thrift.Thrift import TType, TMessageType, TException, TApplicationException
+from ttypes import *
+
+TSENTRY_SERVICE_V1 = 1
+TSENTRY_STATUS_OK = 0
+TSENTRY_STATUS_ALREADY_EXISTS = 1
+TSENTRY_STATUS_NO_SUCH_OBJECT = 2
+TSENTRY_STATUS_RUNTIME_ERROR = 3
+TSENTRY_STATUS_INVALID_INPUT = 4
+TSENTRY_STATUS_ACCESS_DENIED = 5

+ 108 - 0
desktop/libs/libsentry/gen-py/sentry_common_service/ttypes.py

@@ -0,0 +1,108 @@
+#
+# Autogenerated by Thrift Compiler (0.9.1)
+#
+# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+#
+#  options string: py:new_style
+#
+
+from thrift.Thrift import TType, TMessageType, TException, TApplicationException
+import fb303.ttypes
+
+
+from thrift.transport import TTransport
+from thrift.protocol import TBinaryProtocol, TProtocol
+try:
+  from thrift.protocol import fastbinary
+except:
+  fastbinary = None
+
+
+
+class TSentryResponseStatus(object):
+  """
+  Attributes:
+   - value
+   - message
+   - stack
+  """
+
+  thrift_spec = (
+    None, # 0
+    (1, TType.I32, 'value', None, None, ), # 1
+    (2, TType.STRING, 'message', None, None, ), # 2
+    (3, TType.STRING, 'stack', None, None, ), # 3
+  )
+
+  def __init__(self, value=None, message=None, stack=None,):
+    self.value = value
+    self.message = message
+    self.stack = stack
+
+  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.I32:
+          self.value = iprot.readI32();
+        else:
+          iprot.skip(ftype)
+      elif fid == 2:
+        if ftype == TType.STRING:
+          self.message = iprot.readString();
+        else:
+          iprot.skip(ftype)
+      elif fid == 3:
+        if ftype == TType.STRING:
+          self.stack = iprot.readString();
+        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('TSentryResponseStatus')
+    if self.value is not None:
+      oprot.writeFieldBegin('value', TType.I32, 1)
+      oprot.writeI32(self.value)
+      oprot.writeFieldEnd()
+    if self.message is not None:
+      oprot.writeFieldBegin('message', TType.STRING, 2)
+      oprot.writeString(self.message)
+      oprot.writeFieldEnd()
+    if self.stack is not None:
+      oprot.writeFieldBegin('stack', TType.STRING, 3)
+      oprot.writeString(self.stack)
+      oprot.writeFieldEnd()
+    oprot.writeFieldStop()
+    oprot.writeStructEnd()
+
+  def validate(self):
+    if self.value is None:
+      raise TProtocol.TProtocolException(message='Required field value is unset!')
+    if self.message is None:
+      raise TProtocol.TProtocolException(message='Required field message is unset!')
+    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)

+ 144 - 0
desktop/libs/libsentry/gen-py/sentry_policy_service/SentryPolicyService-remote

@@ -0,0 +1,144 @@
+#!/usr/bin/env python
+#
+# Autogenerated by Thrift Compiler (0.9.1)
+#
+# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+#
+#  options string: py:new_style
+#
+
+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
+
+from sentry_policy_service import SentryPolicyService
+from sentry_policy_service.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 '  TCreateSentryRoleResponse create_sentry_role(TCreateSentryRoleRequest request)'
+  print '  TDropSentryRoleResponse drop_sentry_role(TDropSentryRoleRequest request)'
+  print '  TAlterSentryRoleGrantPrivilegeResponse alter_sentry_role_grant_privilege(TAlterSentryRoleGrantPrivilegeRequest request)'
+  print '  TAlterSentryRoleRevokePrivilegeResponse alter_sentry_role_revoke_privilege(TAlterSentryRoleRevokePrivilegeRequest request)'
+  print '  TAlterSentryRoleAddGroupsResponse alter_sentry_role_add_groups(TAlterSentryRoleAddGroupsRequest request)'
+  print '  TAlterSentryRoleDeleteGroupsResponse alter_sentry_role_delete_groups(TAlterSentryRoleDeleteGroupsRequest request)'
+  print '  TListSentryRolesResponse list_sentry_roles_by_group(TListSentryRolesRequest request)'
+  print '  TListSentryPrivilegesResponse list_sentry_privileges_by_role(TListSentryPrivilegesRequest request)'
+  print '  TListSentryPrivilegesForProviderResponse list_sentry_privileges_for_provider(TListSentryPrivilegesForProviderRequest request)'
+  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 = SentryPolicyService.Client(protocol)
+transport.open()
+
+if cmd == 'create_sentry_role':
+  if len(args) != 1:
+    print 'create_sentry_role requires 1 args'
+    sys.exit(1)
+  pp.pprint(client.create_sentry_role(eval(args[0]),))
+
+elif cmd == 'drop_sentry_role':
+  if len(args) != 1:
+    print 'drop_sentry_role requires 1 args'
+    sys.exit(1)
+  pp.pprint(client.drop_sentry_role(eval(args[0]),))
+
+elif cmd == 'alter_sentry_role_grant_privilege':
+  if len(args) != 1:
+    print 'alter_sentry_role_grant_privilege requires 1 args'
+    sys.exit(1)
+  pp.pprint(client.alter_sentry_role_grant_privilege(eval(args[0]),))
+
+elif cmd == 'alter_sentry_role_revoke_privilege':
+  if len(args) != 1:
+    print 'alter_sentry_role_revoke_privilege requires 1 args'
+    sys.exit(1)
+  pp.pprint(client.alter_sentry_role_revoke_privilege(eval(args[0]),))
+
+elif cmd == 'alter_sentry_role_add_groups':
+  if len(args) != 1:
+    print 'alter_sentry_role_add_groups requires 1 args'
+    sys.exit(1)
+  pp.pprint(client.alter_sentry_role_add_groups(eval(args[0]),))
+
+elif cmd == 'alter_sentry_role_delete_groups':
+  if len(args) != 1:
+    print 'alter_sentry_role_delete_groups requires 1 args'
+    sys.exit(1)
+  pp.pprint(client.alter_sentry_role_delete_groups(eval(args[0]),))
+
+elif cmd == 'list_sentry_roles_by_group':
+  if len(args) != 1:
+    print 'list_sentry_roles_by_group requires 1 args'
+    sys.exit(1)
+  pp.pprint(client.list_sentry_roles_by_group(eval(args[0]),))
+
+elif cmd == 'list_sentry_privileges_by_role':
+  if len(args) != 1:
+    print 'list_sentry_privileges_by_role requires 1 args'
+    sys.exit(1)
+  pp.pprint(client.list_sentry_privileges_by_role(eval(args[0]),))
+
+elif cmd == 'list_sentry_privileges_for_provider':
+  if len(args) != 1:
+    print 'list_sentry_privileges_for_provider requires 1 args'
+    sys.exit(1)
+  pp.pprint(client.list_sentry_privileges_for_provider(eval(args[0]),))
+
+else:
+  print 'Unrecognized method %s' % cmd
+  sys.exit(1)
+
+transport.close()

+ 1581 - 0
desktop/libs/libsentry/gen-py/sentry_policy_service/SentryPolicyService.py

@@ -0,0 +1,1581 @@
+#
+# Autogenerated by Thrift Compiler (0.9.1)
+#
+# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+#
+#  options string: py:new_style
+#
+
+from thrift.Thrift import TType, TMessageType, TException, TApplicationException
+from ttypes import *
+from thrift.Thrift import TProcessor
+from thrift.transport import TTransport
+from thrift.protocol import TBinaryProtocol, TProtocol
+try:
+  from thrift.protocol import fastbinary
+except:
+  fastbinary = None
+
+
+class Iface(object):
+  def create_sentry_role(self, request):
+    """
+    Parameters:
+     - request
+    """
+    pass
+
+  def drop_sentry_role(self, request):
+    """
+    Parameters:
+     - request
+    """
+    pass
+
+  def alter_sentry_role_grant_privilege(self, request):
+    """
+    Parameters:
+     - request
+    """
+    pass
+
+  def alter_sentry_role_revoke_privilege(self, request):
+    """
+    Parameters:
+     - request
+    """
+    pass
+
+  def alter_sentry_role_add_groups(self, request):
+    """
+    Parameters:
+     - request
+    """
+    pass
+
+  def alter_sentry_role_delete_groups(self, request):
+    """
+    Parameters:
+     - request
+    """
+    pass
+
+  def list_sentry_roles_by_group(self, request):
+    """
+    Parameters:
+     - request
+    """
+    pass
+
+  def list_sentry_privileges_by_role(self, request):
+    """
+    Parameters:
+     - request
+    """
+    pass
+
+  def list_sentry_privileges_for_provider(self, request):
+    """
+    Parameters:
+     - request
+    """
+    pass
+
+
+class Client(Iface):
+  def __init__(self, iprot, oprot=None):
+    self._iprot = self._oprot = iprot
+    if oprot is not None:
+      self._oprot = oprot
+    self._seqid = 0
+
+  def create_sentry_role(self, request):
+    """
+    Parameters:
+     - request
+    """
+    self.send_create_sentry_role(request)
+    return self.recv_create_sentry_role()
+
+  def send_create_sentry_role(self, request):
+    self._oprot.writeMessageBegin('create_sentry_role', TMessageType.CALL, self._seqid)
+    args = create_sentry_role_args()
+    args.request = request
+    args.write(self._oprot)
+    self._oprot.writeMessageEnd()
+    self._oprot.trans.flush()
+
+  def recv_create_sentry_role(self):
+    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
+    if mtype == TMessageType.EXCEPTION:
+      x = TApplicationException()
+      x.read(self._iprot)
+      self._iprot.readMessageEnd()
+      raise x
+    result = create_sentry_role_result()
+    result.read(self._iprot)
+    self._iprot.readMessageEnd()
+    if result.success is not None:
+      return result.success
+    raise TApplicationException(TApplicationException.MISSING_RESULT, "create_sentry_role failed: unknown result");
+
+  def drop_sentry_role(self, request):
+    """
+    Parameters:
+     - request
+    """
+    self.send_drop_sentry_role(request)
+    return self.recv_drop_sentry_role()
+
+  def send_drop_sentry_role(self, request):
+    self._oprot.writeMessageBegin('drop_sentry_role', TMessageType.CALL, self._seqid)
+    args = drop_sentry_role_args()
+    args.request = request
+    args.write(self._oprot)
+    self._oprot.writeMessageEnd()
+    self._oprot.trans.flush()
+
+  def recv_drop_sentry_role(self):
+    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
+    if mtype == TMessageType.EXCEPTION:
+      x = TApplicationException()
+      x.read(self._iprot)
+      self._iprot.readMessageEnd()
+      raise x
+    result = drop_sentry_role_result()
+    result.read(self._iprot)
+    self._iprot.readMessageEnd()
+    if result.success is not None:
+      return result.success
+    raise TApplicationException(TApplicationException.MISSING_RESULT, "drop_sentry_role failed: unknown result");
+
+  def alter_sentry_role_grant_privilege(self, request):
+    """
+    Parameters:
+     - request
+    """
+    self.send_alter_sentry_role_grant_privilege(request)
+    return self.recv_alter_sentry_role_grant_privilege()
+
+  def send_alter_sentry_role_grant_privilege(self, request):
+    self._oprot.writeMessageBegin('alter_sentry_role_grant_privilege', TMessageType.CALL, self._seqid)
+    args = alter_sentry_role_grant_privilege_args()
+    args.request = request
+    args.write(self._oprot)
+    self._oprot.writeMessageEnd()
+    self._oprot.trans.flush()
+
+  def recv_alter_sentry_role_grant_privilege(self):
+    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
+    if mtype == TMessageType.EXCEPTION:
+      x = TApplicationException()
+      x.read(self._iprot)
+      self._iprot.readMessageEnd()
+      raise x
+    result = alter_sentry_role_grant_privilege_result()
+    result.read(self._iprot)
+    self._iprot.readMessageEnd()
+    if result.success is not None:
+      return result.success
+    raise TApplicationException(TApplicationException.MISSING_RESULT, "alter_sentry_role_grant_privilege failed: unknown result");
+
+  def alter_sentry_role_revoke_privilege(self, request):
+    """
+    Parameters:
+     - request
+    """
+    self.send_alter_sentry_role_revoke_privilege(request)
+    return self.recv_alter_sentry_role_revoke_privilege()
+
+  def send_alter_sentry_role_revoke_privilege(self, request):
+    self._oprot.writeMessageBegin('alter_sentry_role_revoke_privilege', TMessageType.CALL, self._seqid)
+    args = alter_sentry_role_revoke_privilege_args()
+    args.request = request
+    args.write(self._oprot)
+    self._oprot.writeMessageEnd()
+    self._oprot.trans.flush()
+
+  def recv_alter_sentry_role_revoke_privilege(self):
+    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
+    if mtype == TMessageType.EXCEPTION:
+      x = TApplicationException()
+      x.read(self._iprot)
+      self._iprot.readMessageEnd()
+      raise x
+    result = alter_sentry_role_revoke_privilege_result()
+    result.read(self._iprot)
+    self._iprot.readMessageEnd()
+    if result.success is not None:
+      return result.success
+    raise TApplicationException(TApplicationException.MISSING_RESULT, "alter_sentry_role_revoke_privilege failed: unknown result");
+
+  def alter_sentry_role_add_groups(self, request):
+    """
+    Parameters:
+     - request
+    """
+    self.send_alter_sentry_role_add_groups(request)
+    return self.recv_alter_sentry_role_add_groups()
+
+  def send_alter_sentry_role_add_groups(self, request):
+    self._oprot.writeMessageBegin('alter_sentry_role_add_groups', TMessageType.CALL, self._seqid)
+    args = alter_sentry_role_add_groups_args()
+    args.request = request
+    args.write(self._oprot)
+    self._oprot.writeMessageEnd()
+    self._oprot.trans.flush()
+
+  def recv_alter_sentry_role_add_groups(self):
+    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
+    if mtype == TMessageType.EXCEPTION:
+      x = TApplicationException()
+      x.read(self._iprot)
+      self._iprot.readMessageEnd()
+      raise x
+    result = alter_sentry_role_add_groups_result()
+    result.read(self._iprot)
+    self._iprot.readMessageEnd()
+    if result.success is not None:
+      return result.success
+    raise TApplicationException(TApplicationException.MISSING_RESULT, "alter_sentry_role_add_groups failed: unknown result");
+
+  def alter_sentry_role_delete_groups(self, request):
+    """
+    Parameters:
+     - request
+    """
+    self.send_alter_sentry_role_delete_groups(request)
+    return self.recv_alter_sentry_role_delete_groups()
+
+  def send_alter_sentry_role_delete_groups(self, request):
+    self._oprot.writeMessageBegin('alter_sentry_role_delete_groups', TMessageType.CALL, self._seqid)
+    args = alter_sentry_role_delete_groups_args()
+    args.request = request
+    args.write(self._oprot)
+    self._oprot.writeMessageEnd()
+    self._oprot.trans.flush()
+
+  def recv_alter_sentry_role_delete_groups(self):
+    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
+    if mtype == TMessageType.EXCEPTION:
+      x = TApplicationException()
+      x.read(self._iprot)
+      self._iprot.readMessageEnd()
+      raise x
+    result = alter_sentry_role_delete_groups_result()
+    result.read(self._iprot)
+    self._iprot.readMessageEnd()
+    if result.success is not None:
+      return result.success
+    raise TApplicationException(TApplicationException.MISSING_RESULT, "alter_sentry_role_delete_groups failed: unknown result");
+
+  def list_sentry_roles_by_group(self, request):
+    """
+    Parameters:
+     - request
+    """
+    self.send_list_sentry_roles_by_group(request)
+    return self.recv_list_sentry_roles_by_group()
+
+  def send_list_sentry_roles_by_group(self, request):
+    self._oprot.writeMessageBegin('list_sentry_roles_by_group', TMessageType.CALL, self._seqid)
+    args = list_sentry_roles_by_group_args()
+    args.request = request
+    args.write(self._oprot)
+    self._oprot.writeMessageEnd()
+    self._oprot.trans.flush()
+
+  def recv_list_sentry_roles_by_group(self):
+    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
+    if mtype == TMessageType.EXCEPTION:
+      x = TApplicationException()
+      x.read(self._iprot)
+      self._iprot.readMessageEnd()
+      raise x
+    result = list_sentry_roles_by_group_result()
+    result.read(self._iprot)
+    self._iprot.readMessageEnd()
+    if result.success is not None:
+      return result.success
+    raise TApplicationException(TApplicationException.MISSING_RESULT, "list_sentry_roles_by_group failed: unknown result");
+
+  def list_sentry_privileges_by_role(self, request):
+    """
+    Parameters:
+     - request
+    """
+    self.send_list_sentry_privileges_by_role(request)
+    return self.recv_list_sentry_privileges_by_role()
+
+  def send_list_sentry_privileges_by_role(self, request):
+    self._oprot.writeMessageBegin('list_sentry_privileges_by_role', TMessageType.CALL, self._seqid)
+    args = list_sentry_privileges_by_role_args()
+    args.request = request
+    args.write(self._oprot)
+    self._oprot.writeMessageEnd()
+    self._oprot.trans.flush()
+
+  def recv_list_sentry_privileges_by_role(self):
+    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
+    if mtype == TMessageType.EXCEPTION:
+      x = TApplicationException()
+      x.read(self._iprot)
+      self._iprot.readMessageEnd()
+      raise x
+    result = list_sentry_privileges_by_role_result()
+    result.read(self._iprot)
+    self._iprot.readMessageEnd()
+    if result.success is not None:
+      return result.success
+    raise TApplicationException(TApplicationException.MISSING_RESULT, "list_sentry_privileges_by_role failed: unknown result");
+
+  def list_sentry_privileges_for_provider(self, request):
+    """
+    Parameters:
+     - request
+    """
+    self.send_list_sentry_privileges_for_provider(request)
+    return self.recv_list_sentry_privileges_for_provider()
+
+  def send_list_sentry_privileges_for_provider(self, request):
+    self._oprot.writeMessageBegin('list_sentry_privileges_for_provider', TMessageType.CALL, self._seqid)
+    args = list_sentry_privileges_for_provider_args()
+    args.request = request
+    args.write(self._oprot)
+    self._oprot.writeMessageEnd()
+    self._oprot.trans.flush()
+
+  def recv_list_sentry_privileges_for_provider(self):
+    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
+    if mtype == TMessageType.EXCEPTION:
+      x = TApplicationException()
+      x.read(self._iprot)
+      self._iprot.readMessageEnd()
+      raise x
+    result = list_sentry_privileges_for_provider_result()
+    result.read(self._iprot)
+    self._iprot.readMessageEnd()
+    if result.success is not None:
+      return result.success
+    raise TApplicationException(TApplicationException.MISSING_RESULT, "list_sentry_privileges_for_provider failed: unknown result");
+
+
+class Processor(Iface, TProcessor):
+  def __init__(self, handler):
+    self._handler = handler
+    self._processMap = {}
+    self._processMap["create_sentry_role"] = Processor.process_create_sentry_role
+    self._processMap["drop_sentry_role"] = Processor.process_drop_sentry_role
+    self._processMap["alter_sentry_role_grant_privilege"] = Processor.process_alter_sentry_role_grant_privilege
+    self._processMap["alter_sentry_role_revoke_privilege"] = Processor.process_alter_sentry_role_revoke_privilege
+    self._processMap["alter_sentry_role_add_groups"] = Processor.process_alter_sentry_role_add_groups
+    self._processMap["alter_sentry_role_delete_groups"] = Processor.process_alter_sentry_role_delete_groups
+    self._processMap["list_sentry_roles_by_group"] = Processor.process_list_sentry_roles_by_group
+    self._processMap["list_sentry_privileges_by_role"] = Processor.process_list_sentry_privileges_by_role
+    self._processMap["list_sentry_privileges_for_provider"] = Processor.process_list_sentry_privileges_for_provider
+
+  def process(self, iprot, oprot):
+    (name, type, seqid) = iprot.readMessageBegin()
+    if name not in self._processMap:
+      iprot.skip(TType.STRUCT)
+      iprot.readMessageEnd()
+      x = TApplicationException(TApplicationException.UNKNOWN_METHOD, 'Unknown function %s' % (name))
+      oprot.writeMessageBegin(name, TMessageType.EXCEPTION, seqid)
+      x.write(oprot)
+      oprot.writeMessageEnd()
+      oprot.trans.flush()
+      return
+    else:
+      self._processMap[name](self, seqid, iprot, oprot)
+    return True
+
+  def process_create_sentry_role(self, seqid, iprot, oprot):
+    args = create_sentry_role_args()
+    args.read(iprot)
+    iprot.readMessageEnd()
+    result = create_sentry_role_result()
+    result.success = self._handler.create_sentry_role(args.request)
+    oprot.writeMessageBegin("create_sentry_role", TMessageType.REPLY, seqid)
+    result.write(oprot)
+    oprot.writeMessageEnd()
+    oprot.trans.flush()
+
+  def process_drop_sentry_role(self, seqid, iprot, oprot):
+    args = drop_sentry_role_args()
+    args.read(iprot)
+    iprot.readMessageEnd()
+    result = drop_sentry_role_result()
+    result.success = self._handler.drop_sentry_role(args.request)
+    oprot.writeMessageBegin("drop_sentry_role", TMessageType.REPLY, seqid)
+    result.write(oprot)
+    oprot.writeMessageEnd()
+    oprot.trans.flush()
+
+  def process_alter_sentry_role_grant_privilege(self, seqid, iprot, oprot):
+    args = alter_sentry_role_grant_privilege_args()
+    args.read(iprot)
+    iprot.readMessageEnd()
+    result = alter_sentry_role_grant_privilege_result()
+    result.success = self._handler.alter_sentry_role_grant_privilege(args.request)
+    oprot.writeMessageBegin("alter_sentry_role_grant_privilege", TMessageType.REPLY, seqid)
+    result.write(oprot)
+    oprot.writeMessageEnd()
+    oprot.trans.flush()
+
+  def process_alter_sentry_role_revoke_privilege(self, seqid, iprot, oprot):
+    args = alter_sentry_role_revoke_privilege_args()
+    args.read(iprot)
+    iprot.readMessageEnd()
+    result = alter_sentry_role_revoke_privilege_result()
+    result.success = self._handler.alter_sentry_role_revoke_privilege(args.request)
+    oprot.writeMessageBegin("alter_sentry_role_revoke_privilege", TMessageType.REPLY, seqid)
+    result.write(oprot)
+    oprot.writeMessageEnd()
+    oprot.trans.flush()
+
+  def process_alter_sentry_role_add_groups(self, seqid, iprot, oprot):
+    args = alter_sentry_role_add_groups_args()
+    args.read(iprot)
+    iprot.readMessageEnd()
+    result = alter_sentry_role_add_groups_result()
+    result.success = self._handler.alter_sentry_role_add_groups(args.request)
+    oprot.writeMessageBegin("alter_sentry_role_add_groups", TMessageType.REPLY, seqid)
+    result.write(oprot)
+    oprot.writeMessageEnd()
+    oprot.trans.flush()
+
+  def process_alter_sentry_role_delete_groups(self, seqid, iprot, oprot):
+    args = alter_sentry_role_delete_groups_args()
+    args.read(iprot)
+    iprot.readMessageEnd()
+    result = alter_sentry_role_delete_groups_result()
+    result.success = self._handler.alter_sentry_role_delete_groups(args.request)
+    oprot.writeMessageBegin("alter_sentry_role_delete_groups", TMessageType.REPLY, seqid)
+    result.write(oprot)
+    oprot.writeMessageEnd()
+    oprot.trans.flush()
+
+  def process_list_sentry_roles_by_group(self, seqid, iprot, oprot):
+    args = list_sentry_roles_by_group_args()
+    args.read(iprot)
+    iprot.readMessageEnd()
+    result = list_sentry_roles_by_group_result()
+    result.success = self._handler.list_sentry_roles_by_group(args.request)
+    oprot.writeMessageBegin("list_sentry_roles_by_group", TMessageType.REPLY, seqid)
+    result.write(oprot)
+    oprot.writeMessageEnd()
+    oprot.trans.flush()
+
+  def process_list_sentry_privileges_by_role(self, seqid, iprot, oprot):
+    args = list_sentry_privileges_by_role_args()
+    args.read(iprot)
+    iprot.readMessageEnd()
+    result = list_sentry_privileges_by_role_result()
+    result.success = self._handler.list_sentry_privileges_by_role(args.request)
+    oprot.writeMessageBegin("list_sentry_privileges_by_role", TMessageType.REPLY, seqid)
+    result.write(oprot)
+    oprot.writeMessageEnd()
+    oprot.trans.flush()
+
+  def process_list_sentry_privileges_for_provider(self, seqid, iprot, oprot):
+    args = list_sentry_privileges_for_provider_args()
+    args.read(iprot)
+    iprot.readMessageEnd()
+    result = list_sentry_privileges_for_provider_result()
+    result.success = self._handler.list_sentry_privileges_for_provider(args.request)
+    oprot.writeMessageBegin("list_sentry_privileges_for_provider", TMessageType.REPLY, seqid)
+    result.write(oprot)
+    oprot.writeMessageEnd()
+    oprot.trans.flush()
+
+
+# HELPER FUNCTIONS AND STRUCTURES
+
+class create_sentry_role_args(object):
+  """
+  Attributes:
+   - request
+  """
+
+  thrift_spec = (
+    None, # 0
+    (1, TType.STRUCT, 'request', (TCreateSentryRoleRequest, TCreateSentryRoleRequest.thrift_spec), None, ), # 1
+  )
+
+  def __init__(self, request=None,):
+    self.request = request
+
+  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.STRUCT:
+          self.request = TCreateSentryRoleRequest()
+          self.request.read(iprot)
+        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('create_sentry_role_args')
+    if self.request is not None:
+      oprot.writeFieldBegin('request', TType.STRUCT, 1)
+      self.request.write(oprot)
+      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 create_sentry_role_result(object):
+  """
+  Attributes:
+   - success
+  """
+
+  thrift_spec = (
+    (0, TType.STRUCT, 'success', (TCreateSentryRoleResponse, TCreateSentryRoleResponse.thrift_spec), None, ), # 0
+  )
+
+  def __init__(self, success=None,):
+    self.success = success
+
+  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 == 0:
+        if ftype == TType.STRUCT:
+          self.success = TCreateSentryRoleResponse()
+          self.success.read(iprot)
+        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('create_sentry_role_result')
+    if self.success is not None:
+      oprot.writeFieldBegin('success', TType.STRUCT, 0)
+      self.success.write(oprot)
+      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 drop_sentry_role_args(object):
+  """
+  Attributes:
+   - request
+  """
+
+  thrift_spec = (
+    None, # 0
+    (1, TType.STRUCT, 'request', (TDropSentryRoleRequest, TDropSentryRoleRequest.thrift_spec), None, ), # 1
+  )
+
+  def __init__(self, request=None,):
+    self.request = request
+
+  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.STRUCT:
+          self.request = TDropSentryRoleRequest()
+          self.request.read(iprot)
+        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('drop_sentry_role_args')
+    if self.request is not None:
+      oprot.writeFieldBegin('request', TType.STRUCT, 1)
+      self.request.write(oprot)
+      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 drop_sentry_role_result(object):
+  """
+  Attributes:
+   - success
+  """
+
+  thrift_spec = (
+    (0, TType.STRUCT, 'success', (TDropSentryRoleResponse, TDropSentryRoleResponse.thrift_spec), None, ), # 0
+  )
+
+  def __init__(self, success=None,):
+    self.success = success
+
+  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 == 0:
+        if ftype == TType.STRUCT:
+          self.success = TDropSentryRoleResponse()
+          self.success.read(iprot)
+        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('drop_sentry_role_result')
+    if self.success is not None:
+      oprot.writeFieldBegin('success', TType.STRUCT, 0)
+      self.success.write(oprot)
+      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 alter_sentry_role_grant_privilege_args(object):
+  """
+  Attributes:
+   - request
+  """
+
+  thrift_spec = (
+    None, # 0
+    (1, TType.STRUCT, 'request', (TAlterSentryRoleGrantPrivilegeRequest, TAlterSentryRoleGrantPrivilegeRequest.thrift_spec), None, ), # 1
+  )
+
+  def __init__(self, request=None,):
+    self.request = request
+
+  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.STRUCT:
+          self.request = TAlterSentryRoleGrantPrivilegeRequest()
+          self.request.read(iprot)
+        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('alter_sentry_role_grant_privilege_args')
+    if self.request is not None:
+      oprot.writeFieldBegin('request', TType.STRUCT, 1)
+      self.request.write(oprot)
+      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 alter_sentry_role_grant_privilege_result(object):
+  """
+  Attributes:
+   - success
+  """
+
+  thrift_spec = (
+    (0, TType.STRUCT, 'success', (TAlterSentryRoleGrantPrivilegeResponse, TAlterSentryRoleGrantPrivilegeResponse.thrift_spec), None, ), # 0
+  )
+
+  def __init__(self, success=None,):
+    self.success = success
+
+  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 == 0:
+        if ftype == TType.STRUCT:
+          self.success = TAlterSentryRoleGrantPrivilegeResponse()
+          self.success.read(iprot)
+        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('alter_sentry_role_grant_privilege_result')
+    if self.success is not None:
+      oprot.writeFieldBegin('success', TType.STRUCT, 0)
+      self.success.write(oprot)
+      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 alter_sentry_role_revoke_privilege_args(object):
+  """
+  Attributes:
+   - request
+  """
+
+  thrift_spec = (
+    None, # 0
+    (1, TType.STRUCT, 'request', (TAlterSentryRoleRevokePrivilegeRequest, TAlterSentryRoleRevokePrivilegeRequest.thrift_spec), None, ), # 1
+  )
+
+  def __init__(self, request=None,):
+    self.request = request
+
+  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.STRUCT:
+          self.request = TAlterSentryRoleRevokePrivilegeRequest()
+          self.request.read(iprot)
+        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('alter_sentry_role_revoke_privilege_args')
+    if self.request is not None:
+      oprot.writeFieldBegin('request', TType.STRUCT, 1)
+      self.request.write(oprot)
+      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 alter_sentry_role_revoke_privilege_result(object):
+  """
+  Attributes:
+   - success
+  """
+
+  thrift_spec = (
+    (0, TType.STRUCT, 'success', (TAlterSentryRoleRevokePrivilegeResponse, TAlterSentryRoleRevokePrivilegeResponse.thrift_spec), None, ), # 0
+  )
+
+  def __init__(self, success=None,):
+    self.success = success
+
+  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 == 0:
+        if ftype == TType.STRUCT:
+          self.success = TAlterSentryRoleRevokePrivilegeResponse()
+          self.success.read(iprot)
+        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('alter_sentry_role_revoke_privilege_result')
+    if self.success is not None:
+      oprot.writeFieldBegin('success', TType.STRUCT, 0)
+      self.success.write(oprot)
+      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 alter_sentry_role_add_groups_args(object):
+  """
+  Attributes:
+   - request
+  """
+
+  thrift_spec = (
+    None, # 0
+    (1, TType.STRUCT, 'request', (TAlterSentryRoleAddGroupsRequest, TAlterSentryRoleAddGroupsRequest.thrift_spec), None, ), # 1
+  )
+
+  def __init__(self, request=None,):
+    self.request = request
+
+  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.STRUCT:
+          self.request = TAlterSentryRoleAddGroupsRequest()
+          self.request.read(iprot)
+        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('alter_sentry_role_add_groups_args')
+    if self.request is not None:
+      oprot.writeFieldBegin('request', TType.STRUCT, 1)
+      self.request.write(oprot)
+      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 alter_sentry_role_add_groups_result(object):
+  """
+  Attributes:
+   - success
+  """
+
+  thrift_spec = (
+    (0, TType.STRUCT, 'success', (TAlterSentryRoleAddGroupsResponse, TAlterSentryRoleAddGroupsResponse.thrift_spec), None, ), # 0
+  )
+
+  def __init__(self, success=None,):
+    self.success = success
+
+  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 == 0:
+        if ftype == TType.STRUCT:
+          self.success = TAlterSentryRoleAddGroupsResponse()
+          self.success.read(iprot)
+        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('alter_sentry_role_add_groups_result')
+    if self.success is not None:
+      oprot.writeFieldBegin('success', TType.STRUCT, 0)
+      self.success.write(oprot)
+      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 alter_sentry_role_delete_groups_args(object):
+  """
+  Attributes:
+   - request
+  """
+
+  thrift_spec = (
+    None, # 0
+    (1, TType.STRUCT, 'request', (TAlterSentryRoleDeleteGroupsRequest, TAlterSentryRoleDeleteGroupsRequest.thrift_spec), None, ), # 1
+  )
+
+  def __init__(self, request=None,):
+    self.request = request
+
+  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.STRUCT:
+          self.request = TAlterSentryRoleDeleteGroupsRequest()
+          self.request.read(iprot)
+        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('alter_sentry_role_delete_groups_args')
+    if self.request is not None:
+      oprot.writeFieldBegin('request', TType.STRUCT, 1)
+      self.request.write(oprot)
+      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 alter_sentry_role_delete_groups_result(object):
+  """
+  Attributes:
+   - success
+  """
+
+  thrift_spec = (
+    (0, TType.STRUCT, 'success', (TAlterSentryRoleDeleteGroupsResponse, TAlterSentryRoleDeleteGroupsResponse.thrift_spec), None, ), # 0
+  )
+
+  def __init__(self, success=None,):
+    self.success = success
+
+  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 == 0:
+        if ftype == TType.STRUCT:
+          self.success = TAlterSentryRoleDeleteGroupsResponse()
+          self.success.read(iprot)
+        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('alter_sentry_role_delete_groups_result')
+    if self.success is not None:
+      oprot.writeFieldBegin('success', TType.STRUCT, 0)
+      self.success.write(oprot)
+      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 list_sentry_roles_by_group_args(object):
+  """
+  Attributes:
+   - request
+  """
+
+  thrift_spec = (
+    None, # 0
+    (1, TType.STRUCT, 'request', (TListSentryRolesRequest, TListSentryRolesRequest.thrift_spec), None, ), # 1
+  )
+
+  def __init__(self, request=None,):
+    self.request = request
+
+  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.STRUCT:
+          self.request = TListSentryRolesRequest()
+          self.request.read(iprot)
+        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('list_sentry_roles_by_group_args')
+    if self.request is not None:
+      oprot.writeFieldBegin('request', TType.STRUCT, 1)
+      self.request.write(oprot)
+      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 list_sentry_roles_by_group_result(object):
+  """
+  Attributes:
+   - success
+  """
+
+  thrift_spec = (
+    (0, TType.STRUCT, 'success', (TListSentryRolesResponse, TListSentryRolesResponse.thrift_spec), None, ), # 0
+  )
+
+  def __init__(self, success=None,):
+    self.success = success
+
+  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 == 0:
+        if ftype == TType.STRUCT:
+          self.success = TListSentryRolesResponse()
+          self.success.read(iprot)
+        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('list_sentry_roles_by_group_result')
+    if self.success is not None:
+      oprot.writeFieldBegin('success', TType.STRUCT, 0)
+      self.success.write(oprot)
+      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 list_sentry_privileges_by_role_args(object):
+  """
+  Attributes:
+   - request
+  """
+
+  thrift_spec = (
+    None, # 0
+    (1, TType.STRUCT, 'request', (TListSentryPrivilegesRequest, TListSentryPrivilegesRequest.thrift_spec), None, ), # 1
+  )
+
+  def __init__(self, request=None,):
+    self.request = request
+
+  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.STRUCT:
+          self.request = TListSentryPrivilegesRequest()
+          self.request.read(iprot)
+        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('list_sentry_privileges_by_role_args')
+    if self.request is not None:
+      oprot.writeFieldBegin('request', TType.STRUCT, 1)
+      self.request.write(oprot)
+      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 list_sentry_privileges_by_role_result(object):
+  """
+  Attributes:
+   - success
+  """
+
+  thrift_spec = (
+    (0, TType.STRUCT, 'success', (TListSentryPrivilegesResponse, TListSentryPrivilegesResponse.thrift_spec), None, ), # 0
+  )
+
+  def __init__(self, success=None,):
+    self.success = success
+
+  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 == 0:
+        if ftype == TType.STRUCT:
+          self.success = TListSentryPrivilegesResponse()
+          self.success.read(iprot)
+        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('list_sentry_privileges_by_role_result')
+    if self.success is not None:
+      oprot.writeFieldBegin('success', TType.STRUCT, 0)
+      self.success.write(oprot)
+      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 list_sentry_privileges_for_provider_args(object):
+  """
+  Attributes:
+   - request
+  """
+
+  thrift_spec = (
+    None, # 0
+    (1, TType.STRUCT, 'request', (TListSentryPrivilegesForProviderRequest, TListSentryPrivilegesForProviderRequest.thrift_spec), None, ), # 1
+  )
+
+  def __init__(self, request=None,):
+    self.request = request
+
+  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.STRUCT:
+          self.request = TListSentryPrivilegesForProviderRequest()
+          self.request.read(iprot)
+        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('list_sentry_privileges_for_provider_args')
+    if self.request is not None:
+      oprot.writeFieldBegin('request', TType.STRUCT, 1)
+      self.request.write(oprot)
+      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 list_sentry_privileges_for_provider_result(object):
+  """
+  Attributes:
+   - success
+  """
+
+  thrift_spec = (
+    (0, TType.STRUCT, 'success', (TListSentryPrivilegesForProviderResponse, TListSentryPrivilegesForProviderResponse.thrift_spec), None, ), # 0
+  )
+
+  def __init__(self, success=None,):
+    self.success = success
+
+  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 == 0:
+        if ftype == TType.STRUCT:
+          self.success = TListSentryPrivilegesForProviderResponse()
+          self.success.read(iprot)
+        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('list_sentry_privileges_for_provider_result')
+    if self.success is not None:
+      oprot.writeFieldBegin('success', TType.STRUCT, 0)
+      self.success.write(oprot)
+      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)

+ 1 - 0
desktop/libs/libsentry/gen-py/sentry_policy_service/__init__.py

@@ -0,0 +1 @@
+__all__ = ['ttypes', 'constants', 'SentryPolicyService']

+ 11 - 0
desktop/libs/libsentry/gen-py/sentry_policy_service/constants.py

@@ -0,0 +1,11 @@
+#
+# Autogenerated by Thrift Compiler (0.9.1)
+#
+# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+#
+#  options string: py:new_style
+#
+
+from thrift.Thrift import TType, TMessageType, TException, TApplicationException
+from ttypes import *
+

+ 2132 - 0
desktop/libs/libsentry/gen-py/sentry_policy_service/ttypes.py

@@ -0,0 +1,2132 @@
+#
+# Autogenerated by Thrift Compiler (0.9.1)
+#
+# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+#
+#  options string: py:new_style
+#
+
+from thrift.Thrift import TType, TMessageType, TException, TApplicationException
+import fb303.ttypes
+import sentry_common_service.ttypes
+
+
+from thrift.transport import TTransport
+from thrift.protocol import TBinaryProtocol, TProtocol
+try:
+  from thrift.protocol import fastbinary
+except:
+  fastbinary = None
+
+
+
+class TSentryPrivilege(object):
+  """
+  Attributes:
+   - privilegeScope
+   - privilegeName
+   - serverName
+   - dbName
+   - tableName
+   - URI
+   - action
+   - createTime
+   - grantorPrincipal
+  """
+
+  thrift_spec = (
+    None, # 0
+    (1, TType.STRING, 'privilegeScope', None, None, ), # 1
+    (2, TType.STRING, 'privilegeName', None, None, ), # 2
+    (3, TType.STRING, 'serverName', None, None, ), # 3
+    (4, TType.STRING, 'dbName', None, None, ), # 4
+    (5, TType.STRING, 'tableName', None, None, ), # 5
+    (6, TType.STRING, 'URI', None, None, ), # 6
+    (7, TType.STRING, 'action', None, None, ), # 7
+    (8, TType.I64, 'createTime', None, None, ), # 8
+    (9, TType.STRING, 'grantorPrincipal', None, None, ), # 9
+  )
+
+  def __init__(self, privilegeScope=None, privilegeName=None, serverName=None, dbName=None, tableName=None, URI=None, action=None, createTime=None, grantorPrincipal=None,):
+    self.privilegeScope = privilegeScope
+    self.privilegeName = privilegeName
+    self.serverName = serverName
+    self.dbName = dbName
+    self.tableName = tableName
+    self.URI = URI
+    self.action = action
+    self.createTime = createTime
+    self.grantorPrincipal = grantorPrincipal
+
+  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.privilegeScope = iprot.readString();
+        else:
+          iprot.skip(ftype)
+      elif fid == 2:
+        if ftype == TType.STRING:
+          self.privilegeName = iprot.readString();
+        else:
+          iprot.skip(ftype)
+      elif fid == 3:
+        if ftype == TType.STRING:
+          self.serverName = iprot.readString();
+        else:
+          iprot.skip(ftype)
+      elif fid == 4:
+        if ftype == TType.STRING:
+          self.dbName = iprot.readString();
+        else:
+          iprot.skip(ftype)
+      elif fid == 5:
+        if ftype == TType.STRING:
+          self.tableName = iprot.readString();
+        else:
+          iprot.skip(ftype)
+      elif fid == 6:
+        if ftype == TType.STRING:
+          self.URI = iprot.readString();
+        else:
+          iprot.skip(ftype)
+      elif fid == 7:
+        if ftype == TType.STRING:
+          self.action = iprot.readString();
+        else:
+          iprot.skip(ftype)
+      elif fid == 8:
+        if ftype == TType.I64:
+          self.createTime = iprot.readI64();
+        else:
+          iprot.skip(ftype)
+      elif fid == 9:
+        if ftype == TType.STRING:
+          self.grantorPrincipal = iprot.readString();
+        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('TSentryPrivilege')
+    if self.privilegeScope is not None:
+      oprot.writeFieldBegin('privilegeScope', TType.STRING, 1)
+      oprot.writeString(self.privilegeScope)
+      oprot.writeFieldEnd()
+    if self.privilegeName is not None:
+      oprot.writeFieldBegin('privilegeName', TType.STRING, 2)
+      oprot.writeString(self.privilegeName)
+      oprot.writeFieldEnd()
+    if self.serverName is not None:
+      oprot.writeFieldBegin('serverName', TType.STRING, 3)
+      oprot.writeString(self.serverName)
+      oprot.writeFieldEnd()
+    if self.dbName is not None:
+      oprot.writeFieldBegin('dbName', TType.STRING, 4)
+      oprot.writeString(self.dbName)
+      oprot.writeFieldEnd()
+    if self.tableName is not None:
+      oprot.writeFieldBegin('tableName', TType.STRING, 5)
+      oprot.writeString(self.tableName)
+      oprot.writeFieldEnd()
+    if self.URI is not None:
+      oprot.writeFieldBegin('URI', TType.STRING, 6)
+      oprot.writeString(self.URI)
+      oprot.writeFieldEnd()
+    if self.action is not None:
+      oprot.writeFieldBegin('action', TType.STRING, 7)
+      oprot.writeString(self.action)
+      oprot.writeFieldEnd()
+    if self.createTime is not None:
+      oprot.writeFieldBegin('createTime', TType.I64, 8)
+      oprot.writeI64(self.createTime)
+      oprot.writeFieldEnd()
+    if self.grantorPrincipal is not None:
+      oprot.writeFieldBegin('grantorPrincipal', TType.STRING, 9)
+      oprot.writeString(self.grantorPrincipal)
+      oprot.writeFieldEnd()
+    oprot.writeFieldStop()
+    oprot.writeStructEnd()
+
+  def validate(self):
+    if self.privilegeScope is None:
+      raise TProtocol.TProtocolException(message='Required field privilegeScope is unset!')
+    if self.serverName is None:
+      raise TProtocol.TProtocolException(message='Required field serverName is unset!')
+    if self.action is None:
+      raise TProtocol.TProtocolException(message='Required field action is unset!')
+    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 TSentryGroup(object):
+  """
+  Attributes:
+   - groupName
+  """
+
+  thrift_spec = (
+    None, # 0
+    (1, TType.STRING, 'groupName', None, None, ), # 1
+  )
+
+  def __init__(self, groupName=None,):
+    self.groupName = groupName
+
+  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.groupName = iprot.readString();
+        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('TSentryGroup')
+    if self.groupName is not None:
+      oprot.writeFieldBegin('groupName', TType.STRING, 1)
+      oprot.writeString(self.groupName)
+      oprot.writeFieldEnd()
+    oprot.writeFieldStop()
+    oprot.writeStructEnd()
+
+  def validate(self):
+    if self.groupName is None:
+      raise TProtocol.TProtocolException(message='Required field groupName is unset!')
+    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 TCreateSentryRoleRequest(object):
+  """
+  Attributes:
+   - protocol_version
+   - requestorUserName
+   - requestorGroupNames
+   - roleName
+  """
+
+  thrift_spec = (
+    None, # 0
+    (1, TType.I32, 'protocol_version', None, 1, ), # 1
+    (2, TType.STRING, 'requestorUserName', None, None, ), # 2
+    (3, TType.SET, 'requestorGroupNames', (TType.STRING,None), None, ), # 3
+    (4, TType.STRING, 'roleName', None, None, ), # 4
+  )
+
+  def __init__(self, protocol_version=thrift_spec[1][4], requestorUserName=None, requestorGroupNames=None, roleName=None,):
+    self.protocol_version = protocol_version
+    self.requestorUserName = requestorUserName
+    self.requestorGroupNames = requestorGroupNames
+    self.roleName = roleName
+
+  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.I32:
+          self.protocol_version = iprot.readI32();
+        else:
+          iprot.skip(ftype)
+      elif fid == 2:
+        if ftype == TType.STRING:
+          self.requestorUserName = iprot.readString();
+        else:
+          iprot.skip(ftype)
+      elif fid == 3:
+        if ftype == TType.SET:
+          self.requestorGroupNames = set()
+          (_etype3, _size0) = iprot.readSetBegin()
+          for _i4 in xrange(_size0):
+            _elem5 = iprot.readString();
+            self.requestorGroupNames.add(_elem5)
+          iprot.readSetEnd()
+        else:
+          iprot.skip(ftype)
+      elif fid == 4:
+        if ftype == TType.STRING:
+          self.roleName = iprot.readString();
+        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('TCreateSentryRoleRequest')
+    if self.protocol_version is not None:
+      oprot.writeFieldBegin('protocol_version', TType.I32, 1)
+      oprot.writeI32(self.protocol_version)
+      oprot.writeFieldEnd()
+    if self.requestorUserName is not None:
+      oprot.writeFieldBegin('requestorUserName', TType.STRING, 2)
+      oprot.writeString(self.requestorUserName)
+      oprot.writeFieldEnd()
+    if self.requestorGroupNames is not None:
+      oprot.writeFieldBegin('requestorGroupNames', TType.SET, 3)
+      oprot.writeSetBegin(TType.STRING, len(self.requestorGroupNames))
+      for iter6 in self.requestorGroupNames:
+        oprot.writeString(iter6)
+      oprot.writeSetEnd()
+      oprot.writeFieldEnd()
+    if self.roleName is not None:
+      oprot.writeFieldBegin('roleName', TType.STRING, 4)
+      oprot.writeString(self.roleName)
+      oprot.writeFieldEnd()
+    oprot.writeFieldStop()
+    oprot.writeStructEnd()
+
+  def validate(self):
+    if self.protocol_version is None:
+      raise TProtocol.TProtocolException(message='Required field protocol_version is unset!')
+    if self.requestorUserName is None:
+      raise TProtocol.TProtocolException(message='Required field requestorUserName is unset!')
+    if self.requestorGroupNames is None:
+      raise TProtocol.TProtocolException(message='Required field requestorGroupNames is unset!')
+    if self.roleName is None:
+      raise TProtocol.TProtocolException(message='Required field roleName is unset!')
+    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 TCreateSentryRoleResponse(object):
+  """
+  Attributes:
+   - status
+  """
+
+  thrift_spec = (
+    None, # 0
+    (1, TType.STRUCT, 'status', (sentry_common_service.ttypes.TSentryResponseStatus, sentry_common_service.ttypes.TSentryResponseStatus.thrift_spec), None, ), # 1
+  )
+
+  def __init__(self, status=None,):
+    self.status = status
+
+  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.STRUCT:
+          self.status = sentry_common_service.ttypes.TSentryResponseStatus()
+          self.status.read(iprot)
+        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('TCreateSentryRoleResponse')
+    if self.status is not None:
+      oprot.writeFieldBegin('status', TType.STRUCT, 1)
+      self.status.write(oprot)
+      oprot.writeFieldEnd()
+    oprot.writeFieldStop()
+    oprot.writeStructEnd()
+
+  def validate(self):
+    if self.status is None:
+      raise TProtocol.TProtocolException(message='Required field status is unset!')
+    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 TDropSentryRoleRequest(object):
+  """
+  Attributes:
+   - protocol_version
+   - requestorUserName
+   - requestorGroupNames
+   - roleName
+  """
+
+  thrift_spec = (
+    None, # 0
+    (1, TType.I32, 'protocol_version', None, 1, ), # 1
+    (2, TType.STRING, 'requestorUserName', None, None, ), # 2
+    (3, TType.SET, 'requestorGroupNames', (TType.STRING,None), None, ), # 3
+    (4, TType.STRING, 'roleName', None, None, ), # 4
+  )
+
+  def __init__(self, protocol_version=thrift_spec[1][4], requestorUserName=None, requestorGroupNames=None, roleName=None,):
+    self.protocol_version = protocol_version
+    self.requestorUserName = requestorUserName
+    self.requestorGroupNames = requestorGroupNames
+    self.roleName = roleName
+
+  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.I32:
+          self.protocol_version = iprot.readI32();
+        else:
+          iprot.skip(ftype)
+      elif fid == 2:
+        if ftype == TType.STRING:
+          self.requestorUserName = iprot.readString();
+        else:
+          iprot.skip(ftype)
+      elif fid == 3:
+        if ftype == TType.SET:
+          self.requestorGroupNames = set()
+          (_etype10, _size7) = iprot.readSetBegin()
+          for _i11 in xrange(_size7):
+            _elem12 = iprot.readString();
+            self.requestorGroupNames.add(_elem12)
+          iprot.readSetEnd()
+        else:
+          iprot.skip(ftype)
+      elif fid == 4:
+        if ftype == TType.STRING:
+          self.roleName = iprot.readString();
+        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('TDropSentryRoleRequest')
+    if self.protocol_version is not None:
+      oprot.writeFieldBegin('protocol_version', TType.I32, 1)
+      oprot.writeI32(self.protocol_version)
+      oprot.writeFieldEnd()
+    if self.requestorUserName is not None:
+      oprot.writeFieldBegin('requestorUserName', TType.STRING, 2)
+      oprot.writeString(self.requestorUserName)
+      oprot.writeFieldEnd()
+    if self.requestorGroupNames is not None:
+      oprot.writeFieldBegin('requestorGroupNames', TType.SET, 3)
+      oprot.writeSetBegin(TType.STRING, len(self.requestorGroupNames))
+      for iter13 in self.requestorGroupNames:
+        oprot.writeString(iter13)
+      oprot.writeSetEnd()
+      oprot.writeFieldEnd()
+    if self.roleName is not None:
+      oprot.writeFieldBegin('roleName', TType.STRING, 4)
+      oprot.writeString(self.roleName)
+      oprot.writeFieldEnd()
+    oprot.writeFieldStop()
+    oprot.writeStructEnd()
+
+  def validate(self):
+    if self.protocol_version is None:
+      raise TProtocol.TProtocolException(message='Required field protocol_version is unset!')
+    if self.requestorUserName is None:
+      raise TProtocol.TProtocolException(message='Required field requestorUserName is unset!')
+    if self.requestorGroupNames is None:
+      raise TProtocol.TProtocolException(message='Required field requestorGroupNames is unset!')
+    if self.roleName is None:
+      raise TProtocol.TProtocolException(message='Required field roleName is unset!')
+    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 TDropSentryRoleResponse(object):
+  """
+  Attributes:
+   - status
+  """
+
+  thrift_spec = (
+    None, # 0
+    (1, TType.STRUCT, 'status', (sentry_common_service.ttypes.TSentryResponseStatus, sentry_common_service.ttypes.TSentryResponseStatus.thrift_spec), None, ), # 1
+  )
+
+  def __init__(self, status=None,):
+    self.status = status
+
+  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.STRUCT:
+          self.status = sentry_common_service.ttypes.TSentryResponseStatus()
+          self.status.read(iprot)
+        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('TDropSentryRoleResponse')
+    if self.status is not None:
+      oprot.writeFieldBegin('status', TType.STRUCT, 1)
+      self.status.write(oprot)
+      oprot.writeFieldEnd()
+    oprot.writeFieldStop()
+    oprot.writeStructEnd()
+
+  def validate(self):
+    if self.status is None:
+      raise TProtocol.TProtocolException(message='Required field status is unset!')
+    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 TAlterSentryRoleAddGroupsRequest(object):
+  """
+  Attributes:
+   - protocol_version
+   - requestorUserName
+   - requestorGroupNames
+   - roleName
+   - groups
+  """
+
+  thrift_spec = (
+    None, # 0
+    (1, TType.I32, 'protocol_version', None, 1, ), # 1
+    (2, TType.STRING, 'requestorUserName', None, None, ), # 2
+    (3, TType.SET, 'requestorGroupNames', (TType.STRING,None), None, ), # 3
+    (4, TType.STRING, 'roleName', None, None, ), # 4
+    (5, TType.SET, 'groups', (TType.STRUCT,(TSentryGroup, TSentryGroup.thrift_spec)), None, ), # 5
+  )
+
+  def __init__(self, protocol_version=thrift_spec[1][4], requestorUserName=None, requestorGroupNames=None, roleName=None, groups=None,):
+    self.protocol_version = protocol_version
+    self.requestorUserName = requestorUserName
+    self.requestorGroupNames = requestorGroupNames
+    self.roleName = roleName
+    self.groups = groups
+
+  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.I32:
+          self.protocol_version = iprot.readI32();
+        else:
+          iprot.skip(ftype)
+      elif fid == 2:
+        if ftype == TType.STRING:
+          self.requestorUserName = iprot.readString();
+        else:
+          iprot.skip(ftype)
+      elif fid == 3:
+        if ftype == TType.SET:
+          self.requestorGroupNames = set()
+          (_etype17, _size14) = iprot.readSetBegin()
+          for _i18 in xrange(_size14):
+            _elem19 = iprot.readString();
+            self.requestorGroupNames.add(_elem19)
+          iprot.readSetEnd()
+        else:
+          iprot.skip(ftype)
+      elif fid == 4:
+        if ftype == TType.STRING:
+          self.roleName = iprot.readString();
+        else:
+          iprot.skip(ftype)
+      elif fid == 5:
+        if ftype == TType.SET:
+          self.groups = set()
+          (_etype23, _size20) = iprot.readSetBegin()
+          for _i24 in xrange(_size20):
+            _elem25 = TSentryGroup()
+            _elem25.read(iprot)
+            self.groups.add(_elem25)
+          iprot.readSetEnd()
+        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('TAlterSentryRoleAddGroupsRequest')
+    if self.protocol_version is not None:
+      oprot.writeFieldBegin('protocol_version', TType.I32, 1)
+      oprot.writeI32(self.protocol_version)
+      oprot.writeFieldEnd()
+    if self.requestorUserName is not None:
+      oprot.writeFieldBegin('requestorUserName', TType.STRING, 2)
+      oprot.writeString(self.requestorUserName)
+      oprot.writeFieldEnd()
+    if self.requestorGroupNames is not None:
+      oprot.writeFieldBegin('requestorGroupNames', TType.SET, 3)
+      oprot.writeSetBegin(TType.STRING, len(self.requestorGroupNames))
+      for iter26 in self.requestorGroupNames:
+        oprot.writeString(iter26)
+      oprot.writeSetEnd()
+      oprot.writeFieldEnd()
+    if self.roleName is not None:
+      oprot.writeFieldBegin('roleName', TType.STRING, 4)
+      oprot.writeString(self.roleName)
+      oprot.writeFieldEnd()
+    if self.groups is not None:
+      oprot.writeFieldBegin('groups', TType.SET, 5)
+      oprot.writeSetBegin(TType.STRUCT, len(self.groups))
+      for iter27 in self.groups:
+        iter27.write(oprot)
+      oprot.writeSetEnd()
+      oprot.writeFieldEnd()
+    oprot.writeFieldStop()
+    oprot.writeStructEnd()
+
+  def validate(self):
+    if self.protocol_version is None:
+      raise TProtocol.TProtocolException(message='Required field protocol_version is unset!')
+    if self.requestorUserName is None:
+      raise TProtocol.TProtocolException(message='Required field requestorUserName is unset!')
+    if self.requestorGroupNames is None:
+      raise TProtocol.TProtocolException(message='Required field requestorGroupNames is unset!')
+    if self.roleName is None:
+      raise TProtocol.TProtocolException(message='Required field roleName is unset!')
+    if self.groups is None:
+      raise TProtocol.TProtocolException(message='Required field groups is unset!')
+    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 TAlterSentryRoleAddGroupsResponse(object):
+  """
+  Attributes:
+   - status
+  """
+
+  thrift_spec = (
+    None, # 0
+    (1, TType.STRUCT, 'status', (sentry_common_service.ttypes.TSentryResponseStatus, sentry_common_service.ttypes.TSentryResponseStatus.thrift_spec), None, ), # 1
+  )
+
+  def __init__(self, status=None,):
+    self.status = status
+
+  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.STRUCT:
+          self.status = sentry_common_service.ttypes.TSentryResponseStatus()
+          self.status.read(iprot)
+        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('TAlterSentryRoleAddGroupsResponse')
+    if self.status is not None:
+      oprot.writeFieldBegin('status', TType.STRUCT, 1)
+      self.status.write(oprot)
+      oprot.writeFieldEnd()
+    oprot.writeFieldStop()
+    oprot.writeStructEnd()
+
+  def validate(self):
+    if self.status is None:
+      raise TProtocol.TProtocolException(message='Required field status is unset!')
+    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 TAlterSentryRoleDeleteGroupsRequest(object):
+  """
+  Attributes:
+   - protocol_version
+   - requestorUserName
+   - requestorGroupNames
+   - roleName
+   - groups
+  """
+
+  thrift_spec = (
+    None, # 0
+    (1, TType.I32, 'protocol_version', None, 1, ), # 1
+    (2, TType.STRING, 'requestorUserName', None, None, ), # 2
+    (3, TType.SET, 'requestorGroupNames', (TType.STRING,None), None, ), # 3
+    (4, TType.STRING, 'roleName', None, None, ), # 4
+    (5, TType.SET, 'groups', (TType.STRUCT,(TSentryGroup, TSentryGroup.thrift_spec)), None, ), # 5
+  )
+
+  def __init__(self, protocol_version=thrift_spec[1][4], requestorUserName=None, requestorGroupNames=None, roleName=None, groups=None,):
+    self.protocol_version = protocol_version
+    self.requestorUserName = requestorUserName
+    self.requestorGroupNames = requestorGroupNames
+    self.roleName = roleName
+    self.groups = groups
+
+  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.I32:
+          self.protocol_version = iprot.readI32();
+        else:
+          iprot.skip(ftype)
+      elif fid == 2:
+        if ftype == TType.STRING:
+          self.requestorUserName = iprot.readString();
+        else:
+          iprot.skip(ftype)
+      elif fid == 3:
+        if ftype == TType.SET:
+          self.requestorGroupNames = set()
+          (_etype31, _size28) = iprot.readSetBegin()
+          for _i32 in xrange(_size28):
+            _elem33 = iprot.readString();
+            self.requestorGroupNames.add(_elem33)
+          iprot.readSetEnd()
+        else:
+          iprot.skip(ftype)
+      elif fid == 4:
+        if ftype == TType.STRING:
+          self.roleName = iprot.readString();
+        else:
+          iprot.skip(ftype)
+      elif fid == 5:
+        if ftype == TType.SET:
+          self.groups = set()
+          (_etype37, _size34) = iprot.readSetBegin()
+          for _i38 in xrange(_size34):
+            _elem39 = TSentryGroup()
+            _elem39.read(iprot)
+            self.groups.add(_elem39)
+          iprot.readSetEnd()
+        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('TAlterSentryRoleDeleteGroupsRequest')
+    if self.protocol_version is not None:
+      oprot.writeFieldBegin('protocol_version', TType.I32, 1)
+      oprot.writeI32(self.protocol_version)
+      oprot.writeFieldEnd()
+    if self.requestorUserName is not None:
+      oprot.writeFieldBegin('requestorUserName', TType.STRING, 2)
+      oprot.writeString(self.requestorUserName)
+      oprot.writeFieldEnd()
+    if self.requestorGroupNames is not None:
+      oprot.writeFieldBegin('requestorGroupNames', TType.SET, 3)
+      oprot.writeSetBegin(TType.STRING, len(self.requestorGroupNames))
+      for iter40 in self.requestorGroupNames:
+        oprot.writeString(iter40)
+      oprot.writeSetEnd()
+      oprot.writeFieldEnd()
+    if self.roleName is not None:
+      oprot.writeFieldBegin('roleName', TType.STRING, 4)
+      oprot.writeString(self.roleName)
+      oprot.writeFieldEnd()
+    if self.groups is not None:
+      oprot.writeFieldBegin('groups', TType.SET, 5)
+      oprot.writeSetBegin(TType.STRUCT, len(self.groups))
+      for iter41 in self.groups:
+        iter41.write(oprot)
+      oprot.writeSetEnd()
+      oprot.writeFieldEnd()
+    oprot.writeFieldStop()
+    oprot.writeStructEnd()
+
+  def validate(self):
+    if self.protocol_version is None:
+      raise TProtocol.TProtocolException(message='Required field protocol_version is unset!')
+    if self.requestorUserName is None:
+      raise TProtocol.TProtocolException(message='Required field requestorUserName is unset!')
+    if self.requestorGroupNames is None:
+      raise TProtocol.TProtocolException(message='Required field requestorGroupNames is unset!')
+    if self.roleName is None:
+      raise TProtocol.TProtocolException(message='Required field roleName is unset!')
+    if self.groups is None:
+      raise TProtocol.TProtocolException(message='Required field groups is unset!')
+    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 TAlterSentryRoleDeleteGroupsResponse(object):
+  """
+  Attributes:
+   - status
+  """
+
+  thrift_spec = (
+    None, # 0
+    (1, TType.STRUCT, 'status', (sentry_common_service.ttypes.TSentryResponseStatus, sentry_common_service.ttypes.TSentryResponseStatus.thrift_spec), None, ), # 1
+  )
+
+  def __init__(self, status=None,):
+    self.status = status
+
+  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.STRUCT:
+          self.status = sentry_common_service.ttypes.TSentryResponseStatus()
+          self.status.read(iprot)
+        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('TAlterSentryRoleDeleteGroupsResponse')
+    if self.status is not None:
+      oprot.writeFieldBegin('status', TType.STRUCT, 1)
+      self.status.write(oprot)
+      oprot.writeFieldEnd()
+    oprot.writeFieldStop()
+    oprot.writeStructEnd()
+
+  def validate(self):
+    if self.status is None:
+      raise TProtocol.TProtocolException(message='Required field status is unset!')
+    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 TAlterSentryRoleGrantPrivilegeRequest(object):
+  """
+  Attributes:
+   - protocol_version
+   - requestorUserName
+   - requestorGroupNames
+   - roleName
+   - privilege
+  """
+
+  thrift_spec = (
+    None, # 0
+    (1, TType.I32, 'protocol_version', None, 1, ), # 1
+    (2, TType.STRING, 'requestorUserName', None, None, ), # 2
+    (3, TType.SET, 'requestorGroupNames', (TType.STRING,None), None, ), # 3
+    (4, TType.STRING, 'roleName', None, None, ), # 4
+    (5, TType.STRUCT, 'privilege', (TSentryPrivilege, TSentryPrivilege.thrift_spec), None, ), # 5
+  )
+
+  def __init__(self, protocol_version=thrift_spec[1][4], requestorUserName=None, requestorGroupNames=None, roleName=None, privilege=None,):
+    self.protocol_version = protocol_version
+    self.requestorUserName = requestorUserName
+    self.requestorGroupNames = requestorGroupNames
+    self.roleName = roleName
+    self.privilege = privilege
+
+  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.I32:
+          self.protocol_version = iprot.readI32();
+        else:
+          iprot.skip(ftype)
+      elif fid == 2:
+        if ftype == TType.STRING:
+          self.requestorUserName = iprot.readString();
+        else:
+          iprot.skip(ftype)
+      elif fid == 3:
+        if ftype == TType.SET:
+          self.requestorGroupNames = set()
+          (_etype45, _size42) = iprot.readSetBegin()
+          for _i46 in xrange(_size42):
+            _elem47 = iprot.readString();
+            self.requestorGroupNames.add(_elem47)
+          iprot.readSetEnd()
+        else:
+          iprot.skip(ftype)
+      elif fid == 4:
+        if ftype == TType.STRING:
+          self.roleName = iprot.readString();
+        else:
+          iprot.skip(ftype)
+      elif fid == 5:
+        if ftype == TType.STRUCT:
+          self.privilege = TSentryPrivilege()
+          self.privilege.read(iprot)
+        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('TAlterSentryRoleGrantPrivilegeRequest')
+    if self.protocol_version is not None:
+      oprot.writeFieldBegin('protocol_version', TType.I32, 1)
+      oprot.writeI32(self.protocol_version)
+      oprot.writeFieldEnd()
+    if self.requestorUserName is not None:
+      oprot.writeFieldBegin('requestorUserName', TType.STRING, 2)
+      oprot.writeString(self.requestorUserName)
+      oprot.writeFieldEnd()
+    if self.requestorGroupNames is not None:
+      oprot.writeFieldBegin('requestorGroupNames', TType.SET, 3)
+      oprot.writeSetBegin(TType.STRING, len(self.requestorGroupNames))
+      for iter48 in self.requestorGroupNames:
+        oprot.writeString(iter48)
+      oprot.writeSetEnd()
+      oprot.writeFieldEnd()
+    if self.roleName is not None:
+      oprot.writeFieldBegin('roleName', TType.STRING, 4)
+      oprot.writeString(self.roleName)
+      oprot.writeFieldEnd()
+    if self.privilege is not None:
+      oprot.writeFieldBegin('privilege', TType.STRUCT, 5)
+      self.privilege.write(oprot)
+      oprot.writeFieldEnd()
+    oprot.writeFieldStop()
+    oprot.writeStructEnd()
+
+  def validate(self):
+    if self.protocol_version is None:
+      raise TProtocol.TProtocolException(message='Required field protocol_version is unset!')
+    if self.requestorUserName is None:
+      raise TProtocol.TProtocolException(message='Required field requestorUserName is unset!')
+    if self.requestorGroupNames is None:
+      raise TProtocol.TProtocolException(message='Required field requestorGroupNames is unset!')
+    if self.roleName is None:
+      raise TProtocol.TProtocolException(message='Required field roleName is unset!')
+    if self.privilege is None:
+      raise TProtocol.TProtocolException(message='Required field privilege is unset!')
+    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 TAlterSentryRoleGrantPrivilegeResponse(object):
+  """
+  Attributes:
+   - status
+  """
+
+  thrift_spec = (
+    None, # 0
+    (1, TType.STRUCT, 'status', (sentry_common_service.ttypes.TSentryResponseStatus, sentry_common_service.ttypes.TSentryResponseStatus.thrift_spec), None, ), # 1
+  )
+
+  def __init__(self, status=None,):
+    self.status = status
+
+  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.STRUCT:
+          self.status = sentry_common_service.ttypes.TSentryResponseStatus()
+          self.status.read(iprot)
+        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('TAlterSentryRoleGrantPrivilegeResponse')
+    if self.status is not None:
+      oprot.writeFieldBegin('status', TType.STRUCT, 1)
+      self.status.write(oprot)
+      oprot.writeFieldEnd()
+    oprot.writeFieldStop()
+    oprot.writeStructEnd()
+
+  def validate(self):
+    if self.status is None:
+      raise TProtocol.TProtocolException(message='Required field status is unset!')
+    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 TAlterSentryRoleRevokePrivilegeRequest(object):
+  """
+  Attributes:
+   - protocol_version
+   - requestorUserName
+   - requestorGroupNames
+   - roleName
+   - privilege
+  """
+
+  thrift_spec = (
+    None, # 0
+    (1, TType.I32, 'protocol_version', None, 1, ), # 1
+    (2, TType.STRING, 'requestorUserName', None, None, ), # 2
+    (3, TType.SET, 'requestorGroupNames', (TType.STRING,None), None, ), # 3
+    (4, TType.STRING, 'roleName', None, None, ), # 4
+    (5, TType.STRUCT, 'privilege', (TSentryPrivilege, TSentryPrivilege.thrift_spec), None, ), # 5
+  )
+
+  def __init__(self, protocol_version=thrift_spec[1][4], requestorUserName=None, requestorGroupNames=None, roleName=None, privilege=None,):
+    self.protocol_version = protocol_version
+    self.requestorUserName = requestorUserName
+    self.requestorGroupNames = requestorGroupNames
+    self.roleName = roleName
+    self.privilege = privilege
+
+  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.I32:
+          self.protocol_version = iprot.readI32();
+        else:
+          iprot.skip(ftype)
+      elif fid == 2:
+        if ftype == TType.STRING:
+          self.requestorUserName = iprot.readString();
+        else:
+          iprot.skip(ftype)
+      elif fid == 3:
+        if ftype == TType.SET:
+          self.requestorGroupNames = set()
+          (_etype52, _size49) = iprot.readSetBegin()
+          for _i53 in xrange(_size49):
+            _elem54 = iprot.readString();
+            self.requestorGroupNames.add(_elem54)
+          iprot.readSetEnd()
+        else:
+          iprot.skip(ftype)
+      elif fid == 4:
+        if ftype == TType.STRING:
+          self.roleName = iprot.readString();
+        else:
+          iprot.skip(ftype)
+      elif fid == 5:
+        if ftype == TType.STRUCT:
+          self.privilege = TSentryPrivilege()
+          self.privilege.read(iprot)
+        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('TAlterSentryRoleRevokePrivilegeRequest')
+    if self.protocol_version is not None:
+      oprot.writeFieldBegin('protocol_version', TType.I32, 1)
+      oprot.writeI32(self.protocol_version)
+      oprot.writeFieldEnd()
+    if self.requestorUserName is not None:
+      oprot.writeFieldBegin('requestorUserName', TType.STRING, 2)
+      oprot.writeString(self.requestorUserName)
+      oprot.writeFieldEnd()
+    if self.requestorGroupNames is not None:
+      oprot.writeFieldBegin('requestorGroupNames', TType.SET, 3)
+      oprot.writeSetBegin(TType.STRING, len(self.requestorGroupNames))
+      for iter55 in self.requestorGroupNames:
+        oprot.writeString(iter55)
+      oprot.writeSetEnd()
+      oprot.writeFieldEnd()
+    if self.roleName is not None:
+      oprot.writeFieldBegin('roleName', TType.STRING, 4)
+      oprot.writeString(self.roleName)
+      oprot.writeFieldEnd()
+    if self.privilege is not None:
+      oprot.writeFieldBegin('privilege', TType.STRUCT, 5)
+      self.privilege.write(oprot)
+      oprot.writeFieldEnd()
+    oprot.writeFieldStop()
+    oprot.writeStructEnd()
+
+  def validate(self):
+    if self.protocol_version is None:
+      raise TProtocol.TProtocolException(message='Required field protocol_version is unset!')
+    if self.requestorUserName is None:
+      raise TProtocol.TProtocolException(message='Required field requestorUserName is unset!')
+    if self.requestorGroupNames is None:
+      raise TProtocol.TProtocolException(message='Required field requestorGroupNames is unset!')
+    if self.roleName is None:
+      raise TProtocol.TProtocolException(message='Required field roleName is unset!')
+    if self.privilege is None:
+      raise TProtocol.TProtocolException(message='Required field privilege is unset!')
+    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 TAlterSentryRoleRevokePrivilegeResponse(object):
+  """
+  Attributes:
+   - status
+  """
+
+  thrift_spec = (
+    None, # 0
+    (1, TType.STRUCT, 'status', (sentry_common_service.ttypes.TSentryResponseStatus, sentry_common_service.ttypes.TSentryResponseStatus.thrift_spec), None, ), # 1
+  )
+
+  def __init__(self, status=None,):
+    self.status = status
+
+  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.STRUCT:
+          self.status = sentry_common_service.ttypes.TSentryResponseStatus()
+          self.status.read(iprot)
+        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('TAlterSentryRoleRevokePrivilegeResponse')
+    if self.status is not None:
+      oprot.writeFieldBegin('status', TType.STRUCT, 1)
+      self.status.write(oprot)
+      oprot.writeFieldEnd()
+    oprot.writeFieldStop()
+    oprot.writeStructEnd()
+
+  def validate(self):
+    if self.status is None:
+      raise TProtocol.TProtocolException(message='Required field status is unset!')
+    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 TListSentryRolesRequest(object):
+  """
+  Attributes:
+   - protocol_version
+   - requestorUserName
+   - requestorGroupNames
+   - groupName
+  """
+
+  thrift_spec = (
+    None, # 0
+    (1, TType.I32, 'protocol_version', None, 1, ), # 1
+    (2, TType.STRING, 'requestorUserName', None, None, ), # 2
+    (3, TType.SET, 'requestorGroupNames', (TType.STRING,None), None, ), # 3
+    (4, TType.STRING, 'groupName', None, None, ), # 4
+  )
+
+  def __init__(self, protocol_version=thrift_spec[1][4], requestorUserName=None, requestorGroupNames=None, groupName=None,):
+    self.protocol_version = protocol_version
+    self.requestorUserName = requestorUserName
+    self.requestorGroupNames = requestorGroupNames
+    self.groupName = groupName
+
+  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.I32:
+          self.protocol_version = iprot.readI32();
+        else:
+          iprot.skip(ftype)
+      elif fid == 2:
+        if ftype == TType.STRING:
+          self.requestorUserName = iprot.readString();
+        else:
+          iprot.skip(ftype)
+      elif fid == 3:
+        if ftype == TType.SET:
+          self.requestorGroupNames = set()
+          (_etype59, _size56) = iprot.readSetBegin()
+          for _i60 in xrange(_size56):
+            _elem61 = iprot.readString();
+            self.requestorGroupNames.add(_elem61)
+          iprot.readSetEnd()
+        else:
+          iprot.skip(ftype)
+      elif fid == 4:
+        if ftype == TType.STRING:
+          self.groupName = iprot.readString();
+        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('TListSentryRolesRequest')
+    if self.protocol_version is not None:
+      oprot.writeFieldBegin('protocol_version', TType.I32, 1)
+      oprot.writeI32(self.protocol_version)
+      oprot.writeFieldEnd()
+    if self.requestorUserName is not None:
+      oprot.writeFieldBegin('requestorUserName', TType.STRING, 2)
+      oprot.writeString(self.requestorUserName)
+      oprot.writeFieldEnd()
+    if self.requestorGroupNames is not None:
+      oprot.writeFieldBegin('requestorGroupNames', TType.SET, 3)
+      oprot.writeSetBegin(TType.STRING, len(self.requestorGroupNames))
+      for iter62 in self.requestorGroupNames:
+        oprot.writeString(iter62)
+      oprot.writeSetEnd()
+      oprot.writeFieldEnd()
+    if self.groupName is not None:
+      oprot.writeFieldBegin('groupName', TType.STRING, 4)
+      oprot.writeString(self.groupName)
+      oprot.writeFieldEnd()
+    oprot.writeFieldStop()
+    oprot.writeStructEnd()
+
+  def validate(self):
+    if self.protocol_version is None:
+      raise TProtocol.TProtocolException(message='Required field protocol_version is unset!')
+    if self.requestorUserName is None:
+      raise TProtocol.TProtocolException(message='Required field requestorUserName is unset!')
+    if self.requestorGroupNames is None:
+      raise TProtocol.TProtocolException(message='Required field requestorGroupNames is unset!')
+    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 TSentryRole(object):
+  """
+  Attributes:
+   - roleName
+   - groups
+   - grantorPrincipal
+  """
+
+  thrift_spec = (
+    None, # 0
+    (1, TType.STRING, 'roleName', None, None, ), # 1
+    (2, TType.SET, 'groups', (TType.STRUCT,(TSentryGroup, TSentryGroup.thrift_spec)), None, ), # 2
+    (3, TType.STRING, 'grantorPrincipal', None, None, ), # 3
+  )
+
+  def __init__(self, roleName=None, groups=None, grantorPrincipal=None,):
+    self.roleName = roleName
+    self.groups = groups
+    self.grantorPrincipal = grantorPrincipal
+
+  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.roleName = iprot.readString();
+        else:
+          iprot.skip(ftype)
+      elif fid == 2:
+        if ftype == TType.SET:
+          self.groups = set()
+          (_etype66, _size63) = iprot.readSetBegin()
+          for _i67 in xrange(_size63):
+            _elem68 = TSentryGroup()
+            _elem68.read(iprot)
+            self.groups.add(_elem68)
+          iprot.readSetEnd()
+        else:
+          iprot.skip(ftype)
+      elif fid == 3:
+        if ftype == TType.STRING:
+          self.grantorPrincipal = iprot.readString();
+        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('TSentryRole')
+    if self.roleName is not None:
+      oprot.writeFieldBegin('roleName', TType.STRING, 1)
+      oprot.writeString(self.roleName)
+      oprot.writeFieldEnd()
+    if self.groups is not None:
+      oprot.writeFieldBegin('groups', TType.SET, 2)
+      oprot.writeSetBegin(TType.STRUCT, len(self.groups))
+      for iter69 in self.groups:
+        iter69.write(oprot)
+      oprot.writeSetEnd()
+      oprot.writeFieldEnd()
+    if self.grantorPrincipal is not None:
+      oprot.writeFieldBegin('grantorPrincipal', TType.STRING, 3)
+      oprot.writeString(self.grantorPrincipal)
+      oprot.writeFieldEnd()
+    oprot.writeFieldStop()
+    oprot.writeStructEnd()
+
+  def validate(self):
+    if self.roleName is None:
+      raise TProtocol.TProtocolException(message='Required field roleName is unset!')
+    if self.groups is None:
+      raise TProtocol.TProtocolException(message='Required field groups is unset!')
+    if self.grantorPrincipal is None:
+      raise TProtocol.TProtocolException(message='Required field grantorPrincipal is unset!')
+    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 TListSentryRolesResponse(object):
+  """
+  Attributes:
+   - status
+   - roles
+  """
+
+  thrift_spec = (
+    None, # 0
+    (1, TType.STRUCT, 'status', (sentry_common_service.ttypes.TSentryResponseStatus, sentry_common_service.ttypes.TSentryResponseStatus.thrift_spec), None, ), # 1
+    (2, TType.SET, 'roles', (TType.STRUCT,(TSentryRole, TSentryRole.thrift_spec)), None, ), # 2
+  )
+
+  def __init__(self, status=None, roles=None,):
+    self.status = status
+    self.roles = roles
+
+  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.STRUCT:
+          self.status = sentry_common_service.ttypes.TSentryResponseStatus()
+          self.status.read(iprot)
+        else:
+          iprot.skip(ftype)
+      elif fid == 2:
+        if ftype == TType.SET:
+          self.roles = set()
+          (_etype73, _size70) = iprot.readSetBegin()
+          for _i74 in xrange(_size70):
+            _elem75 = TSentryRole()
+            _elem75.read(iprot)
+            self.roles.add(_elem75)
+          iprot.readSetEnd()
+        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('TListSentryRolesResponse')
+    if self.status is not None:
+      oprot.writeFieldBegin('status', TType.STRUCT, 1)
+      self.status.write(oprot)
+      oprot.writeFieldEnd()
+    if self.roles is not None:
+      oprot.writeFieldBegin('roles', TType.SET, 2)
+      oprot.writeSetBegin(TType.STRUCT, len(self.roles))
+      for iter76 in self.roles:
+        iter76.write(oprot)
+      oprot.writeSetEnd()
+      oprot.writeFieldEnd()
+    oprot.writeFieldStop()
+    oprot.writeStructEnd()
+
+  def validate(self):
+    if self.status is None:
+      raise TProtocol.TProtocolException(message='Required field status is unset!')
+    if self.roles is None:
+      raise TProtocol.TProtocolException(message='Required field roles is unset!')
+    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 TListSentryPrivilegesRequest(object):
+  """
+  Attributes:
+   - protocol_version
+   - requestorUserName
+   - requestorGroupNames
+   - roleName
+  """
+
+  thrift_spec = (
+    None, # 0
+    (1, TType.I32, 'protocol_version', None, 1, ), # 1
+    (2, TType.STRING, 'requestorUserName', None, None, ), # 2
+    (3, TType.SET, 'requestorGroupNames', (TType.STRING,None), None, ), # 3
+    (4, TType.STRING, 'roleName', None, None, ), # 4
+  )
+
+  def __init__(self, protocol_version=thrift_spec[1][4], requestorUserName=None, requestorGroupNames=None, roleName=None,):
+    self.protocol_version = protocol_version
+    self.requestorUserName = requestorUserName
+    self.requestorGroupNames = requestorGroupNames
+    self.roleName = roleName
+
+  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.I32:
+          self.protocol_version = iprot.readI32();
+        else:
+          iprot.skip(ftype)
+      elif fid == 2:
+        if ftype == TType.STRING:
+          self.requestorUserName = iprot.readString();
+        else:
+          iprot.skip(ftype)
+      elif fid == 3:
+        if ftype == TType.SET:
+          self.requestorGroupNames = set()
+          (_etype80, _size77) = iprot.readSetBegin()
+          for _i81 in xrange(_size77):
+            _elem82 = iprot.readString();
+            self.requestorGroupNames.add(_elem82)
+          iprot.readSetEnd()
+        else:
+          iprot.skip(ftype)
+      elif fid == 4:
+        if ftype == TType.STRING:
+          self.roleName = iprot.readString();
+        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('TListSentryPrivilegesRequest')
+    if self.protocol_version is not None:
+      oprot.writeFieldBegin('protocol_version', TType.I32, 1)
+      oprot.writeI32(self.protocol_version)
+      oprot.writeFieldEnd()
+    if self.requestorUserName is not None:
+      oprot.writeFieldBegin('requestorUserName', TType.STRING, 2)
+      oprot.writeString(self.requestorUserName)
+      oprot.writeFieldEnd()
+    if self.requestorGroupNames is not None:
+      oprot.writeFieldBegin('requestorGroupNames', TType.SET, 3)
+      oprot.writeSetBegin(TType.STRING, len(self.requestorGroupNames))
+      for iter83 in self.requestorGroupNames:
+        oprot.writeString(iter83)
+      oprot.writeSetEnd()
+      oprot.writeFieldEnd()
+    if self.roleName is not None:
+      oprot.writeFieldBegin('roleName', TType.STRING, 4)
+      oprot.writeString(self.roleName)
+      oprot.writeFieldEnd()
+    oprot.writeFieldStop()
+    oprot.writeStructEnd()
+
+  def validate(self):
+    if self.protocol_version is None:
+      raise TProtocol.TProtocolException(message='Required field protocol_version is unset!')
+    if self.requestorUserName is None:
+      raise TProtocol.TProtocolException(message='Required field requestorUserName is unset!')
+    if self.requestorGroupNames is None:
+      raise TProtocol.TProtocolException(message='Required field requestorGroupNames is unset!')
+    if self.roleName is None:
+      raise TProtocol.TProtocolException(message='Required field roleName is unset!')
+    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 TListSentryPrivilegesResponse(object):
+  """
+  Attributes:
+   - status
+   - privileges
+  """
+
+  thrift_spec = (
+    None, # 0
+    (1, TType.STRUCT, 'status', (sentry_common_service.ttypes.TSentryResponseStatus, sentry_common_service.ttypes.TSentryResponseStatus.thrift_spec), None, ), # 1
+    (2, TType.SET, 'privileges', (TType.STRUCT,(TSentryPrivilege, TSentryPrivilege.thrift_spec)), None, ), # 2
+  )
+
+  def __init__(self, status=None, privileges=None,):
+    self.status = status
+    self.privileges = privileges
+
+  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.STRUCT:
+          self.status = sentry_common_service.ttypes.TSentryResponseStatus()
+          self.status.read(iprot)
+        else:
+          iprot.skip(ftype)
+      elif fid == 2:
+        if ftype == TType.SET:
+          self.privileges = set()
+          (_etype87, _size84) = iprot.readSetBegin()
+          for _i88 in xrange(_size84):
+            _elem89 = TSentryPrivilege()
+            _elem89.read(iprot)
+            self.privileges.add(_elem89)
+          iprot.readSetEnd()
+        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('TListSentryPrivilegesResponse')
+    if self.status is not None:
+      oprot.writeFieldBegin('status', TType.STRUCT, 1)
+      self.status.write(oprot)
+      oprot.writeFieldEnd()
+    if self.privileges is not None:
+      oprot.writeFieldBegin('privileges', TType.SET, 2)
+      oprot.writeSetBegin(TType.STRUCT, len(self.privileges))
+      for iter90 in self.privileges:
+        iter90.write(oprot)
+      oprot.writeSetEnd()
+      oprot.writeFieldEnd()
+    oprot.writeFieldStop()
+    oprot.writeStructEnd()
+
+  def validate(self):
+    if self.status is None:
+      raise TProtocol.TProtocolException(message='Required field status is unset!')
+    if self.privileges is None:
+      raise TProtocol.TProtocolException(message='Required field privileges is unset!')
+    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 TSentryActiveRoleSet(object):
+  """
+  Attributes:
+   - all
+   - roles
+  """
+
+  thrift_spec = (
+    None, # 0
+    (1, TType.BOOL, 'all', None, None, ), # 1
+    (2, TType.SET, 'roles', (TType.STRING,None), None, ), # 2
+  )
+
+  def __init__(self, all=None, roles=None,):
+    self.all = all
+    self.roles = roles
+
+  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.BOOL:
+          self.all = iprot.readBool();
+        else:
+          iprot.skip(ftype)
+      elif fid == 2:
+        if ftype == TType.SET:
+          self.roles = set()
+          (_etype94, _size91) = iprot.readSetBegin()
+          for _i95 in xrange(_size91):
+            _elem96 = iprot.readString();
+            self.roles.add(_elem96)
+          iprot.readSetEnd()
+        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('TSentryActiveRoleSet')
+    if self.all is not None:
+      oprot.writeFieldBegin('all', TType.BOOL, 1)
+      oprot.writeBool(self.all)
+      oprot.writeFieldEnd()
+    if self.roles is not None:
+      oprot.writeFieldBegin('roles', TType.SET, 2)
+      oprot.writeSetBegin(TType.STRING, len(self.roles))
+      for iter97 in self.roles:
+        oprot.writeString(iter97)
+      oprot.writeSetEnd()
+      oprot.writeFieldEnd()
+    oprot.writeFieldStop()
+    oprot.writeStructEnd()
+
+  def validate(self):
+    if self.all is None:
+      raise TProtocol.TProtocolException(message='Required field all is unset!')
+    if self.roles is None:
+      raise TProtocol.TProtocolException(message='Required field roles is unset!')
+    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 TListSentryPrivilegesForProviderRequest(object):
+  """
+  Attributes:
+   - protocol_version
+   - groups
+   - roleSet
+  """
+
+  thrift_spec = (
+    None, # 0
+    (1, TType.I32, 'protocol_version', None, 1, ), # 1
+    (2, TType.SET, 'groups', (TType.STRING,None), None, ), # 2
+    (3, TType.STRUCT, 'roleSet', (TSentryActiveRoleSet, TSentryActiveRoleSet.thrift_spec), None, ), # 3
+  )
+
+  def __init__(self, protocol_version=thrift_spec[1][4], groups=None, roleSet=None,):
+    self.protocol_version = protocol_version
+    self.groups = groups
+    self.roleSet = roleSet
+
+  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.I32:
+          self.protocol_version = iprot.readI32();
+        else:
+          iprot.skip(ftype)
+      elif fid == 2:
+        if ftype == TType.SET:
+          self.groups = set()
+          (_etype101, _size98) = iprot.readSetBegin()
+          for _i102 in xrange(_size98):
+            _elem103 = iprot.readString();
+            self.groups.add(_elem103)
+          iprot.readSetEnd()
+        else:
+          iprot.skip(ftype)
+      elif fid == 3:
+        if ftype == TType.STRUCT:
+          self.roleSet = TSentryActiveRoleSet()
+          self.roleSet.read(iprot)
+        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('TListSentryPrivilegesForProviderRequest')
+    if self.protocol_version is not None:
+      oprot.writeFieldBegin('protocol_version', TType.I32, 1)
+      oprot.writeI32(self.protocol_version)
+      oprot.writeFieldEnd()
+    if self.groups is not None:
+      oprot.writeFieldBegin('groups', TType.SET, 2)
+      oprot.writeSetBegin(TType.STRING, len(self.groups))
+      for iter104 in self.groups:
+        oprot.writeString(iter104)
+      oprot.writeSetEnd()
+      oprot.writeFieldEnd()
+    if self.roleSet is not None:
+      oprot.writeFieldBegin('roleSet', TType.STRUCT, 3)
+      self.roleSet.write(oprot)
+      oprot.writeFieldEnd()
+    oprot.writeFieldStop()
+    oprot.writeStructEnd()
+
+  def validate(self):
+    if self.protocol_version is None:
+      raise TProtocol.TProtocolException(message='Required field protocol_version is unset!')
+    if self.groups is None:
+      raise TProtocol.TProtocolException(message='Required field groups is unset!')
+    if self.roleSet is None:
+      raise TProtocol.TProtocolException(message='Required field roleSet is unset!')
+    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 TListSentryPrivilegesForProviderResponse(object):
+  """
+  Attributes:
+   - status
+   - privileges
+  """
+
+  thrift_spec = (
+    None, # 0
+    (1, TType.STRUCT, 'status', (sentry_common_service.ttypes.TSentryResponseStatus, sentry_common_service.ttypes.TSentryResponseStatus.thrift_spec), None, ), # 1
+    (2, TType.SET, 'privileges', (TType.STRING,None), None, ), # 2
+  )
+
+  def __init__(self, status=None, privileges=None,):
+    self.status = status
+    self.privileges = privileges
+
+  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.STRUCT:
+          self.status = sentry_common_service.ttypes.TSentryResponseStatus()
+          self.status.read(iprot)
+        else:
+          iprot.skip(ftype)
+      elif fid == 2:
+        if ftype == TType.SET:
+          self.privileges = set()
+          (_etype108, _size105) = iprot.readSetBegin()
+          for _i109 in xrange(_size105):
+            _elem110 = iprot.readString();
+            self.privileges.add(_elem110)
+          iprot.readSetEnd()
+        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('TListSentryPrivilegesForProviderResponse')
+    if self.status is not None:
+      oprot.writeFieldBegin('status', TType.STRUCT, 1)
+      self.status.write(oprot)
+      oprot.writeFieldEnd()
+    if self.privileges is not None:
+      oprot.writeFieldBegin('privileges', TType.SET, 2)
+      oprot.writeSetBegin(TType.STRING, len(self.privileges))
+      for iter111 in self.privileges:
+        oprot.writeString(iter111)
+      oprot.writeSetEnd()
+      oprot.writeFieldEnd()
+    oprot.writeFieldStop()
+    oprot.writeStructEnd()
+
+  def validate(self):
+    if self.status is None:
+      raise TProtocol.TProtocolException(message='Required field status is unset!')
+    if self.privileges is None:
+      raise TProtocol.TProtocolException(message='Required field privileges is unset!')
+    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)

+ 19 - 0
desktop/libs/libsentry/regenerate_thrift.sh

@@ -0,0 +1,19 @@
+#!/usr/bin/env bash
+# Licensed to Cloudera, Inc. under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  Cloudera, Inc. 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.
+cd $(dirname $0)
+
+thrift -I thrift/include --gen py:new_style thrift/sentry_policy_service.thrift

+ 30 - 0
desktop/libs/libsentry/setup.py

@@ -0,0 +1,30 @@
+# Licensed to Cloudera, Inc. under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  Cloudera, Inc. 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 setuptools import setup, find_packages
+
+setup(
+      name = "libsentry",
+      version = "3.5.0",
+      url = 'http://github.com/cloudera/hue',
+      description = "Sentry Libraries",
+      packages = find_packages('src'),
+      package_dir = {'': 'src' },
+      install_requires = ['setuptools', 'desktop'],
+      # Even libraries need to be registered as desktop_apps,
+      # if they have configuration, like this one.
+      entry_points = { 'desktop.sdk.lib': 'libsentry=libsentry' },
+)

+ 15 - 0
desktop/libs/libsentry/src/libsentry/__init__.py

@@ -0,0 +1,15 @@
+# Licensed to Cloudera, Inc. under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  Cloudera, Inc. 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.

+ 50 - 0
desktop/libs/libsentry/src/libsentry/api.py

@@ -0,0 +1,50 @@
+#!/usr/bin/env python
+# Licensed to Cloudera, Inc. under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  Cloudera, Inc. 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.
+
+import logging
+
+
+LOG = logging.getLogger(__name__)
+
+
+class SentryApi(object):
+
+  def __init__(self, client):
+    """
+    Parameters
+    ----------
+    client : SentryClient
+      The sentry client
+    """
+    self.client = client
+
+  def get_roles_for_table(self, database, table):
+    roles = self.client.get_roles()
+
+    # Fetch privileges and filter out roles that don't have privileges for this table
+    old_roles = roles.copy()
+    for role, properties in old_roles.items():
+      properties['privileges'] = self.client.get_privileges_for_role(role)
+
+      if not filter(lambda privilege: privilege['scope'].lower() == 'table' and privilege['database'] == database and privilege['table'] == table, roles[role]['privileges']):
+        del roles[role]
+
+    return roles
+
+  def get_roles(self, database):
+    roles = self.client.get_roles()
+    return roles

+ 105 - 0
desktop/libs/libsentry/src/libsentry/client.py

@@ -0,0 +1,105 @@
+#!/usr/bin/env python
+# Licensed to Cloudera, Inc. under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  Cloudera, Inc. 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.
+
+import logging
+import sys
+import os
+
+from desktop.lib import thrift_util
+
+sys.path.append(os.path.join(os.path.dirname(__file__), '../../gen-py'))
+
+from sentry_policy_service import SentryPolicyService, ttypes
+
+
+LOG = logging.getLogger(__name__)
+
+"""
+from libsentry import api
+from django.contrib.auth.models import User
+user = User.objects.all()[0]
+c = api.SentryApi('solaris.abe.cloudera.com', 10001, user)
+response = c.get_roles()
+response = c.get_privileges_for_role('test')
+"""
+
+
+class SentryClient(object):
+
+  def __init__(self, host, port, user):
+    """
+    Client for the sentry service.
+
+    Keyword arguments:
+    host       -- `host` the server is listening on
+    port       -- `port` the server is listening on
+    user       -- Django `user` object
+    """
+    # @TODO(Abe) Kerberos
+    self.user = user
+
+    self.client = thrift_util.get_client(SentryPolicyService.Client,
+                                         host,
+                                         port,
+                                         service_name="SentryPolicyService",
+                                         username=self.user.username,
+                                         timeout_seconds=30,
+                                         multiple=True)
+
+  def roles(self):
+    """
+    Fetch a mapping of roles to groups.
+    """
+    request = ttypes.TListSentryRolesRequest(requestorUserName=self.user.username, requestorGroupNames=[group.name for group in self.user.groups.all()])
+    response = self.client.list_sentry_roles_by_group(request)
+    if response.status.value == 0:
+      roles = {}
+      for role in response.roles:
+        roles[role.roleName] = {
+          'grantor': role.grantorPrincipal,
+          'groups': [group.groupName for group in role.groups]
+        }
+      return roles
+    else:
+      raise RuntimeError(response.status.message)
+
+  def privileges_for_role(self, role):
+    """
+    Fetch the privileges for a role.
+
+    Keyword arguments:
+    role     -- The `role` to fetch privileges for.
+    """
+    request = ttypes.TListSentryPrivilegesRequest(requestorUserName=self.user.username, requestorGroupNames=[group.name for group in self.user.groups.all()], roleName=role)
+    response = self.client.list_sentry_privileges_by_role(request)
+    if response.status.value == 0:
+      priviliges = []
+      for privilige in response.privileges:
+        priviliges.append({
+          'scope': privilige.privilegeScope,
+          'name': privilige.privilegeName,
+          'server': privilige.serverName,
+          'database': privilige.dbName,
+          'table': privilige.tableName,
+          'URI': privilige.URI,
+          'action': privilige.action,
+          'timestamp': privilige.createTime,
+          'grantor': privilige.grantorPrincipal
+        })
+      return priviliges
+    else:
+      raise RuntimeError(response.status.message)

+ 34 - 0
desktop/libs/libsentry/src/libsentry/conf.py

@@ -0,0 +1,34 @@
+#!/usr/bin/env python
+# Licensed to Cloudera, Inc. under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  Cloudera, Inc. 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 django.utils.translation import ugettext_lazy as _t
+from desktop.lib.conf import Config
+
+
+HOSTNAME=Config(
+  key='hostname',
+  help=_t('Hostname or IP of server.'),
+  type=str,
+  default='localhost',
+)
+
+PORT=Config(
+  key='port',
+  help=_t('Port the sentry service is running on.'),
+  type=int,
+  default=10001,
+)

+ 89 - 0
desktop/libs/libsentry/src/libsentry/locale/de/LC_MESSAGES/django.po

@@ -0,0 +1,89 @@
+# German translations for Hue.
+# Copyright (C) 2012 Cloudera
+# This file is distributed under the same license as the Hue project.
+# FIRST AUTHOR <EMAIL@ADDRESS>, 2012.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: PROJECT VERSION\n"
+"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
+"POT-Creation-Date: 2014-03-05 15:04-0800\n"
+"PO-Revision-Date: 2012-07-30 18:50-0700\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: de <LL@li.org>\n"
+"Plural-Forms: nplurals=2; plural=(n != 1)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=utf-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Generated-By: Babel 0.9.6\n"
+
+#: src/librdbms/conf.py:26
+msgid "RDBMS server configurations."
+msgstr "RDBMS-Serverkonfigurationen."
+
+#: src/librdbms/conf.py:28
+msgid "RDBMS server configuration."
+msgstr "RDBMS-Serverkonfiguration."
+
+#: src/librdbms/conf.py:32
+msgid "Nice name of server."
+msgstr "Servername."
+
+#: src/librdbms/conf.py:38
+msgid "Database name or path to database file. If provided, then choosing other databases will not be permitted."
+msgstr "Datenbankname oder Pfad zur Datenbankdatei. Wenn dies angegeben wird, ist das Auswählen anderer Datenbanken nicht zulässig."
+
+#: src/librdbms/conf.py:44
+msgid "Database engine, such as postgresql_psycopg2, mysql, or sqlite3."
+msgstr "Datenbank-Engine wie postgresq_psycopg2, mysql oder sqlite3."
+
+#: src/librdbms/conf.py:50
+msgid "Database username."
+msgstr "Datenbank-Benutzername."
+
+#: src/librdbms/conf.py:56
+msgid "Database password."
+msgstr "Datenbank-Kennwort."
+
+#: src/librdbms/conf.py:62
+msgid "Database host."
+msgstr "Datenbank-Host."
+
+#: src/librdbms/conf.py:68
+msgid "Database port."
+msgstr "Datenbank-Port."
+
+#: src/librdbms/conf.py:74
+msgid "Database options to send to the server when connecting."
+msgstr "Datenbankoptionen zum Senden an den Server, wenn die Verbindung hergestellt wird."
+
+#: src/librdbms/conf.py:90
+msgid "Database name should not be empty for the SQLite backend."
+msgstr "Datenbankname darf für das SQLite-Backend nicht leer sein."
+
+#: src/librdbms/conf.py:92
+msgid "Database name should not be empty for the Oracle backend. It should be the SID of your database."
+msgstr "Datenbankname darf für das Oracle-Backend nicht leer sein. Es muss die SID Ihrer Datenbank sein."
+
+#: src/librdbms/conf.py:94
+msgid "Database name should not be empty for the PostgreSQL backend."
+msgstr "Der Datenbankname darf für das PostgreSQL-Backend nicht leer sein."
+
+#: src/librdbms/design.py:110
+msgid "No server!"
+msgstr "Kein Server!"
+
+#: src/librdbms/design.py:112
+msgid "No database!"
+msgstr "Keine Datenbank!"
+
+#: src/librdbms/server/mysql_lib.py:80
+#, python-format
+msgid "Database '%s' is not allowed. Please use database '%s'."
+msgstr "Datenbank \"%s\" ist nicht zugelassen. Verwenden Sie Datenbank \"%s\"."
+
+#: src/librdbms/server/mysql_lib.py:107
+#, python-format
+msgid "Cannot locate the %s database. Are you sure your configuration is correct?"
+msgstr "Datenbank %s nicht gefunden. Sind Sie sicher, dass Ihre Konfiguration korrekt ist?"
+

+ 41 - 0
desktop/libs/libsentry/src/libsentry/locale/en/LC_MESSAGES/django.po

@@ -0,0 +1,41 @@
+# English translations for Hue.
+# Copyright (C) 2013 Cloudera, Inc
+# This file is distributed under the same license as the Hue project.
+# FIRST AUTHOR <EMAIL@ADDRESS>, 2013.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Hue VERSION\n"
+"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
+"POT-Creation-Date: 2013-05-10 11:59-0700\n"
+"PO-Revision-Date: 2013-10-28 10:31-0700\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: en <LL@li.org>\n"
+"Plural-Forms: nplurals=2; plural=(n != 1)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=utf-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Generated-By: Babel 0.9.6\n"
+
+#: src/impala/conf.py:26
+msgid "Host of the Impala Server."
+msgstr ""
+
+#: src/impala/conf.py:31
+msgid "Port of the Impala Server."
+msgstr ""
+
+#: src/impala/conf.py:37
+msgid ""
+"Beeswax or Hive Server 2 Thrift API used. Choices are: 'beeswax' or "
+"'hiveserver2'."
+msgstr ""
+
+#: src/impala/conf.py:42
+msgid "Kerberos principal name for Impala. Typically 'impala/hostname.foo.com'."
+msgstr ""
+
+#: src/impala/views.py:35
+msgid "A POST request is required."
+msgstr ""
+

+ 41 - 0
desktop/libs/libsentry/src/libsentry/locale/en_US.pot

@@ -0,0 +1,41 @@
+# Translations template for Hue.
+# Copyright (C) 2013 Cloudera, Inc
+# This file is distributed under the same license as the Hue project.
+# FIRST AUTHOR <EMAIL@ADDRESS>, 2013.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: Hue VERSION\n"
+"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
+"POT-Creation-Date: 2013-05-10 11:59-0700\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=utf-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Generated-By: Babel 0.9.6\n"
+
+#: src/impala/conf.py:26
+msgid "Host of the Impala Server."
+msgstr ""
+
+#: src/impala/conf.py:31
+msgid "Port of the Impala Server."
+msgstr ""
+
+#: src/impala/conf.py:37
+msgid ""
+"Beeswax or Hive Server 2 Thrift API used. Choices are: 'beeswax' or "
+"'hiveserver2'."
+msgstr ""
+
+#: src/impala/conf.py:42
+msgid "Kerberos principal name for Impala. Typically 'impala/hostname.foo.com'."
+msgstr ""
+
+#: src/impala/views.py:35
+msgid "A POST request is required."
+msgstr ""
+

+ 89 - 0
desktop/libs/libsentry/src/libsentry/locale/es/LC_MESSAGES/django.po

@@ -0,0 +1,89 @@
+# Spanish translations for Hue.
+# Copyright (C) 2012 Cloudera
+# This file is distributed under the same license as the Hue project.
+# FIRST AUTHOR <EMAIL@ADDRESS>, 2012.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: PROJECT VERSION\n"
+"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
+"POT-Creation-Date: 2014-03-05 15:04-0800\n"
+"PO-Revision-Date: 2012-07-30 18:50-0700\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: es <LL@li.org>\n"
+"Plural-Forms: nplurals=2; plural=(n != 1)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=utf-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Generated-By: Babel 0.9.6\n"
+
+#: src/librdbms/conf.py:26
+msgid "RDBMS server configurations."
+msgstr "Configuraciones del servidor RDBMS."
+
+#: src/librdbms/conf.py:28
+msgid "RDBMS server configuration."
+msgstr "Configuración del servidor RDBMS."
+
+#: src/librdbms/conf.py:32
+msgid "Nice name of server."
+msgstr "Nombre del servidor en inglés o con etiqueta."
+
+#: src/librdbms/conf.py:38
+msgid "Database name or path to database file. If provided, then choosing other databases will not be permitted."
+msgstr "Nombre de la base de datos o ruta del archivo de la base de datos. Si se indica, no se permitirá elegir otras bases de datos."
+
+#: src/librdbms/conf.py:44
+msgid "Database engine, such as postgresql_psycopg2, mysql, or sqlite3."
+msgstr "Motor de base de datos, como postgresql_psycopg2, mysql o sqlite3."
+
+#: src/librdbms/conf.py:50
+msgid "Database username."
+msgstr "Nombre de usuario de la base de datos."
+
+#: src/librdbms/conf.py:56
+msgid "Database password."
+msgstr "Contraseña de la base de datos."
+
+#: src/librdbms/conf.py:62
+msgid "Database host."
+msgstr "Host de la base de datos."
+
+#: src/librdbms/conf.py:68
+msgid "Database port."
+msgstr "Puerto de la base de datos."
+
+#: src/librdbms/conf.py:74
+msgid "Database options to send to the server when connecting."
+msgstr "Opciones de base de datos que enviar al servidor al conectar."
+
+#: src/librdbms/conf.py:90
+msgid "Database name should not be empty for the SQLite backend."
+msgstr "El nombre de la base de datos no debe estar vacío en el back-end de SQLite."
+
+#: src/librdbms/conf.py:92
+msgid "Database name should not be empty for the Oracle backend. It should be the SID of your database."
+msgstr "El nombre de la base de datos no debe estar vacío en el back-end de Oracle. Debe ser el SID de su base de datos."
+
+#: src/librdbms/conf.py:94
+msgid "Database name should not be empty for the PostgreSQL backend."
+msgstr "El nombre de la base de datos no debe estar vacío en el back-end de PostgreSQL."
+
+#: src/librdbms/design.py:110
+msgid "No server!"
+msgstr "No hay servidor."
+
+#: src/librdbms/design.py:112
+msgid "No database!"
+msgstr "No hay base de datos."
+
+#: src/librdbms/server/mysql_lib.py:80
+#, python-format
+msgid "Database '%s' is not allowed. Please use database '%s'."
+msgstr "No se permite la base de datos '%s'. Use la base de datos '%s'."
+
+#: src/librdbms/server/mysql_lib.py:107
+#, python-format
+msgid "Cannot locate the %s database. Are you sure your configuration is correct?"
+msgstr "No se puede localizar la base de datos %s. ¿Está seguro de que la configuración es correcta?"
+

+ 89 - 0
desktop/libs/libsentry/src/libsentry/locale/fr/LC_MESSAGES/django.po

@@ -0,0 +1,89 @@
+# French translations for Hue.
+# Copyright (C) 2012 Cloudera
+# This file is distributed under the same license as the Hue project.
+# FIRST AUTHOR <EMAIL@ADDRESS>, 2012.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: PROJECT VERSION\n"
+"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
+"POT-Creation-Date: 2014-03-05 15:04-0800\n"
+"PO-Revision-Date: 2012-07-30 18:50-0700\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: fr <LL@li.org>\n"
+"Plural-Forms: nplurals=2; plural=(n > 1)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=utf-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Generated-By: Babel 0.9.6\n"
+
+#: src/librdbms/conf.py:26
+msgid "RDBMS server configurations."
+msgstr "Configurations du serveur RDBMS."
+
+#: src/librdbms/conf.py:28
+msgid "RDBMS server configuration."
+msgstr "Configuration du serveur RDBMS."
+
+#: src/librdbms/conf.py:32
+msgid "Nice name of server."
+msgstr "Nom de serveur correct."
+
+#: src/librdbms/conf.py:38
+msgid "Database name or path to database file. If provided, then choosing other databases will not be permitted."
+msgstr "Nom de la base de données ou chemin d'accès au fichier de la base de données. S'il est fourni, il ne sera pas possible de choisir une autre base de données."
+
+#: src/librdbms/conf.py:44
+msgid "Database engine, such as postgresql_psycopg2, mysql, or sqlite3."
+msgstr "Moteur de base de données, tel que  postgresql_psycopg2, mysql ou sqlite3."
+
+#: src/librdbms/conf.py:50
+msgid "Database username."
+msgstr "Nom d'utilisateur de la base de données."
+
+#: src/librdbms/conf.py:56
+msgid "Database password."
+msgstr "Mot de passe de la base de données."
+
+#: src/librdbms/conf.py:62
+msgid "Database host."
+msgstr "Hôte de la base de données."
+
+#: src/librdbms/conf.py:68
+msgid "Database port."
+msgstr "Port de la base de données."
+
+#: src/librdbms/conf.py:74
+msgid "Database options to send to the server when connecting."
+msgstr "Options de base de données à envoyer au serveur lors de la connexion."
+
+#: src/librdbms/conf.py:90
+msgid "Database name should not be empty for the SQLite backend."
+msgstr "Le nom de la base de données ne doit pas être vide pour le serveur principal SQLite."
+
+#: src/librdbms/conf.py:92
+msgid "Database name should not be empty for the Oracle backend. It should be the SID of your database."
+msgstr "Le nom de la base de données ne doit pas être vide pour le serveur principal Oracle. Il doit correspondre au SID de votre base de données."
+
+#: src/librdbms/conf.py:94
+msgid "Database name should not be empty for the PostgreSQL backend."
+msgstr "Le nom de la base de données ne doit pas être vide pour le serveur principal PostgreSQL."
+
+#: src/librdbms/design.py:110
+msgid "No server!"
+msgstr "Pas de serveur !"
+
+#: src/librdbms/design.py:112
+msgid "No database!"
+msgstr "Aucune base de données."
+
+#: src/librdbms/server/mysql_lib.py:80
+#, python-format
+msgid "Database '%s' is not allowed. Please use database '%s'."
+msgstr "La base de données '%s' n'est pas autorisée. Veuillez utiliser la base de données '%s'."
+
+#: src/librdbms/server/mysql_lib.py:107
+#, python-format
+msgid "Cannot locate the %s database. Are you sure your configuration is correct?"
+msgstr "Impossible de localiser la base de données %s. Etes-vous sûr que votre configuration est correcte ?"
+

+ 89 - 0
desktop/libs/libsentry/src/libsentry/locale/ja/LC_MESSAGES/django.po

@@ -0,0 +1,89 @@
+# Japanese translations for Hue.
+# Copyright (C) 2012 Cloudera
+# This file is distributed under the same license as the Hue project.
+# FIRST AUTHOR <EMAIL@ADDRESS>, 2012.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: PROJECT VERSION\n"
+"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
+"POT-Creation-Date: 2014-03-05 15:04-0800\n"
+"PO-Revision-Date: 2012-07-30 18:50-0700\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: ja <LL@li.org>\n"
+"Plural-Forms: nplurals=1; plural=0\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=utf-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Generated-By: Babel 0.9.6\n"
+
+#: src/librdbms/conf.py:26
+msgid "RDBMS server configurations."
+msgstr "RDBMS サーバーの設定です。"
+
+#: src/librdbms/conf.py:28
+msgid "RDBMS server configuration."
+msgstr "RDBMS サーバーの設定です。"
+
+#: src/librdbms/conf.py:32
+msgid "Nice name of server."
+msgstr "サーバーの適切な名前です。"
+
+#: src/librdbms/conf.py:38
+msgid "Database name or path to database file. If provided, then choosing other databases will not be permitted."
+msgstr "データベース名、またはデータベースファイルへのパスです。指定されている場合、その他のデータベースを選択することは許可されません。"
+
+#: src/librdbms/conf.py:44
+msgid "Database engine, such as postgresql_psycopg2, mysql, or sqlite3."
+msgstr "postgresql_psycopg2、mysql、sqlite3 などのデータベースエンジンです。"
+
+#: src/librdbms/conf.py:50
+msgid "Database username."
+msgstr "データベースのユーザー名です。"
+
+#: src/librdbms/conf.py:56
+msgid "Database password."
+msgstr "データベースのパスワードです。"
+
+#: src/librdbms/conf.py:62
+msgid "Database host."
+msgstr "データベースのホストです。"
+
+#: src/librdbms/conf.py:68
+msgid "Database port."
+msgstr "データベースのポートです。"
+
+#: src/librdbms/conf.py:74
+msgid "Database options to send to the server when connecting."
+msgstr "接続時にサーバーに送信するデータベースオプションです。"
+
+#: src/librdbms/conf.py:90
+msgid "Database name should not be empty for the SQLite backend."
+msgstr "SQLite バックエンドのデータベース名は空にできません。"
+
+#: src/librdbms/conf.py:92
+msgid "Database name should not be empty for the Oracle backend. It should be the SID of your database."
+msgstr "Oracle バックエンドのデータベース名は空にできません。データベースの SID にする必要があります。"
+
+#: src/librdbms/conf.py:94
+msgid "Database name should not be empty for the PostgreSQL backend."
+msgstr "PostgreSQL バックエンドのデータベース名は空にできません。"
+
+#: src/librdbms/design.py:110
+msgid "No server!"
+msgstr "サーバーがありません。"
+
+#: src/librdbms/design.py:112
+msgid "No database!"
+msgstr "データベースがありません。"
+
+#: src/librdbms/server/mysql_lib.py:80
+#, python-format
+msgid "Database '%s' is not allowed. Please use database '%s'."
+msgstr "データベース '%s' は使用できません。データベース '%s' を使用してください。"
+
+#: src/librdbms/server/mysql_lib.py:107
+#, python-format
+msgid "Cannot locate the %s database. Are you sure your configuration is correct?"
+msgstr "%s データベースが見つかりません。設定は正しいですか?"
+

+ 89 - 0
desktop/libs/libsentry/src/libsentry/locale/ko/LC_MESSAGES/django.po

@@ -0,0 +1,89 @@
+# Korean translations for Hue.
+# Copyright (C) 2012 Cloudera
+# This file is distributed under the same license as the Hue project.
+# FIRST AUTHOR <EMAIL@ADDRESS>, 2012.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: PROJECT VERSION\n"
+"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
+"POT-Creation-Date: 2014-03-05 15:04-0800\n"
+"PO-Revision-Date: 2012-07-30 18:50-0700\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: ko <LL@li.org>\n"
+"Plural-Forms: nplurals=1; plural=0\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=utf-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Generated-By: Babel 0.9.6\n"
+
+#: src/librdbms/conf.py:26
+msgid "RDBMS server configurations."
+msgstr "RDBMS 서버 구성입니다."
+
+#: src/librdbms/conf.py:28
+msgid "RDBMS server configuration."
+msgstr "RDBMS 서버 구성입니다."
+
+#: src/librdbms/conf.py:32
+msgid "Nice name of server."
+msgstr "적절한 서버 이름입니다."
+
+#: src/librdbms/conf.py:38
+msgid "Database name or path to database file. If provided, then choosing other databases will not be permitted."
+msgstr "데이터베이스 파일에 대한 경로 또는 이름입니다. 지정한 경우에는 다른 데이터베이스를 선택할 수 없습니다."
+
+#: src/librdbms/conf.py:44
+msgid "Database engine, such as postgresql_psycopg2, mysql, or sqlite3."
+msgstr "postgresql_psycopg2, mysql, or sqlite3 같은 데이터베이스 엔진입니다."
+
+#: src/librdbms/conf.py:50
+msgid "Database username."
+msgstr "데이터베이스 사용자 이름입니다."
+
+#: src/librdbms/conf.py:56
+msgid "Database password."
+msgstr "데이터베이스 암호입니다."
+
+#: src/librdbms/conf.py:62
+msgid "Database host."
+msgstr "데이터베이스 호스트입니다."
+
+#: src/librdbms/conf.py:68
+msgid "Database port."
+msgstr "데이터베이스 포트입니다."
+
+#: src/librdbms/conf.py:74
+msgid "Database options to send to the server when connecting."
+msgstr "연결할 때 서버로 보낸 데이터베이스 옵션입니다."
+
+#: src/librdbms/conf.py:90
+msgid "Database name should not be empty for the SQLite backend."
+msgstr "SQLite 백엔드에 대한 데이터베이스 이름은 비워 둘 수 없습니다."
+
+#: src/librdbms/conf.py:92
+msgid "Database name should not be empty for the Oracle backend. It should be the SID of your database."
+msgstr "Oracle 백엔드에 대한 데이터베이스 이름은 비워 둘 수 없습니다. 데이터베이스의 SID여야 합니다."
+
+#: src/librdbms/conf.py:94
+msgid "Database name should not be empty for the PostgreSQL backend."
+msgstr "PostgreSQL 백엔드에 대한 데이터베이스 이름은 비워 둘 수 없습니다."
+
+#: src/librdbms/design.py:110
+msgid "No server!"
+msgstr "서버 없음!"
+
+#: src/librdbms/design.py:112
+msgid "No database!"
+msgstr "데이터베이스 없음!"
+
+#: src/librdbms/server/mysql_lib.py:80
+#, python-format
+msgid "Database '%s' is not allowed. Please use database '%s'."
+msgstr "'%s' 데이터베이스를 사용할 수 없습니다. '%s' 데이터베이스를 사용하십시오."
+
+#: src/librdbms/server/mysql_lib.py:107
+#, python-format
+msgid "Cannot locate the %s database. Are you sure your configuration is correct?"
+msgstr "%s 데이터베이스를 찾을 수 없습니다. 구성이 맞습니까?"
+

+ 89 - 0
desktop/libs/libsentry/src/libsentry/locale/pt/LC_MESSAGES/django.po

@@ -0,0 +1,89 @@
+# Portuguese translations for Hue.
+# Copyright (C) 2012 Cloudera
+# This file is distributed under the same license as the Hue project.
+# FIRST AUTHOR <EMAIL@ADDRESS>, 2012.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: PROJECT VERSION\n"
+"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
+"POT-Creation-Date: 2014-03-05 15:04-0800\n"
+"PO-Revision-Date: 2012-07-30 18:50-0700\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: pt <LL@li.org>\n"
+"Plural-Forms: nplurals=2; plural=(n != 1)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=utf-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Generated-By: Babel 0.9.6\n"
+
+#: src/librdbms/conf.py:26
+msgid "RDBMS server configurations."
+msgstr "Configurações do servidor RDBMS."
+
+#: src/librdbms/conf.py:28
+msgid "RDBMS server configuration."
+msgstr "Configuração do servidor RDBMS."
+
+#: src/librdbms/conf.py:32
+msgid "Nice name of server."
+msgstr "Nome do servidor."
+
+#: src/librdbms/conf.py:38
+msgid "Database name or path to database file. If provided, then choosing other databases will not be permitted."
+msgstr "Nome de base de dados ou caminho para o ficheiro de base de dados. Se fornecido, então a escolha de outras bases de dados não será permitida."
+
+#: src/librdbms/conf.py:44
+msgid "Database engine, such as postgresql_psycopg2, mysql, or sqlite3."
+msgstr "Motor de base de dados, como postgresql_psycopg2, mysql ou sqlite3."
+
+#: src/librdbms/conf.py:50
+msgid "Database username."
+msgstr "Nome de utilizador da base de dados."
+
+#: src/librdbms/conf.py:56
+msgid "Database password."
+msgstr "Palavra-passe da base de dados."
+
+#: src/librdbms/conf.py:62
+msgid "Database host."
+msgstr "Anfitrião da base de dados."
+
+#: src/librdbms/conf.py:68
+msgid "Database port."
+msgstr "Porta da base de dados."
+
+#: src/librdbms/conf.py:74
+msgid "Database options to send to the server when connecting."
+msgstr "Opções da base de dados a enviar para o servidor ao ligar."
+
+#: src/librdbms/conf.py:90
+msgid "Database name should not be empty for the SQLite backend."
+msgstr "O nome da base de dados não deve estar vazio para o back-end de SQLite."
+
+#: src/librdbms/conf.py:92
+msgid "Database name should not be empty for the Oracle backend. It should be the SID of your database."
+msgstr "O nome de base de dados não deve estar vazio para o back-end de Oracle. Deve ser o SID da sua base de dados."
+
+#: src/librdbms/conf.py:94
+msgid "Database name should not be empty for the PostgreSQL backend."
+msgstr "O nome de base de dados não deve estar vazio para o back-end do PostgreSQL."
+
+#: src/librdbms/design.py:110
+msgid "No server!"
+msgstr "Sem servidor!"
+
+#: src/librdbms/design.py:112
+msgid "No database!"
+msgstr "Sem base de dados!"
+
+#: src/librdbms/server/mysql_lib.py:80
+#, python-format
+msgid "Database '%s' is not allowed. Please use database '%s'."
+msgstr "A base de dados \"%s\" não é permitida. Utilize a base de dados \"%s\"."
+
+#: src/librdbms/server/mysql_lib.py:107
+#, python-format
+msgid "Cannot locate the %s database. Are you sure your configuration is correct?"
+msgstr "Não é possível localizar a base de dados %s. Tem a certeza de que a sua configuração está correcta?"
+

+ 89 - 0
desktop/libs/libsentry/src/libsentry/locale/pt_BR/LC_MESSAGES/django.po

@@ -0,0 +1,89 @@
+# Portuguese (Brazil) translations for Hue.
+# Copyright (C) 2012 Cloudera
+# This file is distributed under the same license as the Hue project.
+# FIRST AUTHOR <EMAIL@ADDRESS>, 2012.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: PROJECT VERSION\n"
+"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
+"POT-Creation-Date: 2014-03-05 15:04-0800\n"
+"PO-Revision-Date: 2012-07-30 18:50-0700\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: pt_BR <LL@li.org>\n"
+"Plural-Forms: nplurals=2; plural=(n > 1)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=utf-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Generated-By: Babel 0.9.6\n"
+
+#: src/librdbms/conf.py:26
+msgid "RDBMS server configurations."
+msgstr "Configurações do servidor RDBMS."
+
+#: src/librdbms/conf.py:28
+msgid "RDBMS server configuration."
+msgstr "Configuração do servidor RDBMS."
+
+#: src/librdbms/conf.py:32
+msgid "Nice name of server."
+msgstr "Nome legal de servidor."
+
+#: src/librdbms/conf.py:38
+msgid "Database name or path to database file. If provided, then choosing other databases will not be permitted."
+msgstr "Nome do banco de dados ou caminho para o arquivo do banco de dados. Se for fornecido, escolher outros bancos de dados não será permitido."
+
+#: src/librdbms/conf.py:44
+msgid "Database engine, such as postgresql_psycopg2, mysql, or sqlite3."
+msgstr "Mecanismo de banco de dados, como postgresql_psycopg2, mysql ou sqlite3."
+
+#: src/librdbms/conf.py:50
+msgid "Database username."
+msgstr "Nome de usuário do banco de dados."
+
+#: src/librdbms/conf.py:56
+msgid "Database password."
+msgstr "Senha do banco de dados."
+
+#: src/librdbms/conf.py:62
+msgid "Database host."
+msgstr "Host do banco de dados."
+
+#: src/librdbms/conf.py:68
+msgid "Database port."
+msgstr "Porta do banco de dados."
+
+#: src/librdbms/conf.py:74
+msgid "Database options to send to the server when connecting."
+msgstr "Opções do banco de dados a serem enviadas ao servidor ao conectar."
+
+#: src/librdbms/conf.py:90
+msgid "Database name should not be empty for the SQLite backend."
+msgstr "O nome do banco de dados não deve estar vazio para o back-end do SQLite."
+
+#: src/librdbms/conf.py:92
+msgid "Database name should not be empty for the Oracle backend. It should be the SID of your database."
+msgstr "O nome do banco de dados não deve estar vazio para o back-end da Oracle. Ele deve ser o SID do seu banco de dados."
+
+#: src/librdbms/conf.py:94
+msgid "Database name should not be empty for the PostgreSQL backend."
+msgstr "O nome do banco de dados não deve estar vazio para o back-end do PostgreSQL."
+
+#: src/librdbms/design.py:110
+msgid "No server!"
+msgstr "Nenhum servidor!"
+
+#: src/librdbms/design.py:112
+msgid "No database!"
+msgstr "Nenhum banco de dados!"
+
+#: src/librdbms/server/mysql_lib.py:80
+#, python-format
+msgid "Database '%s' is not allowed. Please use database '%s'."
+msgstr "Banco de dados '%s' não permitido. Use o banco de dados '%s'."
+
+#: src/librdbms/server/mysql_lib.py:107
+#, python-format
+msgid "Cannot locate the %s database. Are you sure your configuration is correct?"
+msgstr "Não é possível localizar o banco de dados %s. Tem certeza de que sua configuração está correta?"
+

+ 89 - 0
desktop/libs/libsentry/src/libsentry/locale/zh_CN/LC_MESSAGES/django.po

@@ -0,0 +1,89 @@
+# Chinese (China) translations for Hue.
+# Copyright (C) 2012 Cloudera
+# This file is distributed under the same license as the Hue project.
+# FIRST AUTHOR <EMAIL@ADDRESS>, 2012.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: PROJECT VERSION\n"
+"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
+"POT-Creation-Date: 2014-03-05 15:04-0800\n"
+"PO-Revision-Date: 2012-07-30 18:50-0700\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: zh_CN <LL@li.org>\n"
+"Plural-Forms: nplurals=1; plural=0\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=utf-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Generated-By: Babel 0.9.6\n"
+
+#: src/librdbms/conf.py:26
+msgid "RDBMS server configurations."
+msgstr "RDBMS 服务器配置。"
+
+#: src/librdbms/conf.py:28
+msgid "RDBMS server configuration."
+msgstr "RDBMS 服务器配置。"
+
+#: src/librdbms/conf.py:32
+msgid "Nice name of server."
+msgstr "服务器名称。"
+
+#: src/librdbms/conf.py:38
+msgid "Database name or path to database file. If provided, then choosing other databases will not be permitted."
+msgstr "数据库名称或数据库文件路径。如果已提供,则不允许选择其他数据库。"
+
+#: src/librdbms/conf.py:44
+msgid "Database engine, such as postgresql_psycopg2, mysql, or sqlite3."
+msgstr "数据库引擎,如 postgresql_psycopg2、mysql 或 sqlite3。"
+
+#: src/librdbms/conf.py:50
+msgid "Database username."
+msgstr "数据库用户名。"
+
+#: src/librdbms/conf.py:56
+msgid "Database password."
+msgstr "数据库密码。"
+
+#: src/librdbms/conf.py:62
+msgid "Database host."
+msgstr "数据库主机。"
+
+#: src/librdbms/conf.py:68
+msgid "Database port."
+msgstr "数据库端口。"
+
+#: src/librdbms/conf.py:74
+msgid "Database options to send to the server when connecting."
+msgstr "连接时发送到服务器的数据库选项。"
+
+#: src/librdbms/conf.py:90
+msgid "Database name should not be empty for the SQLite backend."
+msgstr "对于 SQLite 后端,数据库名称不应为空。"
+
+#: src/librdbms/conf.py:92
+msgid "Database name should not be empty for the Oracle backend. It should be the SID of your database."
+msgstr "对于 Oracle 后端,数据库名称不应为空。该名称应为数据库的 SID。"
+
+#: src/librdbms/conf.py:94
+msgid "Database name should not be empty for the PostgreSQL backend."
+msgstr "对于 PostgreSQL 后端,数据库名称不应为空。"
+
+#: src/librdbms/design.py:110
+msgid "No server!"
+msgstr "无服务器!"
+
+#: src/librdbms/design.py:112
+msgid "No database!"
+msgstr "无数据库!"
+
+#: src/librdbms/server/mysql_lib.py:80
+#, python-format
+msgid "Database '%s' is not allowed. Please use database '%s'."
+msgstr "不允许数据库 '%s'。请使用数据库 '%s'。"
+
+#: src/librdbms/server/mysql_lib.py:107
+#, python-format
+msgid "Cannot locate the %s database. Are you sure your configuration is correct?"
+msgstr "无法找到 %s 数据库。您是否确定配置正确?"
+

+ 16 - 0
desktop/libs/libsentry/src/libsentry/models.py

@@ -0,0 +1,16 @@
+#!/usr/bin/env python
+# Licensed to Cloudera, Inc. under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  Cloudera, Inc. 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.

+ 39 - 0
desktop/libs/libsentry/src/libsentry/views.py

@@ -0,0 +1,39 @@
+#!/usr/bin/env python
+# Licensed to Cloudera, Inc. under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  Cloudera, Inc. 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.
+
+import json
+
+from django.http import HttpResponse
+
+from libsentry import conf
+from libsentry.client import SentryClient
+
+
+def roles(request):
+  response = {
+    'code': -1
+  }
+
+  try:
+    client = SentryClient(conf.HOSTNAME.get(), conf.PORT.get(), request.user)
+    response['roles'] = client.roles()
+    response['code'] = 0
+  except Exception, e:
+    response['code'] = 1
+    response['error'] = e.message
+
+  return HttpResponse(json.dumps(response), mimetype="application/json", status=200)

+ 41 - 0
desktop/libs/libsentry/thrift/sentry_common_service.thrift

@@ -0,0 +1,41 @@
+#!/usr/local/bin/thrift -java
+
+/**
+ * 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.
+ */
+
+include "share/fb303/if/fb303.thrift"
+
+namespace java org.apache.sentry.service.thrift
+namespace php sentry.service.thrift
+namespace cpp Apache.Sentry.Service.Thrift
+
+const i32 TSENTRY_SERVICE_V1 = 1;
+
+const i32 TSENTRY_STATUS_OK = 0;
+const i32 TSENTRY_STATUS_ALREADY_EXISTS = 1;
+const i32 TSENTRY_STATUS_NO_SUCH_OBJECT = 2;
+const i32 TSENTRY_STATUS_RUNTIME_ERROR = 3;
+const i32 TSENTRY_STATUS_INVALID_INPUT = 4;
+const i32 TSENTRY_STATUS_ACCESS_DENIED = 5;
+
+struct TSentryResponseStatus {
+1: required i32 value,
+// message will be set to empty string when status is OK
+2: required string message
+3: optional string stack
+}

+ 187 - 0
desktop/libs/libsentry/thrift/sentry_policy_service.thrift

@@ -0,0 +1,187 @@
+#!/usr/local/bin/thrift -java
+
+/**
+ * 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.
+ */
+
+#
+# Thrift Service that the MetaStore is built on
+#
+
+include "share/fb303/if/fb303.thrift"
+include "sentry_common_service.thrift"
+
+namespace java org.apache.sentry.provider.db.service.thrift
+namespace php sentry.provider.db.service.thrift
+namespace cpp Apache.Sentry.Provider.Db.Service.Thrift
+
+
+# Represents a Privilege in transport from the client to the server
+struct TSentryPrivilege {
+1: required string privilegeScope, # Valid values are SERVER, DATABASE, TABLE
+2: optional string privilegeName, # Generated on server side
+3: required string serverName,
+4: optional string dbName,
+5: optional string tableName,
+6: optional string URI,
+7: required string action,
+8: optional i64 createTime, # Set on server side
+9: optional string grantorPrincipal # Set on server side
+}
+
+# TODO can this be deleted? it's not adding value to TAlterSentryRoleAddGroupsRequest
+struct TSentryGroup {
+1: required string groupName
+}
+
+# CREATE ROLE r1
+struct TCreateSentryRoleRequest {
+1: required i32 protocol_version = sentry_common_service.TSENTRY_SERVICE_V1,
+2: required string requestorUserName, # user on whose behalf the request is issued
+3: required set<string> requestorGroupNames # groups the requesting user belongs to
+4: required string roleName, # TSentryRole is not required for this request
+}
+struct TCreateSentryRoleResponse {
+1: required sentry_common_service.TSentryResponseStatus status
+}
+
+# DROP ROLE r1
+struct TDropSentryRoleRequest {
+1: required i32 protocol_version = sentry_common_service.TSENTRY_SERVICE_V1,
+2: required string requestorUserName, # user on whose behalf the request is issued
+3: required set<string> requestorGroupNames # groups the requesting user belongs to
+4: required string roleName # role to drop
+}
+struct TDropSentryRoleResponse {
+1: required sentry_common_service.TSentryResponseStatus status
+}
+
+# GRANT ROLE r1 TO GROUP g1
+struct TAlterSentryRoleAddGroupsRequest {
+1: required i32 protocol_version = sentry_common_service.TSENTRY_SERVICE_V1,
+2: required string requestorUserName, # user on whose behalf the request is issued
+3: required set<string> requestorGroupNames # groups the requesting user belongs to
+4: required string roleName,
+5: required set<TSentryGroup> groups
+}
+
+struct TAlterSentryRoleAddGroupsResponse {
+1: required sentry_common_service.TSentryResponseStatus status
+}
+
+# REVOLE ROLE r1 FROM GROUP g1
+struct TAlterSentryRoleDeleteGroupsRequest {
+1: required i32 protocol_version = sentry_common_service.TSENTRY_SERVICE_V1,
+2: required string requestorUserName, # user on whose behalf the request is issued
+3: required set<string> requestorGroupNames # groups the requesting user belongs to
+4: required string roleName,
+5: required set<TSentryGroup> groups
+}
+struct TAlterSentryRoleDeleteGroupsResponse {
+1: required sentry_common_service.TSentryResponseStatus status
+}
+
+# GRANT ... ON ... TO ROLE ...
+struct TAlterSentryRoleGrantPrivilegeRequest {
+1: required i32 protocol_version = sentry_common_service.TSENTRY_SERVICE_V1,
+2: required string requestorUserName, # user on whose behalf the request is issued
+3: required set<string> requestorGroupNames # groups the requesting user belongs to
+4: required string roleName,
+5: required TSentryPrivilege privilege
+}
+struct TAlterSentryRoleGrantPrivilegeResponse {
+1: required sentry_common_service.TSentryResponseStatus status
+}
+
+# REVOKE ... ON ... FROM ROLE ...
+struct TAlterSentryRoleRevokePrivilegeRequest {
+1: required i32 protocol_version = sentry_common_service.TSENTRY_SERVICE_V1,
+2: required string requestorUserName, # user on whose behalf the request is issued
+3: required set<string> requestorGroupNames # groups the requesting user belongs to
+4: required string roleName,
+5: required TSentryPrivilege privilege
+}
+struct TAlterSentryRoleRevokePrivilegeResponse {
+1: required sentry_common_service.TSentryResponseStatus status
+}
+
+# SHOW ROLE GRANT
+struct TListSentryRolesRequest {
+1: required i32 protocol_version = sentry_common_service.TSENTRY_SERVICE_V1,
+2: required string requestorUserName, # user on whose behalf the request is issued
+3: required set<string> requestorGroupNames,# groups the requesting user belongs to
+4: optional string groupName # for this group, or all roles for all groups if null
+}
+# used only for TListSentryRolesResponse
+struct TSentryRole {
+1: required string roleName,
+2: required set<TSentryGroup> groups,
+3: required string grantorPrincipal
+}
+struct TListSentryRolesResponse {
+1: required sentry_common_service.TSentryResponseStatus status
+2: required set<TSentryRole> roles
+}
+
+# SHOW GRANT
+struct TListSentryPrivilegesRequest {
+1: required i32 protocol_version = sentry_common_service.TSENTRY_SERVICE_V1,
+2: required string requestorUserName, # user on whose behalf the request is issued
+3: required set<string> requestorGroupNames,# groups the requesting user belongs to
+4: required string roleName # get privileges assigned for this role
+}
+struct TListSentryPrivilegesResponse {
+1: required sentry_common_service.TSentryResponseStatus status
+2: required set<TSentryPrivilege> privileges
+}
+
+# This API was created specifically for ProviderBackend.getPrivileges
+# and is not mean for general purpose privilege retrieval.
+# This request/response pair are created specifically so we can
+# efficiently obtain the specific privilges for a user query
+struct TSentryActiveRoleSet {
+1: required bool all,
+2: required set<string> roles,
+}
+struct TListSentryPrivilegesForProviderRequest {
+1: required i32 protocol_version = sentry_common_service.TSENTRY_SERVICE_V1,
+2: required set<string> groups,
+3: required TSentryActiveRoleSet roleSet,
+}
+struct TListSentryPrivilegesForProviderResponse {
+1: required sentry_common_service.TSentryResponseStatus status
+2: required set<string> privileges
+}
+
+service SentryPolicyService
+{
+  TCreateSentryRoleResponse create_sentry_role(1:TCreateSentryRoleRequest request)
+  TDropSentryRoleResponse drop_sentry_role(1:TDropSentryRoleRequest request)
+
+  TAlterSentryRoleGrantPrivilegeResponse alter_sentry_role_grant_privilege(1:TAlterSentryRoleGrantPrivilegeRequest request)
+  TAlterSentryRoleRevokePrivilegeResponse alter_sentry_role_revoke_privilege(1:TAlterSentryRoleRevokePrivilegeRequest request)
+
+  TAlterSentryRoleAddGroupsResponse alter_sentry_role_add_groups(1:TAlterSentryRoleAddGroupsRequest request)
+  TAlterSentryRoleDeleteGroupsResponse alter_sentry_role_delete_groups(1:TAlterSentryRoleDeleteGroupsRequest request)
+
+  TListSentryRolesResponse list_sentry_roles_by_group(1:TListSentryRolesRequest request)
+
+  TListSentryPrivilegesResponse list_sentry_privileges_by_role(1:TListSentryPrivilegesRequest request)
+
+  # For use with ProviderBackend.getPrivileges only
+  TListSentryPrivilegesForProviderResponse list_sentry_privileges_for_provider(1:TListSentryPrivilegesForProviderRequest request)
+}