kylin-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From liy...@apache.org
Subject [01/37] kylin git commit: after affects of KYLIN-2335
Date Fri, 19 May 2017 10:04:28 GMT
Repository: kylin
Updated Branches:
  refs/heads/master 87fedf75e -> f36372bc6


after affects of KYLIN-2335


Project: http://git-wip-us.apache.org/repos/asf/kylin/repo
Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/d6098099
Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/d6098099
Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/d6098099

Branch: refs/heads/master
Commit: d609809939d8221ec37b8056abad359a58154f4b
Parents: 02a3d14
Author: Hongbin Ma <mahongbin@apache.org>
Authored: Fri Apr 28 13:26:57 2017 +0800
Committer: Hongbin Ma <mahongbin@apache.org>
Committed: Fri Apr 28 13:26:57 2017 +0800

----------------------------------------------------------------------
 .../rest/service/AclTableMigrationTool.java     |   6 +-
 .../apache/kylin/rest/service/UserService.java  | 162 +++++++++----------
 .../kylin/rest/service/ServiceTestBase.java     |   6 +-
 3 files changed, 87 insertions(+), 87 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kylin/blob/d6098099/server-base/src/main/java/org/apache/kylin/rest/service/AclTableMigrationTool.java
----------------------------------------------------------------------
diff --git a/server-base/src/main/java/org/apache/kylin/rest/service/AclTableMigrationTool.java
b/server-base/src/main/java/org/apache/kylin/rest/service/AclTableMigrationTool.java
index da017b3..d147686 100644
--- a/server-base/src/main/java/org/apache/kylin/rest/service/AclTableMigrationTool.java
+++ b/server-base/src/main/java/org/apache/kylin/rest/service/AclTableMigrationTool.java
@@ -146,7 +146,7 @@ public class AclTableMigrationTool {
                     Result result = rs.next();
                     while (result != null) {
                         User user = hbaseRowToUser(result);
-                        UserInfo userInfo = convert(user);
+                        UserService.UserInfo userInfo = convert(user);
                         store.deleteResource(UserService.getId(userInfo.getUsername()));
                         store.putResource(UserService.getId(userInfo.getUsername()), userInfo,
0, UserService.UserInfoSerializer.getInstance());
                         result = rs.next();
@@ -252,10 +252,10 @@ public class AclTableMigrationTool {
         return newInfo;
     }
 
-    private UserInfo convert(User user) {
+    private UserService.UserInfo convert(User user) {
         if (user == null)
             return null;
-        UserInfo newInfo = new UserInfo();
+        UserService.UserInfo newInfo = new UserService.UserInfo();
         newInfo.setUsername(user.getUserName());
         newInfo.setPassword(user.getPassword());
         List<String> authorities = new ArrayList<>();

http://git-wip-us.apache.org/repos/asf/kylin/blob/d6098099/server-base/src/main/java/org/apache/kylin/rest/service/UserService.java
----------------------------------------------------------------------
diff --git a/server-base/src/main/java/org/apache/kylin/rest/service/UserService.java b/server-base/src/main/java/org/apache/kylin/rest/service/UserService.java
index 6a552fd..dd75ace 100644
--- a/server-base/src/main/java/org/apache/kylin/rest/service/UserService.java
+++ b/server-base/src/main/java/org/apache/kylin/rest/service/UserService.java
@@ -180,107 +180,107 @@ public class UserService implements UserDetailsManager {
         }
     }
 
-}
+    public static class UserInfo extends RootPersistentEntity {
+        @JsonProperty()
+        private String username;
+        @JsonProperty()
+        private String password;
+        @JsonProperty()
+        private List<String> authorities = new ArrayList<>();
+
+        public UserInfo(String username, String password, List<String> authorities)
{
+            this.username = username;
+            this.password = password;
+            this.authorities = authorities;
+        }
 
-class UserInfo extends RootPersistentEntity {
-    @JsonProperty()
-    private String username;
-    @JsonProperty()
-    private String password;
-    @JsonProperty()
-    private List<String> authorities = new ArrayList<>();
-
-    public UserInfo(String username, String password, List<String> authorities) {
-        this.username = username;
-        this.password = password;
-        this.authorities = authorities;
-    }
+        public UserInfo(UserDetails user) {
+            this.username = user.getUsername();
+            this.password = user.getPassword();
+            for (GrantedAuthority a : user.getAuthorities()) {
+                this.authorities.add(a.getAuthority());
+            }
+        }
 
-    public UserInfo(UserDetails user) {
-        this.username = user.getUsername();
-        this.password = user.getPassword();
-        for (GrantedAuthority a : user.getAuthorities()) {
-            this.authorities.add(a.getAuthority());
+        public UserInfo() {
         }
-    }
 
-    public UserInfo() {
-    }
+        public String getUsername() {
+            return username;
+        }
 
-    public String getUsername() {
-        return username;
-    }
+        public void setUsername(String username) {
+            this.username = username;
+        }
 
-    public void setUsername(String username) {
-        this.username = username;
-    }
+        public String getPassword() {
+            return password;
+        }
 
-    public String getPassword() {
-        return password;
-    }
+        public void setPassword(String password) {
+            this.password = password;
+        }
 
-    public void setPassword(String password) {
-        this.password = password;
-    }
+        public List<String> getAuthorities() {
+            return authorities;
+        }
 
-    public List<String> getAuthorities() {
-        return authorities;
-    }
+        public void setAuthorities(List<String> authorities) {
+            this.authorities = authorities;
+        }
 
-    public void setAuthorities(List<String> authorities) {
-        this.authorities = authorities;
     }
 
-}
-
-class UserGrantedAuthority implements GrantedAuthority {
-    private static final long serialVersionUID = -5128905636841891058L;
+    public static class UserGrantedAuthority implements GrantedAuthority {
+        private static final long serialVersionUID = -5128905636841891058L;
 
-    private String authority;
+        private String authority;
 
-    public UserGrantedAuthority() {
-    }
+        public UserGrantedAuthority() {
+        }
 
-    public UserGrantedAuthority(String authority) {
-        setAuthority(authority);
-    }
+        public UserGrantedAuthority(String authority) {
+            setAuthority(authority);
+        }
 
-    @Override
-    public String getAuthority() {
-        return authority;
-    }
+        @Override
+        public String getAuthority() {
+            return authority;
+        }
 
-    public void setAuthority(String authority) {
-        this.authority = authority;
-    }
+        public void setAuthority(String authority) {
+            this.authority = authority;
+        }
 
-    @Override
-    public int hashCode() {
-        final int prime = 31;
-        int result = 1;
-        result = prime * result + ((authority == null) ? 0 : authority.hashCode());
-        return result;
-    }
+        @Override
+        public int hashCode() {
+            final int prime = 31;
+            int result = 1;
+            result = prime * result + ((authority == null) ? 0 : authority.hashCode());
+            return result;
+        }
 
-    @Override
-    public boolean equals(Object obj) {
-        if (this == obj)
-            return true;
-        if (obj == null)
-            return false;
-        if (getClass() != obj.getClass())
-            return false;
-        UserGrantedAuthority other = (UserGrantedAuthority) obj;
-        if (authority == null) {
-            if (other.authority != null)
+        @Override
+        public boolean equals(Object obj) {
+            if (this == obj)
+                return true;
+            if (obj == null)
                 return false;
-        } else if (!authority.equals(other.authority))
-            return false;
-        return true;
-    }
+            if (getClass() != obj.getClass())
+                return false;
+            UserGrantedAuthority other = (UserGrantedAuthority) obj;
+            if (authority == null) {
+                if (other.authority != null)
+                    return false;
+            } else if (!authority.equals(other.authority))
+                return false;
+            return true;
+        }
 
-    @Override
-    public String toString() {
-        return authority;
+        @Override
+        public String toString() {
+            return authority;
+        }
     }
+
 }

http://git-wip-us.apache.org/repos/asf/kylin/blob/d6098099/server/src/test/java/org/apache/kylin/rest/service/ServiceTestBase.java
----------------------------------------------------------------------
diff --git a/server/src/test/java/org/apache/kylin/rest/service/ServiceTestBase.java b/server/src/test/java/org/apache/kylin/rest/service/ServiceTestBase.java
index 7370c48..0442bb5 100644
--- a/server/src/test/java/org/apache/kylin/rest/service/ServiceTestBase.java
+++ b/server/src/test/java/org/apache/kylin/rest/service/ServiceTestBase.java
@@ -70,17 +70,17 @@ public class ServiceTestBase extends LocalFileMetadataTestCase {
 
         if (!userService.userExists("ADMIN")) {
             userService.createUser(new User("ADMIN", "KYLIN", Arrays.asList(//
-                new UserGrantedAuthority(Constant.ROLE_ADMIN), new UserGrantedAuthority(Constant.ROLE_ANALYST),
new UserGrantedAuthority(Constant.ROLE_MODELER))));
+                new UserService.UserGrantedAuthority(Constant.ROLE_ADMIN), new UserService.UserGrantedAuthority(Constant.ROLE_ANALYST),
new UserService.UserGrantedAuthority(Constant.ROLE_MODELER))));
         }
 
         if (!userService.userExists("MODELER")) {
             userService.createUser(new User("MODELER", "MODELER", Arrays.asList(//
-                new UserGrantedAuthority(Constant.ROLE_ANALYST), new UserGrantedAuthority(Constant.ROLE_MODELER))));
+                new UserService.UserGrantedAuthority(Constant.ROLE_ANALYST), new UserService.UserGrantedAuthority(Constant.ROLE_MODELER))));
         }
 
         if (!userService.userExists("ANALYST")) {
             userService.createUser(new User("ANALYST", "ANALYST", Arrays.asList(//
-                new UserGrantedAuthority(Constant.ROLE_ANALYST))));
+                new UserService.UserGrantedAuthority(Constant.ROLE_ANALYST))));
         }
     }
 


Mime
View raw message