inject adapter context into spaces

This commit is contained in:
Jonathan Shook
2024-10-30 13:09:08 -05:00
parent b969f6927c
commit 919a741fa8
37 changed files with 73 additions and 71 deletions

View File

@@ -132,7 +132,7 @@ public abstract class BaseDriverAdapter<R extends Op, S extends Space> extends N
@Override
public final synchronized ConcurrentSpaceCache<S> getSpaceCache() {
if (spaceCache == null) {
spaceCache = new ConcurrentSpaceCache<S>(getSpaceInitializer(getConfiguration()));
spaceCache = new ConcurrentSpaceCache<S>(this,getSpaceInitializer(getConfiguration()));
}
return spaceCache;
}

View File

@@ -21,12 +21,14 @@ package io.nosqlbench.adapters.api.activityimpl.uniform;
import java.util.function.IntFunction;
import java.util.function.LongFunction;
public class BaseSpace implements Space {
public class BaseSpace<SelfT extends BaseSpace<SelfT> > implements Space {
private final String spaceName;
private final DriverAdapter<?, SelfT> adapter;
public BaseSpace(long idx) {
public BaseSpace(DriverAdapter<?,SelfT> adapter, long idx) {
this.spaceName = String.valueOf(idx);
this.adapter = adapter;
}
@Override