You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by "DomGarguilo (via GitHub)" <gi...@apache.org> on 2025/07/10 19:56:37 UTC
[PR] compress data used by tablet management iterator [accumulo]
DomGarguilo opened a new pull request, #5736:
URL: https://github.com/apache/accumulo/pull/5736
Closes #5639
Most of this was copied from changes made in #5627. The changes made in #5627 could not be cleanly merged up since the code was too different so this PR integrates that code into main.
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] compress data used by tablet management iterator [accumulo]
Posted by "DomGarguilo (via GitHub)" <gi...@apache.org>.
DomGarguilo merged PR #5736:
URL: https://github.com/apache/accumulo/pull/5736
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] compress data used by tablet management iterator [accumulo]
Posted by "keith-turner (via GitHub)" <gi...@apache.org>.
keith-turner commented on code in PR #5736:
URL: https://github.com/apache/accumulo/pull/5736#discussion_r2201702994
##########
test/src/main/java/org/apache/accumulo/test/functional/TabletManagementIteratorIT.java:
##########
@@ -311,6 +334,8 @@ public void test() throws AccumuloException, AccumuloSecurityException, TableExi
// clean up
dropTables(client, t1, t2, t3, t4, metaCopy1, metaCopy2, metaCopy3, metaCopy4, metaCopy5,
metaCopy6);
+ } finally {
+ super.teardownCluster();
Review Comment:
it may fine, depends on if calling the method twice would cause problems sometimes
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] compress data used by tablet management iterator [accumulo]
Posted by "DomGarguilo (via GitHub)" <gi...@apache.org>.
DomGarguilo commented on code in PR #5736:
URL: https://github.com/apache/accumulo/pull/5736#discussion_r2201331391
##########
test/src/main/java/org/apache/accumulo/test/functional/TabletManagementIteratorIT.java:
##########
@@ -311,6 +334,8 @@ public void test() throws AccumuloException, AccumuloSecurityException, TableExi
// clean up
dropTables(client, t1, t2, t3, t4, metaCopy1, metaCopy2, metaCopy3, metaCopy4, metaCopy5,
metaCopy6);
+ } finally {
+ super.teardownCluster();
Review Comment:
I'll take a look. I was just going off of the addition from #5627 which did things this way. Not sure if that IT should be fixed too or not.
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] compress data used by tablet management iterator [accumulo]
Posted by "keith-turner (via GitHub)" <gi...@apache.org>.
keith-turner commented on code in PR #5736:
URL: https://github.com/apache/accumulo/pull/5736#discussion_r2201911390
##########
server/base/src/main/java/org/apache/accumulo/server/iterators/ServerIteratorOptions.java:
##########
@@ -0,0 +1,139 @@
+/*
+ * 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
+ *
+ * https://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.accumulo.server.iterators;
+
+import static java.nio.charset.StandardCharsets.UTF_8;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.DataInputStream;
+import java.io.DataOutput;
+import java.io.DataOutputStream;
+import java.io.IOException;
+import java.io.UncheckedIOException;
+import java.util.Base64;
+import java.util.Map;
+
+import org.apache.accumulo.core.client.IteratorSetting;
+import org.apache.accumulo.core.conf.AccumuloConfiguration;
+import org.apache.accumulo.core.conf.Property;
+import org.apache.accumulo.core.file.rfile.bcfile.Compression;
+import org.apache.accumulo.core.file.rfile.bcfile.CompressionAlgorithm;
+import org.apache.accumulo.core.spi.file.rfile.compression.NoCompression;
+import org.apache.hadoop.io.compress.Compressor;
+import org.apache.hadoop.io.compress.Decompressor;
+
+import com.google.common.base.Preconditions;
+
+public class ServerIteratorOptions {
+ static final String COMPRESSION_ALGO = "__COMPRESSION_ALGO";
+
+ private static final String NONE = new NoCompression().getName();
+
+ public interface Serializer {
+ void serialize(DataOutput dataOutput) throws IOException;
+ }
+
+ public static void compressOption(final AccumuloConfiguration config,
+ IteratorSetting iteratorSetting, String option, String value) {
+ final String algo = config.get(Property.GENERAL_SERVER_ITERATOR_OPTIONS_COMPRESSION_ALGO);
+ setAlgo(iteratorSetting, algo);
+
+ if (algo.equals(NONE)) {
+ iteratorSetting.addOption(option, value);
+ } else {
+ compressOption(config, iteratorSetting, option, dataOutput -> {
+ byte[] bytes = value.getBytes(UTF_8);
+ dataOutput.writeInt(bytes.length);
+ dataOutput.write(bytes);
+ });
+ }
+ }
+
+ public static void compressOption(final AccumuloConfiguration config,
+ IteratorSetting iteratorSetting, String option, Serializer serializer) {
+ final String algo = config.get(Property.GENERAL_SERVER_ITERATOR_OPTIONS_COMPRESSION_ALGO);
+ final CompressionAlgorithm ca = Compression.getCompressionAlgorithmByName(algo);
+ final Compressor c = ca.getCompressor();
+
+ setAlgo(iteratorSetting, algo);
+
+ try (ByteArrayOutputStream baos = new ByteArrayOutputStream(); DataOutputStream dos =
+ new DataOutputStream(ca.createCompressionStream(baos, c, 32 * 1024))) {
+ serializer.serialize(dos);
+ dos.close();
+ var val = Base64.getEncoder().encodeToString(baos.toByteArray());
+ iteratorSetting.addOption(option, val);
+ } catch (IOException ioe) {
+ throw new UncheckedIOException(ioe);
+ } finally {
+ ca.returnCompressor(c);
+ }
+ }
+
+ private static void setAlgo(IteratorSetting iteratorSetting, String algo) {
+ if (iteratorSetting.getOptions().containsKey(COMPRESSION_ALGO)) {
+ Preconditions.checkArgument(iteratorSetting.getOptions().get(COMPRESSION_ALGO).equals(algo));
+ } else {
+ iteratorSetting.addOption(COMPRESSION_ALGO, algo);
+ }
+ }
+
+ public interface Deserializer<T> {
+ T deserialize(DataInputStream dataInput) throws IOException;
+ }
+
+ public static String decompressOption(Map<String,String> options, String option) {
+ var algo = options.getOrDefault(COMPRESSION_ALGO, NONE);
+ if (algo.equals(NONE)) {
+ return options.get(option);
+ }
+
+ return decompressOption(options, option, dataInput -> {
+ int len = dataInput.readInt();
+ byte[] data = new byte[len];
+ dataInput.readFully(data);
+ return new String(data, UTF_8);
+ });
+ }
+
+ public static <T> T decompressOption(Map<String,String> options, String option,
Review Comment:
I was only looking at what methods TabletManagementIterator used from this class. If its used internally, then leaving it is fine.
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] compress data used by tablet management iterator [accumulo]
Posted by "keith-turner (via GitHub)" <gi...@apache.org>.
keith-turner commented on code in PR #5736:
URL: https://github.com/apache/accumulo/pull/5736#discussion_r2198659988
##########
server/base/src/main/java/org/apache/accumulo/server/iterators/ServerIteratorOptions.java:
##########
@@ -0,0 +1,139 @@
+/*
+ * 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
+ *
+ * https://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.accumulo.server.iterators;
+
+import static java.nio.charset.StandardCharsets.UTF_8;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.DataInputStream;
+import java.io.DataOutput;
+import java.io.DataOutputStream;
+import java.io.IOException;
+import java.io.UncheckedIOException;
+import java.util.Base64;
+import java.util.Map;
+
+import org.apache.accumulo.core.client.IteratorSetting;
+import org.apache.accumulo.core.conf.AccumuloConfiguration;
+import org.apache.accumulo.core.conf.Property;
+import org.apache.accumulo.core.file.rfile.bcfile.Compression;
+import org.apache.accumulo.core.file.rfile.bcfile.CompressionAlgorithm;
+import org.apache.accumulo.core.spi.file.rfile.compression.NoCompression;
+import org.apache.hadoop.io.compress.Compressor;
+import org.apache.hadoop.io.compress.Decompressor;
+
+import com.google.common.base.Preconditions;
+
+public class ServerIteratorOptions {
+ static final String COMPRESSION_ALGO = "__COMPRESSION_ALGO";
+
+ private static final String NONE = new NoCompression().getName();
+
+ public interface Serializer {
+ void serialize(DataOutput dataOutput) throws IOException;
+ }
+
+ public static void compressOption(final AccumuloConfiguration config,
+ IteratorSetting iteratorSetting, String option, String value) {
+ final String algo = config.get(Property.GENERAL_SERVER_ITERATOR_OPTIONS_COMPRESSION_ALGO);
+ setAlgo(iteratorSetting, algo);
+
+ if (algo.equals(NONE)) {
+ iteratorSetting.addOption(option, value);
+ } else {
+ compressOption(config, iteratorSetting, option, dataOutput -> {
+ byte[] bytes = value.getBytes(UTF_8);
+ dataOutput.writeInt(bytes.length);
+ dataOutput.write(bytes);
+ });
+ }
+ }
+
+ public static void compressOption(final AccumuloConfiguration config,
+ IteratorSetting iteratorSetting, String option, Serializer serializer) {
+ final String algo = config.get(Property.GENERAL_SERVER_ITERATOR_OPTIONS_COMPRESSION_ALGO);
+ final CompressionAlgorithm ca = Compression.getCompressionAlgorithmByName(algo);
+ final Compressor c = ca.getCompressor();
+
+ setAlgo(iteratorSetting, algo);
+
+ try (ByteArrayOutputStream baos = new ByteArrayOutputStream(); DataOutputStream dos =
+ new DataOutputStream(ca.createCompressionStream(baos, c, 32 * 1024))) {
+ serializer.serialize(dos);
+ dos.close();
+ var val = Base64.getEncoder().encodeToString(baos.toByteArray());
+ iteratorSetting.addOption(option, val);
+ } catch (IOException ioe) {
+ throw new UncheckedIOException(ioe);
+ } finally {
+ ca.returnCompressor(c);
+ }
+ }
+
+ private static void setAlgo(IteratorSetting iteratorSetting, String algo) {
+ if (iteratorSetting.getOptions().containsKey(COMPRESSION_ALGO)) {
+ Preconditions.checkArgument(iteratorSetting.getOptions().get(COMPRESSION_ALGO).equals(algo));
+ } else {
+ iteratorSetting.addOption(COMPRESSION_ALGO, algo);
+ }
+ }
+
+ public interface Deserializer<T> {
+ T deserialize(DataInputStream dataInput) throws IOException;
+ }
+
+ public static String decompressOption(Map<String,String> options, String option) {
+ var algo = options.getOrDefault(COMPRESSION_ALGO, NONE);
+ if (algo.equals(NONE)) {
+ return options.get(option);
+ }
+
+ return decompressOption(options, option, dataInput -> {
+ int len = dataInput.readInt();
+ byte[] data = new byte[len];
+ dataInput.readFully(data);
+ return new String(data, UTF_8);
+ });
+ }
+
+ public static <T> T decompressOption(Map<String,String> options, String option,
Review Comment:
Seems like this is not used, could remove it and the related code. Can always add it back later if there is a need.
##########
test/src/main/java/org/apache/accumulo/test/functional/TabletManagementIteratorIT.java:
##########
@@ -311,6 +334,8 @@ public void test() throws AccumuloException, AccumuloSecurityException, TableExi
// clean up
dropTables(client, t1, t2, t3, t4, metaCopy1, metaCopy2, metaCopy3, metaCopy4, metaCopy5,
metaCopy6);
+ } finally {
+ super.teardownCluster();
Review Comment:
Should this class overrude this teardown method like it override the setupCluster method? Seems like aftereach may still call this, not sure.
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] compress data used by tablet management iterator [accumulo]
Posted by "DomGarguilo (via GitHub)" <gi...@apache.org>.
DomGarguilo commented on code in PR #5736:
URL: https://github.com/apache/accumulo/pull/5736#discussion_r2201363225
##########
server/base/src/main/java/org/apache/accumulo/server/iterators/ServerIteratorOptions.java:
##########
@@ -0,0 +1,139 @@
+/*
+ * 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
+ *
+ * https://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.accumulo.server.iterators;
+
+import static java.nio.charset.StandardCharsets.UTF_8;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.DataInputStream;
+import java.io.DataOutput;
+import java.io.DataOutputStream;
+import java.io.IOException;
+import java.io.UncheckedIOException;
+import java.util.Base64;
+import java.util.Map;
+
+import org.apache.accumulo.core.client.IteratorSetting;
+import org.apache.accumulo.core.conf.AccumuloConfiguration;
+import org.apache.accumulo.core.conf.Property;
+import org.apache.accumulo.core.file.rfile.bcfile.Compression;
+import org.apache.accumulo.core.file.rfile.bcfile.CompressionAlgorithm;
+import org.apache.accumulo.core.spi.file.rfile.compression.NoCompression;
+import org.apache.hadoop.io.compress.Compressor;
+import org.apache.hadoop.io.compress.Decompressor;
+
+import com.google.common.base.Preconditions;
+
+public class ServerIteratorOptions {
+ static final String COMPRESSION_ALGO = "__COMPRESSION_ALGO";
+
+ private static final String NONE = new NoCompression().getName();
+
+ public interface Serializer {
+ void serialize(DataOutput dataOutput) throws IOException;
+ }
+
+ public static void compressOption(final AccumuloConfiguration config,
+ IteratorSetting iteratorSetting, String option, String value) {
+ final String algo = config.get(Property.GENERAL_SERVER_ITERATOR_OPTIONS_COMPRESSION_ALGO);
+ setAlgo(iteratorSetting, algo);
+
+ if (algo.equals(NONE)) {
+ iteratorSetting.addOption(option, value);
+ } else {
+ compressOption(config, iteratorSetting, option, dataOutput -> {
+ byte[] bytes = value.getBytes(UTF_8);
+ dataOutput.writeInt(bytes.length);
+ dataOutput.write(bytes);
+ });
+ }
+ }
+
+ public static void compressOption(final AccumuloConfiguration config,
+ IteratorSetting iteratorSetting, String option, Serializer serializer) {
+ final String algo = config.get(Property.GENERAL_SERVER_ITERATOR_OPTIONS_COMPRESSION_ALGO);
+ final CompressionAlgorithm ca = Compression.getCompressionAlgorithmByName(algo);
+ final Compressor c = ca.getCompressor();
+
+ setAlgo(iteratorSetting, algo);
+
+ try (ByteArrayOutputStream baos = new ByteArrayOutputStream(); DataOutputStream dos =
+ new DataOutputStream(ca.createCompressionStream(baos, c, 32 * 1024))) {
+ serializer.serialize(dos);
+ dos.close();
+ var val = Base64.getEncoder().encodeToString(baos.toByteArray());
+ iteratorSetting.addOption(option, val);
+ } catch (IOException ioe) {
+ throw new UncheckedIOException(ioe);
+ } finally {
+ ca.returnCompressor(c);
+ }
+ }
+
+ private static void setAlgo(IteratorSetting iteratorSetting, String algo) {
+ if (iteratorSetting.getOptions().containsKey(COMPRESSION_ALGO)) {
+ Preconditions.checkArgument(iteratorSetting.getOptions().get(COMPRESSION_ALGO).equals(algo));
+ } else {
+ iteratorSetting.addOption(COMPRESSION_ALGO, algo);
+ }
+ }
+
+ public interface Deserializer<T> {
+ T deserialize(DataInputStream dataInput) throws IOException;
+ }
+
+ public static String decompressOption(Map<String,String> options, String option) {
+ var algo = options.getOrDefault(COMPRESSION_ALGO, NONE);
+ if (algo.equals(NONE)) {
+ return options.get(option);
+ }
+
+ return decompressOption(options, option, dataInput -> {
+ int len = dataInput.readInt();
+ byte[] data = new byte[len];
+ dataInput.readFully(data);
+ return new String(data, UTF_8);
+ });
+ }
+
+ public static <T> T decompressOption(Map<String,String> options, String option,
Review Comment:
It's used within the other `decompressOption` above. Are you suggesting we just combing the logic here so there is only one `decompressOption` or something else?
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] compress data used by tablet management iterator [accumulo]
Posted by "DomGarguilo (via GitHub)" <gi...@apache.org>.
DomGarguilo commented on code in PR #5736:
URL: https://github.com/apache/accumulo/pull/5736#discussion_r2205408232
##########
server/base/src/main/java/org/apache/accumulo/server/iterators/ServerIteratorOptions.java:
##########
@@ -0,0 +1,139 @@
+/*
+ * 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
+ *
+ * https://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.accumulo.server.iterators;
+
+import static java.nio.charset.StandardCharsets.UTF_8;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.DataInputStream;
+import java.io.DataOutput;
+import java.io.DataOutputStream;
+import java.io.IOException;
+import java.io.UncheckedIOException;
+import java.util.Base64;
+import java.util.Map;
+
+import org.apache.accumulo.core.client.IteratorSetting;
+import org.apache.accumulo.core.conf.AccumuloConfiguration;
+import org.apache.accumulo.core.conf.Property;
+import org.apache.accumulo.core.file.rfile.bcfile.Compression;
+import org.apache.accumulo.core.file.rfile.bcfile.CompressionAlgorithm;
+import org.apache.accumulo.core.spi.file.rfile.compression.NoCompression;
+import org.apache.hadoop.io.compress.Compressor;
+import org.apache.hadoop.io.compress.Decompressor;
+
+import com.google.common.base.Preconditions;
+
+public class ServerIteratorOptions {
+ static final String COMPRESSION_ALGO = "__COMPRESSION_ALGO";
+
+ private static final String NONE = new NoCompression().getName();
+
+ public interface Serializer {
+ void serialize(DataOutput dataOutput) throws IOException;
+ }
+
+ public static void compressOption(final AccumuloConfiguration config,
+ IteratorSetting iteratorSetting, String option, String value) {
+ final String algo = config.get(Property.GENERAL_SERVER_ITERATOR_OPTIONS_COMPRESSION_ALGO);
+ setAlgo(iteratorSetting, algo);
+
+ if (algo.equals(NONE)) {
+ iteratorSetting.addOption(option, value);
+ } else {
+ compressOption(config, iteratorSetting, option, dataOutput -> {
+ byte[] bytes = value.getBytes(UTF_8);
+ dataOutput.writeInt(bytes.length);
+ dataOutput.write(bytes);
+ });
+ }
+ }
+
+ public static void compressOption(final AccumuloConfiguration config,
+ IteratorSetting iteratorSetting, String option, Serializer serializer) {
+ final String algo = config.get(Property.GENERAL_SERVER_ITERATOR_OPTIONS_COMPRESSION_ALGO);
+ final CompressionAlgorithm ca = Compression.getCompressionAlgorithmByName(algo);
+ final Compressor c = ca.getCompressor();
+
+ setAlgo(iteratorSetting, algo);
+
+ try (ByteArrayOutputStream baos = new ByteArrayOutputStream(); DataOutputStream dos =
+ new DataOutputStream(ca.createCompressionStream(baos, c, 32 * 1024))) {
+ serializer.serialize(dos);
+ dos.close();
+ var val = Base64.getEncoder().encodeToString(baos.toByteArray());
+ iteratorSetting.addOption(option, val);
+ } catch (IOException ioe) {
+ throw new UncheckedIOException(ioe);
+ } finally {
+ ca.returnCompressor(c);
+ }
+ }
+
+ private static void setAlgo(IteratorSetting iteratorSetting, String algo) {
+ if (iteratorSetting.getOptions().containsKey(COMPRESSION_ALGO)) {
+ Preconditions.checkArgument(iteratorSetting.getOptions().get(COMPRESSION_ALGO).equals(algo));
+ } else {
+ iteratorSetting.addOption(COMPRESSION_ALGO, algo);
+ }
+ }
+
+ public interface Deserializer<T> {
+ T deserialize(DataInputStream dataInput) throws IOException;
+ }
+
+ public static String decompressOption(Map<String,String> options, String option) {
+ var algo = options.getOrDefault(COMPRESSION_ALGO, NONE);
+ if (algo.equals(NONE)) {
+ return options.get(option);
+ }
+
+ return decompressOption(options, option, dataInput -> {
+ int len = dataInput.readInt();
+ byte[] data = new byte[len];
+ dataInput.readFully(data);
+ return new String(data, UTF_8);
+ });
+ }
+
+ public static <T> T decompressOption(Map<String,String> options, String option,
Review Comment:
Fixed in bf81226
##########
test/src/main/java/org/apache/accumulo/test/functional/TabletManagementIteratorIT.java:
##########
@@ -311,6 +334,8 @@ public void test() throws AccumuloException, AccumuloSecurityException, TableExi
// clean up
dropTables(client, t1, t2, t3, t4, metaCopy1, metaCopy2, metaCopy3, metaCopy4, metaCopy5,
metaCopy6);
+ } finally {
+ super.teardownCluster();
Review Comment:
Fixed in bf81226
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org