Skip to content

Commit

Permalink
Kyligence#92 remove internal keywords
Browse files Browse the repository at this point in the history
  • Loading branch information
Yu Gan committed Dec 18, 2019
1 parent 459f68c commit 804a888
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,10 @@ trait ExternalCatalog {

def setCurrentDatabase(db: String): Unit

/** KAP#16210 */
def listRoleUsers(roleName: String): Seq[String]

/** KAP#16210 */
def listUserRoles(userName: String): Seq[String]

/** KAP#16210 */
def getReadablePrincipals(dbName: String, tableName: String): Map[String, Seq[String]]

// --------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,17 +81,14 @@ class ExternalCatalogWithListener(delegate: ExternalCatalog)
delegate.setCurrentDatabase(db)
}

/** KAP#16210 */
override def listRoleUsers(roleName: String): Seq[String] = {
delegate.listRoleUsers(roleName)
}

/** KAP#16210 */
override def listUserRoles(userName: String): Seq[String] = {
delegate.listUserRoles(userName)
}

/** KAP#16210 */
override def getReadablePrincipals(dbName: String,
tableName: String): Map[String, Seq[String]] = {
delegate.getReadablePrincipals(dbName, tableName)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,17 +176,14 @@ class InMemoryCatalog(

override def setCurrentDatabase(db: String): Unit = { /* no-op */ }

/** KAP#16210 */
override def listRoleUsers(roleName: String): Seq[String] = {
Seq.empty;
}

/** KAP#16210 */
override def listUserRoles(userName: String): Seq[String] = {
Seq.empty
}

/** KAP#16210 */
override def getReadablePrincipals(dbName: String,
tableName: String): Map[String, Seq[String]] = {
Map.empty
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,17 +227,14 @@ private[spark] class HiveExternalCatalog(conf: SparkConf, hadoopConf: Configurat
client.setCurrentDatabase(db)
}

/** KAP#16210 */
override def listRoleUsers(roleName: String): Seq[String] = withClient {
client.listRoleUsers(roleName)
}

/** KAP#16210 */
override def listUserRoles(userName: String): Seq[String] = withClient {
client.listUserRoles(userName)
}

/** KAP#16210 */
override def getReadablePrincipals(dbName: String,
tableName: String): Map[String, Seq[String]] = withClient {
client.getReadablePrincipals(dbName, tableName)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -289,13 +289,10 @@ private[hive] trait HiveClient {
/** Used for testing only. Removes all metadata from this instance of Hive. */
def reset(): Unit

/** KAP#16210 */
def listRoleUsers(roleName: String): Seq[String]

/** KAP#16210 */
def listUserRoles(userName: String): Seq[String]

/** KAP#16210 */
def getReadablePrincipals(dbName: String, tableName: String): Map[String, Seq[String]]

}
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,6 @@ private[hive] class HiveClientImpl(
client.getTablesByPattern(dbName, pattern).asScala
}

/** KAP#16210 */
override def listRoleUsers(roleName: String): Seq[String] = withHiveState {
val resp = client.getMSC.get_principals_in_role(new GetPrincipalsInRoleRequest(roleName))
if (resp == null || resp.getPrincipalGrants == null) {
Expand All @@ -699,7 +698,6 @@ private[hive] class HiveClientImpl(
.map(_.getPrincipalName)
}

/** KAP#16210 */
override def listUserRoles(userName: String): Seq[String] = withHiveState {
val resp = client.getMSC.list_roles(userName, PrincipalType.USER)
if (resp == null) {
Expand All @@ -708,7 +706,6 @@ private[hive] class HiveClientImpl(
resp.asScala.map(_.getRoleName)
}

/** KAP#16210 */
override def getReadablePrincipals(dbName: String,
tableName: String): Map[String, Seq[String]] = withHiveState {
val privileges = client.getMSC.list_privileges(null, null,
Expand Down

0 comments on commit 804a888

Please sign in to comment.