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 8BF1C200BD0 for ; Wed, 30 Nov 2016 20:08:03 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 8A8FE160B28; Wed, 30 Nov 2016 19:08:03 +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 B0943160B06 for ; Wed, 30 Nov 2016 20:08:02 +0100 (CET) Received: (qmail 67021 invoked by uid 500); 30 Nov 2016 19:08:00 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 66847 invoked by uid 99); 30 Nov 2016 19:08:00 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 30 Nov 2016 19:08:00 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id CAE172C2A66 for ; Wed, 30 Nov 2016 19:07:59 +0000 (UTC) Date: Wed, 30 Nov 2016 19:07:59 +0000 (UTC) From: "Plamen Totev (JIRA)" To: issues@commons.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (COMPRESS-375) Allow the clients of ParallelScatterZipCreator to provide ZipArchiveEntryRequestSupplier MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Wed, 30 Nov 2016 19:08:03 -0000 [ https://issues.apache.org/jira/browse/COMPRESS-375?page=3Dcom.atlass= ian.jira.plugin.system.issuetabpanels:all-tabpanel ] Plamen Totev updated COMPRESS-375: ---------------------------------- Description:=20 Currently clients of {{ParallelScatterZipCreator}} could provide {{ZipArchi= veEntry}} and {{InputStreamSupplier}} through {{ParallelScatterZipCreator#a= ddArchiveEntry}}. From those two a {{ZipArchiveEntryRequest}} is created. P= roviding {{InputStreamSupplier}} solves the problem with opening too many f= iles - streams are opened just-in-time - when an entry is compressed, not = when it's submitted. But there are use cases when the stream may contain information about the {= {ZipArchiveEntry}}. In those cases creating {{ZipArchiveEntry}} before the = {{InputStream}} is opened won't work. If there is an option to supply both = {{ZipArchiveEntry}} and {{InputStreamSupplier}} ({{ZipArchiveEntryRequest}}= ), this will solve the issue. There is a bug in Plexus Archiver (https://github.com/codehaus-plexus/plexu= s-archiver/issues/53) that is example for such use case. Plexus Archiver ha= ve option that allows entries that are already zip files to be stored inste= ad of compressed ({{AbstractZipArchiver.recompressAddedZips}}). To detect i= f given entry is zip archive, {{AbstractZipArchiver}} should read the first= several bytes of the stream. So creating {{ZipArchiveEntry}} before the st= ream is opened is not useful - the compress mode is not known. Opening the = stream when the {{ZipArchiveEntry}} is created won't work either. Because = you can add entries to {{ParallelScatterZipCreator}} a lot faster than you = could compress them you could open too many files very fast. And I don't th= ink opening and closing the stream is an option as such operations could be= relatively expensive in the general case. But if it could supply both the = {{ZipArchiveEntry}} and the {{InputStream}} just-in-time (by passing {{ZipA= rchiveEntryRequestSupplier}} to {{ParallelScatterZipCreator}}) then the pro= blem is solved. What do you think? Does the addition of {{ParallelScatterZipCreator#addArch= iveEntry(ZipArchiveEntryRequestSupplier)}} make sense? was: Currently clients of {{ParallelScatterZipCreator}} could provide {{ZipArchi= veEntry}} and {{InputStreamSupplier}} through {{ParallelScatterZipCreator#a= ddArchiveEntry}}. From those two a {{ZipArchiveEntryRequest}} is created. P= roviding {{InputStreamSupplier}} solves the problem with opening too many f= iles - streams are opened just-in-time - when an entry is compressed, not = when it's submitted. But there are use cases when the stream may contain information about the {= {ZipArchiveEntry}}. In those cases creating {{ZipArchiveEntry}} before the = {{InputStream}} is opened won't work. If there is an option to supply both = {{ZipArchiveEntry}} and {{InputStreamSupplier}} ({{ZipArchiveEntryRequest}}= ), this will solve the issue. There is a bug in Plexus Archiver (https://github.com/codehaus-plexus/plexu= s-archiver/issues/53) that is example for such use case. Plexus Archiver ha= ve option that allows entries that are already zip files to be stored inste= ad of compressed ({{AbstractZipArchiver.recompressAddedZips}}). To detect i= f given entry is zip archive, {{AbstractZipArchiver}} should read the first= several bytes of the stream. So creating {{ZipArchiveEntry}} before the st= ream is opened is not useful - the compress mode is not known. Opening the = stream when the {{ZipArchiveEntry}} is created won't work either. Because = you can add entries to {{ParallelScatterZipCreator}} a lot faster than you = could compress them you could open too many files very fast. And I don't th= ink opening and closing the stream is an option as such operations could be= relatively expensive in the general case. But if it could supply both the = {{ZipArchiveEntry}} and the {{InputStream}} just-in-time (by passing {{ZipA= rchiveEntryRequestSupplier}} to {{ParallelScatterZipCreator}}) then the pro= blem is solved. What do you think. Does the addition of {{ParallelScatterZipCreator#addArch= iveEntry(ZipArchiveEntryRequestSupplier)}} make sense? > Allow the clients of ParallelScatterZipCreator to provide ZipArchiveEntry= RequestSupplier > -------------------------------------------------------------------------= --------------- > > Key: COMPRESS-375 > URL: https://issues.apache.org/jira/browse/COMPRESS-375 > Project: Commons Compress > Issue Type: Improvement > Components: Archivers > Reporter: Plamen Totev > > Currently clients of {{ParallelScatterZipCreator}} could provide {{ZipArc= hiveEntry}} and {{InputStreamSupplier}} through {{ParallelScatterZipCreator= #addArchiveEntry}}. From those two a {{ZipArchiveEntryRequest}} is created.= Providing {{InputStreamSupplier}} solves the problem with opening too many= files - streams are opened just-in-time - when an entry is compressed, no= t when it's submitted. > But there are use cases when the stream may contain information about the= {{ZipArchiveEntry}}. In those cases creating {{ZipArchiveEntry}} before th= e {{InputStream}} is opened won't work. If there is an option to supply bot= h {{ZipArchiveEntry}} and {{InputStreamSupplier}} ({{ZipArchiveEntryRequest= }}), this will solve the issue. > There is a bug in Plexus Archiver (https://github.com/codehaus-plexus/ple= xus-archiver/issues/53) that is example for such use case. Plexus Archiver = have option that allows entries that are already zip files to be stored ins= tead of compressed ({{AbstractZipArchiver.recompressAddedZips}}). To detect= if given entry is zip archive, {{AbstractZipArchiver}} should read the fir= st several bytes of the stream. So creating {{ZipArchiveEntry}} before the = stream is opened is not useful - the compress mode is not known. Opening th= e stream when the {{ZipArchiveEntry}} is created won't work either. Becaus= e you can add entries to {{ParallelScatterZipCreator}} a lot faster than yo= u could compress them you could open too many files very fast. And I don't = think opening and closing the stream is an option as such operations could = be relatively expensive in the general case. But if it could supply both th= e {{ZipArchiveEntry}} and the {{InputStream}} just-in-time (by passing {{Zi= pArchiveEntryRequestSupplier}} to {{ParallelScatterZipCreator}}) then the p= roblem is solved. > What do you think? Does the addition of {{ParallelScatterZipCreator#addAr= chiveEntry(ZipArchiveEntryRequestSupplier)}} make sense? -- This message was sent by Atlassian JIRA (v6.3.4#6332)