我对OrientDB比较陌生。 我想将几个CSV文件加载到OrientDb。我将其中一个文件作为顶点加载并且工作正常,类似地,当我尝试加载另一个文件时,抛出以下异常
com.orientechnologies.orient.core.exception.OStorageException:无法打开本地 存储'../databases/AABbd',模式= rw
引起:com.orientechnologies.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"}
]
}
}
}
我用命令执行了json文件 G:\ orientdb社区 - 进口商-2.2.29 \ BIN> oetl.bat /AAB/Members.json 创建了数据库AABdb和Vertex成员。
我要创建的第二个顶点是付款人顶点,相关的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社区 - 进口商-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
---------编辑----------------------------
当我尝试使用第二个json文件(Payer.json)创建一个新的数据库时,会创建一个带有顶点付款人的新数据库,它只是在已经存在的数据库中创建了一个新的顶点。
任何帮助将不胜感激。谢谢
答案 0 :(得分:4)
文件有不同的名称成员-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进行导入,或者您的服务器已关闭,但您已通过控制台连接....
希望有所帮助
此致