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

    https://github.com/apache/tajo/pull/39#discussion_r13848338
  
    --- Diff: 
tajo-catalog/tajo-catalog-server/src/main/java/org/apache/tajo/catalog/store/MariaDBStore.java
 ---
    @@ -0,0 +1,301 @@
    +/**
    + * Licensed to the Apache Software Foundation (ASF) under one
    + * or more contributor license agreements.  See the NOTICE file
    + * distributed with this work for additional information
    + * regarding copyright ownership.  The ASF licenses this file
    + * to you under the Apache License, Version 2.0 (the
    + * "License"); you may not use this file except in compliance
    + * with the License.  You may obtain a copy of the License at
    + *
    + *     http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +
    +/**
    + *
    + */
    +package org.apache.tajo.catalog.store;
    +
    +import org.apache.hadoop.conf.Configuration;
    +import org.apache.tajo.catalog.CatalogUtil;
    +import org.apache.tajo.catalog.exception.CatalogException;
    +import org.apache.tajo.exception.InternalException;
    +
    +import java.sql.*;
    +import java.util.HashMap;
    +import java.util.Map;
    +
    +public class MariaDBStore extends AbstractDBStore  {
    +  /** 2014-06-09: First versioning */
    +  private static final int MARIADB_CATALOG_STORE_VERSION = 2;
    +
    +  private static final String CATALOG_DRIVER = "org.mariadb.jdbc.Driver";
    +  protected String getCatalogDriverName(){
    +    return CATALOG_DRIVER;
    +  }
    +
    +  public MariaDBStore(final Configuration conf) throws InternalException {
    +    super(conf);
    +  }
    +
    +  @Override
    +  public int getDriverVersion() {
    +    return MARIADB_CATALOG_STORE_VERSION;
    +  }
    +
    +  protected Connection createConnection(Configuration conf) throws 
SQLException {
    +    Connection con = DriverManager.getConnection(getCatalogUri(), 
this.connectionId,
    +        this.connectionPassword);
    +    //TODO con.setAutoCommit(false);
    +    return con;
    +  }
    +
    +  @Override
    +  protected boolean isConnValid(int timeout) throws CatalogException {
    +    boolean isValid = false;
    +
    +    try {
    +      isValid = super.isConnValid(timeout);
    +    } catch (NullPointerException e) {
    +      LOG.info("Conn abortion when checking isValid; retrieve false to 
create another Conn.");
    --- End diff --
    
    MariaDBStore's isValid NPE handling will give NACK to getConnection method 
so that Tajo tries to connect another JDBC session.


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to