diff --git a/shell/src/main/java/org/apache/sqoop/shell/GrantPrivilegeFunction.java b/shell/src/main/java/org/apache/sqoop/shell/GrantPrivilegeFunction.java index ccf89884..27959d75 100644 --- a/shell/src/main/java/org/apache/sqoop/shell/GrantPrivilegeFunction.java +++ b/shell/src/main/java/org/apache/sqoop/shell/GrantPrivilegeFunction.java @@ -99,6 +99,10 @@ private Status grantPrivilege(String action, String resourceType, String resourc Arrays.asList(principalObject), Arrays.asList(privilegeObject)); + if (resourceType.toUpperCase().equals(MResource.TYPE.CONNECTOR.name())) { + client.clearCache(); + } + printlnResource(Constants.RES_GRANT_PRIVILEGE_SUCCESSFUL, action, resourceType + " " + resource, ((withGrant) ? " " + resourceString(Constants.RES_GRANT_PRIVILEGE_SUCCESSFUL_WITH_GRANT) : ""), diff --git a/shell/src/main/java/org/apache/sqoop/shell/RevokePrivilegeFunction.java b/shell/src/main/java/org/apache/sqoop/shell/RevokePrivilegeFunction.java index e0b86cf0..0551b54f 100644 --- a/shell/src/main/java/org/apache/sqoop/shell/RevokePrivilegeFunction.java +++ b/shell/src/main/java/org/apache/sqoop/shell/RevokePrivilegeFunction.java @@ -100,6 +100,10 @@ private Status revokePrivilege(String action, String resourceType, String resour Arrays.asList(principalObject), Arrays.asList(privilegeObject)); + if (resourceType.toUpperCase().equals(MResource.TYPE.CONNECTOR.name())) { + client.clearCache(); + } + printlnResource(Constants.RES_REVOKE_PRIVILEGE_SUCCESSFUL, action, resourceType + " " + resource, ((withGrant) ? " " + resourceString(Constants.RES_REVOKE_PRIVILEGE_SUCCESSFUL_WITH_GRANT) : ""),