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.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to