Orient DB 3.0.18:缺少名称 'snappy' 的压缩

Orient DB 3.0.18: Compression with name 'snappy' is absent

我正在尝试使用 Orient DB v2.2.37 创建的 Orient DB 3.0.18 打开数据库,但是出现错误 "Compression with name 'snappy' is absent is outputted"。如何使用 Orient V3 注册 snappy 压缩?我在 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.getGraph(OrientGraphFactory.java:87)
    at com.tinkerpop.blueprints.impls.orient.OrientGraphFactory.getTx(OrientGraphFactory.java:224)

很遗憾,此压缩已删除。您必须将数据库转换为非压缩版本。

Orient DB嵌入模式解决方法如下:

1) 从 Orient DB Github 存储库下载 OSnappyCompression.java 并合并到您的项目中

2) 将以下库添加到您的 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());