ctubbsii commented on code in PR #2910:
URL: https://github.com/apache/accumulo/pull/2910#discussion_r961829449


##########
core/src/main/java/org/apache/accumulo/core/clientImpl/TableOperationsImpl.java:
##########
@@ -2011,6 +2013,16 @@ public ImportDestinationArguments importDirectory(String 
directory) {
     return new BulkImport(directory, context);
   }
 
+  @Override
+  public TimeType getTimeType(final String tableName) throws 
TableNotFoundException {
+    TableId tableId = context.getTableId(tableName);
+    Optional<TabletMetadata> tabletMetadata = 
context.getAmple().readTablets().forTable(tableId)
+        
.fetch(TabletMetadata.ColumnType.TIME).checkConsistency().build().stream().findFirst();
+    TabletMetadata timeData =
+        tabletMetadata.orElseThrow(() -> new RuntimeException("Failed to 
retrieve TimeType"));

Review Comment:
   Prefer a more specific RTE type. Perhaps IllegalStateException here?



##########
shell/src/main/java/org/apache/accumulo/shell/commands/GetTimeTypeCommand.java:
##########
@@ -0,0 +1,63 @@
+/*
+ * 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
+ *
+ *   https://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.accumulo.shell.commands;
+
+import java.util.LinkedList;
+import java.util.List;
+
+import org.apache.accumulo.core.client.TableNotFoundException;
+import org.apache.accumulo.shell.Shell;
+import org.apache.accumulo.shell.Shell.Command;
+import org.apache.commons.cli.CommandLine;
+import org.apache.commons.cli.Options;
+
+public class GetTimeTypeCommand extends Command {

Review Comment:
   Instead of a very narrow "gettimetype" command, a more generic "tableinfo" 
command would be better, so that we don't need a thousand separate 
narrowly-scoped commands to get basic information about a table.



-- 
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: notifications-unsubscr...@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to