use of com.orientechnologies.orient.client.remote.OServerAdmin in project orientdb by orientechnologies.
the class GraphNonBlockingQueryRemote method before.
@Before
public void before() throws ClassNotFoundException, MalformedObjectNameException, InstanceAlreadyExistsException, NotCompliantMBeanException, MBeanRegistrationException, InvocationTargetException, NoSuchMethodException, InstantiationException, IOException, IllegalAccessException {
server = new OServer(false);
server.startup(OrientGraphRemoteTest.class.getResourceAsStream("/embedded-server-config-single-run.xml"));
server.activate();
OServerAdmin admin = new OServerAdmin("remote:localhost:3064");
admin.connect("root", "root");
admin.createDatabase(GraphNonBlockingQueryRemote.class.getSimpleName(), "graph", "memory");
admin.close();
}
use of com.orientechnologies.orient.client.remote.OServerAdmin in project orientdb by orientechnologies.
the class OrientGraphNoTxRemoteTest method generateGraph.
public Graph generateGraph(final String graphDirectoryName) {
final String url = "remote:localhost:" + serverPort + "/" + graphDirectoryName;
OrientGraphNoTx graph = currentGraphs.get(url);
if (graph != null) {
if (graph.isClosed())
currentGraphs.remove(url);
else {
ODatabaseRecordThreadLocal.INSTANCE.set(graph.getRawGraph());
return graph;
}
}
try {
final OServerAdmin serverAdmin = new OServerAdmin(url);
serverAdmin.connect("root", "root");
if (!serverAdmin.existsDatabase(OrientGraphTest.getStorageType()))
serverAdmin.createDatabase("graph", OrientGraphTest.getStorageType());
serverAdmin.close();
} catch (IOException e) {
throw new IllegalStateException(e);
}
OrientGraphFactory factory = graphFactories.get(url);
if (factory == null) {
factory = new OrientGraphFactory(url);
factory.setupPool(5, 256);
graphFactories.put(url, factory);
}
graph = factory.getNoTx();
graph.setWarnOnForceClosingTx(false);
graph.setStandardExceptions(true);
currentGraphs.put(url, graph);
return graph;
}
use of com.orientechnologies.orient.client.remote.OServerAdmin in project orientdb by orientechnologies.
the class OrientGraphNoTxRemoteTest method dropGraph.
@Override
public void dropGraph(final String graphDirectoryName) {
// while to unlock files
try {
final String url = "remote:localhost:" + serverPort + "/" + graphDirectoryName;
final OrientGraphNoTx graph = currentGraphs.get(url);
if (graph != null)
graph.shutdown();
final OrientGraphFactory factory = graphFactories.remove(url);
if (factory != null)
factory.close();
final OServerAdmin serverAdmin = new OServerAdmin(url);
serverAdmin.connect("root", "root");
if (serverAdmin.existsDatabase(OrientGraphTest.getStorageType()))
serverAdmin.dropDatabase(OrientGraphTest.getStorageType());
serverAdmin.close();
} catch (Exception e) {
throw new IllegalStateException(e);
}
}
use of com.orientechnologies.orient.client.remote.OServerAdmin in project orientdb by orientechnologies.
the class OrientGraphRemoteTest method generateGraph.
public Graph generateGraph(final String graphDirectoryName) {
final String url = "remote:localhost:" + serverPort + "/" + graphDirectoryName;
OrientGraph graph = currentGraphs.get(url);
if (graph != null) {
if (graph.isClosed())
currentGraphs.remove(url);
else
return graph;
}
try {
final OServerAdmin serverAdmin = new OServerAdmin(url);
serverAdmin.connect("root", "root");
if (!serverAdmin.existsDatabase(OrientGraphTest.getStorageType()))
serverAdmin.createDatabase("graph", OrientGraphTest.getStorageType());
serverAdmin.close();
} catch (IOException e) {
throw new IllegalStateException(e);
}
OrientGraphFactory factory = graphFactories.get(url);
if (factory == null) {
factory = new OrientGraphFactory(url);
factory.setupPool(5, 256);
graphFactories.put(url, factory);
}
graph = factory.getTx();
graph.setWarnOnForceClosingTx(false);
graph.setStandardExceptions(true);
currentGraphs.put(url, graph);
return graph;
}
use of com.orientechnologies.orient.client.remote.OServerAdmin in project orientdb by orientechnologies.
the class OrientGraphMultithreadRemoteTest method before.
@Before
public void before() {
OGlobalConfiguration.NETWORK_LOCK_TIMEOUT.setValue(15000);
final String url = "remote:localhost:" + serverPort + "/" + OrientGraphMultithreadRemoteTest.class.getSimpleName();
try {
final OServerAdmin serverAdmin = new OServerAdmin(url);
serverAdmin.connect("root", "root");
if (!serverAdmin.existsDatabase(OrientGraphTest.getStorageType()))
serverAdmin.createDatabase("graph", OrientGraphTest.getStorageType());
serverAdmin.close();
} catch (IOException e) {
throw new IllegalStateException(e);
}
graphFactory = new OrientGraphFactory(url);
graphFactory.setupPool(5, 256);
}
Aggregations