[ 
https://issues.apache.org/jira/browse/KNOX-2240?focusedWorklogId=407753&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-407753
 ]

ASF GitHub Bot logged work on KNOX-2240:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 23/Mar/20 08:20
            Start Date: 23/Mar/20 08:20
    Worklog Time Spent: 10m 
      Work Description: smolnar82 commented on pull request #296: KNOX-2240 - 
KnoxShell Custom Command for WEBHDFS Use
URL: https://github.com/apache/knox/pull/296#discussion_r396264134
 
 

 ##########
 File path: 
gateway-shell/src/main/java/org/apache/knox/gateway/shell/commands/WebHDFSCommand.java
 ##########
 @@ -0,0 +1,376 @@
+/*
+ * 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.knox.gateway.shell.commands;
+
+import java.io.Console;
+import java.io.File;
+import java.io.IOException;
+import java.net.URISyntaxException;
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+import java.util.TimeZone;
+
+import org.apache.knox.gateway.shell.CredentialCollectionException;
+import org.apache.knox.gateway.shell.CredentialCollector;
+import org.apache.knox.gateway.shell.KnoxSession;
+import org.apache.knox.gateway.shell.KnoxShellException;
+import org.apache.knox.gateway.shell.hdfs.Hdfs;
+import org.apache.knox.gateway.shell.hdfs.Status.Response;
+import org.apache.knox.gateway.shell.table.KnoxShellTable;
+import org.apache.knox.gateway.util.JsonUtils;
+import org.codehaus.groovy.tools.shell.Groovysh;
+
+public class WebHDFSCommand extends AbstractKnoxShellCommand {
+  private static final String KNOXMOUNTPOINTS = "__knoxmountpoints";
+  private Map<String, KnoxSession> sessions = new HashMap<>();
 
 Review comment:
   nit: make it final?
 
----------------------------------------------------------------
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]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 407753)
    Time Spent: 20m  (was: 10m)

> KnoxShell Custom Command for WEBHDFS Use
> ----------------------------------------
>
>                 Key: KNOX-2240
>                 URL: https://issues.apache.org/jira/browse/KNOX-2240
>             Project: Apache Knox
>          Issue Type: Improvement
>          Components: KnoxShell
>            Reporter: Larry McCay
>            Assignee: Larry McCay
>            Priority: Major
>             Fix For: 1.4.0
>
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> I'd like to extend the KnoxShell environment to have a Custom Command for 
> interacting with Hadoop FileSystems that support the WebHDFS REST API. We 
> will wrap the use of the KnoxShell HDFS classes for posix like commands in 
> the shell environment.
> In order to interact with multiple webhdfs filesystems we introduce the 
> notion of mounting a webhdfs service from a Knox topology URL. For instance, 
> see the following mount command to mount such a service to a mount point:
> {code}
> :fs mount https://knoxhost.example.com/topology/cdp-proxy-api retail
> {code}
> The above mounts a Hadoop filesystem to a mount point called "retail".
> Given this mounted filesystem we are able to interact with it through the 
> mountpoint as the root.
> {code}
> :fs ls /retail/user/lmccay
> {code}
> The above will list the contents of my home directory from the mounted 
> filesystem as well as return the listing as a KnoxShellTable that can be 
> sorted, selected, filtered, etc as any other KnoxShellTable.
> Additional commands
> {code}
> :fs mkdir /retail/user/lmccay/tmp 755
> :fs cat /retail/user/lmccay/tmp/README
> :fs put /home/lmccay/README /retail/user/lmccay/tmp/README
> :fs get /retail/user/lmccay/tmp/README /home/lmccay/README
> :fs rename /retail/user/lmccay/tmp/README /retail/user/lmccay/tmp/README2
> :fs rm /retail/user/lmccay/tmp/README
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to