sumitagrawl commented on code in PR #4540:
URL: https://github.com/apache/ozone/pull/4540#discussion_r1197595588
##########
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/ReconUtils.java:
##########
@@ -18,6 +18,22 @@
package org.apache.hadoop.ozone.recon;
+import com.google.inject.Singleton;
+import org.apache.commons.compress.archivers.tar.TarArchiveEntry;
+import org.apache.commons.compress.archivers.tar.TarArchiveInputStream;
+import org.apache.commons.compress.archivers.tar.TarArchiveOutputStream;
+import org.apache.hadoop.hdds.HddsConfigKeys;
+import org.apache.hadoop.hdds.HddsUtils;
+import org.apache.hadoop.hdds.conf.ConfigurationSource;
+import org.apache.hadoop.hdfs.web.URLConnectionFactory;
+import org.apache.hadoop.io.IOUtils;
+import
org.apache.hadoop.security.authentication.client.AuthenticationException;
+import org.hadoop.ozone.recon.schema.tables.daos.GlobalStatsDao;
+import org.hadoop.ozone.recon.schema.tables.pojos.GlobalStats;
+import org.jooq.Configuration;
+import org.slf4j.Logger;
Review Comment:
Revert un-necessary ordering of imports
##########
hadoop-ozone/recon/pom.xml:
##########
@@ -25,6 +25,7 @@
<artifactId>ozone-recon</artifactId>
<properties>
<pnpm.version>5.18.9</pnpm.version>
+ <solr.version>8.4.1</solr.version>
Review Comment:
solr property is still present, plz revert
##########
hadoop-ozone/dist/src/main/license/jar-report.txt:
##########
@@ -242,23 +243,25 @@ share/ozone/lib/ratis-thirdparty-misc.jar
share/ozone/lib/ratis-tools.jar
share/ozone/lib/re2j.jar
share/ozone/lib/reflections.jar
-share/ozone/lib/rocksdb-checkpoint-differ.jar
share/ozone/lib/reload4j.jar
+share/ozone/lib/rocksdb-checkpoint-differ.jar
share/ozone/lib/rocksdbjni.jar
+share/ozone/lib/simpleclient.jar
share/ozone/lib/simpleclient_common.jar
share/ozone/lib/simpleclient_dropwizard.jar
-share/ozone/lib/simpleclient.jar
share/ozone/lib/slf4j-api.jar
share/ozone/lib/slf4j-reload4j.jar
share/ozone/lib/snakeyaml.jar
share/ozone/lib/snappy-java.jar
+share/ozone/lib/solr-solrj.jar
Review Comment:
solr dependency and other jar are present extra, not present earlier, can
revert this file
##########
hadoop-ozone/recon/src/test/java/org/apache/hadoop/ozone/recon/ReconTestInjector.java:
##########
@@ -18,40 +18,39 @@
package org.apache.hadoop.ozone.recon;
-import static
org.apache.hadoop.hdds.recon.ReconConfigKeys.OZONE_RECON_DATANODE_ADDRESS_KEY;
-import static
org.apache.hadoop.hdds.recon.ReconConfigKeys.OZONE_RECON_PROMETHEUS_HTTP_ENDPOINT;
-import static
org.apache.hadoop.ozone.recon.ReconServerConfigKeys.OZONE_RECON_DB_DIR;
-import static
org.apache.hadoop.ozone.recon.ReconServerConfigKeys.OZONE_RECON_OM_SNAPSHOT_DB_DIR;
-import static
org.apache.hadoop.ozone.recon.ReconServerConfigKeys.OZONE_RECON_SCM_DB_DIR;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
+import com.google.inject.AbstractModule;
+import com.google.inject.Guice;
+import com.google.inject.Injector;
+import com.google.inject.Module;
+import com.google.inject.Singleton;
import org.apache.commons.collections.CollectionUtils;
import org.apache.hadoop.hdds.conf.OzoneConfiguration;
import org.apache.hadoop.hdds.scm.server.OzoneStorageContainerManager;
import org.apache.hadoop.ozone.recon.persistence.AbstractReconSqlDBTest;
import org.apache.hadoop.ozone.recon.recovery.ReconOMMetadataManager;
+import org.apache.hadoop.ozone.recon.spi.OzoneManagerServiceProvider;
import org.apache.hadoop.ozone.recon.spi.ReconContainerMetadataManager;
import org.apache.hadoop.ozone.recon.spi.ReconNamespaceSummaryManager;
-import org.apache.hadoop.ozone.recon.spi.OzoneManagerServiceProvider;
import
org.apache.hadoop.ozone.recon.spi.impl.ReconContainerMetadataManagerImpl;
-import org.apache.hadoop.ozone.recon.spi.impl.ReconNamespaceSummaryManagerImpl;
import org.apache.hadoop.ozone.recon.spi.impl.ReconDBProvider;
+import org.apache.hadoop.ozone.recon.spi.impl.ReconNamespaceSummaryManagerImpl;
import org.junit.Assert;
import org.junit.rules.TemporaryFolder;
-import com.google.inject.AbstractModule;
-import com.google.inject.Guice;
-import com.google.inject.Injector;
-import com.google.inject.Module;
-import com.google.inject.Singleton;
+import java.io.File;
+import java.io.IOException;
Review Comment:
No change in class except import, these can be reverted.
##########
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/api/types/EntityReadAccessHeatMapResponse.java:
##########
@@ -0,0 +1,159 @@
+/*
+ * 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.hadoop.ozone.recon.api.types;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Objects;
+
+/**
+ * HTTP Response wrapped for a read access based heatmap request.
+ * This response is a special response format specifically for
+ * heatmap representation over UI using treemap format.
+ * Technically at low level this class is used to hold an
+ * entity's heatmap and access metadata info for its children.
+ * Sample JSON format per Entity:
+ * {
+ * label: 'hive_write/vectortab_txt/delta/vectortab',
+ * children: [
+ * {
Review Comment:
update the sample output correctly
##########
hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/HddsUtils.java:
##########
@@ -58,10 +44,31 @@
import org.apache.hadoop.metrics2.util.MBeans;
import org.apache.hadoop.net.DNS;
import org.apache.hadoop.net.NetUtils;
+import org.apache.hadoop.ozone.conf.OzoneServiceConfig;
+import org.apache.hadoop.security.AccessControlException;
+import org.apache.hadoop.security.token.SecretManager;
+import org.apache.ratis.thirdparty.com.google.protobuf.ByteString;
+import org.apache.ratis.util.SizeInBytes;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.management.ObjectName;
+import java.io.File;
+import java.io.IOException;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.net.InetSocketAddress;
+import java.net.UnknownHostException;
+import java.nio.file.Path;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import java.util.OptionalInt;
Review Comment:
We can revert the file as no changes in this file
##########
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/heatmap/HeatMapServiceImpl.java:
##########
@@ -0,0 +1,107 @@
+/*
+ * 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.hadoop.ozone.recon.heatmap;
+
+import com.google.inject.Inject;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.hadoop.hdds.conf.OzoneConfiguration;
+import org.apache.hadoop.hdds.scm.server.OzoneStorageContainerManager;
+import org.apache.hadoop.ozone.recon.api.types.EntityReadAccessHeatMapResponse;
+import org.apache.hadoop.ozone.recon.recovery.ReconOMMetadataManager;
+import org.apache.hadoop.ozone.recon.spi.ReconNamespaceSummaryManager;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import static
org.apache.hadoop.hdds.recon.ReconConfigKeys.OZONE_RECON_HEATMAP_PROVIDER_KEY;
+import static org.apache.hadoop.ozone.OzoneConsts.OM_KEY_PREFIX;
+
+/**
+ * This class is an implementation of abstract class for retrieving
+ * data through HeatMapService.
+ */
+public class HeatMapServiceImpl extends HeatMapService {
+ private static final Logger LOG =
+ LoggerFactory.getLogger(HeatMapServiceImpl.class);
+ private final OzoneConfiguration ozoneConfiguration;
+ private final ReconNamespaceSummaryManager reconNamespaceSummaryManager;
+ private final ReconOMMetadataManager omMetadataManager;
+ private final OzoneStorageContainerManager reconSCM;
+ private IHeatMapProvider heatMapProvider;
+ private HeatMapUtil heatMapUtil;
+
+ @Inject
+ public HeatMapServiceImpl(OzoneConfiguration ozoneConfiguration,
+ ReconNamespaceSummaryManager
+ namespaceSummaryManager,
+ ReconOMMetadataManager omMetadataManager,
+ OzoneStorageContainerManager reconSCM) {
+ this.ozoneConfiguration = ozoneConfiguration;
+ this.reconNamespaceSummaryManager = namespaceSummaryManager;
+ this.omMetadataManager = omMetadataManager;
+ this.reconSCM = reconSCM;
+ heatMapUtil =
+ new HeatMapUtil(reconNamespaceSummaryManager, omMetadataManager,
+ reconSCM, ozoneConfiguration);
+ initializeProvider();
+ }
+
+ private void initializeProvider() {
+ String heatMapProviderCls = ozoneConfiguration.get(
+ OZONE_RECON_HEATMAP_PROVIDER_KEY);
+ LOG.info("HeatMapProvider: {}", heatMapProviderCls);
+ if (StringUtils.isEmpty(heatMapProviderCls)) {
+ heatMapProvider = new HeatMapProviderImpl();
+ } else {
+ IHeatMapProvider iHeatMapProvider = null;
+ try {
+ iHeatMapProvider = heatMapUtil.loadHeatMapProvider(heatMapProviderCls);
+ } catch (Exception e) {
+ LOG.error("Loading HeatMapProvider fails!!! : {}", e);
+ return;
+ }
+ if (null != iHeatMapProvider) {
+ try {
+ iHeatMapProvider.init(ozoneConfiguration, omMetadataManager,
Review Comment:
heatMapProvider is not initialized in success path, only temp variable is
populated. Please update same.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]