You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@harmony.apache.org by "Paulex Yang (JIRA)" <ji...@apache.org> on 2006/01/24 17:45:11 UTC

[jira] Created: (HARMONY-42) com.ibm.io.nio.FileChannel is not fully implemented

com.ibm.io.nio.FileChannel is not fully implemented
---------------------------------------------------

         Key: HARMONY-42
         URL: http://issues.apache.org/jira/browse/HARMONY-42
     Project: Harmony
        Type: Bug
  Components: Classlib  
    Reporter: Paulex Yang


Many functions of FileChannel, such as memory map, transfer, gathering/scattering I/O are not implemented. Further, three classes in java.io, FileInputStream FileOutputStream, and RandomAccessFile, are related to java.nio.FileChannel, so that they can be refactored to base on same JNI interface, just like the network channels and sockets. 


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (HARMONY-42) com.ibm.io.nio.FileChannel is not fully implemented

Posted by "Richard Liang (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/HARMONY-42?page=comments#action_12366146 ] 

Richard Liang commented on HARMONY-42:
--------------------------------------

Thanks a lot, Tim. We are satisfied with the patch application. You may close this JIRA.

> com.ibm.io.nio.FileChannel is not fully implemented
> ---------------------------------------------------
>
>          Key: HARMONY-42
>          URL: http://issues.apache.org/jira/browse/HARMONY-42
>      Project: Harmony
>         Type: Bug
>   Components: Classlib
>     Reporter: Paulex Yang
>     Assignee: Tim Ellison
>  Attachments: FileChannel_patch.zip, Harmony42-IFileSystem-patch.txt, Harmony42-IMemorySystem-patch.txt, Harmony42-java_io_FileChannelFactory-patch.txt, Harmony42-java_io_FileOutputStream-patch.txt, IFileSystem.java
>
> Many functions of FileChannel, such as memory map, transfer, gathering/scattering I/O are not implemented. Further, three classes in java.io, FileInputStream FileOutputStream, and RandomAccessFile, are related to java.nio.FileChannel, so that they can be refactored to base on same JNI interface, just like the network channels and sockets. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (HARMONY-42) com.ibm.io.nio.FileChannel is not fully implemented

Posted by "Paulex Yang (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-42?page=all ]

Paulex Yang updated HARMONY-42:
-------------------------------

    Attachment: Harmony42-IFileSystem-patch.txt
                Harmony42-IMemorySystem-patch.txt

Sorry that I didn't tell the whole story, the mmap related functions are moved to IMemorySystem, because most of other mmap related functions, such as load, isLoad and flush are all memory operations, and I think the IMemorySystem is more appropriate place to hold them. 

About the IFileSystem itself, 4 methods are modifed, all of them are not fully implemented in current Harmony code base, and 3 methods are added. Diff patches are attached for your detail information.

> com.ibm.io.nio.FileChannel is not fully implemented
> ---------------------------------------------------
>
>          Key: HARMONY-42
>          URL: http://issues.apache.org/jira/browse/HARMONY-42
>      Project: Harmony
>         Type: Bug
>   Components: Classlib
>     Reporter: Paulex Yang
>     Assignee: Tim Ellison
>  Attachments: Harmony42-IFileSystem-patch.txt, Harmony42-IMemorySystem-patch.txt, IFileSystem.java
>
> Many functions of FileChannel, such as memory map, transfer, gathering/scattering I/O are not implemented. Further, three classes in java.io, FileInputStream FileOutputStream, and RandomAccessFile, are related to java.nio.FileChannel, so that they can be refactored to base on same JNI interface, just like the network channels and sockets. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Closed: (HARMONY-42) com.ibm.io.nio.FileChannel is not fully implemented

Posted by "Tim Ellison (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-42?page=all ]
     
Tim Ellison closed HARMONY-42:
------------------------------


Verified by Richard.

> com.ibm.io.nio.FileChannel is not fully implemented
> ---------------------------------------------------
>
>          Key: HARMONY-42
>          URL: http://issues.apache.org/jira/browse/HARMONY-42
>      Project: Harmony
>         Type: Bug
>   Components: Classlib
>     Reporter: Paulex Yang
>     Assignee: Tim Ellison
>  Attachments: FileChannel_patch.zip, Harmony42-IFileSystem-patch.txt, Harmony42-IMemorySystem-patch.txt, Harmony42-java_io_FileChannelFactory-patch.txt, Harmony42-java_io_FileOutputStream-patch.txt, IFileSystem.java
>
> Many functions of FileChannel, such as memory map, transfer, gathering/scattering I/O are not implemented. Further, three classes in java.io, FileInputStream FileOutputStream, and RandomAccessFile, are related to java.nio.FileChannel, so that they can be refactored to base on same JNI interface, just like the network channels and sockets. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Resolved: (HARMONY-42) com.ibm.io.nio.FileChannel is not fully implemented

Posted by "Tim Ellison (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-42?page=all ]
     
Tim Ellison resolved HARMONY-42:
--------------------------------

    Resolution: Fixed

Paulex / Richard,

I've had a look at the patches you sent and applied them at repo revision 376690.

I have the following comments (note especially #6):

1.  Added a missing ASF copyright statment to IMemorySystem.h,
2.  nio/OSFileSystemWin32.c#OSFileSystem_transferImpl has a number of printf's in there that should be removed (e.g. printf("Error getJavaIoFileDescriptorContentsAsAPointer!\n"); )
3. same thing in port/hymmap.c#hymmap_map_filehandler (e.g. printf("print this to show in this function"); ) -- this also has a very strange code layout !
4. I have added some missing exports from the exp & def files for the new JNI functions you defined
5.  I see a few TODO's in there, like IPv6 support on a couple fo functions -- that's ok, but if you do the work please send it along.
6. I have *not* applied the modifications you made to the portlib to extend the mmap functionality; and therefore I have modified the OSMemory#mmap method to throw a NotYetImplementedException.  I'll discuss this on the mailing list.

Please open a new JIRA for further patches/work in this area -- and thank you very much for your contribution.

> com.ibm.io.nio.FileChannel is not fully implemented
> ---------------------------------------------------
>
>          Key: HARMONY-42
>          URL: http://issues.apache.org/jira/browse/HARMONY-42
>      Project: Harmony
>         Type: Bug
>   Components: Classlib
>     Reporter: Paulex Yang
>     Assignee: Tim Ellison
>  Attachments: FileChannel_patch.zip, Harmony42-IFileSystem-patch.txt, Harmony42-IMemorySystem-patch.txt, Harmony42-java_io_FileChannelFactory-patch.txt, Harmony42-java_io_FileOutputStream-patch.txt, IFileSystem.java
>
> Many functions of FileChannel, such as memory map, transfer, gathering/scattering I/O are not implemented. Further, three classes in java.io, FileInputStream FileOutputStream, and RandomAccessFile, are related to java.nio.FileChannel, so that they can be refactored to base on same JNI interface, just like the network channels and sockets. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (HARMONY-42) com.ibm.io.nio.FileChannel is not fully implemented

Posted by "Tim Ellison (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/HARMONY-42?page=comments#action_12365624 ] 

Tim Ellison commented on HARMONY-42:
------------------------------------

Richard, just to let you know that I'm currently looking at this refactoring -- it will take me a while to get through it so please be patient<g>.

> com.ibm.io.nio.FileChannel is not fully implemented
> ---------------------------------------------------
>
>          Key: HARMONY-42
>          URL: http://issues.apache.org/jira/browse/HARMONY-42
>      Project: Harmony
>         Type: Bug
>   Components: Classlib
>     Reporter: Paulex Yang
>     Assignee: Tim Ellison
>  Attachments: FileChannel_patch.zip, Harmony42-IFileSystem-patch.txt, Harmony42-IMemorySystem-patch.txt, Harmony42-java_io_FileChannelFactory-patch.txt, Harmony42-java_io_FileOutputStream-patch.txt, IFileSystem.java
>
> Many functions of FileChannel, such as memory map, transfer, gathering/scattering I/O are not implemented. Further, three classes in java.io, FileInputStream FileOutputStream, and RandomAccessFile, are related to java.nio.FileChannel, so that they can be refactored to base on same JNI interface, just like the network channels and sockets. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (HARMONY-42) com.ibm.io.nio.FileChannel is not fully implemented

Posted by "Tim Ellison (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/HARMONY-42?page=comments#action_12363844 ] 

Tim Ellison commented on HARMONY-42:
------------------------------------

Paulex,

I don't understand this issue.  The file you have attached is a modified version of the com.ibm.platform.IFileSystem.java that is in NIO. Your comment indicates that it is enhanced to support regular IO types, yet it appears that mmap is removed.  Is that right?

I'm not going to take this enhancement at the moment.  Please provide further rationale.

(Please can you send your enhancements as diff's rather than file replacements, it will make tehm much easier to evaluate.)

Thanks,
Tim

> com.ibm.io.nio.FileChannel is not fully implemented
> ---------------------------------------------------
>
>          Key: HARMONY-42
>          URL: http://issues.apache.org/jira/browse/HARMONY-42
>      Project: Harmony
>         Type: Bug
>   Components: Classlib
>     Reporter: Paulex Yang
>     Assignee: Tim Ellison
>  Attachments: IFileSystem.java
>
> Many functions of FileChannel, such as memory map, transfer, gathering/scattering I/O are not implemented. Further, three classes in java.io, FileInputStream FileOutputStream, and RandomAccessFile, are related to java.nio.FileChannel, so that they can be refactored to base on same JNI interface, just like the network channels and sockets. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (HARMONY-42) com.ibm.io.nio.FileChannel is not fully implemented

Posted by "Paulex Yang (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-42?page=all ]

Paulex Yang updated HARMONY-42:
-------------------------------

    Attachment: Harmony42-java_io_FileChannelFactory-patch.txt
                Harmony42-java_io_FileOutputStream-patch.txt

A POC refactor patch for java.io.FileOutputStream is attached, with some minor changes on FileChannelFactory. java.io.FileInputStream and RandomAccessFile can be easily refactored in similiar style. 

As a completement to my comment on the issue 40, The FileChannelImpl's implCloseChannel() can look like:
    protected void implCloseChannel() throws IOException {
        if(stream instanceof Closeable){
            ((Closeable)stream).close();
        }
        fileSystem.close(handle);
    }
   
    and the FileChannelImpl's super class, AbstractInterruptibleChannel's close method can be:

	public synchronized final void close() throws IOException {
		if (!closed) {
                    closed = true;
                    implCloseChannel();
		}	
	}
    

> com.ibm.io.nio.FileChannel is not fully implemented
> ---------------------------------------------------
>
>          Key: HARMONY-42
>          URL: http://issues.apache.org/jira/browse/HARMONY-42
>      Project: Harmony
>         Type: Bug
>   Components: Classlib
>     Reporter: Paulex Yang
>     Assignee: Tim Ellison
>  Attachments: Harmony42-IFileSystem-patch.txt, Harmony42-IMemorySystem-patch.txt, Harmony42-java_io_FileChannelFactory-patch.txt, Harmony42-java_io_FileOutputStream-patch.txt, IFileSystem.java
>
> Many functions of FileChannel, such as memory map, transfer, gathering/scattering I/O are not implemented. Further, three classes in java.io, FileInputStream FileOutputStream, and RandomAccessFile, are related to java.nio.FileChannel, so that they can be refactored to base on same JNI interface, just like the network channels and sockets. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Assigned: (HARMONY-42) com.ibm.io.nio.FileChannel is not fully implemented

Posted by "Tim Ellison (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-42?page=all ]

Tim Ellison reassigned HARMONY-42:
----------------------------------

    Assign To: Tim Ellison

> com.ibm.io.nio.FileChannel is not fully implemented
> ---------------------------------------------------
>
>          Key: HARMONY-42
>          URL: http://issues.apache.org/jira/browse/HARMONY-42
>      Project: Harmony
>         Type: Bug
>   Components: Classlib
>     Reporter: Paulex Yang
>     Assignee: Tim Ellison
>  Attachments: IFileSystem.java
>
> Many functions of FileChannel, such as memory map, transfer, gathering/scattering I/O are not implemented. Further, three classes in java.io, FileInputStream FileOutputStream, and RandomAccessFile, are related to java.nio.FileChannel, so that they can be refactored to base on same JNI interface, just like the network channels and sockets. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (HARMONY-42) com.ibm.io.nio.FileChannel is not fully implemented

Posted by "Richard Liang (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-42?page=all ]

Richard Liang updated HARMONY-42:
---------------------------------

    Attachment: FileChannel_patch.zip

Hello Tim,

Finally, The refactor of FileChannel and related classes are completed :-), as well as some modification about
some native code (OS File system and OS Memory system). Would you please help to verify my patches? Thanks a lot.

Hopefully, I will post my test cases soon :-)


> com.ibm.io.nio.FileChannel is not fully implemented
> ---------------------------------------------------
>
>          Key: HARMONY-42
>          URL: http://issues.apache.org/jira/browse/HARMONY-42
>      Project: Harmony
>         Type: Bug
>   Components: Classlib
>     Reporter: Paulex Yang
>     Assignee: Tim Ellison
>  Attachments: FileChannel_patch.zip, Harmony42-IFileSystem-patch.txt, Harmony42-IMemorySystem-patch.txt, Harmony42-java_io_FileChannelFactory-patch.txt, Harmony42-java_io_FileOutputStream-patch.txt, IFileSystem.java
>
> Many functions of FileChannel, such as memory map, transfer, gathering/scattering I/O are not implemented. Further, three classes in java.io, FileInputStream FileOutputStream, and RandomAccessFile, are related to java.nio.FileChannel, so that they can be refactored to base on same JNI interface, just like the network channels and sockets. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (HARMONY-42) com.ibm.io.nio.FileChannel is not fully implemented

Posted by "Paulex Yang (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-42?page=all ]

Paulex Yang updated HARMONY-42:
-------------------------------

    Attachment: IFileSystem.java

Here goes my proposal of the JNI interfaces, which can be the base of both FileChannel and the File I/O classes in java.io. 

> com.ibm.io.nio.FileChannel is not fully implemented
> ---------------------------------------------------
>
>          Key: HARMONY-42
>          URL: http://issues.apache.org/jira/browse/HARMONY-42
>      Project: Harmony
>         Type: Bug
>   Components: Classlib
>     Reporter: Paulex Yang
>  Attachments: IFileSystem.java
>
> Many functions of FileChannel, such as memory map, transfer, gathering/scattering I/O are not implemented. Further, three classes in java.io, FileInputStream FileOutputStream, and RandomAccessFile, are related to java.nio.FileChannel, so that they can be refactored to base on same JNI interface, just like the network channels and sockets. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira