我正在尝试使用Orient DB v2.2.37创建的Orient DB 3.0.18打开数据库,但是输出错误“没有名称压缩'snappy'的错误”。如何使用Orient V3注册快速压缩?我在maven POM中尝试了org.xerial.snappy,但没有快乐。提前致谢。
2019-04-22 21:44:20 t.c.s.a.d.Services [DEBUG] error:stop:com.orientechnologies.orient.core.exception.OSecurityException: Compression with name 'snappy' is absent
com.orientechnologies.orient.core.exception.OSecurityException: Compression with name 'snappy' is absent
at com.orientechnologies.orient.core.compression.OCompressionFactory.getCompression(OCompressionFactory.java:79)
at com.orientechnologies.orient.core.storage.cluster.v0.OPaginatedClusterV0.init(OPaginatedClusterV0.java:1547)
at com.orientechnologies.orient.core.storage.cluster.v0.OPaginatedClusterV0.configure(OPaginatedClusterV0.java:154)
at com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage.createClusterFromConfig(OAbstractPaginatedStorage.java:4804)
at com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage.openClusters(OAbstractPaginatedStorage.java:519)
at com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage.open(OAbstractPaginatedStorage.java:388)
at com.orientechnologies.orient.core.db.OrientDBEmbedded.open(OrientDBEmbedded.java:281)
at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.open(ODatabaseDocumentTx.java:903)
at com.orientechnologies.orient.core.db.OPartitionedDatabasePool$DatabaseDocumentTxPooled.internalOpen(OPartitionedDatabasePool.java:440)
at com.orientechnologies.orient.core.db.OPartitionedDatabasePool.openDatabase(OPartitionedDatabasePool.java:303)
at com.orientechnologies.orient.core.db.OPartitionedDatabasePool.acquire(OPartitionedDatabasePool.java:261)
at com.tinkerpop.blueprints.impls.orient.OrientBaseGraph.<init>(OrientBaseGraph.java:172)
at com.tinkerpop.blueprints.impls.orient.OrientTransactionalGraph.<init>(OrientTransactionalGraph.java:78)
at com.tinkerpop.blueprints.impls.orient.OrientGraph.<init>(OrientGraph.java:137)
at com.tinkerpop.blueprints.impls.orient.OrientGraphFactory$1.getGraph(OrientGraphFactory.java:87)
at com.tinkerpop.blueprints.impls.orient.OrientGraphFactory.getTx(OrientGraphFactory.java:224)
在嵌入模式下使用Orient DB的分辨率如下:
1)从Orient DB Github repo下载OSnappyCompression.java并将其合并到您的项目中
2)将以下lib添加到Maven pom.xml中
<dependency>
<groupId>org.xerial.snappy</groupId>
<artifactId>snappy-java</artifactId>
<version>1.1.7.3</version>
</dependency>
3)在启动Orient DB之前注册Snappy压缩方法如下
OCompressionFactory.INSTANCE.register(new OSnappyCompression());
不幸的是,这种压缩被删除了。您必须将数据库转换为非压缩版本。