Skip to content

Commit f97b960

Browse files
OGraphDatabase was removed. Graph tests for remote storage were temporary disabled.
1 parent e6da745 commit f97b960

32 files changed

Lines changed: 403 additions & 2757 deletions

build.xml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
<fileset dir="server" includes="build.xml"/>
3232
<fileset dir="distributed" includes="build.xml"/>
3333
<fileset dir="tools" includes="build.xml"/>
34+
<fileset dir="graphdb" includes="build.xml"/>
3435
<fileset dir="tests" includes="build.xml"/>
3536
</subant>
3637

@@ -128,12 +129,6 @@
128129

129130
<target name="install" depends="init">
130131
<delegate target="install"/>
131-
<subant target="install">
132-
<property name="global.lib" value="../${community.release}/lib"/>
133-
<property name="version" value="${version}"/>
134-
135-
<fileset dir="graphdb" includes="build.xml"/>
136-
</subant>
137132

138133
<copy todir="${community.release}/" flatten="true">
139134
<fileset dir="." includes="*.txt"/>

core/src/main/java/com/orientechnologies/orient/core/command/script/OScriptGraphDatabaseWrapper.java

Lines changed: 0 additions & 248 deletions
This file was deleted.

core/src/main/java/com/orientechnologies/orient/core/command/script/OScriptManager.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,6 @@ public Bindings bind(final Bindings binding, final ODatabaseRecordTx db, final O
183183
if (db != null) {
184184
// BIND FIXED VARIABLES
185185
binding.put("db", new OScriptDocumentDatabaseWrapper(db));
186-
binding.put("gdb", new OScriptGraphDatabaseWrapper(db));
187186
binding.put("orient", new OScriptOrientWrapper(db));
188187
}
189188
binding.put("util", new OFunctionUtilWrapper(null));

core/src/main/java/com/orientechnologies/orient/core/db/ODatabaseFactory.java

Lines changed: 29 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@
2222

2323
import com.orientechnologies.common.log.OLogManager;
2424
import com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx;
25-
import com.orientechnologies.orient.core.db.graph.OGraphDatabase;
25+
import com.orientechnologies.orient.core.metadata.schema.OClass;
2626
import com.orientechnologies.orient.core.storage.OStorage;
27+
import com.orientechnologies.orient.core.type.tree.provider.OMVRBTreeRIDProvider;
2728

2829
/**
2930
* Factory to create high-level ODatabase instances. The global instance is managed by Orient class.
@@ -96,21 +97,36 @@ public synchronized void shutdown() {
9697
}
9798

9899
public ODatabaseDocumentTx createDatabase(final String iType, final String url) {
99-
if ("graph".equals(iType))
100-
return new OGraphDatabase(url);
101-
else
102-
return new ODatabaseDocumentTx(url);
103-
}
100+
if (iType.equals("graph"))
101+
return new ODatabaseDocumentTx(url) {
102+
@Override
103+
public <THISDB extends ODatabase> THISDB create() {
104+
final THISDB db = super.create();
104105

105-
public ODatabaseDocumentTx createObjectDatabase(final String url) {
106-
return new ODatabaseDocumentTx(url);
107-
}
106+
checkSchema();
108107

109-
public OGraphDatabase createGraphDatabase(final String url) {
110-
return new OGraphDatabase(url);
111-
}
108+
return db;
109+
}
110+
111+
private void checkSchema() {
112+
getMetadata().getSchema().getOrCreateClass(OMVRBTreeRIDProvider.PERSISTENT_CLASS_NAME);
113+
114+
OClass vertexBaseClass = getMetadata().getSchema().getClass("V");
115+
OClass edgeBaseClass = getMetadata().getSchema().getClass("E");
116+
117+
if (vertexBaseClass == null) {
118+
// CREATE THE META MODEL USING THE ORIENT SCHEMA
119+
vertexBaseClass = getMetadata().getSchema().createClass("V");
120+
vertexBaseClass.setOverSize(2);
121+
}
122+
123+
if (edgeBaseClass == null) {
124+
edgeBaseClass = getMetadata().getSchema().createClass("E");
125+
edgeBaseClass.setShortName("E");
126+
}
127+
}
128+
};
112129

113-
public ODatabaseDocumentTx createDocumentDatabase(final String url) {
114130
return new ODatabaseDocumentTx(url);
115131
}
116132
}

0 commit comments

Comments
 (0)