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

Show governor ip in memq cluster page; Show StorageHandler in topic config #267

Merged
merged 1 commit into from
Apr 4, 2024
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,15 @@
import com.pinterest.orion.core.memq.MemqCluster;
import com.pinterest.orion.utils.NetworkUtils;

import static com.pinterest.orion.core.memq.MemqCluster.CLUSTER_CONTEXT;

public class MemqClusterSensor extends MemqSensor {

public static final String WRITE_ASSIGNMENTS = "writeAssignments";
public static final String TOPIC_CONFIG = "topicconfig";
public static final String BROKERS = "/brokers";
public static final String TOPICS = "/topics";
public static final String GOVERNOR = "/governor";
public static final String RAW_BROKER_INFO = "rawBrokerInfo";

@Override
Expand Down Expand Up @@ -102,9 +105,15 @@ public void sense(MemqCluster cluster) throws Exception {
TopicConfig topicConfig = gson.fromJson(new String(topicData), TopicConfig.class);
topicConfigMap.put(topic, topicConfig);
}

byte[] governorData = zkClient.getData().forPath(GOVERNOR);
String governorIp = new String(governorData);
String clusterContext = "Governor: " + governorIp + "\n";

setAttribute(cluster, TOPIC_CONFIG, topicConfigMap);
setAttribute(cluster, RAW_BROKER_INFO, rawBrokerMap);
setAttribute(cluster, WRITE_ASSIGNMENTS, writeBrokerAssignments);
setAttribute(cluster, CLUSTER_CONTEXT, clusterContext);
} catch (Exception e) {
e.printStackTrace();
throw e;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ public class MemqCluster extends Cluster {
public static final String SERVERSET_PATH = "serversetPath";
public static final String ZK_CONNECTION_STRING = "zkConnectionString";
public static final String CLUSTER_REGION = "region";
public static final String CLUSTER_CONTEXT = "cluster.context";
public static final String DEFAULT_REGION = "us-east-1";
private static final long serialVersionUID = 1L;
private static final Logger logger = Logger.getLogger(MemqCluster.class.getName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,20 @@ export default function ClusterSummary(props) {
</Box>
</Paper>
);
} else {
} else if (cluster.attributes["cluster.context"]) {
return (
<Paper variant="outlined">
<Box mx={2} my={1}>
<Typography
variant="caption"
>
{cluster.attributes["cluster.context"]}
</Typography>
</Box>
</Paper>
);
}
else {
return <div></div>;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ export default function Topics(props) {
batchSizeMB: topicInfoRow.config.batchSizeMB,
configs: topicInfoRow.configs,
storageConfigs: topicInfoRow.config.storageHandlerConfig,
storageHandlerName: topicInfoRow.config.storageHandlerName,
raw: topicInfoRow,
};
});
Expand Down
Loading