Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bulk api test #1363

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 19 additions & 5 deletions src/main/java/com/autotune/Autotune.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,20 @@
import com.autotune.analyzer.utils.AnalyzerConstants;
import com.autotune.common.datasource.DataSourceCollection;
import com.autotune.common.datasource.DataSourceInfo;
import com.autotune.common.exceptions.datasource.DataSourceAlreadyExist;
import com.autotune.common.exceptions.datasource.DataSourceNotServiceable;
import com.autotune.common.exceptions.datasource.UnsupportedDataSourceProvider;
import com.autotune.database.helper.DBConstants;
import com.autotune.database.init.KruizeHibernateUtil;
import com.autotune.experimentManager.core.ExperimentManager;
import com.autotune.operator.InitializeDeployment;
import com.autotune.operator.KruizeDeploymentInfo;
import com.autotune.service.HealthService;
import com.autotune.service.InitiateListener;
import com.autotune.utils.*;
import com.autotune.utils.CloudWatchAppender;
import com.autotune.utils.KruizeConstants;
import com.autotune.utils.MetricsConfig;
import com.autotune.utils.ServerContext;
import com.autotune.utils.filter.KruizeCORSFilter;
import io.prometheus.client.exporter.MetricsServlet;
import io.prometheus.client.hotspot.DefaultExports;
Expand All @@ -50,8 +56,12 @@

import javax.servlet.DispatcherType;
import java.io.File;
import java.io.IOException;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.security.KeyManagementException;
import java.security.KeyStoreException;
import java.security.NoSuchAlgorithmException;
import java.util.EnumSet;
import java.util.HashMap;
import java.util.Scanner;
Expand Down Expand Up @@ -112,7 +122,11 @@ public static void main(String[] args) {
// load available datasources from db
loadDataSourcesFromDB();
// setting up DataSources
setUpDataSources();
try {
setUpDataSources();
} catch (Exception e) {
LOGGER.error(e.getMessage());
}
// checking available DataSources
checkAvailableDataSources();
// load available metric profiles from db
Expand All @@ -124,7 +138,7 @@ public static void main(String[] args) {
//Regenerate a Hibernate session following the creation of new tables
KruizeHibernateUtil.buildSessionFactory();
} catch (Exception | K8sTypeNotSupportedException | MonitoringAgentNotSupportedException |
MonitoringAgentNotFoundException e) {
MonitoringAgentNotFoundException e) {
e.printStackTrace();
System.exit(1);
}
Expand Down Expand Up @@ -170,7 +184,7 @@ public static void main(String[] args) {
/**
* Set up the data sources available at installation time from config file
*/
private static void setUpDataSources() {
private static void setUpDataSources() throws UnsupportedDataSourceProvider, DataSourceNotServiceable, DataSourceAlreadyExist, IOException, NoSuchAlgorithmException, KeyStoreException, KeyManagementException {
DataSourceCollection dataSourceCollection = DataSourceCollection.getInstance();
dataSourceCollection.addDataSourcesFromConfigFile(KruizeConstants.CONFIG_FILE);
}
Expand All @@ -190,7 +204,7 @@ private static void checkAvailableDataSources() {
DataSourceCollection dataSourceCollection = DataSourceCollection.getInstance();
LOGGER.info(KruizeConstants.DataSourceConstants.DataSourceInfoMsgs.CHECKING_AVAILABLE_DATASOURCE);
HashMap<String, DataSourceInfo> dataSources = dataSourceCollection.getDataSourcesCollection();
for (String name: dataSources.keySet()) {
for (String name : dataSources.keySet()) {
DataSourceInfo dataSource = dataSources.get(name);
String dataSourceName = dataSource.getName();
String url = dataSource.getUrl().toString();
Expand Down

Large diffs are not rendered by default.

Loading
Loading