You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "ppkarwasz (via GitHub)" <gi...@apache.org> on 2025/08/25 14:21:44 UTC
[PR] feat: Align DUMP archive block size with Linux `dump` utility [commons-compress]
ppkarwasz opened a new pull request, #697:
URL: https://github.com/apache/commons-compress/pull/697
This update standardizes the block size limit in `DumpArchiveInputStream` to match the value used by the Linux `dump` utility for ext2/3/4 filesystems.
By using the same limit as the reference implementation, we ensure consistent parsing behavior and improve compatibility with archives generated by standard `dump` tools.
- [x] Read the [ASF Generative Tooling Guidance](https://www.apache.org/legal/generative-tooling.html) if you use Artificial Intelligence (AI).
- [x] I used AI to: proofread comments
- [x] Run a successful build using the default [Maven](https://maven.apache.org/) goal with `mvn`; that's `mvn` on the command line by itself.
- [x] Write unit tests that match behavioral changes, where the tests fail if the changes to the runtime are not applied. This may not always be possible, but it is a best-practice.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Each commit in the pull request should have a meaningful subject line and body. Note that a maintainer may squash commits during the merge process.
--
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: issues-unsubscribe@commons.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat: Align DUMP archive block size with Linux `dump` utility [commons-compress]
Posted by "garydgregory (via GitHub)" <gi...@apache.org>.
garydgregory merged PR #697:
URL: https://github.com/apache/commons-compress/pull/697
--
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: issues-unsubscribe@commons.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat: Align DUMP archive block size with Linux `dump` utility [commons-compress]
Posted by "garydgregory (via GitHub)" <gi...@apache.org>.
garydgregory commented on code in PR #697:
URL: https://github.com/apache/commons-compress/pull/697#discussion_r2298262098
##########
src/main/java/org/apache/commons/compress/archivers/dump/DumpArchiveConstants.java:
##########
@@ -135,15 +135,32 @@ public static SEGMENT_TYPE find(final int code) {
public static final int TP_SIZE = 1024;
/**
- * NTREC value {@value}.
+ * Minimum number of kilobytes per record: {@value}.
+ */
+ public static final int MIN_NTREC = 1;
+
+ /**
+ * Default number of kilobytes per record: {@value}.
*/
public static final int NTREC = 10;
/**
- * HIGH_DENSITY_NTREC value {@value}.
+ * Number of kilobytes per record for high density tapes: {@value}.
*/
public static final int HIGH_DENSITY_NTREC = 32;
+ /**
+ * Maximum number of kilobytes per record: {@value}.
+ * <p>
+ * This limit matches the one used by the Linux ext2/3/4 dump/restore utilities.
+ * For more details, see the
+ * <a href="https://dump.sourceforge.io/">Linux dump/restore utilities documentation</a>
+ * and the
+ * <a href="https://manpages.debian.org/unstable/dump/dump.8.en.html#b,">dump(8) man page</a>.
+ * </p>
Review Comment:
New public and protected elements need a Javadoc `@since` tag. The question really is: Does this really need to be public or can it be package-private or private?
##########
src/main/java/org/apache/commons/compress/archivers/dump/DumpArchiveConstants.java:
##########
@@ -135,15 +135,32 @@ public static SEGMENT_TYPE find(final int code) {
public static final int TP_SIZE = 1024;
/**
- * NTREC value {@value}.
+ * Minimum number of kilobytes per record: {@value}.
+ */
Review Comment:
New public and protected elements need a Javadoc `@since` tag. The question really is: Does this really need to be public or can it be package-private or private?
--
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: issues-unsubscribe@commons.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat: Align DUMP archive block size with Linux `dump` utility [commons-compress]
Posted by "ppkarwasz (via GitHub)" <gi...@apache.org>.
ppkarwasz commented on code in PR #697:
URL: https://github.com/apache/commons-compress/pull/697#discussion_r2298284121
##########
src/main/java/org/apache/commons/compress/archivers/dump/DumpArchiveConstants.java:
##########
@@ -135,15 +135,32 @@ public static SEGMENT_TYPE find(final int code) {
public static final int TP_SIZE = 1024;
/**
- * NTREC value {@value}.
+ * Minimum number of kilobytes per record: {@value}.
+ */
Review Comment:
Fixed in https://github.com/apache/commons-compress/pull/697/commits/9e21d6adec7d56cd6f9f411969e4643d483da890, although I am wondering whether we need to make the constants public.
What do you think?
##########
src/main/java/org/apache/commons/compress/archivers/dump/DumpArchiveConstants.java:
##########
@@ -135,15 +135,32 @@ public static SEGMENT_TYPE find(final int code) {
public static final int TP_SIZE = 1024;
/**
- * NTREC value {@value}.
+ * Minimum number of kilobytes per record: {@value}.
+ */
+ public static final int MIN_NTREC = 1;
+
+ /**
+ * Default number of kilobytes per record: {@value}.
*/
public static final int NTREC = 10;
/**
- * HIGH_DENSITY_NTREC value {@value}.
+ * Number of kilobytes per record for high density tapes: {@value}.
*/
public static final int HIGH_DENSITY_NTREC = 32;
+ /**
+ * Maximum number of kilobytes per record: {@value}.
+ * <p>
+ * This limit matches the one used by the Linux ext2/3/4 dump/restore utilities.
+ * For more details, see the
+ * <a href="https://dump.sourceforge.io/">Linux dump/restore utilities documentation</a>
+ * and the
+ * <a href="https://manpages.debian.org/unstable/dump/dump.8.en.html#b,">dump(8) man page</a>.
+ * </p>
Review Comment:
Fixed in https://github.com/apache/commons-compress/pull/697/commits/9e21d6adec7d56cd6f9f411969e4643d483da890
--
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: issues-unsubscribe@commons.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat: Align DUMP archive block size with Linux `dump` utility [commons-compress]
Posted by "ppkarwasz (via GitHub)" <gi...@apache.org>.
ppkarwasz commented on code in PR #697:
URL: https://github.com/apache/commons-compress/pull/697#discussion_r2298347332
##########
src/main/java/org/apache/commons/compress/archivers/dump/DumpArchiveConstants.java:
##########
@@ -135,15 +135,32 @@ public static SEGMENT_TYPE find(final int code) {
public static final int TP_SIZE = 1024;
/**
- * NTREC value {@value}.
+ * Minimum number of kilobytes per record: {@value}.
+ */
Review Comment:
Fixed in https://github.com/apache/commons-compress/pull/697/commits/5d443fd1c168979e0db35382219e895b26baae7a
--
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: issues-unsubscribe@commons.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat: Align DUMP archive block size with Linux `dump` utility [commons-compress]
Posted by "garydgregory (via GitHub)" <gi...@apache.org>.
garydgregory commented on code in PR #697:
URL: https://github.com/apache/commons-compress/pull/697#discussion_r2298305434
##########
src/main/java/org/apache/commons/compress/archivers/dump/DumpArchiveConstants.java:
##########
@@ -135,15 +135,32 @@ public static SEGMENT_TYPE find(final int code) {
public static final int TP_SIZE = 1024;
/**
- * NTREC value {@value}.
+ * Minimum number of kilobytes per record: {@value}.
+ */
Review Comment:
For now, I would say keep them private. We can make them public later but not the other way around.
--
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: issues-unsubscribe@commons.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org