Update netty
This commit is contained in:
parent
c9a12760bc
commit
84c9a2c3cc
10
pom.xml
10
pom.xml
@ -102,11 +102,11 @@
|
||||
<artifactId>guava</artifactId>
|
||||
<version>31.1-jre</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.netty</groupId>
|
||||
<artifactId>netty5-buffer</artifactId>
|
||||
<version>5.0.0.Alpha1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.netty</groupId>
|
||||
<artifactId>netty5-buffer</artifactId>
|
||||
<version>5.0.0.Alpha2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.yaml</groupId>
|
||||
<artifactId>snakeyaml</artifactId>
|
||||
|
@ -1,7 +1,5 @@
|
||||
package it.cavallium.dbengine.database;
|
||||
|
||||
import static io.netty5.buffer.Unpooled.wrappedBuffer;
|
||||
|
||||
import io.netty5.buffer.api.Buffer;
|
||||
import io.netty5.buffer.api.Drop;
|
||||
import io.netty5.buffer.api.Owned;
|
||||
|
@ -809,7 +809,7 @@ public class LLUtils {
|
||||
b1.writerOffset(b1.writerOffset() + b2.readableBytes());
|
||||
return b1;
|
||||
} else {
|
||||
return CompositeBuffer.compose(alloc, b1.send(), b2.send());
|
||||
return alloc.compose(List.of(b1.send(), b2.send()));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -834,7 +834,7 @@ public class LLUtils {
|
||||
b1.writerOffset(b1.writerOffset() + b3.readableBytes());
|
||||
return b1;
|
||||
} else {
|
||||
return CompositeBuffer.compose(alloc, b1.send(), b2.send(), b3.send());
|
||||
return alloc.compose(List.of(b1.send(), b2.send(), b3.send()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -267,8 +267,8 @@ public class CappedWriteBatch extends WriteBatch {
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized void close() {
|
||||
super.close();
|
||||
protected void disposeInternal(boolean owningHandle) {
|
||||
super.disposeInternal(owningHandle);
|
||||
releaseAllBuffers();
|
||||
}
|
||||
}
|
||||
|
@ -1499,7 +1499,11 @@ public class LLLocalKeyValueDatabase implements LLKeyValueDatabase {
|
||||
compressedCache,
|
||||
new ArrayList<>(handles.values().stream().map(RocksObj::v).toList())
|
||||
);
|
||||
handles.values().forEach(ResourceSupport::close);
|
||||
handles.values().forEach(columnFamilyHandleRocksObj -> {
|
||||
if (columnFamilyHandleRocksObj.isAccessible()) {
|
||||
columnFamilyHandleRocksObj.close();
|
||||
}
|
||||
});
|
||||
handles.clear();
|
||||
deleteUnusedOldLogFiles();
|
||||
} catch (RocksDBException e) {
|
||||
|
@ -12,7 +12,7 @@ public class RocksObj<T extends AbstractNativeReference> extends ResourceSupport
|
||||
@Override
|
||||
public void drop(RocksObj obj) {
|
||||
if (obj.val != null) {
|
||||
obj.val.close();
|
||||
if (obj.val.isAccessible()) obj.val.close();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,5 @@
|
||||
package it.cavallium.dbengine.database.serialization;
|
||||
|
||||
import io.netty5.buffer.ByteBufUtil;
|
||||
import io.netty5.buffer.api.Buffer;
|
||||
import io.netty5.buffer.api.BufferAllocator;
|
||||
import io.netty5.buffer.api.Send;
|
||||
|
@ -1,6 +1,5 @@
|
||||
package it.cavallium.dbengine.lucene.directory;
|
||||
|
||||
import io.netty5.buffer.Unpooled;
|
||||
import io.netty5.buffer.api.Buffer;
|
||||
import io.netty5.buffer.api.BufferAllocator;
|
||||
import io.netty5.buffer.api.BufferRef;
|
||||
|
@ -1,7 +1,5 @@
|
||||
package it.cavallium.dbengine.lucene.directory;
|
||||
|
||||
import io.netty5.buffer.ByteBuf;
|
||||
import io.netty5.buffer.ByteBufAllocator;
|
||||
import io.netty5.buffer.api.Buffer;
|
||||
import org.apache.lucene.store.BufferedChecksum;
|
||||
import org.apache.lucene.store.IndexOutput;
|
||||
|
@ -8,7 +8,7 @@ import static it.cavallium.dbengine.SyncUtils.*;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.fail;
|
||||
|
||||
import io.netty5.buffer.PooledByteBufAllocator;
|
||||
import io.netty.buffer.PooledByteBufAllocator;
|
||||
import it.cavallium.dbengine.DbTestUtils.TempDb;
|
||||
import it.cavallium.dbengine.DbTestUtils.TestAllocator;
|
||||
import it.cavallium.dbengine.client.HitKey;
|
||||
|
@ -1,8 +1,5 @@
|
||||
package it.cavallium.dbengine.database.collections;
|
||||
|
||||
import static io.netty5.buffer.Unpooled.wrappedBuffer;
|
||||
|
||||
import io.netty5.buffer.Unpooled;
|
||||
import io.netty5.buffer.api.Buffer;
|
||||
import io.netty5.buffer.api.BufferAllocator;
|
||||
import it.cavallium.dbengine.database.LLUtils;
|
||||
@ -26,11 +23,6 @@ public class TestRanges {
|
||||
alloc = BufferAllocator.offHeapPooled();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDirectBuffer() {
|
||||
Assertions.assertTrue(wrappedBuffer(Unpooled.directBuffer(10, 10), Unpooled.buffer(10, 10)).isDirect());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testNextRangeKey() {
|
||||
testNextRangeKey(new byte[] {0x00, 0x00, 0x00});
|
||||
|
Loading…
Reference in New Issue
Block a user