From hdfs-issues-return-235571-archive-asf-public=cust-asf.ponee.io@hadoop.apache.org Tue Sep 25 07:00:05 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 6045C180675 for ; Tue, 25 Sep 2018 07:00:05 +0200 (CEST) Received: (qmail 73591 invoked by uid 500); 25 Sep 2018 05:00:04 -0000 Mailing-List: contact hdfs-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list hdfs-issues@hadoop.apache.org Received: (qmail 73278 invoked by uid 99); 25 Sep 2018 05:00:04 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 25 Sep 2018 05:00:04 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id A734A1824E7 for ; Tue, 25 Sep 2018 05:00:03 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -109.501 X-Spam-Level: X-Spam-Status: No, score=-109.501 tagged_above=-999 required=6.31 tests=[ENV_AND_HDR_SPF_MATCH=-0.5, KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, USER_IN_DEF_SPF_WL=-7.5, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id 2DCnsYxSvBW2 for ; Tue, 25 Sep 2018 05:00:02 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id A58C95F5A6 for ; Tue, 25 Sep 2018 05:00:01 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id C9685E2618 for ; Tue, 25 Sep 2018 05:00:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 6628C23FA7 for ; Tue, 25 Sep 2018 05:00:00 +0000 (UTC) Date: Tue, 25 Sep 2018 05:00:00 +0000 (UTC) From: "Bharat Viswanadham (JIRA)" To: hdfs-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Comment Edited] (HDDS-444) Add rest service to the s3gateway MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HDDS-444?page=3Dcom.atlassian.j= ira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D166267= 71#comment-16626771 ]=20 Bharat Viswanadham edited comment on HDDS-444 at 9/25/18 4:59 AM: ------------------------------------------------------------------ I will commit this patch shortly. Will fix the jenkins=C2=A0issue during committing the patch. Test failures are not related to this patch. was (Author: bharatviswa): I will commit this patch shortly. Will fix the jenkins=C2=A0issue during committing the patch. > Add rest service to the s3gateway > --------------------------------- > > Key: HDDS-444 > URL: https://issues.apache.org/jira/browse/HDDS-444 > Project: Hadoop Distributed Data Store > Issue Type: Sub-task > Reporter: Elek, Marton > Assignee: Elek, Marton > Priority: Major > Labels: newbie > Attachments: HDDS-444.001.patch, HDDS-444.002.patch, HDDS-444.003= .patch, HDDS-444.004.patch, HDDS-444.005.patch > > > The next step is after HDDS-441 is to add a rest server to the s3gateway = service. > For the http server the obvious choice is to use org.apache.hadoop.http.H= ttpServer2. We also have a org.apache.hadoop.hdds.server.BaseHttpServer whi= ch helps to create the HttpServer2. > In hadoop usually the jersey 1.19 is used. I prefer to exclude jersey dep= endency from the s3gateway and add the latest jersey2. Hopefully it also co= uld be initialized easily, similar to HttpServer2.addJerseyResourcePackage > The trickiest part is the resource handling. By default the input paramet= er of the jersey is the JAX-RS resource class and jersey creates new instan= ces from the specified resource classes. > But with this approach we can't inject other components (such as the Ozon= eClient) to the resource classes. In Hadoop usually a singleton is used or = the reference object is injected to the ServletContext. Both of these are j= ust workaround and make the testing harder. > I propose to use some lightweight managed dependency injection: > # If we can use and JettyApi to instantiate the resource classes, that w= ould be the easiest one. > # Using a simple CDI framework like dagger, also would help. Dagger is v= ery lightweight, it doesn't support request scoped objects just simple @Inj= ect annotations, but hopefully we won't need fancy new features. > # The most complex solution would be to use CDI or Guice. CDI seems to b= e more nature choice for the JAX-RS. It can be checked how easy is to integ= rate Weld to the Jetty + Jersey combo. > The expected end result of this task is a new HttpServer subcomponent ins= ide the s3gateway which could be started/stopped. We need an example simple= service (for exampe a /health endpoint which returns with an 'OK' string) = which can demonstrate how our own utilitites (such as OzoneClient) could be= injected to the REST resources. -- This message was sent by Atlassian JIRA (v7.6.3#76005) --------------------------------------------------------------------- To unsubscribe, e-mail: hdfs-issues-unsubscribe@hadoop.apache.org For additional commands, e-mail: hdfs-issues-help@hadoop.apache.org