Class BpfMap

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable
    Direct Known Subclasses:
    BpfMap.SynchronizedBpfMap

    public class BpfMap
    extends BpfObj
    implements java.io.Closeable
    • Field Detail

      • CPUS

        public static final int CPUS
      • keySize

        public final int keySize
      • valueSize

        public final int valueSize
      • totalValueSize

        public final int totalValueSize
      • maxEntries

        public final int maxEntries
      • flags

        public final int flags
    • Constructor Detail

      • BpfMap

        BpfMap​(MapType type,
               int id,
               java.lang.String name,
               int keySize,
               int valueSize,
               int maxEntries,
               int flags,
               int fd)
    • Method Detail

      • roundUp

        private static int roundUp​(int valueSize)
      • get

        public boolean get​(byte[] key,
                           byte[] result)
                    throws java.io.IOException
        Throws:
        java.io.IOException
      • get

        protected boolean get​(byte[] key,
                              byte[] result,
                              int flags)
                       throws java.io.IOException
        Throws:
        java.io.IOException
      • get

        public byte[] get​(byte[] key)
                   throws java.io.IOException
        Throws:
        java.io.IOException
      • put

        public boolean put​(byte[] key,
                           byte[] value)
                    throws java.io.IOException
        Throws:
        java.io.IOException
      • putIfAbsent

        public boolean putIfAbsent​(byte[] key,
                                   byte[] value)
                            throws java.io.IOException
        Throws:
        java.io.IOException
      • putIfPresent

        public boolean putIfPresent​(byte[] key,
                                    byte[] value)
                             throws java.io.IOException
        Throws:
        java.io.IOException
      • put

        protected boolean put​(byte[] key,
                              byte[] value,
                              int flags)
                       throws java.io.IOException
        Throws:
        java.io.IOException
      • remove

        public boolean remove​(byte[] key)
                       throws java.io.IOException
        Throws:
        java.io.IOException
      • keys

        public java.lang.Iterable<byte[]> keys()
      • synchronizedMap

        public BpfMap synchronizedMap()
      • getPinned

        public static BpfMap getPinned​(java.lang.String path)
                                throws java.io.IOException
        Throws:
        java.io.IOException
      • getById

        public static BpfMap getById​(int id)
                              throws java.io.IOException
        Throws:
        java.io.IOException
      • getByFd

        public static BpfMap getByFd​(int fd)
                              throws java.io.IOException
        Throws:
        java.io.IOException
      • newMap

        public static BpfMap newMap​(MapType type,
                                    int keySize,
                                    int valueSize,
                                    int maxEntries,
                                    java.lang.String name,
                                    int flags)
                             throws java.io.IOException
        Throws:
        java.io.IOException
      • newMapOfMaps

        public static BpfMap newMapOfMaps​(MapType type,
                                          int keySize,
                                          int maxEntries,
                                          java.lang.String name,
                                          int flags,
                                          BpfMap innerMap)
                                   throws java.io.IOException
        Throws:
        java.io.IOException
      • newPerfEventArray

        public static BpfMap newPerfEventArray​(java.lang.String name,
                                               int flags)
                                        throws java.io.IOException
        Throws:
        java.io.IOException
      • checkKeyLength

        private void checkKeyLength​(int length)
      • checkTotalValueLength

        private void checkTotalValueLength​(int length)
      • getAllIds

        public static java.lang.Iterable<java.lang.Integer> getAllIds()
      • bytes

        public static byte[] bytes​(int i)
      • bytes

        public static byte[] bytes​(long i)
      • bytes

        public static java.nio.ByteBuffer bytes​(byte[] value)
      • ints

        public static java.nio.IntBuffer ints​(byte[] value)
      • longs

        public static java.nio.LongBuffer longs​(byte[] value)