[ 
https://issues.apache.org/jira/browse/EAGLE-455?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15417193#comment-15417193
 ] 

ASF GitHub Bot commented on EAGLE-455:
--------------------------------------

Github user haoch commented on a diff in the pull request:

    https://github.com/apache/incubator-eagle/pull/331#discussion_r74418107
  
    --- Diff: 
eagle-security/eagle-security-common/src/main/java/org/apache/eagle/security/service/JDBCSecurityMetadataDAO.java
 ---
    @@ -20,73 +20,72 @@
     package org.apache.eagle.security.service;
     
     import com.google.inject.Inject;
    -import com.typesafe.config.Config;
    +import org.apache.eagle.metadata.store.jdbc.JDBCMetadataQueryService;
     import org.slf4j.Logger;
     import org.slf4j.LoggerFactory;
     
    -import java.sql.*;
    -import java.util.ArrayList;
    +import javax.sql.DataSource;
    +import java.sql.Connection;
    +import java.sql.PreparedStatement;
    +import java.sql.SQLException;
     import java.util.Collection;
    +import java.util.Collections;
     
     /**
      * Since 8/8/16.
      */
     public class JDBCSecurityMetadataDAO implements ISecurityMetadataDAO  {
         private static final Logger LOG = 
LoggerFactory.getLogger(JDBCSecurityMetadataDAO.class);
     
    -    private Config config;
         /**
          * composite primary key: site and hbase_resource
          */
    +    private final String TABLE_DDL_STATEMENT = "create table if not exists 
hbase_sensitivity_entity (site varchar(20), hbase_resource varchar(100), 
sensitivity_type varchar(20), primary key (site, hbase_resource));";
         private final String QUERY_ALL_STATEMENT = "SELECT site, 
hbase_resource, sensitivity_type FROM hbase_sensitivity_entity";
         private final String INSERT_STATEMENT = "INSERT INTO 
hbase_sensitivity_entity (site, hbase_resource, sensitivity_type) VALUES (?, ?, 
?)";
     
    -    // get connection url from config
    +    private DataSource dataSource;
    +    private JDBCMetadataQueryService queryService;
    +
    +    /**
    +     * Inject datasource
    +     *
    +     * @param dataSource
    +     */
         @Inject
    -    public JDBCSecurityMetadataDAO(Config config){
    -        this.config = config;
    +    public JDBCSecurityMetadataDAO(DataSource dataSource, 
JDBCMetadataQueryService queryService) {
    --- End diff --
    
    Create table if not exists when initializing.


> Provide shared JDBCQueryService for JDBCMetadataStore
> -----------------------------------------------------
>
>                 Key: EAGLE-455
>                 URL: https://issues.apache.org/jira/browse/EAGLE-455
>             Project: Eagle
>          Issue Type: New Feature
>            Reporter: Hao Chen
>            Assignee: Hao Chen
>




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to