private OServer _server;
public static void main(String[] args) {
new EmbeddedServer(args[0]);
}
public EmbeddedServer(String nodeName) {
try {
_server = OServerMain.create();
_server.startup(
"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>"
+ "<orient-server>"
+ "<handlers>"
+ " <handler class=\"com.orientechnologies.orient.graph.handler.OGraphServerHandler\">\n" +
" <parameters>\n" +
" <parameter value=\"true\" name=\"enabled\"/>\n" +
" <parameter value=\"50\" name=\"graph.pool.max\"/>\n" +
" </parameters>\n" +
" </handler>\n"
+ " <handler class=\"com.orientechnologies.orient.server.handler.OServerSideScriptInterpreter\">\n" +
" <parameters>\n" +
" <parameter value=\"true\" name=\"enabled\"/>\n" +
" <parameter value=\"SQL\" name=\"allowedLanguages\"/>\n" +
" </parameters>\n" +
" </handler>\n"
+ " <handler class=\"com.orientechnologies.orient.server.token.OrientTokenHandler\">\n" +
" <parameters>\n" +
" <parameter value=\"false\" name=\"enabled\"/>\n" +
" <parameter value=\"\" name=\"oAuth2Key\"/>\n" +
" <parameter value=\"60\" name=\"sessionLength\"/>\n" +
" <parameter value=\"HmacSHA256\" name=\"encryptionAlgorithm\"/>\n" +
" </parameters>\n" +
" </handler>\n"
+ "<handler class=\"com.orientechnologies.orient.server.hazelcast.OHazelcastPlugin\">"
+ "<parameters>"
+ "<parameter value=\"Z:/OrientDBTest/config/default-distributed-db-config.json\" name=\"configuration.db.default\"/>"
+ "<parameter value=\"Z:/OrientDBTest/config/hazelcast.xml\" name=\"configuration.hazelcast\"/>"
+ "<parameter value=\""+nodeName+"\" name=\"nodeName\"/>"
+ "</parameters>"
+ "</handler>"
+ "</handlers>"
+ "<network>"
+ "<protocols>"
+ "<protocol name=\"binary\" implementation=\"com.orientechnologies.orient.server.network.protocol.binary.ONetworkProtocolBinary\"/>"
+ "<protocol name=\"http\" implementation=\"com.orientechnologies.orient.server.network.protocol.http.ONetworkProtocolHttpDb\"/>"
+ "</protocols>"
+ "<listeners>"
+ "<listener ip-address=\"0.0.0.0\" port-range=\"2424-2430\" protocol=\"binary\"/>"
+ "<listener ip-address=\"0.0.0.0\" port-range=\"2480-2490\" protocol=\"http\"/>"
+ "</listeners>"
+ "</network>"
+ "<users>"
+ "<user name=\"root\" password=\"asdf123$\" resources=\"*\"/>"
+ "</users>"
+ "<properties>"
+ " <entry value=\"1\" name=\"db.pool.min\"/>\n" +
" <entry value=\"50\" name=\"db.pool.max\"/>\n" +
" <entry value=\"true\" name=\"profiler.enabled\"/>"
+ " <entry name=\"log.console.level\" value=\"info\"/>"
+ " <entry name=\"log.file.level\" value=\"fine\"/>"
+ "</properties>"
+ "</orient-server>");
_server.activate();
} catch (Exception e) {
e.printStackTrace();
}
}
apply plugin: 'java'
sourceCompatibility = 1.7
version = '1.0'
repositories {
mavenCentral()
}
jar {
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
}
dependencies {
compile 'com.orientechnologies:orientdb-graphdb:2.0.6'
compile 'com.orientechnologies:orientdb-core:2.0.6'
compile 'com.orientechnologies:orientdb-client:2.0.6'
compile 'com.orientechnologies:orientdb-distributed:2.0.6'
compile 'com.orientechnologies:orientdb-server:2.0.6'
compile 'com.orientechnologies:orientdb-enterprise:2.0.6'
}
public class CreateDbEntry {
public static void main(String[] args) {
OServerAdmin server = null;
try {
server = new OServerAdmin("remote:"+args[0]+"/graphdb");
server.connect("root", "asdf123$");
if (!server.existsDatabase("plocal"))
server.createDatabase("graph", "plocal");
server.close(true);
if (server.isConnected()) {
System.out.println("We're still connected after the close()?");
}
else {
System.out.println("Database Created!");
}
} catch (IOException e) {
e.printStackTrace();
}
}
}
OrientGraphFactory factory = new OrientGraphFactory("remote:"+database+"/graphdb", "root", "asdf123$").setupPool(1, 20);
OrientGraphNoTx graph = factory.getNoTx();
String readQuery = String.format("select from " +
"(traverse OUT('reports'), OUT('followed_by'), OUT('direct_use') from (select from JobRecord where test_id=%d)) " +
"where @class='Artifact'", i);
List artifacts = graph.getRawGraph().command(new OCommandSQL(readQuery)).execute();
OrientGraphFactory factory = new OrientGraphFactory("remote:"+database+"/graphdb", "root", "asdf123$").setupPool(1, 20);
OrientGraphNoTx graph = factory.getNoTx();
String deleteQuery = String.format("delete vertex from " +
"(traverse OUT('reports'), OUT('followed_by') from (select from JobRecord where test_id=%d))", i);
int no = graph.getRawGraph().command(new OCommandSQL(deleteQuery)).execute();
2015-04-10 14:31:38:780 INFO [node1] received new status node1.graphdb=ONLINE [OHazelcastPlugin]Sent run-time exception to the client /127.0.0.1:51399: com.or
ientechnologies.orient.core.exception.OQueryParsingException: Error on parsing query at position #111: Error on parsing query
Query: (traverse OUT('reports'), OUT('followed_by'), OUT('direct_use') from (select from JobRecord where test_id=0)) where @class='Artifact'
--------------------------------------------------------------------------------------------------------------------^
com.orientechnologies.orient.core.exception.OQueryParsingException: Error on parsing query at position #111: Error on parsing query
Query: (traverse OUT('reports'), OUT('followed_by'), OUT('direct_use') from (select from JobRecord where test_id=0)) where @class='Artifact'
--------------------------------------------------------------------------------------------------------------------^
at com.orientechnologies.orient.core.sql.filter.OSQLTarget.<init>(OSQLTarget.java:76)
at com.orientechnologies.orient.core.sql.OSQLEngine.parseTarget(OSQLEngine.java:440)
at com.orientechnologies.orient.core.sql.OCommandExecutorSQLSelect.parse(OCommandExecutorSQLSelect.java:218)
at com.orientechnologies.orient.core.sql.OCommandExecutorSQLSelect.parse(OCommandExecutorSQLSelect.java:96)
at com.orientechnologies.orient.core.sql.OCommandExecutorSQLDelegate.parse(OCommandExecutorSQLDelegate.java:56)
at com.orientechnologies.orient.core.sql.OCommandExecutorSQLDelegate.parse(OCommandExecutorSQLDelegate.java:37)
at com.orientechnologies.orient.server.distributed.ODistributedStorage.command(ODistributedStorage.java:223)
at com.orientechnologies.orient.core.command.OCommandRequestTextAbstract.execute(OCommandRequestTextAbstract.java:63)
at com.orientechnologies.orient.server.network.protocol.binary.ONetworkProtocolBinary.command(ONetworkProtocolBinary.java:1178)
at com.orientechnologies.orient.server.network.protocol.binary.ONetworkProtocolBinary.executeRequest(ONetworkProtocolBinary.java:385)
at com.orientechnologies.orient.server.network.protocol.binary.OBinaryNetworkProtocolAbstract.execute(OBinaryNetworkProtocolAbstract.java:220)
at com.orientechnologies.common.thread.OSoftThread.run(OSoftThread.java:69)
Caused by: com.orientechnologies.orient.core.sql.OCommandSQLParsingException: Error on parsing command at position #0: No function with name 'out', available n
ames are : [date,encode,distance,document,distinct,traversedelement,sum,decode,uuid,mode,sysdate,avg,min,traversededge,ifnull,traversedvertex,stddev,if,map,uni
onall,set,intersect,last,max,coalesce,count,format,list,eval,percentile,median,variance,difference,first]
at com.orientechnologies.orient.core.sql.OSQLEngine.getFunction(OSQLEngine.java:399)
at com.orientechnologies.orient.core.sql.functions.OSQLFunctionRuntime.setRoot(OSQLFunctionRuntime.java:202)
at com.orientechnologies.orient.core.sql.filter.OSQLFilterItemAbstract.<init>(OSQLFilterItemAbstract.java:61)
at com.orientechnologies.orient.core.sql.functions.OSQLFunctionRuntime.<init>(OSQLFunctionRuntime.java:55)
at com.orientechnologies.orient.core.sql.OSQLHelper.getFunction(OSQLHelper.java:220)
at com.orientechnologies.orient.core.sql.OSQLHelper.parseValue(OSQLHelper.java:198)
at com.orientechnologies.orient.core.sql.OCommandExecutorSQLTraverse.parseFields(OCommandExecutorSQLTraverse.java:209)
at com.orientechnologies.orient.core.sql.OCommandExecutorSQLTraverse.parse(OCommandExecutorSQLTraverse.java:70)
at com.orientechnologies.orient.core.sql.OCommandExecutorSQLTraverse.parse(OCommandExecutorSQLTraverse.java:55)
at com.orientechnologies.orient.core.sql.OCommandExecutorSQLDelegate.parse(OCommandExecutorSQLDelegate.java:56)
at com.orientechnologies.orient.core.sql.filter.OSQLTarget.extractTargets(OSQLTarget.java:177)
at com.orientechnologies.orient.core.sql.filter.OSQLTarget.<init>(OSQLTarget.java:67)
... 11 more
Sent run-time exception to the client /127.0.0.1:51704: com.orientechnologies.orient.core.command.OCommandExecutorNotFoundException: Cannot find a command exec
utor for the command request: sql.create vertex
com.orientechnologies.orient.core.command.OCommandExecutorNotFoundException: Cannot find a command executor for the command request: sql.create vertex
at com.orientechnologies.orient.core.sql.OCommandExecutorSQLDelegate.parse(OCommandExecutorSQLDelegate.java:52)
at com.orientechnologies.orient.core.sql.OCommandExecutorSQLDelegate.parse(OCommandExecutorSQLDelegate.java:37)
at com.orientechnologies.orient.server.distributed.ODistributedStorage.command(ODistributedStorage.java:223)
at com.orientechnologies.orient.core.command.OCommandRequestTextAbstract.execute(OCommandRequestTextAbstract.java:63)
at com.orientechnologies.orient.server.network.protocol.binary.ONetworkProtocolBinary.command(ONetworkProtocolBinary.java:1178)
at com.orientechnologies.orient.server.network.protocol.binary.ONetworkProtocolBinary.executeRequest(ONetworkProtocolBinary.java:385)
at com.orientechnologies.orient.server.network.protocol.binary.OBinaryNetworkProtocolAbstract.execute(OBinaryNetworkProtocolAbstract.java:220)
at com.orientechnologies.common.thread.OSoftThread.run(OSoftThread.java:69)
Orient Technologies
The Company behind OrientDB
--
---
You received this message because you are subscribed to the Google Groups "OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to orient-databa...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.