Skip to content

Commit

Permalink
handle 'metadataQueryMaxSize'
Browse files Browse the repository at this point in the history
  • Loading branch information
tristaZero committed Oct 6, 2019
1 parent b6b3462 commit 40efde6
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.Properties;

/**
* MySQL storage provider should be secondary choice for production usage as SkyWalking storage solution. It enhanced
* and came from H2StorageProvider, but consider more in using in production.
Expand Down Expand Up @@ -95,7 +97,7 @@ public MySQLStorageProvider() {
}

@Override public void prepare() throws ServiceNotProvidedException {
mysqlClient = new JDBCHikariCPClient(config.getProperties());
mysqlClient = new JDBCHikariCPClient(getConfigProperties());

this.registerServiceImplementation(IBatchDAO.class, new H2BatchDAO(mysqlClient));
this.registerServiceImplementation(StorageDAO.class, new H2StorageDAO(mysqlClient));
Expand All @@ -117,7 +119,7 @@ public MySQLStorageProvider() {
this.registerServiceImplementation(ITopNRecordsQueryDAO.class, new H2TopNRecordsQueryDAO(mysqlClient));
this.registerServiceImplementation(ILogQueryDAO.class, new MySQLLogQueryDAO(mysqlClient));
}

@Override public void start() throws ServiceNotProvidedException, ModuleStartException {
try {
mysqlClient.connect();
Expand All @@ -139,6 +141,12 @@ public MySQLStorageProvider() {
return new String[] {CoreModule.NAME};
}

private Properties getConfigProperties() {
Properties properties = new Properties(config.getProperties());
properties.remove("metadataQueryMaxSize");
return properties;
}

private int getMetadataQueryMaxSize() {
String result = config.getProperties().getProperty("metadataQueryMaxSize", "5000");
return Integer.valueOf(result);
Expand Down

0 comments on commit 40efde6

Please sign in to comment.