Skip to content

Commit

Permalink
Replace Sqlite with LMDB
Browse files Browse the repository at this point in the history
  • Loading branch information
stroomdev66 committed Dec 13, 2023
1 parent 05299be commit 97d0914
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@
* This impl uses {@link ArrayBlockingQueue}
*/
@Singleton
public class ByteBufferPoolImpl6 implements ByteBufferPool {
public class ByteBufferPoolImpl implements ByteBufferPool {

private static final LambdaLogger LOGGER = LambdaLoggerFactory.getLogger(ByteBufferPoolImpl6.class);
private static final LambdaLogger LOGGER = LambdaLoggerFactory.getLogger(ByteBufferPoolImpl.class);

// If no count is provided for a buffer size in the config then this value is used.
private static final int DEFAULT_MAX_BUFFERS_PER_QUEUE = 50;
Expand Down Expand Up @@ -100,7 +100,7 @@ public class ByteBufferPoolImpl6 implements ByteBufferPool {
private final int maxOffset;

@Inject
public ByteBufferPoolImpl6(final Provider<ByteBufferPoolConfig> byteBufferPoolConfigProvider) {
public ByteBufferPoolImpl(final Provider<ByteBufferPoolConfig> byteBufferPoolConfigProvider) {

// Don't use a provider as all the props are RequiresRestart and we want system info to
// report on config that matches what we init'd with.
Expand All @@ -114,7 +114,7 @@ public ByteBufferPoolImpl6(final Provider<ByteBufferPoolConfig> byteBufferPoolCo
? OptionalInt.empty()
: pooledByteBufferCounts.keySet()
.stream()
.filter(ByteBufferPoolImpl6::isPowerOf10)
.filter(ByteBufferPoolImpl::isPowerOf10)
.mapToInt(Integer::intValue)
.max();

Expand Down Expand Up @@ -310,7 +310,7 @@ private void unmapBuffer(final ByteBuffer buffer) {
public PooledByteBufferPair getPooledBufferPair(final int minKeyCapacity, final int minValueCapacity) {
final PooledByteBuffer keyBuffer = getBufferByMinCapacity(minKeyCapacity);
final PooledByteBuffer valueBuffer = getBufferByMinCapacity(minValueCapacity);
return new PooledByteBufferPairImpl6(keyBuffer, valueBuffer);
return new PooledByteBufferPairImpl(keyBuffer, valueBuffer);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@
* Wrapper for a pair of {@link ByteBuffer}s obtained from a {@link ByteBufferPool} that can be used
* with a try with resources block as it implements {@link AutoCloseable}.
*/
class PooledByteBufferPairImpl6 implements PooledByteBufferPair {
class PooledByteBufferPairImpl implements PooledByteBufferPair {

private final PooledByteBuffer keyBuffer;
private final PooledByteBuffer valueBuffer;

PooledByteBufferPairImpl6(final PooledByteBuffer keyBuffer,
final PooledByteBuffer valueBuffer) {
PooledByteBufferPairImpl(final PooledByteBuffer keyBuffer,
final PooledByteBuffer valueBuffer) {
this.keyBuffer = keyBuffer;
this.valueBuffer = valueBuffer;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

package stroom.bytebuffer;

import stroom.bytebuffer.impl6.ByteBufferPoolImpl6;
import stroom.bytebuffer.impl6.ByteBufferPoolImpl;
import stroom.util.logging.LogUtil;
import stroom.util.sysinfo.SystemInfoResult;

Expand Down Expand Up @@ -338,12 +338,12 @@ void testSinglePoolPerformance() throws ExecutionException, InterruptedException
List<DynamicTest> comparePerformance() {
final List<ByteBufferPool> byteBufferPools = new ArrayList<>();
byteBufferPools.add(new NonPooledByteBufferPool());
byteBufferPools.add(new ByteBufferPoolImpl());
byteBufferPools.add(new stroom.bytebuffer.ByteBufferPoolImpl());
byteBufferPools.add(new ByteBufferPoolImpl2());
byteBufferPools.add(new ByteBufferPoolImpl3());
byteBufferPools.add(new ByteBufferPoolImpl4(ByteBufferPoolConfig::new));
byteBufferPools.add(new ByteBufferPoolImpl5());
byteBufferPools.add(new ByteBufferPoolImpl6(ByteBufferPoolConfig::new));
byteBufferPools.add(new ByteBufferPoolImpl(ByteBufferPoolConfig::new));
byteBufferPools.add(new JettyByteBufferPool());

final int threads = 10;
Expand Down Expand Up @@ -406,7 +406,7 @@ void testPoolPerformanceComparison() throws ExecutionException, InterruptedExcep

final ExecutorService executorService = Executors.newFixedThreadPool(threads);
final ByteBufferPool nonPooledByteBufferPool = new NonPooledByteBufferPool();
final ByteBufferPool byteBufferPool = new ByteBufferPoolImpl();
final ByteBufferPool byteBufferPool = new stroom.bytebuffer.ByteBufferPoolImpl();
final ByteBufferPool byteBufferPool2 = new ByteBufferPoolImpl2();
final ByteBufferPool byteBufferPool3 = new ByteBufferPoolImpl3();
final ByteBufferPool byteBufferPool4 = new ByteBufferPoolImpl4(ByteBufferPoolConfig::new);
Expand Down

0 comments on commit 97d0914

Please sign in to comment.