Class IoUringIoOps

java.lang.Object
io.netty.channel.uring.IoUringIoOps
All Implemented Interfaces:
IoOps

public final class IoUringIoOps extends Object implements IoOps
IoOps for implementation for Io_uring.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final long
     
    private final int
     
    private final byte
     
    private final short
     
    private final int
     
    private final byte
     
    private final short
     
    private final long
     
    private final long
     
    private final int
     
    private final short
     
    private final int
     
    private final long
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    IoUringIoOps(byte opcode, byte flags, short ioPrio, int fd, long union1, long union2, int len, int union3, long data, short union4, short personality, int union5, long union6)
    Create a new instance which represents the io_uring_sqe struct.
    IoUringIoOps(byte opcode, byte flags, short ioPrio, int fd, long union1, long union2, int len, int union3, short data, short union4, short personality, int union5, long union6)
  • Method Summary

    Modifier and Type
    Method
    Description
    (package private) short
    Deprecated.
    use userData() instead.
    (package private) int
    fd()
     
    (package private) byte
     
    (package private) short
     
    (package private) int
    len()
     
    (package private) static IoUringIoOps
    newAccept(int fd, byte flags, int acceptFlags, short ioPrio, long acceptedAddressMemoryAddress, long acceptedAddressLengthMemoryAddress, short data)
    Returns a new OP_ACCEPT IoUringIoOps.
    (package private) static IoUringIoOps
    newAsyncCancel(byte flags, long userData, short data)
    Returns a new OP_ASYNC_CANCEL IoUringIoOps.
    (package private) static IoUringIoOps
    newClose(int fd, byte flags, short data)
    Returns a new OP_CLOSE IoUringIoOps.
    (package private) static IoUringIoOps
    newConnect(int fd, byte flags, long remoteMemoryAddress, int addrLen, short data)
    Returns a new OP_CONNECT IoUringIoOps.
    (package private) static IoUringIoOps
    newConnect(int fd, byte flags, long remoteMemoryAddress, short data)
    Returns a new OP_CONNECT IoUringIoOps.
    (package private) static IoUringIoOps
    newPollAdd(int fd, byte flags, int mask, int len, short data)
    Returns a new OP_POLL_ADD IoUringIoOps.
    (package private) static IoUringIoOps
    newRecv(int fd, byte flags, short ioPrio, int recvFlags, long memoryAddress, int length, short data)
    Returns a new OP_RECV IoUringIoOps.
    (package private) static IoUringIoOps
    newRecv(int fd, byte flags, short ioPrio, int recvFlags, long memoryAddress, int length, short data, short bid)
     
    (package private) static IoUringIoOps
    newRecvmsg(int fd, byte flags, int msgFlags, long memoryAddress, short data)
    Returns a new OP_RECVMSG IoUringIoOps.
    (package private) static IoUringIoOps
    newSend(int fd, byte flags, int sendFlags, long memoryAddress, int length, short data)
    Returns a new OP_SEND IoUringIoOps.
    (package private) static IoUringIoOps
    newSendmsg(int fd, byte flags, int msgFlags, long address, short data)
    Returns a new OP_SENDMSG IoUringIoOps.
    (package private) static IoUringIoOps
    newSendmsgZc(int fd, byte flags, int msgFlags, long address, long data)
     
    (package private) static IoUringIoOps
    newSendZc(int fd, long memoryAddress, int length, int flags, long data, int zcFlags)
     
    (package private) static IoUringIoOps
    newShutdown(int fd, byte flags, int how, short data)
    Returns a new OP_SHUTDOWN IoUringIoOps.
    (package private) static IoUringIoOps
    newSplice(int fd_in, long off_in, int fd_out, long off_out, int nbytes, int splice_flags, short data)
    Returns a new OP_SPLICE IoUringIoOps.
    (package private) static IoUringIoOps
    newWrite(int fd, byte flags, int writeFlags, long memoryAddress, int length, short data)
    Returns a new OP_WRITE IoUringIoOps.
    (package private) static IoUringIoOps
    newWritev(int fd, byte flags, int writevFlags, long memoryAddress, int length, short data)
    Returns a new OP_WRITEV IoUringIoOps.
    (package private) byte
     
    (package private) short
     
     
    (package private) long
     
    (package private) long
     
    (package private) int
     
    (package private) short
     
    (package private) int
     
    (package private) long
     
    (package private) long
     

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • opcode

      private final byte opcode
    • flags

      private final byte flags
    • ioPrio

      private final short ioPrio
    • fd

      private final int fd
    • union1

      private final long union1
    • union2

      private final long union2
    • len

      private final int len
    • union3

      private final int union3
    • data

      private final long data
    • personality

      private final short personality
    • union4

      private final short union4
    • union5

      private final int union5
    • union6

      private final long union6
  • Constructor Details

    • IoUringIoOps

      @Deprecated public IoUringIoOps(byte opcode, byte flags, short ioPrio, int fd, long union1, long union2, int len, int union3, short data, short union4, short personality, int union5, long union6)
      Create a new instance which represents the io_uring_sqe struct.
    • IoUringIoOps

      public IoUringIoOps(byte opcode, byte flags, short ioPrio, int fd, long union1, long union2, int len, int union3, long data, short union4, short personality, int union5, long union6)
      Create a new instance which represents the io_uring_sqe struct.
       struct io_uring_sqe {
           __u8    opcode;    // type of operation for this sqe
           __u8    flags;     // IOSQE_ flags
           __u16   ioprio;    // ioprio for the request
           __s32   fd;        // file descriptor to do IO on
      
           union {            // union1
               __u64 off;     // offset into file
               __u64 addr2;
               struct {
                   __u32 cmd_op;
                   __u32 __pad1;
               };
           };
      
           union {             // union2
               __u64 addr;    // pointer to buffer or iovecs
               __u64 splice_off_in;
               struct {
                   __u32 level;
                   __u32 optname;
               };
           };
           __u32 len;        // buffer size or number of iovecs
      
           union {           // union3
               __kernel_rwf_t rw_flags;
               __u32 fsync_flags;
               __u16 poll_events;    // compatibility
               __u32 poll32_events; // word-reversed for BE
               __u32 sync_range_flags;
               __u32 msg_flags;
               __u32 timeout_flags;
               __u32 accept_flags;
               __u32 cancel_flags;
               __u32 open_flags;
               __u32 statx_flags;
               __u32 fadvise_advice;
               __u32 splice_flags;
               __u32 rename_flags;
               __u32 unlink_flags;
               __u32 hardlink_flags;
               __u32 xeattr_flags;
               __u32 msg_ring_flags;
               __u32 uring_cmd_flags;
               __u32 waitid_flags;
               __u32 futex_flags;
               __u32 install_fd_flags;
               __u32 nop_flags;
           };
           __u64 user_data;    // data to be passed back at completion time
                               // pack this to avoid bogus arm OABI complaints
      
           union {             // union4
      
               // index into fixed buffers, if used
               __u16 buf_index;
               // for grouped buffer selection
               __u16 buf_group;
           }__attribute__((packed));
           // personality to use, if used
           __u16 personality;
      
           union {            // union5
      
               __s32 splice_fd_in;
               __u32 file_index;
               __u32 optlen;
               struct {
                   __u16 addr_len;
                   __u16 __pad3[ 1];
               };
           };
      
           union {           // union6
      
               struct {
                   __u64 addr3;
                   __u64 __pad2[ 1];
               };
               __u64 optval;
               //
               // If the ring is initialized with IORING_SETUP_SQE128, then
               // this field is used for 80 bytes of arbitrary command data
               __u8 cmd[ 0];
           };
       };
      
      
  • Method Details

    • opcode

      byte opcode()
    • flags

      byte flags()
    • ioPrio

      short ioPrio()
    • fd

      int fd()
    • union1

      long union1()
    • union2

      long union2()
    • len

      int len()
    • union3

      int union3()
    • data

      @Deprecated short data()
      Deprecated.
      use userData() instead.
      Returns the data that is passed as part of this IoUringIoOps.
      Returns:
      data.
    • userData

      long userData()
    • personality

      short personality()
    • union4

      short union4()
    • union5

      int union5()
    • union6

      long union6()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • newAsyncCancel

      static IoUringIoOps newAsyncCancel(byte flags, long userData, short data)
      Returns a new OP_ASYNC_CANCEL IoUringIoOps.
      Parameters:
      flags - the flags.
      userData - the user data that identify a previous submitted IoUringIoOps that should be cancelled. The value to use here is returned by IoRegistration.submit(IoOps).
      data - the data
      Returns:
      ops.
    • newClose

      static IoUringIoOps newClose(int fd, byte flags, short data)
      Returns a new OP_CLOSE IoUringIoOps.
      Parameters:
      fd - the filedescriptor
      flags - the flags.
      data - the data
      Returns:
      ops.
    • newPollAdd

      static IoUringIoOps newPollAdd(int fd, byte flags, int mask, int len, short data)
      Returns a new OP_POLL_ADD IoUringIoOps.
      Parameters:
      fd - the filedescriptor
      flags - the flags.
      mask - the mask.
      len - the len.
      data - the data.
      Returns:
      ops.
    • newSendmsg

      static IoUringIoOps newSendmsg(int fd, byte flags, int msgFlags, long address, short data)
      Returns a new OP_SENDMSG IoUringIoOps.
      Parameters:
      fd - the filedescriptor
      flags - the flags.
      msgFlags - the msg flags.
      data - the data
      Returns:
      ops.
    • newConnect

      static IoUringIoOps newConnect(int fd, byte flags, long remoteMemoryAddress, short data)
      Returns a new OP_CONNECT IoUringIoOps.
      Parameters:
      fd - the filedescriptor
      flags - the flags.
      remoteMemoryAddress - the memory address of the sockaddr_storage.
      data - the data
      Returns:
      ops.
    • newConnect

      static IoUringIoOps newConnect(int fd, byte flags, long remoteMemoryAddress, int addrLen, short data)
      Returns a new OP_CONNECT IoUringIoOps.
      Parameters:
      fd - the filedescriptor
      flags - the flags.
      remoteMemoryAddress - the memory address of the sockaddr_storage.
      addrLen - then remoteMemory storage length.
      data - the data
      Returns:
      ops.
    • newAccept

      static IoUringIoOps newAccept(int fd, byte flags, int acceptFlags, short ioPrio, long acceptedAddressMemoryAddress, long acceptedAddressLengthMemoryAddress, short data)
      Returns a new OP_ACCEPT IoUringIoOps.
      Parameters:
      fd - the filedescriptor
      flags - the flags.
      acceptFlags - the flags for ACCEPT itself
      ioPrio - io_prio
      acceptedAddressMemoryAddress - the memory address of the sockaddr_storage.
      acceptedAddressLengthMemoryAddress - the memory address of the length that will be updated once a new connection was accepted.
      data - the data
      Returns:
      ops.
    • newWritev

      static IoUringIoOps newWritev(int fd, byte flags, int writevFlags, long memoryAddress, int length, short data)
      Returns a new OP_WRITEV IoUringIoOps.
      Parameters:
      fd - the filedescriptor
      flags - the flags.
      writevFlags - the writev flags.
      memoryAddress - the memory address of the io_vec array.
      length - the length of the io_vec array.
      data - the data
      Returns:
      ops.
    • newWrite

      static IoUringIoOps newWrite(int fd, byte flags, int writeFlags, long memoryAddress, int length, short data)
      Returns a new OP_WRITE IoUringIoOps.
      Parameters:
      fd - the filedescriptor
      flags - the flags.
      writeFlags - the write flags.
      memoryAddress - the memory address of the buffer
      length - the length of the buffer.
      data - the data
      Returns:
      ops.
    • newRecv

      static IoUringIoOps newRecv(int fd, byte flags, short ioPrio, int recvFlags, long memoryAddress, int length, short data)
      Returns a new OP_RECV IoUringIoOps.
      Parameters:
      fd - the filedescriptor
      flags - the flags.
      ioPrio - the ioPrio.
      recvFlags - the recv flags.
      memoryAddress - the memory address of the buffer
      length - the length of the buffer.
      data - the data
      Returns:
      ops.
    • newRecv

      static IoUringIoOps newRecv(int fd, byte flags, short ioPrio, int recvFlags, long memoryAddress, int length, short data, short bid)
    • newSendZc

      static IoUringIoOps newSendZc(int fd, long memoryAddress, int length, int flags, long data, int zcFlags)
    • newSendmsgZc

      static IoUringIoOps newSendmsgZc(int fd, byte flags, int msgFlags, long address, long data)
    • newRecvmsg

      static IoUringIoOps newRecvmsg(int fd, byte flags, int msgFlags, long memoryAddress, short data)
      Returns a new OP_RECVMSG IoUringIoOps.
      Parameters:
      fd - the filedescriptor
      flags - the flags.
      msgFlags - the recvmsg flags.
      memoryAddress - the memory address of the msghdr struct
      data - the data
      Returns:
      ops.
    • newSend

      static IoUringIoOps newSend(int fd, byte flags, int sendFlags, long memoryAddress, int length, short data)
      Returns a new OP_SEND IoUringIoOps.
      Parameters:
      fd - the filedescriptor
      flags - the flags.
      sendFlags - the send flags.
      memoryAddress - the memory address of the buffer.
      length - the length of the buffer.
      data - the data
      Returns:
      ops.
    • newShutdown

      static IoUringIoOps newShutdown(int fd, byte flags, int how, short data)
      Returns a new OP_SHUTDOWN IoUringIoOps.
      Parameters:
      fd - the filedescriptor
      flags - the flags.
      how - how the shutdown will be done.
      data - the data
      Returns:
      ops.
    • newSplice

      static IoUringIoOps newSplice(int fd_in, long off_in, int fd_out, long off_out, int nbytes, int splice_flags, short data)
      Returns a new OP_SPLICE IoUringIoOps.
      Parameters:
      fd_in - the filedescriptor
      off_in - the filedescriptor offset
      fd_out - the filedescriptor
      off_out - the filedescriptor offset
      nbytes - splice bytes
      splice_flags - the flag
      data - the data
      Returns:
      ops.