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

3- New BulkAPI format - bulk api recommendation api responses are recorded #1477

Closed
wants to merge 3 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
361 changes: 240 additions & 121 deletions src/main/java/com/autotune/analyzer/serviceObjects/BulkJobStatus.java

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws Se
return;
}
jobDetails = jobStatusMap.get(jobID);
LOGGER.info("Job Status: " + jobDetails.getStatus());
LOGGER.info("Job Status: " + jobDetails.getSummary().getStatus());
resp.setContentType(JSON_CONTENT_TYPE);
resp.setCharacterEncoding(CHARACTER_ENCODING);
SimpleFilterProvider filters = new SimpleFilterProvider();
Expand Down
119 changes: 76 additions & 43 deletions src/main/java/com/autotune/analyzer/workerimpl/BulkJobManager.java

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.autotune.common.data.dataSourceMetadata;

import com.autotune.utils.KruizeConstants;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.gson.annotations.SerializedName;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand All @@ -14,38 +15,38 @@
public class DataSource {
private static final Logger LOGGER = LoggerFactory.getLogger(DataSource.class);
@SerializedName(KruizeConstants.DataSourceConstants.DataSourceMetadataInfoJSONKeys.DATASOURCE_NAME)
@JsonProperty(KruizeConstants.DataSourceConstants.DataSourceMetadataInfoJSONKeys.DATASOURCE_NAME)
private String dataSourceName;

/**
* Key: Cluster name
* Value: Associated DataSourceCluster object
*/
@SerializedName(KruizeConstants.DataSourceConstants.DataSourceMetadataInfoJSONKeys.CLUSTERS)
private HashMap<String, DataSourceCluster> clusterHashMap;
private HashMap<String, DataSourceCluster> clusters;

public DataSource(String dataSourceName, HashMap<String,DataSourceCluster> clusterHashMap) {
public DataSource(String dataSourceName, HashMap<String, DataSourceCluster> clusters) {
this.dataSourceName = dataSourceName;
this.clusterHashMap = clusterHashMap;
this.clusters = clusters;
}

public String getDataSourceName() {
return dataSourceName;
}

public HashMap<String, DataSourceCluster> getDataSourceClusterHashMap() {
return clusterHashMap;
public HashMap<String, DataSourceCluster> getClusters() {
return clusters;
}

public void setDataSourceClusterHashMap(HashMap<String, DataSourceCluster> clusterHashMap) {
public void setClusters(HashMap<String, DataSourceCluster> clusterHashMap) {
if (null == clusterHashMap) {
LOGGER.debug(KruizeConstants.DataSourceConstants.DataSourceMetadataErrorMsgs.SET_CLUSTER_MAP_ERROR + "{}", dataSourceName);
}
this.clusterHashMap = clusterHashMap;
this.clusters = clusterHashMap;
}

public DataSourceCluster getDataSourceClusterObject(String clusterName) {
if (null != clusterHashMap && clusterHashMap.containsKey(clusterName)) {
return clusterHashMap.get(clusterName);
if (null != clusters && clusters.containsKey(clusterName)) {
return clusters.get(clusterName);
}
return null;
}
Expand All @@ -54,7 +55,7 @@ public DataSourceCluster getDataSourceClusterObject(String clusterName) {
public String toString() {
return "DataSource{" +
"datasource_name='" + dataSourceName + '\'' +
", clusters=" + clusterHashMap +
", clusters=" + clusters +
'}';
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.autotune.common.data.dataSourceMetadata;

import com.autotune.utils.KruizeConstants;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.gson.annotations.SerializedName;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand All @@ -14,38 +15,38 @@
public class DataSourceCluster {
private static final Logger LOGGER = LoggerFactory.getLogger(DataSourceCluster.class);
@SerializedName(KruizeConstants.DataSourceConstants.DataSourceMetadataInfoJSONKeys.CLUSTER_NAME)
@JsonProperty(KruizeConstants.DataSourceConstants.DataSourceMetadataInfoJSONKeys.CLUSTER_NAME)
private String clusterName;

/**
* Key: Namespace
* Value: Associated DataSourceNamespace object
*/
@SerializedName(KruizeConstants.DataSourceConstants.DataSourceMetadataInfoJSONKeys.NAMESPACES)
private HashMap<String, DataSourceNamespace> namespaceHashMap;
private HashMap<String, DataSourceNamespace> namespaces;

public DataSourceCluster(String clusterName, HashMap<String, DataSourceNamespace> namespaceHashMap) {
public DataSourceCluster(String clusterName, HashMap<String, DataSourceNamespace> namespaces) {
this.clusterName = clusterName;
this.namespaceHashMap = namespaceHashMap;
this.namespaces = namespaces;
}

public String getDataSourceClusterName() {
return clusterName;
}

public HashMap<String, DataSourceNamespace> getDataSourceNamespaceHashMap() {
return namespaceHashMap;
public HashMap<String, DataSourceNamespace> getNamespaces() {
return namespaces;
}

public void setDataSourceNamespaceHashMap(HashMap<String, DataSourceNamespace> namespaceHashMap) {
public void setNamespaces(HashMap<String, DataSourceNamespace> namespaceHashMap) {
if (null == namespaceHashMap) {
LOGGER.debug(KruizeConstants.DataSourceConstants.DataSourceMetadataErrorMsgs.SET_NAMESPACE_MAP_ERROR + "{}", clusterName);
}
this.namespaceHashMap = namespaceHashMap;
this.namespaces = namespaceHashMap;
}

public DataSourceNamespace getDataSourceNamespaceObject(String namespace) {
if (null != namespaceHashMap && namespaceHashMap.containsKey(namespace)) {
return namespaceHashMap.get(namespace);
if (null != namespaces && namespaces.containsKey(namespace)) {
return namespaces.get(namespace);
}
return null;
}
Expand All @@ -54,7 +55,7 @@ public DataSourceNamespace getDataSourceNamespaceObject(String namespace) {
public String toString() {
return "DataSourceCluster{" +
"cluster_name='" + clusterName + '\'' +
", namespaces=" + namespaceHashMap +
", namespaces=" + namespaces +
'}';
}
}
Original file line number Diff line number Diff line change
@@ -1,24 +1,32 @@
package com.autotune.common.data.dataSourceMetadata;

import com.autotune.utils.KruizeConstants;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.gson.annotations.SerializedName;

/**
* DataSourceContainer object represents the container metadata for a workload
*/
public class DataSourceContainer {
@SerializedName(KruizeConstants.DataSourceConstants.DataSourceMetadataInfoJSONKeys.CONTAINER_NAME)
@JsonProperty(KruizeConstants.DataSourceConstants.DataSourceMetadataInfoJSONKeys.CONTAINER_NAME)
private String containerName;
@SerializedName(KruizeConstants.DataSourceConstants.DataSourceMetadataInfoJSONKeys.CONTAINER_IMAGE_NAME)
@JsonProperty(KruizeConstants.DataSourceConstants.DataSourceMetadataInfoJSONKeys.CONTAINER_IMAGE_NAME)
private String containerImageName;

public DataSourceContainer(String containerName, String containerImageName) {
this.containerName = containerName;
this.containerImageName = containerImageName;
}

public String getDataSourceContainerName() { return containerName;}
public String getDataSourceContainerImageName() { return containerImageName;}
public String getContainerName() {
return containerName;
}

public String getContainerImageName() {
return containerImageName;
}

@Override
public String toString() {
Expand Down
Loading