0

我对 OrientDB 比较陌生。我想将几个 CSV 文件加载到 OrientDb。我将其中一个文件加载为顶点,它工作正常,同样,当我尝试加载另一个文件时,抛出以下异常

com.orientechnologies.orient.core.exception.OStorageException:无法使用 mode=rw 打开本地存储“../databases/AABbd”

原因:com.orienttechnologies.orient.core.exception.OStorageException:无法打开存储它被其他进程获取

第一个文件 (member-gm.csv) 包含如下所示的值

MEMBERID,ENROLLBEGINDATE,ENROLLENDDATE,Dental,Drug,MHInpt,MHDN,MHAMB,CDInpt,CDDN,CDAMB,Hospice,Payer,PEFlag,Ind
95000,20141118,20160328,Y,Y,Y,Y,Y,Y,Y,Y,N,MCS,N,A
95001,20150225,20181231,Y,N,Y,Y,Y,Y,Y,Y,N,POS,N,A
95002,20150607,20160620,Y,Y,Y,Y,Y,Y,Y,Y,N,MLI,N,

为加载上述文件而创建的 Json(Members.json) 文件是

{
  "source": { "file": { "path": "/G:/AAB/member-gm.csv" } },  
  "extractor": { "csv": { "columns":    ["MEMBERID","Gender","DOB","LName","FName","MMidName","SubID","Add1","Add2","City","State","MZip","MPhone","PFirstName","PMidName","PLastName","Race","Ethn","RaceDS","EthnDS","SpokenLang","SpokenLangSource","WrittenLang","WrittenLangSource","OtherLang","OtherSource"],
       "columnsOnFirstLine": true } },
"transformers": [
{ "vertex": { "class": "Member" } }
],
"loader": {
"orientdb": {
   "dbURL": "plocal:../databases/AABbd",
   "dbType": "graph",
   "classes": [
     {"name": "Member", "extends": "V"}
    ]
  }
 }
} 

我使用命令 G:\orientdb-community-importers-2.2.29\bin> oetl.bat /AAB/Members.json 执行了 json 文件, 并创建了数据库 AABdb 和顶点成员。

我要创建的第二个顶点是付款人顶点,相关的 csv(Payer_category.csv) 如下

ID,Payer_Line,Payer_Name,Input_Payer,Output_payer
1,Medicaid,Medicaid,MMP,MCD
2,Medicare,Medicaid Dual Eligible HMO,MDE,MCR
3,Medicaid,Medicaid Dual Eligible HMO,MDE,MCD

相关 Payer.json 文件包含

{
  "source": { "file": { "path": "/G:/AAB/Payer_category.csv" } },  
  "extractor": { "csv": { "columns": ["ID","Payer_Line","Payer_Name","Input_Payer","Output_payer"],
                            "columnsOnFirstLine": true } },
  "transformers": [
    { "vertex": { "class": "Payer" } }
  ],
  "loader": {
    "orientdb": {
       "dbURL": "plocal:../databases/AABbd",
       "dbType": "graph",
       "classes": [
         {"name": "Payer", "extends": "V"}
       ]
    }
  }
}

当我执行 G:\orientdb-community-importers-2.2.29\bin> oetl.bat /AAB/Payer.json 抛出以下错误

G:\orientdb-community-importers-2.2.29\bin>oetl.bat /AAB/Payer.json
OrientDB etl v.2.2.29 (build 9914189f972103907c24377a1567897e68642920) 
https://www.orientdb.com
[file] INFO Load from file /G:/AAB/Payer_category.csv
[csv] INFO column types: {Payer_Name=ANY, Payer_Line=ANY, ID=ANY, Input_Payer=AN
Y, Output_payer=ANY}
[orientdb] INFO Opening database 'plocal:../databases/AABbd'...
$ANSI{green {db=AABbd}} Exception `3023DF74` in storage `AABbd`
com.orientechnologies.orient.core.exception.OStorageException: Cannot open local
 storage '../databases/AABbd' with mode=rw
    DB name="AABbd"
    at com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginat
edStorage.open(OAbstractPaginatedStorage.java:304)
    at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.ope
n(ODatabaseDocumentTx.java:259)
    at com.orientechnologies.orient.etl.loader.OOrientDBLoader.configureDocu
mentDB(OOrientDBLoader.java:400)
    at com.orientechnologies.orient.etl.loader.OOrientDBLoader.configure(OOr
ientDBLoader.java:343)
    at com.orientechnologies.orient.etl.OETLProcessor.configureComponent(OET
LProcessor.java:470)
    at com.orientechnologies.orient.etl.OETLProcessor.configureLoader(OETLPr
ocessor.java:291)
    at com.orientechnologies.orient.etl.OETLProcessor.parse(OETLProcessor.ja
va:223)
    at com.orientechnologies.orient.etl.OETLProcessor.parse(OETLProcessor.ja
va:187)
    at com.orientechnologies.orient.etl.OETLProcessor.parseConfigAndParamete
rs(OETLProcessor.java:155)
    at com.orientechnologies.orient.etl.OETLProcessor.main(OETLProcessor.jav
a:119)
Caused by: com.orientechnologies.orient.core.exception.OStorageException: Cannot
 open storage it is acquired by other process
    DB name="AABbd"
    at com.orientechnologies.orient.core.storage.impl.local.paginated.OPagin
atedStorageDirtyFlag.lockFile(OPaginatedStorageDirtyFlag.java:96)
    at com.orientechnologies.orient.core.storage.impl.local.paginated.OPagin
atedStorageDirtyFlag.open(OPaginatedStorageDirtyFlag.java:129)
    at com.orientechnologies.orient.core.storage.impl.local.paginated.OLocal
PaginatedStorage.preOpenSteps(OLocalPaginatedStorage.java:424)
    at com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginat
edStorage.open(OAbstractPaginatedStorage.java:258)
    ... 9 more
Exception in thread "main" com.orientechnologies.orient.core.exception.OConfigur
ationException: Error on creating ETL processor
    at com.orientechnologies.orient.etl.OETLProcessor.parse(OETLProcessor.ja
va:239)
    at com.orientechnologies.orient.etl.OETLProcessor.parse(OETLProcessor.ja
va:187)
    at com.orientechnologies.orient.etl.OETLProcessor.parseConfigAndParamete
rs(OETLProcessor.java:155)
    at com.orientechnologies.orient.etl.OETLProcessor.main(OETLProcessor.jav
a:119)
Caused by: com.orientechnologies.orient.core.exception.OStorageException: Cannot
 open local storage '../databases/AABbd' with mode=rw
    DB name="AABbd"
    at com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginat
edStorage.open(OAbstractPaginatedStorage.java:304)
    at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.ope
n(ODatabaseDocumentTx.java:259)
    at com.orientechnologies.orient.etl.loader.OOrientDBLoader.configureDocu
mentDB(OOrientDBLoader.java:400)
    at com.orientechnologies.orient.etl.loader.OOrientDBLoader.configure(OOr
ientDBLoader.java:343)
    at com.orientechnologies.orient.etl.OETLProcessor.configureComponent(OET
LProcessor.java:470)
    at com.orientechnologies.orient.etl.OETLProcessor.configureLoader(OETLPr
ocessor.java:291)
    at com.orientechnologies.orient.etl.OETLProcessor.parse(OETLProcessor.ja
va:223)
    ... 3 more
Caused by: com.orientechnologies.orient.core.exception.OStorageException: Cannot
 open storage it is acquired by other process
    DB name="AABbd"
    at com.orientechnologies.orient.core.storage.impl.local.paginated.OPagin
atedStorageDirtyFlag.lockFile(OPaginatedStorageDirtyFlag.java:96)
    at com.orientechnologies.orient.core.storage.impl.local.paginated.OPagin
atedStorageDirtyFlag.open(OPaginatedStorageDirtyFlag.java:129)
    at com.orientechnologies.orient.core.storage.impl.local.paginated.OLocal
PaginatedStorage.preOpenSteps(OLocalPaginatedStorage.java:424)
    at com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginat
edStorage.open(OAbstractPaginatedStorage.java:258)
    ... 9 more
  • 所有这些都直接在服务器上完成。
  • 我也尝试使用 dbUsername 和 dbPassword 属性,结果是一样的

- - - - -编辑 - - - - - - - - - - - - - -

当我尝试使用第二个 json 文件(Payer.json)创建一个新数据库时,会创建一个带有顶点 Payer 的新数据库,这只是在一个已经存在的数据库中没有创建一个新顶点。


任何帮助都感激不尽。谢谢

4

1 回答 1

4

文件具有不同的名称 member-gm.csv member-en.csv 是否正常?我尝试了这个案例,它工作正常,顺便说一下,这个错误:

com.orientechnologies.orient.core.exception.OStorageException: Cannot open local storage '../databases/AABbd' with mode=rw

Caused by: com.orientechnologies.orient.core.exception.OStorageException: Cannot open storage it is acquired by other process 

这可能是由于服务器已启动并正在运行,而您正在使用 plocal 进行导入,或者您的服务器已关闭但您已通过控制台连接....

希望能帮助到你

问候

于 2017-10-26T23:57:36.833 回答