Package one.nio.os.bpf
Class BpfMap
- java.lang.Object
-
- one.nio.os.bpf.Handle
-
- one.nio.os.bpf.BpfObj
-
- one.nio.os.bpf.BpfMap
-
- All Implemented Interfaces:
Closeable,AutoCloseable
public class BpfMap extends BpfObj implements Closeable
-
-
Field Summary
Fields Modifier and Type Field Description static intARRAY_KEY_SIZEstatic intCPUSintflagsintkeySizeintmaxEntriesinttotalValueSizeMapTypetypeintvalueSize-
Fields inherited from class one.nio.os.bpf.BpfObj
id, MAX_NAME_LEN, name
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ByteBufferbytes(byte[] value)static byte[]bytes(int i)static byte[]bytes(long i)byte[]get(byte[] key)booleanget(byte[] key, byte[] result)protected booleanget(byte[] key, byte[] result, int flags)static Iterable<Integer>getAllIds()static BpfMapgetByFd(int fd)static BpfMapgetById(int id)static BpfMapgetPinned(String path)static IntBufferints(byte[] value)Iterable<byte[]>keys()static LongBufferlongs(byte[] value)static BpfMapnewMap(MapType type, int keySize, int valueSize, int maxEntries, String name, int flags)static BpfMapnewMapOfMaps(MapType type, int keySize, int maxEntries, String name, int flags, BpfMap innerMap)static BpfMapnewPerfEventArray(String name, int flags)booleanput(byte[] key, byte[] value)protected booleanput(byte[] key, byte[] value, int flags)booleanputIfAbsent(byte[] key, byte[] value)booleanputIfPresent(byte[] key, byte[] value)booleanremove(byte[] key)BpfMapsynchronizedMap()
-
-
-
Field Detail
-
CPUS
public static final int CPUS
-
ARRAY_KEY_SIZE
public static final int ARRAY_KEY_SIZE
- See Also:
- Constant Field Values
-
type
public final MapType type
-
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
-
-
Method Detail
-
get
public boolean get(byte[] key, byte[] result) throws IOException- Throws:
IOException
-
get
protected boolean get(byte[] key, byte[] result, int flags) throws IOException- Throws:
IOException
-
get
public byte[] get(byte[] key) throws IOException- Throws:
IOException
-
put
public boolean put(byte[] key, byte[] value) throws IOException- Throws:
IOException
-
putIfAbsent
public boolean putIfAbsent(byte[] key, byte[] value) throws IOException- Throws:
IOException
-
putIfPresent
public boolean putIfPresent(byte[] key, byte[] value) throws IOException- Throws:
IOException
-
put
protected boolean put(byte[] key, byte[] value, int flags) throws IOException- Throws:
IOException
-
remove
public boolean remove(byte[] key) throws IOException- Throws:
IOException
-
keys
public Iterable<byte[]> keys()
-
synchronizedMap
public BpfMap synchronizedMap()
-
getPinned
public static BpfMap getPinned(String path) throws IOException
- Throws:
IOException
-
getById
public static BpfMap getById(int id) throws IOException
- Throws:
IOException
-
getByFd
public static BpfMap getByFd(int fd) throws IOException
- Throws:
IOException
-
newMap
public static BpfMap newMap(MapType type, int keySize, int valueSize, int maxEntries, String name, int flags) throws IOException
- Throws:
IOException
-
newMapOfMaps
public static BpfMap newMapOfMaps(MapType type, int keySize, int maxEntries, String name, int flags, BpfMap innerMap) throws IOException
- Throws:
IOException
-
newPerfEventArray
public static BpfMap newPerfEventArray(String name, int flags) throws IOException
- Throws:
IOException
-
bytes
public static byte[] bytes(int i)
-
bytes
public static byte[] bytes(long i)
-
bytes
public static ByteBuffer bytes(byte[] value)
-
ints
public static IntBuffer ints(byte[] value)
-
longs
public static LongBuffer longs(byte[] value)
-
-