@Test public void testSentryThriftAPIMatchVersion() throws Exception { SentryPolicyStoreProcessor.validateClientVersion(ServiceConstants.ThriftConstants.TSENTRY_SERVICE_VERSION_CURRENT); }
@VisibleForTesting static void validateClientVersion(int protocol_version) throws SentryThriftAPIMismatchException { if (ServiceConstants.ThriftConstants.TSENTRY_SERVICE_VERSION_CURRENT != protocol_version) { String msg = "Sentry thrift API protocol version mismatch: Client thrift version " + "is: " + protocol_version + " , server thrift verion " + "is " + ThriftConstants.TSENTRY_SERVICE_VERSION_CURRENT; throw new SentryThriftAPIMismatchException(msg); } }
SentryPolicyStoreProcessor implements SentryPolicyService.Iface { @VisibleForTesting static void validateClientVersion(int protocol_version) throws SentryThriftAPIMismatchException { if (ServiceConstants.ThriftConstants.TSENTRY_SERVICE_VERSION_CURRENT != protocol_version) { String msg = "Sentry thrift API protocol version mismatch: Client thrift version " + "is: " + protocol_version + " , server thrift verion " + "is " + ThriftConstants.TSENTRY_SERVICE_VERSION_CURRENT; throw new SentryThriftAPIMismatchException(msg); } } }
SentryPolicyStoreProcessor implements SentryPolicyService.Iface { @VisibleForTesting static void validateClientVersion(int protocol_version) throws SentryThriftAPIMismatchException { if (ServiceConstants.ThriftConstants.TSENTRY_SERVICE_VERSION_CURRENT != protocol_version) { String msg = "Sentry thrift API protocol version mismatch: Client thrift version " + "is: " + protocol_version + " , server thrift verion " + "is " + ThriftConstants.TSENTRY_SERVICE_VERSION_CURRENT; throw new SentryThriftAPIMismatchException(msg); } } SentryPolicyStoreProcessor(String name, Configuration conf); }
SentryPolicyStoreProcessor implements SentryPolicyService.Iface { @VisibleForTesting static void validateClientVersion(int protocol_version) throws SentryThriftAPIMismatchException { if (ServiceConstants.ThriftConstants.TSENTRY_SERVICE_VERSION_CURRENT != protocol_version) { String msg = "Sentry thrift API protocol version mismatch: Client thrift version " + "is: " + protocol_version + " , server thrift verion " + "is " + ThriftConstants.TSENTRY_SERVICE_VERSION_CURRENT; throw new SentryThriftAPIMismatchException(msg); } } SentryPolicyStoreProcessor(String name, Configuration conf); void stop(); void registerPlugin(SentryPolicyStorePlugin plugin); @VisibleForTesting Configuration getSentryStoreConf(); @Override TCreateSentryRoleResponse create_sentry_role(
    TCreateSentryRoleRequest request); @Override TAlterSentryRoleGrantPrivilegeResponse alter_sentry_role_grant_privilege(TAlterSentryRoleGrantPrivilegeRequest request); @Override TAlterSentryRoleRevokePrivilegeResponse alter_sentry_role_revoke_privilege(TAlterSentryRoleRevokePrivilegeRequest request); @Override TDropSentryRoleResponse drop_sentry_role(
    TDropSentryRoleRequest request); @Override TAlterSentryRoleAddGroupsResponse alter_sentry_role_add_groups(
    TAlterSentryRoleAddGroupsRequest request); @Override TAlterSentryRoleDeleteGroupsResponse alter_sentry_role_delete_groups(
    TAlterSentryRoleDeleteGroupsRequest request); @Override TListSentryRolesResponse list_sentry_roles_by_group(
    TListSentryRolesRequest request); @Override TListSentryPrivilegesResponse list_sentry_privileges_by_role(
      TListSentryPrivilegesRequest request); @Override TListSentryPrivilegesForProviderResponse list_sentry_privileges_for_provider(
      TListSentryPrivilegesForProviderRequest request); static Set<String> getGroupsFromUserName(Configuration conf,
      String userName); @Override TDropPrivilegesResponse drop_sentry_privilege(
      TDropPrivilegesRequest request); @Override TRenamePrivilegesResponse rename_sentry_privilege(
      TRenamePrivilegesRequest request); @Override TListSentryPrivilegesByAuthResponse list_sentry_privileges_by_authorizable(
      TListSentryPrivilegesByAuthRequest request); @Override TSentryConfigValueResponse get_sentry_config_value(
          TSentryConfigValueRequest request); @Override TSentryExportMappingDataResponse export_sentry_mapping_data(
      TSentryExportMappingDataRequest request); @Override TSentryImportMappingDataResponse import_sentry_mapping_data(
      TSentryImportMappingDataRequest request); }
SentryPolicyStoreProcessor implements SentryPolicyService.Iface { @VisibleForTesting static void validateClientVersion(int protocol_version) throws SentryThriftAPIMismatchException { if (ServiceConstants.ThriftConstants.TSENTRY_SERVICE_VERSION_CURRENT != protocol_version) { String msg = "Sentry thrift API protocol version mismatch: Client thrift version " + "is: " + protocol_version + " , server thrift verion " + "is " + ThriftConstants.TSENTRY_SERVICE_VERSION_CURRENT; throw new SentryThriftAPIMismatchException(msg); } } SentryPolicyStoreProcessor(String name, Configuration conf); void stop(); void registerPlugin(SentryPolicyStorePlugin plugin); @VisibleForTesting Configuration getSentryStoreConf(); @Override TCreateSentryRoleResponse create_sentry_role(
    TCreateSentryRoleRequest request); @Override TAlterSentryRoleGrantPrivilegeResponse alter_sentry_role_grant_privilege(TAlterSentryRoleGrantPrivilegeRequest request); @Override TAlterSentryRoleRevokePrivilegeResponse alter_sentry_role_revoke_privilege(TAlterSentryRoleRevokePrivilegeRequest request); @Override TDropSentryRoleResponse drop_sentry_role(
    TDropSentryRoleRequest request); @Override TAlterSentryRoleAddGroupsResponse alter_sentry_role_add_groups(
    TAlterSentryRoleAddGroupsRequest request); @Override TAlterSentryRoleDeleteGroupsResponse alter_sentry_role_delete_groups(
    TAlterSentryRoleDeleteGroupsRequest request); @Override TListSentryRolesResponse list_sentry_roles_by_group(
    TListSentryRolesRequest request); @Override TListSentryPrivilegesResponse list_sentry_privileges_by_role(
      TListSentryPrivilegesRequest request); @Override TListSentryPrivilegesForProviderResponse list_sentry_privileges_for_provider(
      TListSentryPrivilegesForProviderRequest request); static Set<String> getGroupsFromUserName(Configuration conf,
      String userName); @Override TDropPrivilegesResponse drop_sentry_privilege(
      TDropPrivilegesRequest request); @Override TRenamePrivilegesResponse rename_sentry_privilege(
      TRenamePrivilegesRequest request); @Override TListSentryPrivilegesByAuthResponse list_sentry_privileges_by_authorizable(
      TListSentryPrivilegesByAuthRequest request); @Override TSentryConfigValueResponse get_sentry_config_value(
          TSentryConfigValueRequest request); @Override TSentryExportMappingDataResponse export_sentry_mapping_data(
      TSentryExportMappingDataRequest request); @Override TSentryImportMappingDataResponse import_sentry_mapping_data(
      TSentryImportMappingDataRequest request); static final String SENTRY_POLICY_SERVICE_NAME; static volatile SentryPolicyStoreProcessor instance; }