com.opdar.gulosity.base.TableCache Maven / Gradle / Ivy
The newest version!
package com.opdar.gulosity.base;
import com.opdar.gulosity.connection.MysqlConnection;
import com.opdar.gulosity.connection.entity.Column;
import com.opdar.gulosity.entity.MysqlAuthInfoEntity;
import com.opdar.gulosity.utils.MysqlUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.IOException;
import java.util.*;
/**
* Created by 俊帆 on 2016/10/14.
*/
public class TableCache implements Runnable {
public static final String INFORMATION_SCHEMA = "information_schema";
public static final String MYSQL = "mysql";
public static final String PERFORMANCE_SCHEMA = "performance_schema";
private MysqlAuthInfoEntity authInfo;
private TableCacheCallback cacheCallback;
private Logger logger = LoggerFactory.getLogger(getClass());
public TableCache(MysqlAuthInfoEntity authInfo,TableCacheCallback cacheCallback) {
this.authInfo = authInfo;
this.cacheCallback = cacheCallback;
}
@Override
public void run() {
MysqlConnection connection = new MysqlConnection(authInfo);
try {
connection.connect();
connection.waitConnect();
List