npawar commented on a change in pull request #4117: Admin tool for listing 
segments with invalid intervals for offline tables
URL: https://github.com/apache/incubator-pinot/pull/4117#discussion_r276418540
 
 

 ##########
 File path: 
pinot-tools/src/main/java/org/apache/pinot/tools/admin/command/OfflineSegmentIntervalCheckerCommand.java
 ##########
 @@ -0,0 +1,149 @@
+/**
+ * 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.tools.admin.command;
+
+import java.util.ArrayList;
+import java.util.List;
+import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.helix.PropertyPathConfig;
+import org.apache.helix.PropertyType;
+import org.apache.helix.ZNRecord;
+import org.apache.helix.manager.zk.ZKHelixAdmin;
+import org.apache.helix.manager.zk.ZNRecordSerializer;
+import org.apache.helix.store.zk.ZkHelixPropertyStore;
+import org.apache.pinot.common.config.TableConfig;
+import org.apache.pinot.common.config.TableNameBuilder;
+import org.apache.pinot.common.metadata.ZKMetadataProvider;
+import org.apache.pinot.common.metadata.segment.OfflineSegmentZKMetadata;
+import org.apache.pinot.controller.util.SegmentIntervalUtils;
+import org.apache.pinot.tools.Command;
+import org.joda.time.Interval;
+import org.kohsuke.args4j.Option;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+/**
+ * Pinot admin command to list all offline segments with invalid intervals, 
group by table name
+ */
+public class OfflineSegmentIntervalCheckerCommand extends 
AbstractBaseAdminCommand implements Command {
+  private static final Logger LOGGER = 
LoggerFactory.getLogger(OfflineSegmentIntervalCheckerCommand.class);
+
+  private ZKHelixAdmin _helixAdmin;
+  private ZkHelixPropertyStore<ZNRecord> _propertyStore;
+
+  @Option(name = "-zkAddress", required = true, metaVar = "<http>", usage = 
"Zookeeper server:port/cluster")
+  private String _zkAddress;
+
+  @Option(name = "-clusterName", required = true, metaVar = "<String>", usage 
= "Helix cluster name")
+  private String _clusterName;
+
+  @Option(name = "-tableNames", metaVar = "<string>", usage = "Comma separated 
list of tables to check for invalid segment intervals")
+  private String _tableNames;
+
+  @Option(name = "-help", help = true, aliases = {"-h", "--h", "--help"}, 
usage = "Print this message.")
+  private boolean _help = false;
+
+  @Override
+  public boolean getHelp() {
+    return _help;
+  }
+
+  @Override
+  public String toString() {
+    return ("OfflineSegmentIntervalChecker");
 
 Review comment:
   Fixed. It was a result of copying code from other AdminCommands :)

----------------------------------------------------------------
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]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to