Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 163F3200D56 for ; Tue, 12 Dec 2017 23:58:54 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 14F7C160C00; Tue, 12 Dec 2017 22:58:54 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 8C6AC160BE7 for ; Tue, 12 Dec 2017 23:58:52 +0100 (CET) Received: (qmail 13408 invoked by uid 500); 12 Dec 2017 22:58:51 -0000 Mailing-List: contact dev-help@oodt.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@oodt.apache.org Delivered-To: mailing list dev@oodt.apache.org Received: (qmail 13397 invoked by uid 99); 12 Dec 2017 22:58:51 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 12 Dec 2017 22:58:51 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id D3DE51A0FFD for ; Tue, 12 Dec 2017 22:58:50 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -1.499 X-Spam-Level: X-Spam-Status: No, score=-1.499 tagged_above=-999 required=6.31 tests=[HEADER_FROM_DIFFERENT_DOMAINS=0.001, KAM_ASCII_DIVIDERS=0.8, MIME_QP_LONG_LINE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-2.8, RCVD_IN_SORBS_SPAM=0.5, SPF_PASS=-0.001] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id abREDaVBnNVd for ; Tue, 12 Dec 2017 22:58:46 +0000 (UTC) Received: from mail-yb0-f172.google.com (mail-yb0-f172.google.com [209.85.213.172]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id 1F6035F3B7 for ; Tue, 12 Dec 2017 22:58:46 +0000 (UTC) Received: by mail-yb0-f172.google.com with SMTP id j7so269784ybl.3 for ; Tue, 12 Dec 2017 14:58:46 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:user-agent:date:subject:from:to:message-id :thread-topic:references:in-reply-to:mime-version :content-transfer-encoding; bh=W2I6m7YFJwhZRcgbMm1cmDjbnQF//lp0iLoluNFOsGA=; b=E2FxHnQxlu8KEvI31onmNgHNIdN50WwI4vXzCfSvMNEY/yQvxOwKErN6Hd2fqOqBfH wkSOv4hnNKgcfngz+EIgwQYrBy3kGofYwbq/gzNijym2mwcFjxqkhKBM4QaJ+mOv3son MekFhRoRzMzuxUn/zpLLj+w0GR/BuoSPyHm+DG7+iwWg4f08nU/PPHIKHZy4WSJhwsrq 1qkxAyVlrcbQT7H9j2/k3CyqpGkYNmnyClp+BWnvTf15hnTHQPu7Koi71Vy2+Yeink71 ZsIx0plycMlI3r1cwf5BHHlfj04+4OYIvLERYGzvw5GjEaOWWFE4lWyG71I05W22A8AG r55A== X-Gm-Message-State: AKGB3mJma0lNrTakQyQ82O+SPkwqWSC243HKYicR5Xb9x32iSKxGWmVV SxgpgUB7STyzC6xkrT+/oMbeqrHk X-Google-Smtp-Source: ACJfBotmuO1ALYwYNYtfpz85F279RGHXSxbBR9CraTVQd7r34RXg4P/aTkI2XO8xKP9XFqRKCjALnQ== X-Received: by 10.37.12.131 with SMTP id 125mr363909ybm.301.1513119525131; Tue, 12 Dec 2017 14:58:45 -0800 (PST) Received: from [192.168.1.126] ([138.229.216.66]) by smtp.gmail.com with ESMTPSA id h21sm143244ywk.43.2017.12.12.14.58.44 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 12 Dec 2017 14:58:44 -0800 (PST) User-Agent: Microsoft-MacOutlook/f.21.0.170409 Date: Tue, 12 Dec 2017 14:58:40 -0800 Subject: Re: oodt git commit: close connection to release client From: Chris Mattmann To: "dev@oodt.apache.org" Message-ID: <2EBD4654-2B45-48C2-98E1-C93D22107657@jpl.nasa.gov> Thread-Topic: oodt git commit: close connection to release client References: <5086465c053e46719eebabcd774b3a81@git.apache.org> In-Reply-To: <5086465c053e46719eebabcd774b3a81@git.apache.org> Mime-version: 1.0 Content-type: text/plain; charset="UTF-8" Content-transfer-encoding: quoted-printable archived-at: Tue, 12 Dec 2017 22:58:54 -0000 Tom, please revert this commit and do a commit that doesn=E2=80=99t include a bil= lion lines of formatting change and includes the actual change? ( Cheers, Chris On 12/12/17, 2:56 PM, "magicaltrout@apache.org" w= rote: Repository: oodt Updated Branches: refs/heads/development bfb78c9a0 -> 82b522516 =20 =20 close connection to release client =20 =20 Project: http://git-wip-us.apache.org/repos/asf/oodt/repo Commit: http://git-wip-us.apache.org/repos/asf/oodt/commit/82b52251 Tree: http://git-wip-us.apache.org/repos/asf/oodt/tree/82b52251 Diff: http://git-wip-us.apache.org/repos/asf/oodt/diff/82b52251 =20 Branch: refs/heads/development Commit: 82b5225162f78ee092e473218769bea61e3e510f Parents: bfb78c9 Author: Tom Barber Authored: Tue Dec 12 22:56:39 2017 +0000 Committer: Tom Barber Committed: Tue Dec 12 22:56:39 2017 +0000 =20 ---------------------------------------------------------------------- .../filemgr/system/AvroFileManagerClient.java | 320 ++++++++++++++++= +-- 1 file changed, 301 insertions(+), 19 deletions(-) ---------------------------------------------------------------------- =20 =20 http://git-wip-us.apache.org/repos/asf/oodt/blob/82b52251/filemgr/src/m= ain/java/org/apache/oodt/cas/filemgr/system/AvroFileManagerClient.java ---------------------------------------------------------------------- diff --git a/filemgr/src/main/java/org/apache/oodt/cas/filemgr/system/A= vroFileManagerClient.java b/filemgr/src/main/java/org/apache/oodt/cas/filemg= r/system/AvroFileManagerClient.java index 3feda3d..043330a 100644 --- a/filemgr/src/main/java/org/apache/oodt/cas/filemgr/system/AvroFile= ManagerClient.java +++ b/filemgr/src/main/java/org/apache/oodt/cas/filemgr/system/AvroFile= ManagerClient.java @@ -17,45 +17,46 @@ =20 package org.apache.oodt.cas.filemgr.system; =20 +import java.io.IOException; +import java.net.InetSocketAddress; +import java.net.URL; +import java.nio.ByteBuffer; +import java.util.ArrayList; +import java.util.List; +import java.util.logging.Level; +import java.util.logging.Logger; import org.apache.avro.AvroRemoteException; import org.apache.avro.ipc.NettyTransceiver; import org.apache.avro.ipc.Transceiver; import org.apache.avro.ipc.specific.SpecificRequestor; import org.apache.oodt.cas.filemgr.datatransfer.DataTransfer; +import org.apache.oodt.cas.filemgr.exceptions.FileManagerException; import org.apache.oodt.cas.filemgr.structs.Element; -import org.apache.oodt.cas.filemgr.structs.Product; import org.apache.oodt.cas.filemgr.structs.FileTransferStatus; +import org.apache.oodt.cas.filemgr.structs.Product; import org.apache.oodt.cas.filemgr.structs.ProductPage; import org.apache.oodt.cas.filemgr.structs.ProductType; -import org.apache.oodt.cas.filemgr.structs.Reference; import org.apache.oodt.cas.filemgr.structs.Query; +import org.apache.oodt.cas.filemgr.structs.Reference; +import org.apache.oodt.cas.filemgr.structs.avrotypes.AvroElement; import org.apache.oodt.cas.filemgr.structs.avrotypes.AvroFileManager; import org.apache.oodt.cas.filemgr.structs.avrotypes.AvroFileTransferS= tatus; import org.apache.oodt.cas.filemgr.structs.avrotypes.AvroProduct; -import org.apache.oodt.cas.filemgr.structs.avrotypes.AvroElement; -import org.apache.oodt.cas.filemgr.structs.avrotypes.AvroQueryResult; import org.apache.oodt.cas.filemgr.structs.avrotypes.AvroProductType; +import org.apache.oodt.cas.filemgr.structs.avrotypes.AvroQueryResult; import org.apache.oodt.cas.filemgr.structs.avrotypes.AvroReference; -import org.apache.oodt.cas.filemgr.structs.exceptions.RepositoryManage= rException; import org.apache.oodt.cas.filemgr.structs.exceptions.CatalogException= ; +import org.apache.oodt.cas.filemgr.structs.exceptions.ConnectionExcept= ion; import org.apache.oodt.cas.filemgr.structs.exceptions.DataTransferExce= ption; +import org.apache.oodt.cas.filemgr.structs.exceptions.RepositoryManage= rException; import org.apache.oodt.cas.filemgr.structs.exceptions.ValidationLayerE= xception; import org.apache.oodt.cas.filemgr.structs.exceptions.VersioningExcept= ion; -import org.apache.oodt.cas.filemgr.structs.exceptions.ConnectionExcept= ion; import org.apache.oodt.cas.filemgr.structs.query.ComplexQuery; import org.apache.oodt.cas.filemgr.structs.query.QueryResult; import org.apache.oodt.cas.filemgr.util.AvroTypeFactory; import org.apache.oodt.cas.filemgr.util.GenericFileManagerObjectFactor= y; import org.apache.oodt.cas.filemgr.versioning.Versioner; import org.apache.oodt.cas.metadata.Metadata; -import java.io.IOException; -import java.net.InetSocketAddress; -import java.net.URL; -import java.nio.ByteBuffer; -import java.util.ArrayList; -import java.util.List; -import java.util.logging.Level; -import java.util.logging.Logger; =20 /** * @author radu @@ -142,8 +143,13 @@ public class AvroFileManagerClient implements File= ManagerClient { try { success =3D proxy.transferringProduct(AvroTypeFactory.getAvr= oProduct(product)); } catch (AvroRemoteException e) { - e.printStackTrace(); throw new DataTransferException(e.getMessage()); + } finally { + try { + this.client.close(); + } catch (IOException e) { + throw new DataTransferException(e.getMessage()); + } } =20 return success; @@ -156,6 +162,12 @@ public class AvroFileManagerClient implements File= ManagerClient { success =3D proxy.removeProductTransferStatus(AvroTypeFactor= y.getAvroProduct(product)); } catch (AvroRemoteException e) { throw new DataTransferException(e.getMessage()); + } finally { + try { + this.client.close(); + } catch (IOException e) { + throw new DataTransferException(e.getMessage()); + } } return success; } @@ -167,6 +179,12 @@ public class AvroFileManagerClient implements File= ManagerClient { success =3D this.proxy.isTransferComplete(AvroTypeFactory.ge= tAvroProduct(product)); } catch (AvroRemoteException e) { throw new DataTransferException(e.getMessage()); + } finally { + try { + this.client.close(); + } catch (IOException e) { + throw new DataTransferException(e.getMessage()); + } } return success; } @@ -178,6 +196,12 @@ public class AvroFileManagerClient implements File= ManagerClient { success =3D this.proxy.moveProduct(AvroTypeFactory.getAvroPr= oduct(product), newPath); } catch (AvroRemoteException e) { throw new DataTransferException(e.getMessage()); + } finally { + try { + this.client.close(); + } catch (IOException e) { + throw new DataTransferException(e.getMessage()); + } } return success; } @@ -189,6 +213,12 @@ public class AvroFileManagerClient implements File= ManagerClient { success =3D this.proxy.modifyProduct(AvroTypeFactory.getAvro= Product(product)); } catch (AvroRemoteException e) { throw new CatalogException(e.getMessage()); + } finally { + try { + this.client.close(); + } catch (IOException e) { + throw new CatalogException(e.getMessage()); + } } return success; } @@ -200,6 +230,12 @@ public class AvroFileManagerClient implements File= ManagerClient { success =3D this.proxy.removeProduct(AvroTypeFactory.getAvro= Product(product)); } catch (AvroRemoteException e) { throw new CatalogException(e.getMessage()); + } finally { + try { + this.client.close(); + } catch (IOException e) { + throw new CatalogException(e.getMessage()); + } } return success; } @@ -210,6 +246,12 @@ public class AvroFileManagerClient implements File= ManagerClient { return AvroTypeFactory.getFileTransferStatus(this.proxy.ge= tCurrentFileTransfer()); } catch (AvroRemoteException e) { throw new DataTransferException(e.getMessage()); + } finally { + try { + this.client.close(); + } catch (IOException e) { + throw new DataTransferException(e.getMessage()); + } } } =20 @@ -222,6 +264,12 @@ public class AvroFileManagerClient implements File= ManagerClient { } } catch (AvroRemoteException e) { throw new DataTransferException(e.getMessage()); + } finally { + try { + this.client.close(); + } catch (IOException e) { + throw new DataTransferException(e.getMessage()); + } } return fileTransferStatuses; } @@ -232,6 +280,12 @@ public class AvroFileManagerClient implements File= ManagerClient { return this.proxy.getProductPctTransferred(AvroTypeFactory= .getAvroProduct(product)); } catch (AvroRemoteException e) { throw new DataTransferException(e.getMessage()); + } finally { + try { + this.client.close(); + } catch (IOException e) { + throw new DataTransferException(e.getMessage()); + } } } =20 @@ -241,6 +295,12 @@ public class AvroFileManagerClient implements File= ManagerClient { return this.proxy.getRefPctTransferred(AvroTypeFactory.get= AvroReference(reference)); } catch (AvroRemoteException e) { throw new DataTransferException(e.getMessage()); + } finally { + try { + this.client.close(); + } catch (IOException e) { + throw new DataTransferException(e.getMessage()); + } } } =20 @@ -255,6 +315,12 @@ public class AvroFileManagerClient implements File= ManagerClient { )); } catch (AvroRemoteException e) { throw new CatalogException(e.getMessage()); + } finally { + try { + this.client.close(); + } catch (IOException e) { + throw new CatalogException(e.getMessage()); + } } } =20 @@ -264,6 +330,12 @@ public class AvroFileManagerClient implements File= ManagerClient { return AvroTypeFactory.getProductPage(this.proxy.getFirstP= age(AvroTypeFactory.getAvroProductType(type))); } catch (AvroRemoteException e) { throw new CatalogException(e.getMessage()); + } finally { + try { + this.client.close(); + } catch (IOException e) { + throw new CatalogException(e.getMessage()); + } } } =20 @@ -273,6 +345,12 @@ public class AvroFileManagerClient implements File= ManagerClient { return AvroTypeFactory.getProductPage(this.proxy.getLastPa= ge(AvroTypeFactory.getAvroProductType(type))); } catch (AvroRemoteException e) { throw new CatalogException(e.getMessage()); + } finally { + try { + this.client.close(); + } catch (IOException e) { + throw new CatalogException(e.getMessage()); + } } } =20 @@ -285,6 +363,12 @@ public class AvroFileManagerClient implements File= ManagerClient { )); } catch (AvroRemoteException e) { throw new CatalogException(e.getMessage()); + } finally { + try { + this.client.close(); + } catch (IOException e) { + throw new CatalogException(e.getMessage()); + } } } =20 @@ -297,6 +381,12 @@ public class AvroFileManagerClient implements File= ManagerClient { )); } catch (AvroRemoteException e) { throw new CatalogException(e.getMessage()); + } finally { + try { + this.client.close(); + } catch (IOException e) { + throw new CatalogException(e.getMessage()); + } } } =20 @@ -306,6 +396,12 @@ public class AvroFileManagerClient implements File= ManagerClient { return this.proxy.addProductType(AvroTypeFactory.getAvroPr= oductType(type)); } catch (AvroRemoteException e) { throw new RepositoryManagerException(e.getMessage()); + } finally { + try { + this.client.close(); + } catch (IOException e) { + throw new RepositoryManagerException(e.getMessage()); + } } } =20 @@ -315,6 +411,12 @@ public class AvroFileManagerClient implements File= ManagerClient { return this.proxy.hasProduct(productName); } catch (AvroRemoteException e) { throw new CatalogException(e.getMessage()); + } finally { + try { + this.client.close(); + } catch (IOException e) { + throw new CatalogException(e.getMessage()); + } } } =20 @@ -324,6 +426,12 @@ public class AvroFileManagerClient implements File= ManagerClient { return this.proxy.getNumProducts(AvroTypeFactory.getAvroPr= oductType(type)); } catch (AvroRemoteException e) { throw new CatalogException(e.getMessage()); + } finally { + try { + this.client.close(); + } catch (IOException e) { + throw new CatalogException(e.getMessage()); + } } } =20 @@ -336,6 +444,12 @@ public class AvroFileManagerClient implements File= ManagerClient { } } catch (AvroRemoteException e) { throw new CatalogException(e.getMessage()); + } finally { + try { + this.client.close(); + } catch (IOException e) { + throw new CatalogException(e.getMessage()); + } } return products; } @@ -349,6 +463,12 @@ public class AvroFileManagerClient implements File= ManagerClient { } } catch (AvroRemoteException e) { throw new CatalogException(e.getMessage()); + } finally { + try { + this.client.close(); + } catch (IOException e) { + throw new CatalogException(e.getMessage()); + } } return products; } @@ -359,6 +479,12 @@ public class AvroFileManagerClient implements File= ManagerClient { this.proxy.setProductTransferStatus(AvroTypeFactory.getAvr= oProduct(product)); } catch (AvroRemoteException e) { throw new CatalogException(e.getMessage()); + } finally { + try { + this.client.close(); + } catch (IOException e) { + throw new CatalogException(e.getMessage()); + } } } =20 @@ -368,6 +494,12 @@ public class AvroFileManagerClient implements File= ManagerClient { this.proxy.addProductReferences(AvroTypeFactory.getAvroPro= duct(product)); } catch (AvroRemoteException e) { throw new CatalogException(e.getMessage()); + } finally { + try { + this.client.close(); + } catch (IOException e) { + throw new CatalogException(e.getMessage()); + } } } =20 @@ -378,6 +510,12 @@ public class AvroFileManagerClient implements File= ManagerClient { AvroTypeFactory.getAvroMetadata(metadata)); } catch (AvroRemoteException e) { throw new CatalogException(e.getMessage()); + } finally { + try { + this.client.close(); + } catch (IOException e) { + throw new CatalogException(e.getMessage()); + } } =20 } @@ -391,6 +529,12 @@ public class AvroFileManagerClient implements File= ManagerClient { ); } catch (AvroRemoteException e) { throw new CatalogException(e.getMessage()); + } finally { + try { + this.client.close(); + } catch (IOException e) { + throw new CatalogException(e.getMessage()); + } } } =20 @@ -400,6 +544,12 @@ public class AvroFileManagerClient implements File= ManagerClient { return this.proxy.catalogProduct(AvroTypeFactory.getAvroPr= oduct(product)); } catch (AvroRemoteException e) { throw new CatalogException(e.getMessage()); + } finally { + try { + this.client.close(); + } catch (IOException e) { + throw new CatalogException(e.getMessage()); + } } } =20 @@ -409,6 +559,12 @@ public class AvroFileManagerClient implements File= ManagerClient { return AvroTypeFactory.getMetadata(this.proxy.getMetadata(= AvroTypeFactory.getAvroProduct(product))); } catch (AvroRemoteException e) { throw new CatalogException(e.getMessage()); + } finally { + try { + this.client.close(); + } catch (IOException e) { + throw new CatalogException(e.getMessage()); + } } } =20 @@ -419,6 +575,12 @@ public class AvroFileManagerClient implements File= ManagerClient { this.proxy.getReducedMetadata(AvroTypeFactory.getA= vroProduct(product), (List) elements)); } catch (AvroRemoteException e) { throw new CatalogException(e.getMessage()); + } finally { + try { + this.client.close(); + } catch (IOException e) { + throw new CatalogException(e.getMessage()); + } } } =20 @@ -428,6 +590,12 @@ public class AvroFileManagerClient implements File= ManagerClient { return this.proxy.removeFile(filePath); } catch (AvroRemoteException e) { throw new DataTransferException(e.getMessage()); + } finally { + try { + this.client.close(); + } catch (IOException e) { + throw new DataTransferException(e.getMessage()); + } } } =20 @@ -437,6 +605,12 @@ public class AvroFileManagerClient implements File= ManagerClient { return this.proxy.retrieveFile(filePath, offset, numBytes)= .array(); } catch (AvroRemoteException e) { throw new DataTransferException(e.getMessage()); + } finally { + try { + this.client.close(); + } catch (IOException e) { + throw new DataTransferException(e.getMessage()); + } } } =20 @@ -446,6 +620,12 @@ public class AvroFileManagerClient implements File= ManagerClient { this.proxy.transferFile(filePath, ByteBuffer.wrap(fileData= ), offset, numBytes); } catch (AvroRemoteException e) { throw new DataTransferException(e.getMessage()); + } finally { + try { + this.client.close(); + } catch (IOException e) { + throw new DataTransferException(e.getMessage()); + } } =20 } @@ -461,6 +641,12 @@ public class AvroFileManagerClient implements File= ManagerClient { =20 } catch (AvroRemoteException e) { throw new CatalogException(e.getMessage()); + } finally { + try { + this.client.close(); + } catch (IOException e) { + throw new CatalogException(e.getMessage()); + } } =20 } @@ -474,6 +660,12 @@ public class AvroFileManagerClient implements File= ManagerClient { } } catch (AvroRemoteException e) { throw new ValidationLayerException(e.getMessage()); + } finally { + try { + this.client.close(); + } catch (IOException e) { + throw new ValidationLayerException(e.getMessage()); + } } return products; } @@ -484,6 +676,12 @@ public class AvroFileManagerClient implements File= ManagerClient { return AvroTypeFactory.getElement(this.proxy.getElementByI= d(elementId)); } catch (AvroRemoteException e) { throw new ValidationLayerException(e.getMessage()); + } finally { + try { + this.client.close(); + } catch (IOException e) { + throw new ValidationLayerException(e.getMessage()); + } } } =20 @@ -493,6 +691,12 @@ public class AvroFileManagerClient implements File= ManagerClient { return AvroTypeFactory.getElement(this.proxy.getElementByN= ame(elementName)); } catch (AvroRemoteException e) { throw new ValidationLayerException(e.getMessage()); + } finally { + try { + this.client.close(); + } catch (IOException e) { + throw new ValidationLayerException(e.getMessage()); + } } } =20 @@ -506,6 +710,12 @@ public class AvroFileManagerClient implements File= ManagerClient { } } catch (AvroRemoteException e) { throw new CatalogException(e.getMessage()); + } finally { + try { + this.client.close(); + } catch (IOException e) { + throw new CatalogException(e.getMessage()); + } } return queryResults; } @@ -519,6 +729,12 @@ public class AvroFileManagerClient implements File= ManagerClient { } } catch (AvroRemoteException e) { throw new CatalogException(e.getMessage()); + } finally { + try { + this.client.close(); + } catch (IOException e) { + throw new CatalogException(e.getMessage()); + } } return products; } @@ -529,6 +745,12 @@ public class AvroFileManagerClient implements File= ManagerClient { return AvroTypeFactory.getProductType(this.proxy.getProduc= tTypeByName(productTypeName)); } catch (AvroRemoteException e) { throw new RepositoryManagerException(e.getMessage()); + } finally { + try { + this.client.close(); + } catch (IOException e) { + throw new RepositoryManagerException(e.getMessage()); + } } } =20 @@ -538,6 +760,12 @@ public class AvroFileManagerClient implements File= ManagerClient { return AvroTypeFactory.getProductType(this.proxy.getProduc= tTypeById(productTypeId)); } catch (AvroRemoteException e) { throw new RepositoryManagerException(e.getMessage()); + } finally { + try { + this.client.close(); + } catch (IOException e) { + throw new RepositoryManagerException(e.getMessage()); + } } } =20 @@ -550,6 +778,12 @@ public class AvroFileManagerClient implements File= ManagerClient { } } catch (AvroRemoteException e) { throw new RepositoryManagerException(e.getMessage()); + } finally { + try { + this.client.close(); + } catch (IOException e) { + throw new RepositoryManagerException(e.getMessage()); + } } return productTypes; } @@ -563,6 +797,12 @@ public class AvroFileManagerClient implements File= ManagerClient { } } catch (AvroRemoteException e) { throw new CatalogException(e.getMessage()); + } finally { + try { + this.client.close(); + } catch (IOException e) { + throw new CatalogException(e.getMessage()); + } } return references; } @@ -573,6 +813,12 @@ public class AvroFileManagerClient implements File= ManagerClient { return AvroTypeFactory.getProduct(this.proxy.getProductByI= d(productId)); } catch (AvroRemoteException e) { throw new CatalogException(e.getMessage()); + } finally { + try { + this.client.close(); + } catch (IOException e) { + throw new CatalogException(e.getMessage()); + } } } =20 @@ -582,6 +828,12 @@ public class AvroFileManagerClient implements File= ManagerClient { return AvroTypeFactory.getProduct(this.proxy.getProductByN= ame(productName)); } catch (AvroRemoteException e) { throw new CatalogException(e.getMessage()); + } finally { + try { + this.client.close(); + } catch (IOException e) { + throw new CatalogException(e.getMessage()); + } } } =20 @@ -696,30 +948,60 @@ public class AvroFileManagerClient implements Fil= eManagerClient { } throw new Exception("Failed to ingest product [" + product= + "] : " + e.getMessage()); + } finally { + try { + this.client.close(); + } catch (IOException e) { + throw new FileManagerException(e.getMessage()); + } } =20 } =20 @Override public Metadata getCatalogValues(Metadata metadata, ProductType pr= oductType) throws Exception { - return AvroTypeFactory.getMetadata(this.proxy.getCatalogValues= ( + try { + return AvroTypeFactory.getMetadata(this.proxy.getCatalogVa= lues( AvroTypeFactory.getAvroMetadata(metadata), AvroTypeFactory.getAvroProductType(productType))); + } finally { + try { + this.client.close(); + } catch (IOException e) { + throw new FileManagerException(e.getMessage()); + } + } } =20 @Override public Metadata getOrigValues(Metadata metadata, ProductType produ= ctType) throws Exception { - return AvroTypeFactory.getMetadata(this.proxy.getOrigValues( + try { + return AvroTypeFactory.getMetadata(this.proxy.getOrigValue= s( AvroTypeFactory.getAvroMetadata(metadata), AvroTypeFactory.getAvroProductType(productType))); + } finally { + try { + this.client.close(); + } catch (IOException e) { + throw new FileManagerException(e.getMessage()); + } + } } =20 @Override public Query getCatalogQuery(Query query, ProductType productType)= throws Exception { - return AvroTypeFactory.getQuery(this.proxy.getCatalogQuery( + try { + return AvroTypeFactory.getQuery(this.proxy.getCatalogQuery= ( AvroTypeFactory.getAvroQuery(query), AvroTypeFactory.getAvroProductType(productType) - )); + )); + } finally { + try { + this.client.close(); + } catch (IOException e) { + throw new FileManagerException(e.getMessage()); + } + } } =20 @Override =20 =20