mayankshriv commented on a change in pull request #6817: URL: https://github.com/apache/incubator-pinot/pull/6817#discussion_r616278878
########## File path: pinot-common/src/main/java/org/apache/pinot/common/utils/PinotAppConfigs.java ########## @@ -0,0 +1,367 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.pinot.common.utils; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.lang.management.GarbageCollectorMXBean; +import java.lang.management.ManagementFactory; +import java.lang.management.MemoryMXBean; +import java.lang.management.MemoryManagerMXBean; +import java.lang.management.MemoryUsage; +import java.lang.management.OperatingSystemMXBean; +import java.lang.management.RuntimeMXBean; +import java.lang.management.ThreadMXBean; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.stream.Collectors; +import org.apache.commons.io.FileUtils; +import org.apache.pinot.spi.env.PinotConfiguration; + + +/** + * Class that represents various configs for a pinot component: + * <ul> + * <li>System Configs</li> + * <li>JVM Configs</li> + * <li>Runtime Configs</li> + * <li>PinotConfiguration</li> + * </ul> + * + * This class is JSON serializable and de-serializable. + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonPropertyOrder({"systemConfig", "runtimeConfig", "pinotConfig", "jvmConfig"}) +public class PinotAppConfigs { + private static final String UNKNOWN_VALUE = "-"; + private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper(); + + @JsonProperty("systemConfig") + SystemConfig _systemConfig; + + @JsonProperty("jvmConfig") + JVMConfig _jvmConfig; + + @JsonProperty("runtimeConfig") + RuntimeConfig _runtimeConfig; + + @JsonProperty("pinotConfig") + PinotConfiguration _pinotConfig; + + @JsonCreator + @SuppressWarnings("unused") + public PinotAppConfigs() { Review comment: We do deserialize in tests. Also, I wanted to keep the deserialization feature so that if we get this huge JSON from a deployment, we can simply load it in a viewer GUI browse it. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
