From 6b6f53eafb9df4d6f2ab1b1c7940e8fe8a20a487 Mon Sep 17 00:00:00 2001 From: brinn <brinn> Date: Fri, 5 Aug 2011 08:59:09 +0000 Subject: [PATCH] refactor Hdf5Container for minimal interface (writer) SVN: 22348 --- .../hdf5/CompressingHdf5WriterWrapper.java | 479 +----------------- .../cisd/common/hdf5/Hdf5Container.java | 16 +- ...archicalStructureDuplicatorFileToHdf5.java | 9 +- .../common/hdf5/IHDF5ContainerWriter.java | 40 ++ .../cisd/common/hdf5/Hdf5ContainerTest.java | 10 +- .../dss/etl/Hdf5ThumbnailGenerator.java | 8 +- 6 files changed, 72 insertions(+), 490 deletions(-) create mode 100644 common/source/java/ch/systemsx/cisd/common/hdf5/IHDF5ContainerWriter.java diff --git a/common/source/java/ch/systemsx/cisd/common/hdf5/CompressingHdf5WriterWrapper.java b/common/source/java/ch/systemsx/cisd/common/hdf5/CompressingHdf5WriterWrapper.java index 8335139b687..1560bfe6430 100644 --- a/common/source/java/ch/systemsx/cisd/common/hdf5/CompressingHdf5WriterWrapper.java +++ b/common/source/java/ch/systemsx/cisd/common/hdf5/CompressingHdf5WriterWrapper.java @@ -16,23 +16,14 @@ package ch.systemsx.cisd.common.hdf5; -import java.util.BitSet; -import java.util.Date; -import java.util.List; - -import ncsa.hdf.hdf5lib.exceptions.HDF5DatatypeInterfaceException; -import ncsa.hdf.hdf5lib.exceptions.HDF5JavaException; - -import ch.systemsx.cisd.hdf5.HDF5DataSetInformation; import ch.systemsx.cisd.hdf5.HDF5GenericStorageFeatures; import ch.systemsx.cisd.hdf5.HDF5IntStorageFeatures; -import ch.systemsx.cisd.hdf5.IHDF5SimpleWriter; import ch.systemsx.cisd.hdf5.IHDF5Writer; /** * @author Chandrasekhar Ramakrishnan */ -class CompressingHdf5WriterWrapper implements IHDF5SimpleWriter +class CompressingHdf5WriterWrapper implements IHDF5ContainerWriter { private final IHDF5Writer writer; @@ -41,86 +32,19 @@ class CompressingHdf5WriterWrapper implements IHDF5SimpleWriter private final HDF5GenericStorageFeatures genericStorageFeatures; private final HDF5IntStorageFeatures intStorageFeatures; - - CompressingHdf5WriterWrapper(Hdf5Container parent, IHDF5Writer writer) + + CompressingHdf5WriterWrapper(Hdf5Container parent, IHDF5Writer writer, boolean compress) { this.writer = writer; - this.genericStorageFeatures = HDF5GenericStorageFeatures.GENERIC_DEFLATE; - this.intStorageFeatures = HDF5IntStorageFeatures.INT_DEFLATE; - } - - /** - * @param objectPath - * @see ch.systemsx.cisd.hdf5.IHDF5SimpleWriter#delete(java.lang.String) - */ - public void delete(String objectPath) - { - writer.delete(objectPath); - } - - /** - * @see ch.systemsx.cisd.hdf5.IHDF5SimpleReader#close() - */ - public void close() - { - writer.close(); - } - - /** - * @param objectPath - * @param value - * @see ch.systemsx.cisd.hdf5.IHDF5SimpleWriter#writeBoolean(java.lang.String, boolean) - */ - public void writeBoolean(String objectPath, boolean value) - { - writer.writeBoolean(objectPath, value); - } - - /** - * @param objectPath - * @see ch.systemsx.cisd.hdf5.IHDF5SimpleReader#exists(java.lang.String) - */ - public boolean exists(String objectPath) - { - return writer.exists(objectPath); - } - - /** - * @param objectPath - * @see ch.systemsx.cisd.hdf5.IHDF5SimpleReader#isGroup(java.lang.String) - */ - public boolean isGroup(String objectPath) - { - return writer.isGroup(objectPath); - } - - /** - * @param objectPath - * @param data - * @see ch.systemsx.cisd.hdf5.IHDF5SimpleWriter#writeBitField(java.lang.String, - * java.util.BitSet) - */ - public void writeBitField(String objectPath, BitSet data) - { - writer.writeBitField(objectPath, data); - } - - /** - * @param dataSetPath - * @see ch.systemsx.cisd.hdf5.IHDF5SimpleReader#getDataSetInformation(java.lang.String) - */ - public HDF5DataSetInformation getDataSetInformation(String dataSetPath) - { - return writer.getDataSetInformation(dataSetPath); - } - - /** - * @param groupPath - * @see ch.systemsx.cisd.hdf5.IHDF5SimpleReader#getGroupMembers(java.lang.String) - */ - public List<String> getGroupMembers(String groupPath) - { - return writer.getGroupMembers(groupPath); + if (compress) + { + this.genericStorageFeatures = HDF5GenericStorageFeatures.GENERIC_DEFLATE; + this.intStorageFeatures = HDF5IntStorageFeatures.INT_DEFLATE; + } else + { + this.genericStorageFeatures = HDF5GenericStorageFeatures.GENERIC_CONTIGUOUS; + this.intStorageFeatures = HDF5IntStorageFeatures.INT_CONTIGUOUS; + } } /** @@ -134,384 +58,11 @@ class CompressingHdf5WriterWrapper implements IHDF5SimpleWriter } /** - * @param objectPath - * @see ch.systemsx.cisd.hdf5.IHDF5SimpleReader#readAsByteArray(java.lang.String) - */ - public byte[] readAsByteArray(String objectPath) - { - return writer.readAsByteArray(objectPath); - } - - /** - * @param objectPath - * @param value - * @see ch.systemsx.cisd.hdf5.IHDF5SimpleWriter#writeInt(java.lang.String, int) - */ - public void writeInt(String objectPath, int value) - { - writer.writeInt(objectPath, value); - } - - /** - * @param objectPath - * @throws HDF5JavaException - * @see ch.systemsx.cisd.hdf5.IHDF5SimpleReader#readBoolean(java.lang.String) - */ - public boolean readBoolean(String objectPath) throws HDF5JavaException - { - return writer.readBoolean(objectPath); - } - - /** - * @param objectPath - * @param data - * @see ch.systemsx.cisd.hdf5.IHDF5SimpleWriter#writeIntArray(java.lang.String, int[]) - */ - public void writeIntArray(String objectPath, int[] data) - { - writer.writeIntArray(objectPath, data); - } - - /** - * @param objectPath - * @throws HDF5DatatypeInterfaceException - * @see ch.systemsx.cisd.hdf5.IHDF5SimpleReader#readBitField(java.lang.String) - */ - public BitSet readBitField(String objectPath) throws HDF5DatatypeInterfaceException - { - return writer.readBitField(objectPath); - } - - /** - * @param objectPath - * @param data - * @see ch.systemsx.cisd.hdf5.IHDF5SimpleWriter#writeIntMatrix(java.lang.String, int[][]) - */ - public void writeIntMatrix(String objectPath, int[][] data) - { - writer.writeIntMatrix(objectPath, data); - } - - /** - * @param objectPath - * @param value - * @see ch.systemsx.cisd.hdf5.IHDF5SimpleWriter#writeLong(java.lang.String, long) - */ - public void writeLong(String objectPath, long value) - { - writer.writeLong(objectPath, value); - } - - /** - * @param objectPath - * @param data - * @see ch.systemsx.cisd.hdf5.IHDF5SimpleWriter#writeLongArray(java.lang.String, long[]) - */ - public void writeLongArray(String objectPath, long[] data) - { - writer.writeLongArray(objectPath, data); - } - - /** - * @param objectPath - * @see ch.systemsx.cisd.hdf5.IHDF5SimpleReader#readInt(java.lang.String) - */ - public int readInt(String objectPath) - { - return writer.readInt(objectPath); - } - - /** - * @param objectPath - * @param data - * @see ch.systemsx.cisd.hdf5.IHDF5SimpleWriter#writeLongMatrix(java.lang.String, long[][]) - */ - public void writeLongMatrix(String objectPath, long[][] data) - { - writer.writeLongMatrix(objectPath, data); - } - - /** - * @param objectPath - * @see ch.systemsx.cisd.hdf5.IHDF5SimpleReader#readIntArray(java.lang.String) - */ - public int[] readIntArray(String objectPath) - { - return writer.readIntArray(objectPath); - } - - /** - * @param objectPath - * @param value - * @see ch.systemsx.cisd.hdf5.IHDF5SimpleWriter#writeFloat(java.lang.String, float) - */ - public void writeFloat(String objectPath, float value) - { - writer.writeFloat(objectPath, value); - } - - /** - * @param objectPath - * @see ch.systemsx.cisd.hdf5.IHDF5SimpleReader#readIntMatrix(java.lang.String) - */ - public int[][] readIntMatrix(String objectPath) - { - return writer.readIntMatrix(objectPath); - } - - /** - * @param objectPath - * @param data - * @see ch.systemsx.cisd.hdf5.IHDF5SimpleWriter#writeFloatArray(java.lang.String, float[]) - */ - public void writeFloatArray(String objectPath, float[] data) - { - writer.writeFloatArray(objectPath, data); - } - - /** - * @param objectPath - * @see ch.systemsx.cisd.hdf5.IHDF5SimpleReader#readLong(java.lang.String) - */ - public long readLong(String objectPath) - { - return writer.readLong(objectPath); - } - - /** - * @param objectPath - * @param data - * @see ch.systemsx.cisd.hdf5.IHDF5SimpleWriter#writeFloatMatrix(java.lang.String, float[][]) - */ - public void writeFloatMatrix(String objectPath, float[][] data) - { - writer.writeFloatMatrix(objectPath, data); - } - - /** - * @param objectPath - * @see ch.systemsx.cisd.hdf5.IHDF5SimpleReader#readLongArray(java.lang.String) - */ - public long[] readLongArray(String objectPath) - { - return writer.readLongArray(objectPath); - } - - /** - * @param objectPath - * @param value - * @see ch.systemsx.cisd.hdf5.IHDF5SimpleWriter#writeDouble(java.lang.String, double) - */ - public void writeDouble(String objectPath, double value) - { - writer.writeDouble(objectPath, value); - } - - /** - * @param objectPath - * @see ch.systemsx.cisd.hdf5.IHDF5SimpleReader#readLongMatrix(java.lang.String) - */ - public long[][] readLongMatrix(String objectPath) - { - return writer.readLongMatrix(objectPath); - } - - /** - * @param objectPath - * @param data - * @see ch.systemsx.cisd.hdf5.IHDF5SimpleWriter#writeDoubleArray(java.lang.String, double[]) - */ - public void writeDoubleArray(String objectPath, double[] data) - { - writer.writeDoubleArray(objectPath, data); - } - - /** - * @param objectPath - * @see ch.systemsx.cisd.hdf5.IHDF5SimpleReader#readFloat(java.lang.String) - */ - public float readFloat(String objectPath) - { - return writer.readFloat(objectPath); - } - - /** - * @param objectPath - * @param data - * @see ch.systemsx.cisd.hdf5.IHDF5SimpleWriter#writeDoubleMatrix(java.lang.String, double[][]) - */ - public void writeDoubleMatrix(String objectPath, double[][] data) - { - writer.writeDoubleMatrix(objectPath, data); - } - - /** - * @param objectPath - * @see ch.systemsx.cisd.hdf5.IHDF5SimpleReader#readFloatArray(java.lang.String) - */ - public float[] readFloatArray(String objectPath) - { - return writer.readFloatArray(objectPath); - } - - /** - * @param objectPath - * @param date - * @see ch.systemsx.cisd.hdf5.IHDF5SimpleWriter#writeDate(java.lang.String, java.util.Date) - */ - public void writeDate(String objectPath, Date date) - { - writer.writeDate(objectPath, date); - } - - /** - * @param objectPath - * @see ch.systemsx.cisd.hdf5.IHDF5SimpleReader#readFloatMatrix(java.lang.String) - */ - public float[][] readFloatMatrix(String objectPath) - { - return writer.readFloatMatrix(objectPath); - } - - /** - * @param objectPath - * @see ch.systemsx.cisd.hdf5.IHDF5SimpleReader#readDouble(java.lang.String) - */ - public double readDouble(String objectPath) - { - return writer.readDouble(objectPath); - } - - /** - * @param objectPath - * @param dates - * @see ch.systemsx.cisd.hdf5.IHDF5SimpleWriter#writeDateArray(java.lang.String, - * java.util.Date[]) - */ - public void writeDateArray(String objectPath, Date[] dates) - { - writer.writeDateArray(objectPath, dates); - } - - /** - * @param objectPath - * @param timeDuration - * @see ch.systemsx.cisd.hdf5.IHDF5SimpleWriter#writeTimeDuration(java.lang.String, long) - */ - public void writeTimeDuration(String objectPath, long timeDuration) - { - writer.writeTimeDuration(objectPath, timeDuration); - } - - /** - * @param objectPath - * @see ch.systemsx.cisd.hdf5.IHDF5SimpleReader#readDoubleArray(java.lang.String) - */ - public double[] readDoubleArray(String objectPath) - { - return writer.readDoubleArray(objectPath); - } - - /** - * @param objectPath - * @param timeDurations - * @see ch.systemsx.cisd.hdf5.IHDF5SimpleWriter#writeTimeDurationArray(java.lang.String, long[]) - */ - public void writeTimeDurationArray(String objectPath, long[] timeDurations) - { - writer.writeTimeDurationArray(objectPath, timeDurations); - } - - /** - * @param objectPath - * @see ch.systemsx.cisd.hdf5.IHDF5SimpleReader#readDoubleMatrix(java.lang.String) - */ - public double[][] readDoubleMatrix(String objectPath) - { - return writer.readDoubleMatrix(objectPath); - } - - /** - * @param objectPath - * @param data - * @param maxLength - * @see ch.systemsx.cisd.hdf5.IHDF5SimpleWriter#writeString(java.lang.String, java.lang.String, - * int) - */ - public void writeString(String objectPath, String data, int maxLength) - { - writer.writeString(objectPath, data, maxLength); - } - - /** - * @param objectPath - * @throws HDF5JavaException - * @see ch.systemsx.cisd.hdf5.IHDF5SimpleReader#readDate(java.lang.String) - */ - public Date readDate(String objectPath) throws HDF5JavaException - { - return writer.readDate(objectPath); - } - - /** - * @param objectPath - * @param data - * @param maxLength - * @see ch.systemsx.cisd.hdf5.IHDF5SimpleWriter#writeStringArray(java.lang.String, - * java.lang.String[], int) - */ - public void writeStringArray(String objectPath, String[] data, int maxLength) - { - writer.writeStringArray(objectPath, data, maxLength); - } - - /** - * @param objectPath - * @throws HDF5JavaException - * @see ch.systemsx.cisd.hdf5.IHDF5SimpleReader#readDateArray(java.lang.String) - */ - public Date[] readDateArray(String objectPath) throws HDF5JavaException - { - return writer.readDateArray(objectPath); - } - - /** - * @param objectPath - * @throws HDF5JavaException - * @see ch.systemsx.cisd.hdf5.IHDF5SimpleReader#readTimeDuration(java.lang.String) - */ - public long readTimeDuration(String objectPath) throws HDF5JavaException - { - return writer.readTimeDuration(objectPath); - } - - /** - * @param objectPath - * @throws HDF5JavaException - * @see ch.systemsx.cisd.hdf5.IHDF5SimpleReader#readTimeDurationArray(java.lang.String) - */ - public long[] readTimeDurationArray(String objectPath) throws HDF5JavaException - { - return writer.readTimeDurationArray(objectPath); - } - - /** - * @param objectPath - * @throws HDF5JavaException - * @see ch.systemsx.cisd.hdf5.IHDF5SimpleReader#readString(java.lang.String) + * @see ch.systemsx.cisd.hdf5.IHDF5SimpleReader#close() */ - public String readString(String objectPath) throws HDF5JavaException + public void close() { - return writer.readString(objectPath); + writer.close(); } - /** - * @param objectPath - * @throws HDF5JavaException - * @see ch.systemsx.cisd.hdf5.IHDF5SimpleReader#readStringArray(java.lang.String) - */ - public String[] readStringArray(String objectPath) throws HDF5JavaException - { - return writer.readStringArray(objectPath); - } } diff --git a/common/source/java/ch/systemsx/cisd/common/hdf5/Hdf5Container.java b/common/source/java/ch/systemsx/cisd/common/hdf5/Hdf5Container.java index c61c2a5db56..4787e44af6e 100644 --- a/common/source/java/ch/systemsx/cisd/common/hdf5/Hdf5Container.java +++ b/common/source/java/ch/systemsx/cisd/common/hdf5/Hdf5Container.java @@ -43,7 +43,7 @@ public class Hdf5Container /** * Run code using a writer. Implementations do <b>not</b> need to close the writer. */ - public void runWithSimpleWriter(IHDF5SimpleWriter writer); + public void runWithSimpleWriter(IHDF5ContainerWriter writer); } /** @@ -92,16 +92,10 @@ public class Hdf5Container * @param isContentCompressed Pass in true to have byte arrays transparently compressed. * @return A new IHDF5SimpleWriter */ - private IHDF5SimpleWriter createSimpleWriter(boolean isContentCompressed) + private IHDF5ContainerWriter createSimpleWriter(boolean isContentCompressed) { - if (isContentCompressed) - { - return new CompressingHdf5WriterWrapper(this, HDF5FactoryProvider.get().open( - hdf5Container)); - } else - { - return HDF5FactoryProvider.get().open(hdf5Container); - } + return new CompressingHdf5WriterWrapper(this, HDF5FactoryProvider.get().open( + hdf5Container), isContentCompressed); } /** @@ -110,7 +104,7 @@ public class Hdf5Container */ public void runWriterClient(boolean isContentCompressed, IHdf5WriterClient client) { - IHDF5SimpleWriter writer = createSimpleWriter(isContentCompressed); + IHDF5ContainerWriter writer = createSimpleWriter(isContentCompressed); try { client.runWithSimpleWriter(writer); diff --git a/common/source/java/ch/systemsx/cisd/common/hdf5/HierarchicalStructureDuplicatorFileToHdf5.java b/common/source/java/ch/systemsx/cisd/common/hdf5/HierarchicalStructureDuplicatorFileToHdf5.java index 130b73b6191..b956b85e520 100644 --- a/common/source/java/ch/systemsx/cisd/common/hdf5/HierarchicalStructureDuplicatorFileToHdf5.java +++ b/common/source/java/ch/systemsx/cisd/common/hdf5/HierarchicalStructureDuplicatorFileToHdf5.java @@ -24,7 +24,6 @@ import org.apache.commons.io.FileUtils; import ch.systemsx.cisd.base.exceptions.CheckedExceptionTunnel; import ch.systemsx.cisd.base.exceptions.IOExceptionUnchecked; import ch.systemsx.cisd.common.filesystem.FileUtilities; -import ch.systemsx.cisd.hdf5.IHDF5SimpleWriter; /** * Takes the hierarchical structure of a file and applies it to an HDF5 container. @@ -35,7 +34,7 @@ public class HierarchicalStructureDuplicatorFileToHdf5 { private final File file; - private final IHDF5SimpleWriter writer; + private final IHDF5ContainerWriter writer; /** * Utility class that adapts to the IHdf5WriterClient interface @@ -51,7 +50,7 @@ public class HierarchicalStructureDuplicatorFileToHdf5 this.file = file; } - public void runWithSimpleWriter(IHDF5SimpleWriter writer) + public void runWithSimpleWriter(IHDF5ContainerWriter writer) { HierarchicalStructureDuplicatorFileToHdf5.makeDuplicate(file, writer); } @@ -67,12 +66,12 @@ public class HierarchicalStructureDuplicatorFileToHdf5 * @throws CheckedExceptionTunnel Thrown if an underlying error occurs * @throws IOExceptionUnchecked Thrown if an underlying error occurs */ - public static void makeDuplicate(File file, IHDF5SimpleWriter writer) + public static void makeDuplicate(File file, IHDF5ContainerWriter writer) { new HierarchicalStructureDuplicatorFileToHdf5(file, writer).makeDuplicate(); } - private HierarchicalStructureDuplicatorFileToHdf5(File file, IHDF5SimpleWriter writer) + private HierarchicalStructureDuplicatorFileToHdf5(File file, IHDF5ContainerWriter writer) { this.file = file; this.writer = writer; diff --git a/common/source/java/ch/systemsx/cisd/common/hdf5/IHDF5ContainerWriter.java b/common/source/java/ch/systemsx/cisd/common/hdf5/IHDF5ContainerWriter.java new file mode 100644 index 00000000000..18ec61e7bcf --- /dev/null +++ b/common/source/java/ch/systemsx/cisd/common/hdf5/IHDF5ContainerWriter.java @@ -0,0 +1,40 @@ +/* + * Copyright 2011 ETH Zuerich, CISD + * + * Licensed 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 ch.systemsx.cisd.common.hdf5; + +/** + * A simple abstraction of the methods needed to write an HDF5 container. + * + * @author Bernd Rinn + */ +public interface IHDF5ContainerWriter +{ + /** + * Writes out a <code>byte</code> array (of rank 1). Uses a compact storage layout. Should only + * be used for small data sets. + * + * @param objectPath The name (including path information) of the data set object in the file. + * @param data The data to write. Must not be <code>null</code>. + */ + public void writeByteArray(final String objectPath, final byte[] data); + + /** + * Closes this object and the file referenced by this object. This object must not be used after + * being closed. + */ + public void close(); +} diff --git a/common/sourceTest/java/ch/systemsx/cisd/common/hdf5/Hdf5ContainerTest.java b/common/sourceTest/java/ch/systemsx/cisd/common/hdf5/Hdf5ContainerTest.java index 179f4f80e99..2fb24a3cdf3 100644 --- a/common/sourceTest/java/ch/systemsx/cisd/common/hdf5/Hdf5ContainerTest.java +++ b/common/sourceTest/java/ch/systemsx/cisd/common/hdf5/Hdf5ContainerTest.java @@ -24,11 +24,9 @@ import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; import ch.systemsx.cisd.base.tests.AbstractFileSystemTestCase; -import ch.systemsx.cisd.common.hdf5.Hdf5Container; import ch.systemsx.cisd.common.hdf5.Hdf5Container.IHdf5ReaderClient; import ch.systemsx.cisd.common.hdf5.Hdf5Container.IHdf5WriterClient; import ch.systemsx.cisd.hdf5.IHDF5SimpleReader; -import ch.systemsx.cisd.hdf5.IHDF5SimpleWriter; /** * @author Chandrasekhar Ramakrishnan @@ -51,7 +49,7 @@ public class Hdf5ContainerTest extends AbstractFileSystemTestCase hdf5Content.runWriterClient(false, new IHdf5WriterClient() { - public void runWithSimpleWriter(IHDF5SimpleWriter writer) + public void runWithSimpleWriter(IHDF5ContainerWriter writer) { writer.writeByteArray("/test-bytes", byteArray); @@ -77,7 +75,7 @@ public class Hdf5ContainerTest extends AbstractFileSystemTestCase hdf5Content.runWriterClient(true, new IHdf5WriterClient() { - public void runWithSimpleWriter(IHDF5SimpleWriter writer) + public void runWithSimpleWriter(IHDF5ContainerWriter writer) { writer.writeByteArray("/test-bytes", byteArray); @@ -103,7 +101,7 @@ public class Hdf5ContainerTest extends AbstractFileSystemTestCase Hdf5Container hdf5ContentUncompressed = new Hdf5Container(hdf5FileUncompressed); hdf5ContentUncompressed.runWriterClient(false, new IHdf5WriterClient() { - public void runWithSimpleWriter(IHDF5SimpleWriter writer) + public void runWithSimpleWriter(IHDF5ContainerWriter writer) { writer.writeByteArray("/test-bytes", byteArray); @@ -114,7 +112,7 @@ public class Hdf5ContainerTest extends AbstractFileSystemTestCase Hdf5Container hdf5ContentCompressed = new Hdf5Container(hdf5FileCompressed); hdf5ContentCompressed.runWriterClient(true, new IHdf5WriterClient() { - public void runWithSimpleWriter(IHDF5SimpleWriter writer) + public void runWithSimpleWriter(IHDF5ContainerWriter writer) { writer.writeByteArray("/test-bytes", byteArray); diff --git a/screening/source/java/ch/systemsx/cisd/openbis/dss/etl/Hdf5ThumbnailGenerator.java b/screening/source/java/ch/systemsx/cisd/openbis/dss/etl/Hdf5ThumbnailGenerator.java index 92c90584203..e5a14d2c714 100644 --- a/screening/source/java/ch/systemsx/cisd/openbis/dss/etl/Hdf5ThumbnailGenerator.java +++ b/screening/source/java/ch/systemsx/cisd/openbis/dss/etl/Hdf5ThumbnailGenerator.java @@ -36,13 +36,13 @@ import ch.systemsx.cisd.common.concurrent.ITaskExecutor; import ch.systemsx.cisd.common.concurrent.ParallelizedExecutor; import ch.systemsx.cisd.common.exceptions.Status; import ch.systemsx.cisd.common.hdf5.Hdf5Container.IHdf5WriterClient; +import ch.systemsx.cisd.common.hdf5.IHDF5ContainerWriter; import ch.systemsx.cisd.common.io.FileBasedContent; import ch.systemsx.cisd.common.logging.LogCategory; import ch.systemsx.cisd.common.logging.LogFactory; import ch.systemsx.cisd.common.process.ProcessExecutionHelper; import ch.systemsx.cisd.common.process.ProcessIOStrategy; import ch.systemsx.cisd.common.process.ProcessResult; -import ch.systemsx.cisd.hdf5.IHDF5SimpleWriter; import ch.systemsx.cisd.openbis.dss.etl.dto.ImageLibraryInfo; import ch.systemsx.cisd.openbis.dss.etl.dto.api.v1.ThumbnailsStorageFormat; import ch.systemsx.cisd.openbis.dss.generic.shared.utils.ImageUtil; @@ -90,7 +90,7 @@ class Hdf5ThumbnailGenerator implements IHdf5WriterClient * the thumbnail. Using it allows not to allocate memory each time when a thumbnail * is generated. */ - private Status generateThumbnail(IHDF5SimpleWriter writer, AcquiredSingleImage plateImage, + private Status generateThumbnail(IHDF5ContainerWriter writer, AcquiredSingleImage plateImage, ByteArrayOutputStream bufferOutputStream) { RelativeImageReference imageReference = plateImage.getImageReference(); @@ -214,7 +214,7 @@ class Hdf5ThumbnailGenerator implements IHdf5WriterClient } private ITaskExecutor<AcquiredSingleImage> createThumbnailGenerator( - final IHDF5SimpleWriter writer) + final IHDF5ContainerWriter writer) { return new ITaskExecutor<AcquiredSingleImage>() { @@ -239,7 +239,7 @@ class Hdf5ThumbnailGenerator implements IHdf5WriterClient }; } - public void runWithSimpleWriter(IHDF5SimpleWriter writer) + public void runWithSimpleWriter(IHDF5ContainerWriter writer) { Collection<FailureRecord<AcquiredSingleImage>> errors = ParallelizedExecutor.process(plateImages, createThumbnailGenerator(writer), -- GitLab