[jira] [Work logged] (IO-726) Add MemoryMappedInputStream

2021-09-23 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/IO-726?focusedWorklogId=654549&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-654549
 ]

ASF GitHub Bot logged work on IO-726:
-

Author: ASF GitHub Bot
Created on: 23/Sep/21 14:04
Start Date: 23/Sep/21 14:04
Worklog Time Spent: 10m 
  Work Description: garydgregory commented on pull request #215:
URL: https://github.com/apache/commons-io/pull/215#issuecomment-925847341


   Code in git master, no reply from the original author, closing.


-- 
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-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 654549)
Time Spent: 5h 20m  (was: 5h 10m)

> Add MemoryMappedInputStream
> ---
>
> Key: IO-726
> URL: https://issues.apache.org/jira/browse/IO-726
> Project: Commons IO
>  Issue Type: New Feature
>  Components: Streams/Writers
>Affects Versions: 2.8.0
>Reporter: S Hollander
>Priority: Major
> Fix For: 2.12.0
>
>  Time Spent: 5h 20m
>  Remaining Estimate: 0h
>
> A very useful tool for improving performance with disk-based IO is the use of 
> memory mapped files. I propose an {{InputStream}} that provides a bridge 
> between memory mapped files and the {{InputStream}} ecosystem.
> In my limited performance tests, the use of the MemoryMappedInputStream 
> provided a 25% increase in throughput.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (IO-726) Add MemoryMappedInputStream

2021-09-23 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/IO-726?focusedWorklogId=654550&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-654550
 ]

ASF GitHub Bot logged work on IO-726:
-

Author: ASF GitHub Bot
Created on: 23/Sep/21 14:04
Start Date: 23/Sep/21 14:04
Worklog Time Spent: 10m 
  Work Description: garydgregory closed pull request #215:
URL: https://github.com/apache/commons-io/pull/215


   


-- 
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-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 654550)
Time Spent: 5.5h  (was: 5h 20m)

> Add MemoryMappedInputStream
> ---
>
> Key: IO-726
> URL: https://issues.apache.org/jira/browse/IO-726
> Project: Commons IO
>  Issue Type: New Feature
>  Components: Streams/Writers
>Affects Versions: 2.8.0
>Reporter: S Hollander
>Priority: Major
> Fix For: 2.12.0
>
>  Time Spent: 5.5h
>  Remaining Estimate: 0h
>
> A very useful tool for improving performance with disk-based IO is the use of 
> memory mapped files. I propose an {{InputStream}} that provides a bridge 
> between memory mapped files and the {{InputStream}} ecosystem.
> In my limited performance tests, the use of the MemoryMappedInputStream 
> provided a 25% increase in throughput.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (IO-726) Add MemoryMappedInputStream

2021-09-19 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/IO-726?focusedWorklogId=652758&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-652758
 ]

ASF GitHub Bot logged work on IO-726:
-

Author: ASF GitHub Bot
Created on: 20/Sep/21 02:13
Start Date: 20/Sep/21 02:13
Worklog Time Spent: 10m 
  Work Description: garydgregory commented on pull request #215:
URL: https://github.com/apache/commons-io/pull/215#issuecomment-922598115


   @shollander 
   
   I modified this PR 215 for git master with:
   - Do not write the console.
   - Simplify cleaner check support.
   - Simplify exception handling.
   - Don't initialize instance variables to their default values.
   - Un-nest else clause.
   - Declaring interfaces as static is redundant.
   - Use EOF constant instead of magic number.
   - Don't throw RuntimeException, use IllegalStateException.
   - Pacakge private class does not need public method.
   - Use final.
   - Improve Javadocs.
   - Javadoc sentences should end in a period.
   - Javadoc do not need first sentence to be in an HTML p element.
   - No need to use `this.` when you do not need to.
   - In-line some single use variables.
   - Sort members.
   
   Please check it out. Feel free to rebase this PR on master or provide a new 
PR if you need more for your use case.
   TY!


-- 
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-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 652758)
Time Spent: 5h 10m  (was: 5h)

> Add MemoryMappedInputStream
> ---
>
> Key: IO-726
> URL: https://issues.apache.org/jira/browse/IO-726
> Project: Commons IO
>  Issue Type: New Feature
>  Components: Streams/Writers
>Affects Versions: 2.8.0
>Reporter: S Hollander
>Priority: Major
>  Time Spent: 5h 10m
>  Remaining Estimate: 0h
>
> A very useful tool for improving performance with disk-based IO is the use of 
> memory mapped files. I propose an {{InputStream}} that provides a bridge 
> between memory mapped files and the {{InputStream}} ecosystem.
> In my limited performance tests, the use of the MemoryMappedInputStream 
> provided a 25% increase in throughput.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (IO-726) Add MemoryMappedInputStream

2021-09-15 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/IO-726?focusedWorklogId=651078&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-651078
 ]

ASF GitHub Bot logged work on IO-726:
-

Author: ASF GitHub Bot
Created on: 15/Sep/21 13:19
Start Date: 15/Sep/21 13:19
Worklog Time Spent: 10m 
  Work Description: shollander commented on a change in pull request #215:
URL: https://github.com/apache/commons-io/pull/215#discussion_r709178065



##
File path: src/main/java/org/apache/commons/io/input/ByteBufferCleaner.java
##
@@ -0,0 +1,144 @@
+/*
+ * 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
+ *
+ *  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 org.apache.commons.io.input;
+
+import java.lang.reflect.Field;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.nio.ByteBuffer;
+
+/**
+ * Utility to manually clean a direct {@link ByteBuffer}. Without manual
+ * intervention, direct ByteBuffers will be cleaned eventually upon garbage
+ * collection. However, this should be be relied upon since it may not occur in
+ * a timely fashion - especially since off heap ByeBuffers don't put pressure 
on
+ * the garbage collector.
+ * 
+ * 
+ * Warning: Do not attempt to use a direct {@link ByteBuffer} that has
+ * been cleaned or bad things will happen. Don't use this class unless you can
+ * ensure that the cleaned buffer will not be accessed anymore.
+ * 
+ * 
+ * See https://bugs.openjdk.java.net/browse/JDK-4724038>JDK-4724038
+ * 
+ * 
+ * @since 2.10.0

Review comment:
   fixed.




-- 
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-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 651078)
Time Spent: 4h 40m  (was: 4.5h)

> Add MemoryMappedInputStream
> ---
>
> Key: IO-726
> URL: https://issues.apache.org/jira/browse/IO-726
> Project: Commons IO
>  Issue Type: New Feature
>  Components: Streams/Writers
>Affects Versions: 2.8.0
>Reporter: S Hollander
>Priority: Major
>  Time Spent: 4h 40m
>  Remaining Estimate: 0h
>
> A very useful tool for improving performance with disk-based IO is the use of 
> memory mapped files. I propose an {{InputStream}} that provides a bridge 
> between memory mapped files and the {{InputStream}} ecosystem.
> In my limited performance tests, the use of the MemoryMappedInputStream 
> provided a 25% increase in throughput.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (IO-726) Add MemoryMappedInputStream

2021-09-15 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/IO-726?focusedWorklogId=651080&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-651080
 ]

ASF GitHub Bot logged work on IO-726:
-

Author: ASF GitHub Bot
Created on: 15/Sep/21 13:19
Start Date: 15/Sep/21 13:19
Worklog Time Spent: 10m 
  Work Description: shollander commented on a change in pull request #215:
URL: https://github.com/apache/commons-io/pull/215#discussion_r709178629



##
File path: 
src/main/java/org/apache/commons/io/input/MemoryMappedFileInputStream.java
##
@@ -0,0 +1,169 @@
+/*
+ * 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
+ *
+ *  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 org.apache.commons.io.input;
+
+import static org.apache.commons.io.IOUtils.EOF;
+
+import java.io.BufferedInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.nio.ByteBuffer;
+import java.nio.channels.FileChannel;
+import java.nio.channels.FileChannel.MapMode;
+import java.nio.file.Path;
+import java.nio.file.StandardOpenOption;
+
+/**
+ * 
+ * An {@link InputStream} that utilizes memory mapped files to improve
+ * performance. A sliding window of the file is mapped to memory to avoid
+ * mapping the entire file to memory at one time. The size of the sliding 
buffer
+ * is user configurable.
+ * 
+ * 
+ * For most operating systems, mapping a file into memory is more expensive 
than
+ * reading or writing a few tens of kilobytes of data. From the standpoint of
+ * performance it is generally only worth mapping relatively large files into
+ * memory.
+ * 
+ * Note: Use of this class does not necessarily obviate the need to use a
+ * {@link BufferedInputStream}. Depending on the use case, the use of buffering
+ * may still further improve performance. For example:
+ * 
+ * 
+ * new BufferedInputStream(new GzipInputStream(new 
MemoryMappedFileInputStream(path
+ * 
+ * 
+ * will greatly outperform:
+ * 
+ * 
+ * new GzipInputStream(new MemoryMappedFileInputStream(path))
+ * 
+ * 
+ * @since 2.10.0
+ */
+public class MemoryMappedFileInputStream extends InputStream {
+/**
+ * Default size of the sliding memory mapped buffer. We use 256K, equal to 
65536
+ * pages (given a 4K page size). Increasing the value beyond the default 
size
+ * will generally not provide any increase in throughput.
+ */
+private static final int DEFAULT_BUFFER_SIZE = 256 * 1024;
+private static final ByteBuffer EMPTY_BUFFER = ByteBuffer.wrap(new 
byte[0]).asReadOnlyBuffer();
+private static final boolean IS_CLEANING_SUPPORTED = 
ByteBufferCleaner.isSupported();
+private final int bufferSize;
+private final FileChannel channel;
+private ByteBuffer buffer = EMPTY_BUFFER;
+private boolean closed = false;
+/**
+ * The starting position (within the file) of the next sliding buffer.
+ */
+private long nextBufferPosition = 0;
+
+public MemoryMappedFileInputStream(final Path file) throws IOException {

Review comment:
   fixed




-- 
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-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 651080)
Time Spent: 5h  (was: 4h 50m)

> Add MemoryMappedInputStream
> ---
>
> Key: IO-726
> URL: https://issues.apache.org/jira/browse/IO-726
> Project: Commons IO
>  Issue Type: New Feature
>  Components: Streams/Writers
>Affects Versions: 2.8.0
>Reporter: S Hollander
>Priority: Major
>  Time Spent: 5h
>  Remaining Estimate: 0h
>
> A very useful tool for improving performance with disk-based IO is the use of 
> memory mapped files. I propose an {{InputStream}} that provides a bridge 
> between memory mapped files and the {{InputStream}} ecosystem.
> In my limited performance tests, the use of the MemoryMappedInputStream 
> provided a 2

[jira] [Work logged] (IO-726) Add MemoryMappedInputStream

2021-09-15 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/IO-726?focusedWorklogId=651079&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-651079
 ]

ASF GitHub Bot logged work on IO-726:
-

Author: ASF GitHub Bot
Created on: 15/Sep/21 13:19
Start Date: 15/Sep/21 13:19
Worklog Time Spent: 10m 
  Work Description: shollander commented on a change in pull request #215:
URL: https://github.com/apache/commons-io/pull/215#discussion_r709178300



##
File path: 
src/main/java/org/apache/commons/io/input/MemoryMappedFileInputStream.java
##
@@ -0,0 +1,169 @@
+/*
+ * 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
+ *
+ *  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 org.apache.commons.io.input;
+
+import static org.apache.commons.io.IOUtils.EOF;
+
+import java.io.BufferedInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.nio.ByteBuffer;
+import java.nio.channels.FileChannel;
+import java.nio.channels.FileChannel.MapMode;
+import java.nio.file.Path;
+import java.nio.file.StandardOpenOption;
+
+/**
+ * 
+ * An {@link InputStream} that utilizes memory mapped files to improve
+ * performance. A sliding window of the file is mapped to memory to avoid
+ * mapping the entire file to memory at one time. The size of the sliding 
buffer
+ * is user configurable.
+ * 
+ * 
+ * For most operating systems, mapping a file into memory is more expensive 
than
+ * reading or writing a few tens of kilobytes of data. From the standpoint of
+ * performance it is generally only worth mapping relatively large files into
+ * memory.
+ * 
+ * Note: Use of this class does not necessarily obviate the need to use a
+ * {@link BufferedInputStream}. Depending on the use case, the use of buffering
+ * may still further improve performance. For example:
+ * 
+ * 
+ * new BufferedInputStream(new GzipInputStream(new 
MemoryMappedFileInputStream(path
+ * 
+ * 
+ * will greatly outperform:
+ * 
+ * 
+ * new GzipInputStream(new MemoryMappedFileInputStream(path))
+ * 
+ * 
+ * @since 2.10.0

Review comment:
   fixed.




-- 
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-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 651079)
Time Spent: 4h 50m  (was: 4h 40m)

> Add MemoryMappedInputStream
> ---
>
> Key: IO-726
> URL: https://issues.apache.org/jira/browse/IO-726
> Project: Commons IO
>  Issue Type: New Feature
>  Components: Streams/Writers
>Affects Versions: 2.8.0
>Reporter: S Hollander
>Priority: Major
>  Time Spent: 4h 50m
>  Remaining Estimate: 0h
>
> A very useful tool for improving performance with disk-based IO is the use of 
> memory mapped files. I propose an {{InputStream}} that provides a bridge 
> between memory mapped files and the {{InputStream}} ecosystem.
> In my limited performance tests, the use of the MemoryMappedInputStream 
> provided a 25% increase in throughput.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (IO-726) Add MemoryMappedInputStream

2021-09-15 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/IO-726?focusedWorklogId=651076&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-651076
 ]

ASF GitHub Bot logged work on IO-726:
-

Author: ASF GitHub Bot
Created on: 15/Sep/21 13:18
Start Date: 15/Sep/21 13:18
Worklog Time Spent: 10m 
  Work Description: shollander commented on a change in pull request #215:
URL: https://github.com/apache/commons-io/pull/215#discussion_r709177797



##
File path: src/main/java/org/apache/commons/io/input/ByteBufferCleaner.java
##
@@ -0,0 +1,144 @@
+/*
+ * 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
+ *
+ *  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 org.apache.commons.io.input;
+
+import java.lang.reflect.Field;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.nio.ByteBuffer;
+
+/**
+ * Utility to manually clean a direct {@link ByteBuffer}. Without manual
+ * intervention, direct ByteBuffers will be cleaned eventually upon garbage
+ * collection. However, this should be be relied upon since it may not occur in

Review comment:
   fixed.




-- 
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-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 651076)
Time Spent: 4.5h  (was: 4h 20m)

> Add MemoryMappedInputStream
> ---
>
> Key: IO-726
> URL: https://issues.apache.org/jira/browse/IO-726
> Project: Commons IO
>  Issue Type: New Feature
>  Components: Streams/Writers
>Affects Versions: 2.8.0
>Reporter: S Hollander
>Priority: Major
>  Time Spent: 4.5h
>  Remaining Estimate: 0h
>
> A very useful tool for improving performance with disk-based IO is the use of 
> memory mapped files. I propose an {{InputStream}} that provides a bridge 
> between memory mapped files and the {{InputStream}} ecosystem.
> In my limited performance tests, the use of the MemoryMappedInputStream 
> provided a 25% increase in throughput.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (IO-726) Add MemoryMappedInputStream

2021-09-14 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/IO-726?focusedWorklogId=650566&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-650566
 ]

ASF GitHub Bot logged work on IO-726:
-

Author: ASF GitHub Bot
Created on: 14/Sep/21 13:30
Start Date: 14/Sep/21 13:30
Worklog Time Spent: 10m 
  Work Description: garydgregory commented on a change in pull request #215:
URL: https://github.com/apache/commons-io/pull/215#discussion_r708257169



##
File path: src/main/java/org/apache/commons/io/input/ByteBufferCleaner.java
##
@@ -0,0 +1,144 @@
+/*
+ * 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
+ *
+ *  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 org.apache.commons.io.input;
+
+import java.lang.reflect.Field;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.nio.ByteBuffer;
+
+/**
+ * Utility to manually clean a direct {@link ByteBuffer}. Without manual
+ * intervention, direct ByteBuffers will be cleaned eventually upon garbage
+ * collection. However, this should be be relied upon since it may not occur in
+ * a timely fashion - especially since off heap ByeBuffers don't put pressure 
on
+ * the garbage collector.
+ * 
+ * 
+ * Warning: Do not attempt to use a direct {@link ByteBuffer} that has
+ * been cleaned or bad things will happen. Don't use this class unless you can
+ * ensure that the cleaned buffer will not be accessed anymore.
+ * 
+ * 
+ * See https://bugs.openjdk.java.net/browse/JDK-4724038>JDK-4724038
+ * 
+ * 
+ * @since 2.10.0

Review comment:
   You do need a since tag since this is package private. Also new public 
and protected elements should be since 2.12.0 ;-)

##
File path: src/main/java/org/apache/commons/io/input/ByteBufferCleaner.java
##
@@ -0,0 +1,144 @@
+/*
+ * 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
+ *
+ *  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 org.apache.commons.io.input;
+
+import java.lang.reflect.Field;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.nio.ByteBuffer;
+
+/**
+ * Utility to manually clean a direct {@link ByteBuffer}. Without manual
+ * intervention, direct ByteBuffers will be cleaned eventually upon garbage
+ * collection. However, this should be be relied upon since it may not occur in

Review comment:
   "this should be be relied"  -> "this should NOT be relied"

##
File path: 
src/main/java/org/apache/commons/io/input/MemoryMappedFileInputStream.java
##
@@ -0,0 +1,169 @@
+/*
+ * 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
+ *
+ *  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 org.apache.commons.io.input;
+
+import static org.apache.commons.io.IOUtils.EOF;
+
+import ja

[jira] [Work logged] (IO-726) Add MemoryMappedInputStream

2021-09-13 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/IO-726?focusedWorklogId=650230&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-650230
 ]

ASF GitHub Bot logged work on IO-726:
-

Author: ASF GitHub Bot
Created on: 13/Sep/21 20:40
Start Date: 13/Sep/21 20:40
Worklog Time Spent: 10m 
  Work Description: shollander commented on pull request #215:
URL: https://github.com/apache/commons-io/pull/215#issuecomment-918558686


   > 
   > 
   > @shollander
   > May you please rebase on master?
   
   Done.


-- 
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-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 650230)
Time Spent: 4h 10m  (was: 4h)

> Add MemoryMappedInputStream
> ---
>
> Key: IO-726
> URL: https://issues.apache.org/jira/browse/IO-726
> Project: Commons IO
>  Issue Type: New Feature
>  Components: Streams/Writers
>Affects Versions: 2.8.0
>Reporter: S Hollander
>Priority: Major
>  Time Spent: 4h 10m
>  Remaining Estimate: 0h
>
> A very useful tool for improving performance with disk-based IO is the use of 
> memory mapped files. I propose an {{InputStream}} that provides a bridge 
> between memory mapped files and the {{InputStream}} ecosystem.
> In my limited performance tests, the use of the MemoryMappedInputStream 
> provided a 25% increase in throughput.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (IO-726) Add MemoryMappedInputStream

2021-09-13 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/IO-726?focusedWorklogId=650229&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-650229
 ]

ASF GitHub Bot logged work on IO-726:
-

Author: ASF GitHub Bot
Created on: 13/Sep/21 20:40
Start Date: 13/Sep/21 20:40
Worklog Time Spent: 10m 
  Work Description: shollander commented on a change in pull request #215:
URL: https://github.com/apache/commons-io/pull/215#discussion_r707665058



##
File path: 
src/test/java/org/apache/commons/io/input/MemoryMappedFileInputStreamTest.java
##
@@ -0,0 +1,248 @@
+/*
+ * 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
+ *
+ *  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 org.apache.commons.io.input;
+
+import static org.junit.jupiter.api.Assertions.assertArrayEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+import java.io.BufferedOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.util.Arrays;
+
+import org.apache.commons.io.IOUtils;
+import org.apache.commons.lang3.RandomUtils;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.io.TempDir;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.ValueSource;
+
+class MemoryMappedFileInputStreamTest {

Review comment:
   Done.

##
File path: src/test/java/org/apache/commons/io/ByteBufferCleanerTest.java
##
@@ -0,0 +1,49 @@
+/*
+ * 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
+ *
+ *  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 org.apache.commons.io;
+
+import static org.junit.jupiter.api.Assertions.*;
+
+import java.nio.ByteBuffer;
+
+import org.apache.commons.lang3.RandomUtils;
+import org.junit.jupiter.api.Test;
+
+class ByteBufferCleanerTest {

Review comment:
   Fixed.




-- 
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-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 650229)
Time Spent: 4h  (was: 3h 50m)

> Add MemoryMappedInputStream
> ---
>
> Key: IO-726
> URL: https://issues.apache.org/jira/browse/IO-726
> Project: Commons IO
>  Issue Type: New Feature
>  Components: Streams/Writers
>Affects Versions: 2.8.0
>Reporter: S Hollander
>Priority: Major
>  Time Spent: 4h
>  Remaining Estimate: 0h
>
> A very useful tool for improving performance with disk-based IO is the use of 
> memory mapped files. I propose an {{InputStream}} that provides a bridge 
> between memory mapped files and the {{InputStream}} ecosystem.
> In my limited performance tests, the use of the MemoryMappedInputStream 
> provided a 25% increase in throughput.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (IO-726) Add MemoryMappedInputStream

2021-09-13 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/IO-726?focusedWorklogId=650124&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-650124
 ]

ASF GitHub Bot logged work on IO-726:
-

Author: ASF GitHub Bot
Created on: 13/Sep/21 16:39
Start Date: 13/Sep/21 16:39
Worklog Time Spent: 10m 
  Work Description: garydgregory commented on pull request #215:
URL: https://github.com/apache/commons-io/pull/215#issuecomment-918373577


   @shollander
   May you please rebase on master?


-- 
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-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 650124)
Time Spent: 3h 50m  (was: 3h 40m)

> Add MemoryMappedInputStream
> ---
>
> Key: IO-726
> URL: https://issues.apache.org/jira/browse/IO-726
> Project: Commons IO
>  Issue Type: New Feature
>  Components: Streams/Writers
>Affects Versions: 2.8.0
>Reporter: S Hollander
>Priority: Major
>  Time Spent: 3h 50m
>  Remaining Estimate: 0h
>
> A very useful tool for improving performance with disk-based IO is the use of 
> memory mapped files. I propose an {{InputStream}} that provides a bridge 
> between memory mapped files and the {{InputStream}} ecosystem.
> In my limited performance tests, the use of the MemoryMappedInputStream 
> provided a 25% increase in throughput.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (IO-726) Add MemoryMappedInputStream

2021-09-04 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/IO-726?focusedWorklogId=646587&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-646587
 ]

ASF GitHub Bot logged work on IO-726:
-

Author: ASF GitHub Bot
Created on: 04/Sep/21 12:09
Start Date: 04/Sep/21 12:09
Worklog Time Spent: 10m 
  Work Description: garydgregory commented on pull request #215:
URL: https://github.com/apache/commons-io/pull/215#issuecomment-912963285


   @shollander 
   May you please rebase on master? 


-- 
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-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 646587)
Time Spent: 3h 40m  (was: 3.5h)

> Add MemoryMappedInputStream
> ---
>
> Key: IO-726
> URL: https://issues.apache.org/jira/browse/IO-726
> Project: Commons IO
>  Issue Type: New Feature
>  Components: Streams/Writers
>Affects Versions: 2.8.0
>Reporter: S Hollander
>Priority: Major
>  Time Spent: 3h 40m
>  Remaining Estimate: 0h
>
> A very useful tool for improving performance with disk-based IO is the use of 
> memory mapped files. I propose an {{InputStream}} that provides a bridge 
> between memory mapped files and the {{InputStream}} ecosystem.
> In my limited performance tests, the use of the MemoryMappedInputStream 
> provided a 25% increase in throughput.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (IO-726) Add MemoryMappedInputStream

2021-09-04 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/IO-726?focusedWorklogId=646586&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-646586
 ]

ASF GitHub Bot logged work on IO-726:
-

Author: ASF GitHub Bot
Created on: 04/Sep/21 12:08
Start Date: 04/Sep/21 12:08
Worklog Time Spent: 10m 
  Work Description: garydgregory commented on a change in pull request #215:
URL: https://github.com/apache/commons-io/pull/215#discussion_r702276829



##
File path: 
src/test/java/org/apache/commons/io/input/MemoryMappedFileInputStreamTest.java
##
@@ -0,0 +1,248 @@
+/*
+ * 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
+ *
+ *  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 org.apache.commons.io.input;
+
+import static org.junit.jupiter.api.Assertions.assertArrayEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+import java.io.BufferedOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.util.Arrays;
+
+import org.apache.commons.io.IOUtils;
+import org.apache.commons.lang3.RandomUtils;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.io.TempDir;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.ValueSource;
+
+class MemoryMappedFileInputStreamTest {

Review comment:
   Make public.




-- 
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-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 646586)
Time Spent: 3.5h  (was: 3h 20m)

> Add MemoryMappedInputStream
> ---
>
> Key: IO-726
> URL: https://issues.apache.org/jira/browse/IO-726
> Project: Commons IO
>  Issue Type: New Feature
>  Components: Streams/Writers
>Affects Versions: 2.8.0
>Reporter: S Hollander
>Priority: Major
>  Time Spent: 3.5h
>  Remaining Estimate: 0h
>
> A very useful tool for improving performance with disk-based IO is the use of 
> memory mapped files. I propose an {{InputStream}} that provides a bridge 
> between memory mapped files and the {{InputStream}} ecosystem.
> In my limited performance tests, the use of the MemoryMappedInputStream 
> provided a 25% increase in throughput.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (IO-726) Add MemoryMappedInputStream

2021-07-11 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/IO-726?focusedWorklogId=621366&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-621366
 ]

ASF GitHub Bot logged work on IO-726:
-

Author: ASF GitHub Bot
Created on: 11/Jul/21 14:40
Start Date: 11/Jul/21 14:40
Worklog Time Spent: 10m 
  Work Description: garydgregory commented on a change in pull request #215:
URL: https://github.com/apache/commons-io/pull/215#discussion_r646559878



##
File path: 
src/main/java/org/apache/commons/io/input/MemoryMappedFileInputStream.java
##
@@ -0,0 +1,169 @@
+/*
+ * 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
+ *
+ *  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 org.apache.commons.io.input;
+
+import static org.apache.commons.io.IOUtils.EOF;
+
+import java.io.BufferedInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.nio.ByteBuffer;
+import java.nio.channels.FileChannel;
+import java.nio.channels.FileChannel.MapMode;
+import java.nio.file.Path;
+import java.nio.file.StandardOpenOption;
+
+import org.apache.commons.io.ByteBufferCleaner;
+
+/**
+ * An {@link InputStream} that utilizes memory mapped files to improve
+ * performance. A sliding window of the file is mapped to memory to avoid
+ * mapping the entire file to memory at one time. The size of the sliding 
buffer
+ * is user configurable.
+ * 
+ * For most operating systems, mapping a file into memory is more expensive 
than
+ * reading or writing a few tens of kilobytes of data. From the standpoint of
+ * performance it is generally only worth mapping relatively large files into
+ * memory. Use of this class can provide approximately a 25% increase in
+ * throughput when reading large files. 

Review comment:
   I would not make any performance claims without backing it up with 
evidence like a test anyone can run on their combination of OS/JRE/file. IOW, 
provide a test where the user can specify the file size in a sys prop or 
command line for example.




-- 
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-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 621366)
Time Spent: 3h 20m  (was: 3h 10m)

> Add MemoryMappedInputStream
> ---
>
> Key: IO-726
> URL: https://issues.apache.org/jira/browse/IO-726
> Project: Commons IO
>  Issue Type: New Feature
>  Components: Streams/Writers
>Affects Versions: 2.8.0
>Reporter: S Hollander
>Priority: Major
>  Time Spent: 3h 20m
>  Remaining Estimate: 0h
>
> A very useful tool for improving performance with disk-based IO is the use of 
> memory mapped files. I propose an {{InputStream}} that provides a bridge 
> between memory mapped files and the {{InputStream}} ecosystem.
> In my limited performance tests, the use of the MemoryMappedInputStream 
> provided a 25% increase in throughput.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (IO-726) Add MemoryMappedInputStream

2021-06-30 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/IO-726?focusedWorklogId=617165&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-617165
 ]

ASF GitHub Bot logged work on IO-726:
-

Author: ASF GitHub Bot
Created on: 30/Jun/21 16:58
Start Date: 30/Jun/21 16:58
Worklog Time Spent: 10m 
  Work Description: garydgregory commented on a change in pull request #215:
URL: https://github.com/apache/commons-io/pull/215#discussion_r661656643



##
File path: src/test/java/org/apache/commons/io/ByteBufferCleanerTest.java
##
@@ -0,0 +1,49 @@
+/*
+ * 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
+ *
+ *  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 org.apache.commons.io;
+
+import static org.junit.jupiter.api.Assertions.*;
+
+import java.nio.ByteBuffer;
+
+import org.apache.commons.lang3.RandomUtils;
+import org.junit.jupiter.api.Test;
+
+class ByteBufferCleanerTest {

Review comment:
   @shollander
Because you want to match the existing style we use.
   




-- 
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-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 617165)
Time Spent: 3h 10m  (was: 3h)

> Add MemoryMappedInputStream
> ---
>
> Key: IO-726
> URL: https://issues.apache.org/jira/browse/IO-726
> Project: Commons IO
>  Issue Type: New Feature
>  Components: Streams/Writers
>Affects Versions: 2.8.0
>Reporter: S Hollander
>Priority: Major
>  Time Spent: 3h 10m
>  Remaining Estimate: 0h
>
> A very useful tool for improving performance with disk-based IO is the use of 
> memory mapped files. I propose an {{InputStream}} that provides a bridge 
> between memory mapped files and the {{InputStream}} ecosystem.
> In my limited performance tests, the use of the MemoryMappedInputStream 
> provided a 25% increase in throughput.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (IO-726) Add MemoryMappedInputStream

2021-06-10 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/IO-726?focusedWorklogId=609921&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-609921
 ]

ASF GitHub Bot logged work on IO-726:
-

Author: ASF GitHub Bot
Created on: 10/Jun/21 20:33
Start Date: 10/Jun/21 20:33
Worklog Time Spent: 10m 
  Work Description: coveralls edited a comment on pull request #215:
URL: https://github.com/apache/commons-io/pull/215#issuecomment-805093521


   
   [![Coverage 
Status](https://coveralls.io/builds/40491554/badge)](https://coveralls.io/builds/40491554)
   
   Coverage decreased (-0.1%) to 89.144% when pulling 
**1d87249613f91bd0b27149812ec4909ca01f948a on shollander:mmap_inputStream** 
into **414e597e01e02ef1714fc0f8524eea8c836f315f on apache:master**.
   


-- 
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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 609921)
Time Spent: 3h  (was: 2h 50m)

> Add MemoryMappedInputStream
> ---
>
> Key: IO-726
> URL: https://issues.apache.org/jira/browse/IO-726
> Project: Commons IO
>  Issue Type: New Feature
>  Components: Streams/Writers
>Affects Versions: 2.8.0
>Reporter: S Hollander
>Priority: Major
> Fix For: 2.10.0
>
>  Time Spent: 3h
>  Remaining Estimate: 0h
>
> A very useful tool for improving performance with disk-based IO is the use of 
> memory mapped files. I propose an {{InputStream}} that provides a bridge 
> between memory mapped files and the {{InputStream}} ecosystem.
> In my limited performance tests, the use of the MemoryMappedInputStream 
> provided a 25% increase in throughput.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (IO-726) Add MemoryMappedInputStream

2021-06-10 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/IO-726?focusedWorklogId=609889&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-609889
 ]

ASF GitHub Bot logged work on IO-726:
-

Author: ASF GitHub Bot
Created on: 10/Jun/21 19:20
Start Date: 10/Jun/21 19:20
Worklog Time Spent: 10m 
  Work Description: shollander commented on a change in pull request #215:
URL: https://github.com/apache/commons-io/pull/215#discussion_r649458869



##
File path: 
src/main/java/org/apache/commons/io/input/MemoryMappedFileInputStream.java
##
@@ -0,0 +1,169 @@
+/*
+ * 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
+ *
+ *  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 org.apache.commons.io.input;
+
+import static org.apache.commons.io.IOUtils.EOF;
+
+import java.io.BufferedInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.nio.ByteBuffer;
+import java.nio.channels.FileChannel;
+import java.nio.channels.FileChannel.MapMode;
+import java.nio.file.Path;
+import java.nio.file.StandardOpenOption;
+
+import org.apache.commons.io.ByteBufferCleaner;
+
+/**
+ * An {@link InputStream} that utilizes memory mapped files to improve
+ * performance. A sliding window of the file is mapped to memory to avoid
+ * mapping the entire file to memory at one time. The size of the sliding 
buffer
+ * is user configurable.
+ * 
+ * For most operating systems, mapping a file into memory is more expensive 
than
+ * reading or writing a few tens of kilobytes of data. From the standpoint of
+ * performance it is generally only worth mapping relatively large files into
+ * memory. Use of this class can provide approximately a 25% increase in
+ * throughput when reading large files. 

Review comment:
   Done

##
File path: src/main/java/org/apache/commons/io/ByteBufferCleaner.java
##
@@ -0,0 +1,144 @@
+/*
+ * 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
+ *
+ *  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 org.apache.commons.io;
+
+import java.lang.reflect.Field;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.nio.ByteBuffer;
+
+/**
+ * Utility to manually clean a direct {@link ByteBuffer}. Without manual

Review comment:
   Done

##
File path: 
src/main/java/org/apache/commons/io/input/MemoryMappedFileInputStream.java
##
@@ -0,0 +1,169 @@
+/*
+ * 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
+ *
+ *  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 org.apache.commons.io.input;
+
+import static org.apache.commons.io.IOUtils.EOF;
+
+import java.io.BufferedInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.nio.ByteBuffer;
+import java.nio.channels.FileChannel;
+im

[jira] [Work logged] (IO-726) Add MemoryMappedInputStream

2021-06-10 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/IO-726?focusedWorklogId=609879&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-609879
 ]

ASF GitHub Bot logged work on IO-726:
-

Author: ASF GitHub Bot
Created on: 10/Jun/21 18:46
Start Date: 10/Jun/21 18:46
Worklog Time Spent: 10m 
  Work Description: shollander commented on a change in pull request #215:
URL: https://github.com/apache/commons-io/pull/215#discussion_r649437283



##
File path: 
src/main/java/org/apache/commons/io/input/MemoryMappedFileInputStream.java
##
@@ -0,0 +1,169 @@
+/*
+ * 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
+ *
+ *  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 org.apache.commons.io.input;
+
+import static org.apache.commons.io.IOUtils.EOF;
+
+import java.io.BufferedInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.nio.ByteBuffer;
+import java.nio.channels.FileChannel;
+import java.nio.channels.FileChannel.MapMode;
+import java.nio.file.Path;
+import java.nio.file.StandardOpenOption;
+
+import org.apache.commons.io.ByteBufferCleaner;
+
+/**
+ * An {@link InputStream} that utilizes memory mapped files to improve
+ * performance. A sliding window of the file is mapped to memory to avoid
+ * mapping the entire file to memory at one time. The size of the sliding 
buffer
+ * is user configurable.
+ * 
+ * For most operating systems, mapping a file into memory is more expensive 
than
+ * reading or writing a few tens of kilobytes of data. From the standpoint of
+ * performance it is generally only worth mapping relatively large files into
+ * memory. Use of this class can provide approximately a 25% increase in
+ * throughput when reading large files. 

Review comment:
   The number given is based on one use case where I used this code.
   I will remove the performance claim since I don't have time to spend 
developing benchmarks.




-- 
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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 609879)
Time Spent: 2h 40m  (was: 2.5h)

> Add MemoryMappedInputStream
> ---
>
> Key: IO-726
> URL: https://issues.apache.org/jira/browse/IO-726
> Project: Commons IO
>  Issue Type: New Feature
>  Components: Streams/Writers
>Affects Versions: 2.8.0
>Reporter: S Hollander
>Priority: Major
> Fix For: 2.10.0
>
>  Time Spent: 2h 40m
>  Remaining Estimate: 0h
>
> A very useful tool for improving performance with disk-based IO is the use of 
> memory mapped files. I propose an {{InputStream}} that provides a bridge 
> between memory mapped files and the {{InputStream}} ecosystem.
> In my limited performance tests, the use of the MemoryMappedInputStream 
> provided a 25% increase in throughput.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (IO-726) Add MemoryMappedInputStream

2021-06-10 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/IO-726?focusedWorklogId=609878&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-609878
 ]

ASF GitHub Bot logged work on IO-726:
-

Author: ASF GitHub Bot
Created on: 10/Jun/21 18:45
Start Date: 10/Jun/21 18:45
Worklog Time Spent: 10m 
  Work Description: shollander commented on a change in pull request #215:
URL: https://github.com/apache/commons-io/pull/215#discussion_r649436531



##
File path: 
src/main/java/org/apache/commons/io/input/MemoryMappedFileInputStream.java
##
@@ -0,0 +1,169 @@
+/*
+ * 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
+ *
+ *  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 org.apache.commons.io.input;
+
+import static org.apache.commons.io.IOUtils.EOF;
+
+import java.io.BufferedInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.nio.ByteBuffer;
+import java.nio.channels.FileChannel;
+import java.nio.channels.FileChannel.MapMode;
+import java.nio.file.Path;
+import java.nio.file.StandardOpenOption;
+
+import org.apache.commons.io.ByteBufferCleaner;
+
+/**
+ * An {@link InputStream} that utilizes memory mapped files to improve
+ * performance. A sliding window of the file is mapped to memory to avoid
+ * mapping the entire file to memory at one time. The size of the sliding 
buffer
+ * is user configurable.
+ * 
+ * For most operating systems, mapping a file into memory is more expensive 
than
+ * reading or writing a few tens of kilobytes of data. From the standpoint of
+ * performance it is generally only worth mapping relatively large files into
+ * memory. Use of this class can provide approximately a 25% increase in
+ * throughput when reading large files. 
+ * Note: Use of this class does not necessarily obviate the need to use a
+ * {@link BufferedInputStream}. Depending on the use case, the use of buffering
+ * may still further improve performance. For example:
+ * 
+ * 
+ * new BufferedInputStream(new GzipInputStream(new 
MemoryMappedFileInputStream(path
+ * 
+ * 
+ * will greatly outperform:
+ * 
+ * 
+ * new GzipInputStream(new MemoryMappedFileInputStream(path))

Review comment:
   This comment has nothing to do with the performance of this class. It is 
just noting that user's shouldn't think there is no need for buffering after 
using this class. In the example given, buffering is needed to improve the 
performance of the gzip compression in memory.




-- 
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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 609878)
Time Spent: 2.5h  (was: 2h 20m)

> Add MemoryMappedInputStream
> ---
>
> Key: IO-726
> URL: https://issues.apache.org/jira/browse/IO-726
> Project: Commons IO
>  Issue Type: New Feature
>  Components: Streams/Writers
>Affects Versions: 2.8.0
>Reporter: S Hollander
>Priority: Major
> Fix For: 2.10.0
>
>  Time Spent: 2.5h
>  Remaining Estimate: 0h
>
> A very useful tool for improving performance with disk-based IO is the use of 
> memory mapped files. I propose an {{InputStream}} that provides a bridge 
> between memory mapped files and the {{InputStream}} ecosystem.
> In my limited performance tests, the use of the MemoryMappedInputStream 
> provided a 25% increase in throughput.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (IO-726) Add MemoryMappedInputStream

2021-06-10 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/IO-726?focusedWorklogId=609864&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-609864
 ]

ASF GitHub Bot logged work on IO-726:
-

Author: ASF GitHub Bot
Created on: 10/Jun/21 18:22
Start Date: 10/Jun/21 18:22
Worklog Time Spent: 10m 
  Work Description: shollander commented on a change in pull request #215:
URL: https://github.com/apache/commons-io/pull/215#discussion_r649421639



##
File path: src/test/java/org/apache/commons/io/ByteBufferCleanerTest.java
##
@@ -0,0 +1,49 @@
+/*
+ * 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
+ *
+ *  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 org.apache.commons.io;
+
+import static org.junit.jupiter.api.Assertions.*;
+
+import java.nio.ByteBuffer;
+
+import org.apache.commons.lang3.RandomUtils;
+import org.junit.jupiter.api.Test;
+
+class ByteBufferCleanerTest {

Review comment:
   Seems like a holdover from legacy JUnit. Why bother when JUnit doesn't 
require it anymore?




-- 
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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 609864)
Time Spent: 2h 20m  (was: 2h 10m)

> Add MemoryMappedInputStream
> ---
>
> Key: IO-726
> URL: https://issues.apache.org/jira/browse/IO-726
> Project: Commons IO
>  Issue Type: New Feature
>  Components: Streams/Writers
>Affects Versions: 2.8.0
>Reporter: S Hollander
>Priority: Major
> Fix For: 2.10.0
>
>  Time Spent: 2h 20m
>  Remaining Estimate: 0h
>
> A very useful tool for improving performance with disk-based IO is the use of 
> memory mapped files. I propose an {{InputStream}} that provides a bridge 
> between memory mapped files and the {{InputStream}} ecosystem.
> In my limited performance tests, the use of the MemoryMappedInputStream 
> provided a 25% increase in throughput.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (IO-726) Add MemoryMappedInputStream

2021-06-07 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/IO-726?focusedWorklogId=607842&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-607842
 ]

ASF GitHub Bot logged work on IO-726:
-

Author: ASF GitHub Bot
Created on: 07/Jun/21 12:58
Start Date: 07/Jun/21 12:58
Worklog Time Spent: 10m 
  Work Description: garydgregory commented on a change in pull request #215:
URL: https://github.com/apache/commons-io/pull/215#discussion_r646560785



##
File path: src/main/java/org/apache/commons/io/ByteBufferCleaner.java
##
@@ -0,0 +1,144 @@
+/*
+ * 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
+ *
+ *  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 org.apache.commons.io;
+
+import java.lang.reflect.Field;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.nio.ByteBuffer;
+
+/**
+ * Utility to manually clean a direct {@link ByteBuffer}. Without manual

Review comment:
   Move this class to the input package and make it package private to 
reduce the public API surface, we can make it public later.

##
File path: 
src/main/java/org/apache/commons/io/input/MemoryMappedFileInputStream.java
##
@@ -0,0 +1,169 @@
+/*
+ * 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
+ *
+ *  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 org.apache.commons.io.input;
+
+import static org.apache.commons.io.IOUtils.EOF;
+
+import java.io.BufferedInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.nio.ByteBuffer;
+import java.nio.channels.FileChannel;
+import java.nio.channels.FileChannel.MapMode;
+import java.nio.file.Path;
+import java.nio.file.StandardOpenOption;
+
+import org.apache.commons.io.ByteBufferCleaner;
+
+/**
+ * An {@link InputStream} that utilizes memory mapped files to improve
+ * performance. A sliding window of the file is mapped to memory to avoid
+ * mapping the entire file to memory at one time. The size of the sliding 
buffer
+ * is user configurable.
+ * 
+ * For most operating systems, mapping a file into memory is more expensive 
than
+ * reading or writing a few tens of kilobytes of data. From the standpoint of
+ * performance it is generally only worth mapping relatively large files into
+ * memory. Use of this class can provide approximately a 25% increase in
+ * throughput when reading large files. 
+ * Note: Use of this class does not necessarily obviate the need to use a
+ * {@link BufferedInputStream}. Depending on the use case, the use of buffering
+ * may still further improve performance. For example:
+ * 
+ * 
+ * new BufferedInputStream(new GzipInputStream(new 
MemoryMappedFileInputStream(path
+ * 
+ * 
+ * will greatly outperform:
+ * 
+ * 
+ * new GzipInputStream(new MemoryMappedFileInputStream(path))

Review comment:
   This comparison does not make sense. You should compare using this class 
with a code fragment that does not use it.

##
File path: 
src/main/java/org/apache/commons/io/input/MemoryMappedFileInputStream.java
##
@@ -0,0 +1,169 @@
+/*
+ * 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 th

[jira] [Work logged] (IO-726) Add MemoryMappedInputStream

2021-05-19 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/IO-726?focusedWorklogId=599296&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-599296
 ]

ASF GitHub Bot logged work on IO-726:
-

Author: ASF GitHub Bot
Created on: 19/May/21 15:01
Start Date: 19/May/21 15:01
Worklog Time Spent: 10m 
  Work Description: shollander commented on pull request #215:
URL: https://github.com/apache/commons-io/pull/215#issuecomment-844190370


   @garydgregory Issues addressed.


-- 
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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 599296)
Time Spent: 2h  (was: 1h 50m)

> Add MemoryMappedInputStream
> ---
>
> Key: IO-726
> URL: https://issues.apache.org/jira/browse/IO-726
> Project: Commons IO
>  Issue Type: New Feature
>  Components: Streams/Writers
>Affects Versions: 2.8.0
>Reporter: S Hollander
>Priority: Major
> Fix For: 2.9.0
>
>  Time Spent: 2h
>  Remaining Estimate: 0h
>
> A very useful tool for improving performance with disk-based IO is the use of 
> memory mapped files. I propose an {{InputStream}} that provides a bridge 
> between memory mapped files and the {{InputStream}} ecosystem.
> In my limited performance tests, the use of the MemoryMappedInputStream 
> provided a 25% increase in throughput.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (IO-726) Add MemoryMappedInputStream

2021-05-19 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/IO-726?focusedWorklogId=599246&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-599246
 ]

ASF GitHub Bot logged work on IO-726:
-

Author: ASF GitHub Bot
Created on: 19/May/21 13:50
Start Date: 19/May/21 13:50
Worklog Time Spent: 10m 
  Work Description: coveralls edited a comment on pull request #215:
URL: https://github.com/apache/commons-io/pull/215#issuecomment-805093521


   
   [![Coverage 
Status](https://coveralls.io/builds/39819390/badge)](https://coveralls.io/builds/39819390)
   
   Coverage decreased (-0.09%) to 89.286% when pulling 
**c3e7bb06024303f3398d8e75bf2d371974660c75 on shollander:mmap_inputStream** 
into **e569d0f76924502007ba838dded7d5fdfcedd578 on apache:master**.
   


-- 
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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 599246)
Time Spent: 1h 50m  (was: 1h 40m)

> Add MemoryMappedInputStream
> ---
>
> Key: IO-726
> URL: https://issues.apache.org/jira/browse/IO-726
> Project: Commons IO
>  Issue Type: New Feature
>  Components: Streams/Writers
>Affects Versions: 2.8.0
>Reporter: S Hollander
>Priority: Major
> Fix For: 2.9.0
>
>  Time Spent: 1h 50m
>  Remaining Estimate: 0h
>
> A very useful tool for improving performance with disk-based IO is the use of 
> memory mapped files. I propose an {{InputStream}} that provides a bridge 
> between memory mapped files and the {{InputStream}} ecosystem.
> In my limited performance tests, the use of the MemoryMappedInputStream 
> provided a 25% increase in throughput.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (IO-726) Add MemoryMappedInputStream

2021-05-19 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/IO-726?focusedWorklogId=599216&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-599216
 ]

ASF GitHub Bot logged work on IO-726:
-

Author: ASF GitHub Bot
Created on: 19/May/21 13:17
Start Date: 19/May/21 13:17
Worklog Time Spent: 10m 
  Work Description: coveralls edited a comment on pull request #215:
URL: https://github.com/apache/commons-io/pull/215#issuecomment-805093521


   
   [![Coverage 
Status](https://coveralls.io/builds/39818300/badge)](https://coveralls.io/builds/39818300)
   
   Coverage decreased (-0.3%) to 89.03% when pulling 
**d64e9274a8affeb256248f5e1c9210519ee5a904 on shollander:mmap_inputStream** 
into **e569d0f76924502007ba838dded7d5fdfcedd578 on apache:master**.
   


-- 
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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 599216)
Time Spent: 1h 40m  (was: 1.5h)

> Add MemoryMappedInputStream
> ---
>
> Key: IO-726
> URL: https://issues.apache.org/jira/browse/IO-726
> Project: Commons IO
>  Issue Type: New Feature
>  Components: Streams/Writers
>Affects Versions: 2.8.0
>Reporter: S Hollander
>Priority: Major
> Fix For: 2.9.0
>
>  Time Spent: 1h 40m
>  Remaining Estimate: 0h
>
> A very useful tool for improving performance with disk-based IO is the use of 
> memory mapped files. I propose an {{InputStream}} that provides a bridge 
> between memory mapped files and the {{InputStream}} ecosystem.
> In my limited performance tests, the use of the MemoryMappedInputStream 
> provided a 25% increase in throughput.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (IO-726) Add MemoryMappedInputStream

2021-05-17 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/IO-726?focusedWorklogId=598013&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-598013
 ]

ASF GitHub Bot logged work on IO-726:
-

Author: ASF GitHub Bot
Created on: 17/May/21 18:23
Start Date: 17/May/21 18:23
Worklog Time Spent: 10m 
  Work Description: garydgregory edited a comment on pull request #215:
URL: https://github.com/apache/commons-io/pull/215#issuecomment-842358898






-- 
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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 598013)
Time Spent: 1.5h  (was: 1h 20m)

> Add MemoryMappedInputStream
> ---
>
> Key: IO-726
> URL: https://issues.apache.org/jira/browse/IO-726
> Project: Commons IO
>  Issue Type: New Feature
>  Components: Streams/Writers
>Affects Versions: 2.8.0
>Reporter: S Hollander
>Priority: Major
> Fix For: 2.9.0
>
>  Time Spent: 1.5h
>  Remaining Estimate: 0h
>
> A very useful tool for improving performance with disk-based IO is the use of 
> memory mapped files. I propose an {{InputStream}} that provides a bridge 
> between memory mapped files and the {{InputStream}} ecosystem.
> In my limited performance tests, the use of the MemoryMappedInputStream 
> provided a 25% increase in throughput.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (IO-726) Add MemoryMappedInputStream

2021-05-17 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/IO-726?focusedWorklogId=597973&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-597973
 ]

ASF GitHub Bot logged work on IO-726:
-

Author: ASF GitHub Bot
Created on: 17/May/21 18:18
Start Date: 17/May/21 18:18
Worklog Time Spent: 10m 
  Work Description: garydgregory commented on pull request #215:
URL: https://github.com/apache/commons-io/pull/215#issuecomment-842358898


   @shollander 
   The Java 17-EA builds but I can't see why; may you please rebase on master, 
all builds are green there.


-- 
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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 597973)
Time Spent: 1h 20m  (was: 1h 10m)

> Add MemoryMappedInputStream
> ---
>
> Key: IO-726
> URL: https://issues.apache.org/jira/browse/IO-726
> Project: Commons IO
>  Issue Type: New Feature
>  Components: Streams/Writers
>Affects Versions: 2.8.0
>Reporter: S Hollander
>Priority: Major
> Fix For: 2.9.0
>
>  Time Spent: 1h 20m
>  Remaining Estimate: 0h
>
> A very useful tool for improving performance with disk-based IO is the use of 
> memory mapped files. I propose an {{InputStream}} that provides a bridge 
> between memory mapped files and the {{InputStream}} ecosystem.
> In my limited performance tests, the use of the MemoryMappedInputStream 
> provided a 25% increase in throughput.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (IO-726) Add MemoryMappedInputStream

2021-05-17 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/IO-726?focusedWorklogId=597680&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-597680
 ]

ASF GitHub Bot logged work on IO-726:
-

Author: ASF GitHub Bot
Created on: 17/May/21 14:22
Start Date: 17/May/21 14:22
Worklog Time Spent: 10m 
  Work Description: garydgregory edited a comment on pull request #215:
URL: https://github.com/apache/commons-io/pull/215#issuecomment-842358898


   Hi @shollander 
   The Java 17-EA builds which seems to be fixed in the latest EA; may you 
please rebase on master, all builds are green there.
   This appears to introduce some duplication with 
`org.apache.commons.io.input.BufferedFileChannelInputStream`; it would be 
better if this cleaning functionality was defined only once and reused.
   


-- 
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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 597680)
Time Spent: 1h 10m  (was: 1h)

> Add MemoryMappedInputStream
> ---
>
> Key: IO-726
> URL: https://issues.apache.org/jira/browse/IO-726
> Project: Commons IO
>  Issue Type: New Feature
>  Components: Streams/Writers
>Affects Versions: 2.8.0
>Reporter: S Hollander
>Priority: Major
> Fix For: 2.9.0
>
>  Time Spent: 1h 10m
>  Remaining Estimate: 0h
>
> A very useful tool for improving performance with disk-based IO is the use of 
> memory mapped files. I propose an {{InputStream}} that provides a bridge 
> between memory mapped files and the {{InputStream}} ecosystem.
> In my limited performance tests, the use of the MemoryMappedInputStream 
> provided a 25% increase in throughput.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (IO-726) Add MemoryMappedInputStream

2021-05-17 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/IO-726?focusedWorklogId=597675&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-597675
 ]

ASF GitHub Bot logged work on IO-726:
-

Author: ASF GitHub Bot
Created on: 17/May/21 14:16
Start Date: 17/May/21 14:16
Worklog Time Spent: 10m 
  Work Description: garydgregory edited a comment on pull request #215:
URL: https://github.com/apache/commons-io/pull/215#issuecomment-842358898


   Hi @shollander 
   The Java 17-EA builds but I can't see why; may you please rebase on master, 
all builds are green there.
   This appears to introduce some duplication with 
`org.apache.commons.io.input.BufferedFileChannelInputStream`; it would be 
better if this cleaning functionality was defined only once and reused.
   


-- 
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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 597675)
Time Spent: 1h  (was: 50m)

> Add MemoryMappedInputStream
> ---
>
> Key: IO-726
> URL: https://issues.apache.org/jira/browse/IO-726
> Project: Commons IO
>  Issue Type: New Feature
>  Components: Streams/Writers
>Affects Versions: 2.8.0
>Reporter: S Hollander
>Priority: Major
> Fix For: 2.9.0
>
>  Time Spent: 1h
>  Remaining Estimate: 0h
>
> A very useful tool for improving performance with disk-based IO is the use of 
> memory mapped files. I propose an {{InputStream}} that provides a bridge 
> between memory mapped files and the {{InputStream}} ecosystem.
> In my limited performance tests, the use of the MemoryMappedInputStream 
> provided a 25% increase in throughput.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (IO-726) Add MemoryMappedInputStream

2021-05-17 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/IO-726?focusedWorklogId=597671&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-597671
 ]

ASF GitHub Bot logged work on IO-726:
-

Author: ASF GitHub Bot
Created on: 17/May/21 14:12
Start Date: 17/May/21 14:12
Worklog Time Spent: 10m 
  Work Description: garydgregory commented on pull request #215:
URL: https://github.com/apache/commons-io/pull/215#issuecomment-842358898


   @shollander 
   The Java 17-EA builds but I can't see why; may you please rebase on master, 
all builds are green there.


-- 
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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 597671)
Time Spent: 50m  (was: 40m)

> Add MemoryMappedInputStream
> ---
>
> Key: IO-726
> URL: https://issues.apache.org/jira/browse/IO-726
> Project: Commons IO
>  Issue Type: New Feature
>  Components: Streams/Writers
>Affects Versions: 2.8.0
>Reporter: S Hollander
>Priority: Major
> Fix For: 2.9.0
>
>  Time Spent: 50m
>  Remaining Estimate: 0h
>
> A very useful tool for improving performance with disk-based IO is the use of 
> memory mapped files. I propose an {{InputStream}} that provides a bridge 
> between memory mapped files and the {{InputStream}} ecosystem.
> In my limited performance tests, the use of the MemoryMappedInputStream 
> provided a 25% increase in throughput.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (IO-726) Add MemoryMappedInputStream

2021-03-24 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/IO-726?focusedWorklogId=571408&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-571408
 ]

ASF GitHub Bot logged work on IO-726:
-

Author: ASF GitHub Bot
Created on: 24/Mar/21 18:58
Start Date: 24/Mar/21 18:58
Worklog Time Spent: 10m 
  Work Description: coveralls edited a comment on pull request #215:
URL: https://github.com/apache/commons-io/pull/215#issuecomment-805093521


   
   [![Coverage 
Status](https://coveralls.io/builds/38222040/badge)](https://coveralls.io/builds/38222040)
   
   Coverage decreased (-0.2%) to 89.051% when pulling 
**03fc3d4fce35d851b9adc2a446e94a852c4a8df6 on shollander:mmap_inputStream** 
into **c1ee77787f74ce9b660bf377462059d084458fef on apache:master**.
   


-- 
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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 571408)
Time Spent: 40m  (was: 0.5h)

> Add MemoryMappedInputStream
> ---
>
> Key: IO-726
> URL: https://issues.apache.org/jira/browse/IO-726
> Project: Commons IO
>  Issue Type: New Feature
>  Components: Streams/Writers
>Affects Versions: 2.8.0
>Reporter: S Hollander
>Priority: Major
> Fix For: 2.9.0
>
>  Time Spent: 40m
>  Remaining Estimate: 0h
>
> A very useful tool for improving performance with disk-based IO is the use of 
> memory mapped files. I propose an {{InputStream}} that provides a bridge 
> between memory mapped files and the {{InputStream}} ecosystem.
> In my limited performance tests, the use of the MemoryMappedInputStream 
> provided a 25% increase in throughput.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (IO-726) Add MemoryMappedInputStream

2021-03-24 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/IO-726?focusedWorklogId=570970&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-570970
 ]

ASF GitHub Bot logged work on IO-726:
-

Author: ASF GitHub Bot
Created on: 24/Mar/21 07:15
Start Date: 24/Mar/21 07:15
Worklog Time Spent: 10m 
  Work Description: coveralls edited a comment on pull request #215:
URL: https://github.com/apache/commons-io/pull/215#issuecomment-805093521


   
   [![Coverage 
Status](https://coveralls.io/builds/38200996/badge)](https://coveralls.io/builds/38200996)
   
   Coverage decreased (-0.1%) to 89.15% when pulling 
**9f28e14b25cdc66133f8db351619babec3be1d5e on shollander:mmap_inputStream** 
into **c1ee77787f74ce9b660bf377462059d084458fef on apache:master**.
   


-- 
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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 570970)
Time Spent: 0.5h  (was: 20m)

> Add MemoryMappedInputStream
> ---
>
> Key: IO-726
> URL: https://issues.apache.org/jira/browse/IO-726
> Project: Commons IO
>  Issue Type: New Feature
>  Components: Streams/Writers
>Affects Versions: 2.8.0
>Reporter: S Hollander
>Priority: Major
> Fix For: 2.9.0
>
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> A very useful tool for improving performance with disk-based IO is the use of 
> memory mapped files. I propose an {{InputStream}} that provides a bridge 
> between memory mapped files and the {{InputStream}} ecosystem.
> In my limited performance tests, the use of the MemoryMappedInputStream 
> provided a 25% increase in throughput.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (IO-726) Add MemoryMappedInputStream

2021-03-23 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/IO-726?focusedWorklogId=570668&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-570668
 ]

ASF GitHub Bot logged work on IO-726:
-

Author: ASF GitHub Bot
Created on: 23/Mar/21 17:34
Start Date: 23/Mar/21 17:34
Worklog Time Spent: 10m 
  Work Description: coveralls commented on pull request #215:
URL: https://github.com/apache/commons-io/pull/215#issuecomment-805093521


   
   [![Coverage 
Status](https://coveralls.io/builds/38182956/badge)](https://coveralls.io/builds/38182956)
   
   Coverage increased (+0.05%) to 89.309% when pulling 
**005eb02ba0f0aa2dccb84266b1f7344880a056c5 on shollander:mmap_inputStream** 
into **c1ee77787f74ce9b660bf377462059d084458fef on apache:master**.
   


-- 
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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 570668)
Time Spent: 20m  (was: 10m)

> Add MemoryMappedInputStream
> ---
>
> Key: IO-726
> URL: https://issues.apache.org/jira/browse/IO-726
> Project: Commons IO
>  Issue Type: New Feature
>  Components: Streams/Writers
>Affects Versions: 2.8.0
>Reporter: S Hollander
>Priority: Major
> Fix For: 2.9.0
>
>  Time Spent: 20m
>  Remaining Estimate: 0h
>
> A very useful tool for improving performance with disk-based IO is the use of 
> memory mapped files. I propose an {{InputStream}} that provides a bridge 
> between memory mapped files and the {{InputStream}} ecosystem.
> In my limited performance tests, the use of the MemoryMappedInputStream 
> provided a 25% increase in throughput.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (IO-726) Add MemoryMappedInputStream

2021-03-22 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/IO-726?focusedWorklogId=570042&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-570042
 ]

ASF GitHub Bot logged work on IO-726:
-

Author: ASF GitHub Bot
Created on: 22/Mar/21 21:07
Start Date: 22/Mar/21 21:07
Worklog Time Spent: 10m 
  Work Description: shollander opened a new pull request #215:
URL: https://github.com/apache/commons-io/pull/215


   Adds a `MemoryMappedInputStream` class bridging memory mapped files and 
`InputStream`s. Makes it easy to use memory mapped files and turbo charge disk 
IO.
   
   Fixes IO-726.


-- 
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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 570042)
Remaining Estimate: 0h
Time Spent: 10m

> Add MemoryMappedInputStream
> ---
>
> Key: IO-726
> URL: https://issues.apache.org/jira/browse/IO-726
> Project: Commons IO
>  Issue Type: New Feature
>  Components: Streams/Writers
>Affects Versions: 2.8.0
>Reporter: S Hollander
>Priority: Major
> Fix For: 2.9.0
>
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> A very useful tool for improving performance with disk-based IO is the use of 
> memory mapped files. I propose an {{InputStream}} that provides a bridge 
> between memory mapped files and the {{InputStream}} ecosystem.
> In my limited performance tests, the use of the MemoryMappedInputStream 
> provided a 25% increase in throughput.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)