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

Import Data from Global Hashmap and retrieve Datasource details #1083

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
b69acc1
Implement DataSourceDetailsInfo and associated nested JSON object cla…
shreyabiradar07 Jan 17, 2024
b3722ba
Add abstraction for PromQL queries
shreyabiradar07 Jan 17, 2024
92fdaac
Add DataSourceManager to manage experiments from collection of data s…
shreyabiradar07 Jan 18, 2024
503c3a9
Add extractDataObject function to extract data object for processing …
shreyabiradar07 Jan 19, 2024
0e740ef
Invoke DataSourceManager to create experiments from Datasource on ini…
shreyabiradar07 Jan 19, 2024
d6c5921
Add abstraction to create DataSourceDetailsInfo Object
shreyabiradar07 Jan 19, 2024
517e8cc
Implement helper functions to process metric data object and populate…
shreyabiradar07 Jan 19, 2024
0c71bf4
Refactor code by encapsulating common API functionality for Prometheu…
shreyabiradar07 Jan 22, 2024
b26b4fa
Refactor interface methods for Prometheus data extraction
shreyabiradar07 Jan 22, 2024
55f2870
Update extract methods to specifically extract Prometheus data values…
shreyabiradar07 Jan 22, 2024
fee27ff
Convert DataSourceDetailsOperator to singleton for restricted access …
shreyabiradar07 Jan 23, 2024
a1b45dc
Add comments explaining DataSourceQueries and PromQLDataSourceQueries…
shreyabiradar07 Jan 24, 2024
0428f61
Update return type to JsonArray and rename function to getPrometheusD…
shreyabiradar07 Jan 25, 2024
5fd8e3f
Rename function to getPrometheusDataValue
shreyabiradar07 Jan 25, 2024
a6c063a
Rename and update function documentation
shreyabiradar07 Jan 29, 2024
dd0becb
Rename createExperimentsFromDataSource to ImportDataFromDataSource an…
shreyabiradar07 Jan 29, 2024
58a1a01
Merge branch 'kruize_local_add_datasource' into 'retreive_datasource_…
shreyabiradar07 Jan 30, 2024
61b4a89
Add methods to execute queries on datasources
shreyabiradar07 Jan 30, 2024
1ff1a92
Optimize code by replacing strings with constants
shreyabiradar07 Jan 30, 2024
6f845f7
implement functionality to import data for a specified data source
shreyabiradar07 Jan 30, 2024
92eff8c
Add validation for query result array
shreyabiradar07 Jan 30, 2024
8d9e594
Optimise code by adding validation constants and exception
shreyabiradar07 Jan 30, 2024
3db7ea1
Improve code formatting
shreyabiradar07 Jan 31, 2024
32f9294
Add 'getDataFromDataSource' method to retrieve details for a specific…
shreyabiradar07 Jan 31, 2024
e11903a
Refactor data population on runtime based on data source provider
shreyabiradar07 Jan 31, 2024
c3516c5
Merge remote-tracking branch 'upstream/kruize_local_poc' into 'retrie…
shreyabiradar07 Feb 1, 2024
d76b029
Add exceptions to handle data source details
shreyabiradar07 Feb 5, 2024
76d4ac3
Refactor datasource metadata population validation logic
shreyabiradar07 Feb 5, 2024
4708484
Refactor 'DataSourceDetailsInfo' and nested objects to use HashMap
shreyabiradar07 Feb 7, 2024
d80a641
Update 'DataSourceDetailsInfo' data population with namespace metadata
shreyabiradar07 Feb 7, 2024
8525835
Refactor DataSourceDetails classes and delete unused setter functions
shreyabiradar07 Feb 9, 2024
4e6c13a
Add functionalities for population of workload and container metadata…
shreyabiradar07 Feb 9, 2024
1bf18bb
Update comments and refactor exception handling
shreyabiradar07 Feb 9, 2024
aaa4782
Add debug statements and replace strings with constants
shreyabiradar07 Feb 12, 2024
ca9d759
Set cluster name as default and refactor nested if statements
shreyabiradar07 Feb 15, 2024
4f5c7b5
Update getDataSourceDetailsInfo() to return metadata specific to a gi…
shreyabiradar07 Feb 16, 2024
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
package com.autotune.common.data.dataSourceDetails;

import com.autotune.utils.KruizeConstants;
import com.google.gson.annotations.SerializedName;
import java.util.HashMap;

/**
* DataSourceCluster object represents the cluster of a data source, and it's associated namespaces
* used to store hashmap of DataSourceNamespace objects representing namespace metadata
*/
public class DataSourceCluster {
@SerializedName(KruizeConstants.DataSourceConstants.DataSourceDetailsInfoJSONKeys.CLUSTER_NAME)
private String clusterName;

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

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

public String getDataSourceClusterName() {
return clusterName;
}

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

public DataSourceNamespace getDataSourceNamespaceObject(String namespace) {
if (null != namespaceHashMap && namespaceHashMap.containsKey(namespace)) {
return namespaceHashMap.get(namespace);
}
return null;
}

@Override
public String toString() {
return "DataSourceCluster{" +
"cluster_name='" + clusterName + '\'' +
", namespaces=" + namespaceHashMap +
'}';
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
package com.autotune.common.data.dataSourceDetails;

import com.autotune.utils.KruizeConstants;
import com.google.gson.annotations.SerializedName;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.HashMap;

/**
* DataSourceClusterGroup object represents the cluster group for a given data source, and it's associated clusters
* used to store hashmap of DataSourceCluster objects representing cluster metadata
*/
public class DataSourceClusterGroup {
private static final Logger LOGGER = LoggerFactory.getLogger(DataSourceClusterGroup.class);
@SerializedName(KruizeConstants.DataSourceConstants.DataSourceDetailsInfoJSONKeys.CLUSTER_GROUP_NAME)
private String clusterGroupName;

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

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

public String getDataSourceClusterGroupName() {
return clusterGroupName;
}

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

public void setDataSourceClusterHashMap(HashMap<String, DataSourceCluster> clusters) {
if (null == clusters) {
LOGGER.error(KruizeConstants.DataSourceConstants.DataSourceDetailsErrorMsgs.SET_CLUSTER_MAP_ERROR + clusterGroupName);
}
this.clusterHashMap = clusters;
}

public DataSourceCluster getDataSourceClusterObject(String clusterName) {
if (null != clusterHashMap && clusterHashMap.containsKey(clusterName)) {
return clusterHashMap.get(clusterName);
}
return null;
}

@Override
public String toString() {
return "DataSourceClusterGroup{" +
"cluster_group_name='" + clusterGroupName + '\'' +
", clusters=" + clusterHashMap +
'}';
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package com.autotune.common.data.dataSourceDetails;

import com.autotune.utils.KruizeConstants;
import com.google.gson.annotations.SerializedName;

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

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

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

@Override
public String toString() {
return "DataSourceContainer{" +
"container_name ='" + containerName + '\'' +
", container_image_name ='" + containerImageName + '\'' +
'}';
}
}
Loading
Loading