SingleWriterBpfMap - eliminate spurious constructor
Test: TreeHugger Signed-off-by: Maciej Żenczykowski <maze@google.com> Change-Id: I8368e5397ac1e72f8728b0de64f502f0ad1d288e
This commit is contained in:
parent
7eb7d67279
commit
c606f1ab3c
1 changed files with 2 additions and 12 deletions
|
|
@ -61,14 +61,9 @@ public class SingleWriterBpfMap<K extends Struct, V extends Struct> extends BpfM
|
|||
// our code can contain hundreds of items.
|
||||
private final HashMap<K, V> mCache = new HashMap<>();
|
||||
|
||||
protected SingleWriterBpfMap(@NonNull final String path, final int flag, final Class<K> key,
|
||||
public SingleWriterBpfMap(@NonNull final String path, final Class<K> key,
|
||||
final Class<V> value) throws ErrnoException, NullPointerException {
|
||||
super(path, flag, key, value);
|
||||
|
||||
if (flag != BPF_F_RDWR) {
|
||||
throw new IllegalArgumentException(
|
||||
"Using " + getClass().getName() + " for read-only maps does not make sense");
|
||||
}
|
||||
super(path, BPF_F_RDWR, key, value);
|
||||
|
||||
// Populate cache with the current map contents.
|
||||
K currentKey = super.getFirstKey();
|
||||
|
|
@ -78,11 +73,6 @@ public class SingleWriterBpfMap<K extends Struct, V extends Struct> extends BpfM
|
|||
}
|
||||
}
|
||||
|
||||
public SingleWriterBpfMap(@NonNull final String path, final Class<K> key,
|
||||
final Class<V> value) throws ErrnoException, NullPointerException {
|
||||
this(path, BPF_F_RDWR, key, value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized void updateEntry(K key, V value) throws ErrnoException {
|
||||
super.updateEntry(key, value);
|
||||
|
|
|
|||
Loading…
Reference in a new issue