You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@knox.apache.org by GitBox <gi...@apache.org> on 2020/07/24 13:41:20 UTC

[GitHub] [knox] smolnar82 opened a new pull request #365: KNOX-2402 - Adding Gateway performance testing

smolnar82 opened a new pull request #365:
URL: https://github.com/apache/knox/pull/365


   ## What changes were proposed in this pull request?
   
   //TODO
   
   ## How was this patch tested?
   
   Manual testing: TODO


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [knox] smolnar82 commented on pull request #365: KNOX-2402 - Adding Gateway performance testing

Posted by GitBox <gi...@apache.org>.
smolnar82 commented on pull request #365:
URL: https://github.com/apache/knox/pull/365#issuecomment-663544985


   I still need to produce documentation about the tool (and update the PR's description once it's done). I just wanted you guys to review the code as soon as possible.


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [knox] pzampino commented on a change in pull request #365: KNOX-2402 - Adding Gateway performance testing

Posted by GitBox <gi...@apache.org>.
pzampino commented on a change in pull request #365:
URL: https://github.com/apache/knox/pull/365#discussion_r478501003



##########
File path: gateway-performance-test/src/main/java/org/apache/knox/gateway/performance/test/knoxtoken/KnoxTokenCache.java
##########
@@ -0,0 +1,41 @@
+/*
+ * 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.performance.test.knoxtoken;
+
+import java.util.Queue;
+import java.util.concurrent.ConcurrentLinkedQueue;
+
+class KnoxTokenCache {
+  private static final int CAPACITY = 500;
+  private final Queue<String> knoxTokens = new ConcurrentLinkedQueue<>();
+
+  void saveKnoxToken(String knoxToken) {
+    cleanIfNecessary();
+    this.knoxTokens.offer(knoxToken);

Review comment:
       Is it acceptable for a token to NOT be saved here? Just wondering why you're using _offer_ instead of _add_.

##########
File path: gateway-performance-test/src/main/java/org/apache/knox/gateway/performance/test/PerformanceTestRunner.java
##########
@@ -0,0 +1,40 @@
+/*
+ * 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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.performance.test;
+
+import java.util.Arrays;
+import java.util.List;
+
+import org.apache.knox.gateway.performance.test.reporting.GatewayMetricsReporter;
+
+public class PerformanceTestRunner {
+
+  public static void main(String[] args) throws Exception {
+    final PerformanceTestConfiguration configuration = new PerformanceTestConfiguration(args[0]);
+    final ResponseTimeCache responseTimeCache = new ResponseTimeCache();
+    final GatewayMetricsReporter metricsReporter = new GatewayMetricsReporter(configuration, responseTimeCache);
+    metricsReporter.start();
+    final List<PerformanceTestLifeCyleListener> lifeCyleListeners = Arrays.asList(metricsReporter);
+    for (PerformanceTestUseCase useCase : PerformanceTestUseCase.values()) {

Review comment:
       Could use ServiceLoader instead of a hard-coded enum to find PerformanceTestUseCase implementations.

##########
File path: gateway-server/src/main/java/org/apache/knox/gateway/services/token/impl/DefaultTokenStateService.java
##########
@@ -154,17 +177,16 @@ public long getTokenExpiration(final String tokenId) throws UnknownTokenExceptio
 
   @Override
   public long getTokenExpiration(String tokenId, boolean validate) throws UnknownTokenException {
-    long expiration;
-
     if (validate) {
       validateToken(tokenId);
     }
 
+    long expiration = -1;
     synchronized (tokenExpirations) {
-      if (!tokenExpirations.containsKey(tokenId)) {
-        throw new UnknownTokenException(tokenId);
-      }
-      expiration = tokenExpirations.get(tokenId);
+      expiration = tokenExpirations.getOrDefault(tokenId, -1L);
+    }
+    if (expiration == -1) {

Review comment:
       This doesn't appear to be any different than the previous implementation. If this were a check for _expiration < 0_, I could see a difference. What is the reason for the change?

##########
File path: gateway-shell/src/main/java/org/apache/knox/gateway/shell/hdfs/Ls.java
##########
@@ -41,6 +42,11 @@ public Request dir( String dir ) {
       return this;
     }
 
+    public Request knoxToken(String knoxToken) {

Review comment:
       Why not add Knox token support to KnoxSession?




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [knox] risdenk commented on a change in pull request #365: KNOX-2402 - Adding Gateway performance testing

Posted by GitBox <gi...@apache.org>.
risdenk commented on a change in pull request #365:
URL: https://github.com/apache/knox/pull/365#discussion_r469973162



##########
File path: gateway-performance-test/pom.xml
##########
@@ -0,0 +1,126 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.knox</groupId>
+        <artifactId>gateway</artifactId>
+        <version>1.5.0-SNAPSHOT</version>
+    </parent>
+
+    <artifactId>gateway-performance-test</artifactId>
+    <name>gateway-performance-test</name>
+    <description>A test framework to measure the Knox Gateway's performance</description>
+    
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.knox</groupId>
+            <artifactId>gateway-i18n</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.knox</groupId>
+            <artifactId>gateway-i18n-logging-log4j</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.knox</groupId>
+            <artifactId>gateway-shell</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.knox</groupId>
+            <artifactId>gateway-spi</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.knox</groupId>
+            <artifactId>gateway-util-common</artifactId>
+        </dependency>
+
+        <dependency>
+           <groupId>com.fasterxml.jackson.core</groupId>
+           <artifactId>jackson-databind</artifactId>
+        </dependency>
+        <dependency>
+           <groupId>com.fasterxml.jackson.dataformat</groupId>
+           <artifactId>jackson-dataformat-yaml</artifactId>
+        </dependency>
+        <dependency>
+           <groupId>commons-io</groupId>
+           <artifactId>commons-io</artifactId>
+        </dependency>
+        <dependency>
+           <groupId>javax.servlet</groupId>
+           <artifactId>javax.servlet-api</artifactId>
+        </dependency>
+        <dependency>
+           <groupId>org.apache.commons</groupId>
+           <artifactId>commons-lang3</artifactId>
+        </dependency>
+        <dependency>
+           <groupId>org.apache.commons</groupId>
+           <artifactId>commons-math3</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.httpcomponents</groupId>
+            <artifactId>httpclient</artifactId>
+        </dependency>
+        <dependency>
+           <groupId>org.apache.httpcomponents</groupId>
+           <artifactId>httpcore</artifactId>
+        </dependency>
+    </dependencies>
+    <profiles>
+        <profile>
+             <id>gateway-performance-test</id>
+             <build>
+                 <plugins>
+                     <plugin>
+                         <groupId>org.codehaus.mojo</groupId>
+                         <artifactId>exec-maven-plugin</artifactId>
+                         <version>${exec-maven-plugin.version}</version>
+                         <executions>
+                             <execution>
+					            <id>run_gateway_performance_test</id>
+					            <phase>test</phase>
+					            <goals>
+					              <goal>java</goal>
+					            </goals>
+					            <configuration>
+					                <mainClass>org.apache.knox.gateway.performance.test.PerformanceTestRunner</mainClass>
+					                <arguments>
+					                    <argument>${basedir}/src/test/resources/performance.test.configuration.properties</argument>
+					                </arguments>
+					                <systemProperties>
+					                    <systemProperty>
+					                        <key>perf.test.report.generation.target.folder</key>
+					                        <value>${basedir}/target/testResults</value>
+					                    </systemProperty>
+					                    <systemProperty>
+					                        <key>log4j.configuration</key>
+					                        <value>file:${basedir}/src/test/resources/performanceTest-log4j.properties</value>
+					                    </systemProperty>
+					                </systemProperties>
+					            </configuration>

Review comment:
       Indentation?




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [knox] smolnar82 commented on a change in pull request #365: KNOX-2402 - Adding Gateway performance testing

Posted by GitBox <gi...@apache.org>.
smolnar82 commented on a change in pull request #365:
URL: https://github.com/apache/knox/pull/365#discussion_r479990543



##########
File path: gateway-performance-test/src/main/java/org/apache/knox/gateway/performance/test/knoxtoken/KnoxTokenCache.java
##########
@@ -0,0 +1,41 @@
+/*
+ * 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.performance.test.knoxtoken;
+
+import java.util.Queue;
+import java.util.concurrent.ConcurrentLinkedQueue;
+
+class KnoxTokenCache {
+  private static final int CAPACITY = 500;
+  private final Queue<String> knoxTokens = new ConcurrentLinkedQueue<>();
+
+  void saveKnoxToken(String knoxToken) {
+    cleanIfNecessary();
+    this.knoxTokens.offer(knoxToken);

Review comment:
       As discussed offline, it is acceptable: this cache works only as a storage to make sure there is an already acquired Knox DT to be renewed/used. It really does not matter if we miss some.




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [knox] smolnar82 commented on a change in pull request #365: KNOX-2402 - Adding Gateway performance testing

Posted by GitBox <gi...@apache.org>.
smolnar82 commented on a change in pull request #365:
URL: https://github.com/apache/knox/pull/365#discussion_r480022743



##########
File path: gateway-performance-test/src/main/java/org/apache/knox/gateway/performance/test/PerformanceTestRunner.java
##########
@@ -0,0 +1,40 @@
+/*
+ * 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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.performance.test;
+
+import java.util.Arrays;
+import java.util.List;
+
+import org.apache.knox.gateway.performance.test.reporting.GatewayMetricsReporter;
+
+public class PerformanceTestRunner {
+
+  public static void main(String[] args) throws Exception {
+    final PerformanceTestConfiguration configuration = new PerformanceTestConfiguration(args[0]);
+    final ResponseTimeCache responseTimeCache = new ResponseTimeCache();
+    final GatewayMetricsReporter metricsReporter = new GatewayMetricsReporter(configuration, responseTimeCache);
+    metricsReporter.start();
+    final List<PerformanceTestLifeCyleListener> lifeCyleListeners = Arrays.asList(metricsReporter);
+    for (PerformanceTestUseCase useCase : PerformanceTestUseCase.values()) {

Review comment:
       Thanks for your comment; I made the requested change.




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [knox] smolnar82 merged pull request #365: KNOX-2402 - Adding Gateway performance testing

Posted by GitBox <gi...@apache.org>.
smolnar82 merged pull request #365:
URL: https://github.com/apache/knox/pull/365


   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [knox] smolnar82 commented on a change in pull request #365: KNOX-2402 - Adding Gateway performance testing

Posted by GitBox <gi...@apache.org>.
smolnar82 commented on a change in pull request #365:
URL: https://github.com/apache/knox/pull/365#discussion_r479993879



##########
File path: gateway-server/src/main/java/org/apache/knox/gateway/services/token/impl/DefaultTokenStateService.java
##########
@@ -154,17 +177,16 @@ public long getTokenExpiration(final String tokenId) throws UnknownTokenExceptio
 
   @Override
   public long getTokenExpiration(String tokenId, boolean validate) throws UnknownTokenException {
-    long expiration;
-
     if (validate) {
       validateToken(tokenId);
     }
 
+    long expiration = -1;
     synchronized (tokenExpirations) {
-      if (!tokenExpirations.containsKey(tokenId)) {
-        throw new UnknownTokenException(tokenId);
-      }
-      expiration = tokenExpirations.get(tokenId);
+      expiration = tokenExpirations.getOrDefault(tokenId, -1L);
+    }
+    if (expiration == -1) {

Review comment:
       There is a slight difference: we can save one iteration when checking `tokenExpirations`
   `containsKey + get` vs. `getOrDefault`.
   But you are right, there is no more difference between the two versions.




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [knox] smolnar82 commented on a change in pull request #365: KNOX-2402 - Adding Gateway performance testing

Posted by GitBox <gi...@apache.org>.
smolnar82 commented on a change in pull request #365:
URL: https://github.com/apache/knox/pull/365#discussion_r480022971



##########
File path: gateway-shell/src/main/java/org/apache/knox/gateway/shell/hdfs/Ls.java
##########
@@ -41,6 +42,11 @@ public Request dir( String dir ) {
       return this;
     }
 
+    public Request knoxToken(String knoxToken) {

Review comment:
       Fixed.




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [knox] smolnar82 commented on a change in pull request #365: KNOX-2402 - Adding Gateway performance testing

Posted by GitBox <gi...@apache.org>.
smolnar82 commented on a change in pull request #365:
URL: https://github.com/apache/knox/pull/365#discussion_r471089801



##########
File path: gateway-performance-test/pom.xml
##########
@@ -0,0 +1,126 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.knox</groupId>
+        <artifactId>gateway</artifactId>
+        <version>1.5.0-SNAPSHOT</version>
+    </parent>
+
+    <artifactId>gateway-performance-test</artifactId>
+    <name>gateway-performance-test</name>
+    <description>A test framework to measure the Knox Gateway's performance</description>
+    
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.knox</groupId>
+            <artifactId>gateway-i18n</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.knox</groupId>
+            <artifactId>gateway-i18n-logging-log4j</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.knox</groupId>
+            <artifactId>gateway-shell</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.knox</groupId>
+            <artifactId>gateway-spi</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.knox</groupId>
+            <artifactId>gateway-util-common</artifactId>
+        </dependency>
+
+        <dependency>
+           <groupId>com.fasterxml.jackson.core</groupId>
+           <artifactId>jackson-databind</artifactId>
+        </dependency>
+        <dependency>
+           <groupId>com.fasterxml.jackson.dataformat</groupId>
+           <artifactId>jackson-dataformat-yaml</artifactId>
+        </dependency>
+        <dependency>
+           <groupId>commons-io</groupId>
+           <artifactId>commons-io</artifactId>
+        </dependency>
+        <dependency>
+           <groupId>javax.servlet</groupId>
+           <artifactId>javax.servlet-api</artifactId>
+        </dependency>
+        <dependency>
+           <groupId>org.apache.commons</groupId>
+           <artifactId>commons-lang3</artifactId>
+        </dependency>
+        <dependency>
+           <groupId>org.apache.commons</groupId>
+           <artifactId>commons-math3</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.httpcomponents</groupId>
+            <artifactId>httpclient</artifactId>
+        </dependency>
+        <dependency>
+           <groupId>org.apache.httpcomponents</groupId>
+           <artifactId>httpcore</artifactId>
+        </dependency>
+    </dependencies>
+    <profiles>
+        <profile>
+             <id>gateway-performance-test</id>
+             <build>
+                 <plugins>
+                     <plugin>
+                         <groupId>org.codehaus.mojo</groupId>
+                         <artifactId>exec-maven-plugin</artifactId>
+                         <version>${exec-maven-plugin.version}</version>
+                         <executions>
+                             <execution>
+					            <id>run_gateway_performance_test</id>
+					            <phase>test</phase>
+					            <goals>
+					              <goal>java</goal>
+					            </goals>
+					            <configuration>
+					                <mainClass>org.apache.knox.gateway.performance.test.PerformanceTestRunner</mainClass>
+					                <arguments>
+					                    <argument>${basedir}/src/test/resources/performance.test.configuration.properties</argument>
+					                </arguments>
+					                <systemProperties>
+					                    <systemProperty>
+					                        <key>perf.test.report.generation.target.folder</key>
+					                        <value>${basedir}/target/testResults</value>
+					                    </systemProperty>
+					                    <systemProperty>
+					                        <key>log4j.configuration</key>
+					                        <value>file:${basedir}/src/test/resources/performanceTest-log4j.properties</value>
+					                    </systemProperty>
+					                </systemProperties>
+					            </configuration>

Review comment:
       Ohh...copy-pasted that section from the original Maven page which comes with tabs. Fixed now.




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [knox] smolnar82 commented on a change in pull request #365: KNOX-2402 - Adding Gateway performance testing

Posted by GitBox <gi...@apache.org>.
smolnar82 commented on a change in pull request #365:
URL: https://github.com/apache/knox/pull/365#discussion_r480022903



##########
File path: gateway-server/src/main/java/org/apache/knox/gateway/services/token/impl/DefaultTokenStateService.java
##########
@@ -154,17 +177,16 @@ public long getTokenExpiration(final String tokenId) throws UnknownTokenExceptio
 
   @Override
   public long getTokenExpiration(String tokenId, boolean validate) throws UnknownTokenException {
-    long expiration;
-
     if (validate) {
       validateToken(tokenId);
     }
 
+    long expiration = -1;
     synchronized (tokenExpirations) {
-      if (!tokenExpirations.containsKey(tokenId)) {
-        throw new UnknownTokenException(tokenId);
-      }
-      expiration = tokenExpirations.get(tokenId);
+      expiration = tokenExpirations.getOrDefault(tokenId, -1L);
+    }
+    if (expiration == -1) {

Review comment:
       I left it as-is based on my previous comment.




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [knox] smolnar82 commented on a change in pull request #365: KNOX-2402 - Adding Gateway performance testing

Posted by GitBox <gi...@apache.org>.
smolnar82 commented on a change in pull request #365:
URL: https://github.com/apache/knox/pull/365#discussion_r480005728



##########
File path: gateway-shell/src/main/java/org/apache/knox/gateway/shell/hdfs/Ls.java
##########
@@ -41,6 +42,11 @@ public Request dir( String dir ) {
       return this;
     }
 
+    public Request knoxToken(String knoxToken) {

Review comment:
       IMO, the token handling should happen on request level. But you are right, this should not be limited to the `ls` command -> moving it to the abstract parent.




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [knox] smolnar82 commented on pull request #365: KNOX-2402 - Adding Gateway performance testing

Posted by GitBox <gi...@apache.org>.
smolnar82 commented on pull request #365:
URL: https://github.com/apache/knox/pull/365#issuecomment-673417551


   Thanks, @risdenk for your comment! It totally makes sense; there is no reason to overcomplicate it. I added a new profile to run performance tests using Maven instead of having a separate release artifact.


----------------------------------------------------------------
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:
users@infra.apache.org