use of com.orientechnologies.orient.server.OServer in project orientdb by orientechnologies.
the class OCommandExecutorSQLHASyncCluster method execute.
/**
* Execute the SYNC CLUSTER.
*/
public Object execute(final Map<Object, Object> iArgs) {
final ODatabaseDocumentInternal database = getDatabase();
database.checkSecurity(ORule.ResourceGeneric.CLUSTER, "sync", ORole.PERMISSION_UPDATE);
final String dbUrl = database.getURL();
final String path = dbUrl.substring(dbUrl.indexOf(":") + 1);
final OServer serverInstance = OServer.getInstanceByPath(path);
final OHazelcastPlugin dManager = (OHazelcastPlugin) serverInstance.getDistributedManager();
if (dManager == null || !dManager.isEnabled())
throw new OCommandExecutionException("OrientDB is not started in distributed mode");
final String databaseName = database.getName();
try {
if (this.parsedStatement.modeFull) {
return replaceCluster(dManager, database, serverInstance, databaseName, this.parsedStatement.clusterName.getStringValue());
}
// else {
// int merged = 0;
// return String.format("Merged %d records", merged);
// }
} catch (Exception e) {
throw OException.wrapException(new OCommandExecutionException("Cannot execute synchronization of cluster"), e);
}
return "Mode not supported";
}
use of com.orientechnologies.orient.server.OServer 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.server.OServer in project orientdb by orientechnologies.
the class EdgeBug method run.
public void run() throws Exception {
OServer server = setupDatabase();
try {
setupClasses();
populateDatabase();
tryLabelQuery();
runEdgeTest();
} finally {
server.shutdown();
}
}
use of com.orientechnologies.orient.server.OServer in project orientdb by orientechnologies.
the class EdgeBug method setupDatabase.
private OServer setupDatabase() throws Exception {
OServer ret = new OServer(false);
ret.startup("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>" + "<orient-server>" + "<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=\"root\" resources=\"*\"/>" + "</users>" + "<storages>" + "<storage path=\"memory:temp\" name=\"temp\" userName=\"admin\" userPassword=\"admin\" loaded-at-startup=\"true\" />" + "</storages>" + "<properties>" + "<entry name=\"orientdb.www.path\" value=\"/Users/curtis/orientdb-graphed-1.3.0/www/\"/>" + "<entry name=\"orientdb.config.file\" value=\"/Users/curtis/orientdb-graphed-1.3.0/config/orientdb-server-config.xml\"/>" + "<entry name=\"server.cache.staticResources\" value=\"false\"/>" + "<entry name=\"log.console.level\" value=\"info\"/>" + "<entry name=\"log.file.level\" value=\"info\"/>" + "</properties>" + "<isAfterFirstTime>true</isAfterFirstTime></orient-server>");
return ret;
}
use of com.orientechnologies.orient.server.OServer in project orientdb by orientechnologies.
the class OrientGraphRemoteTest method startEmbeddedServer.
@BeforeClass
public static void startEmbeddedServer() throws Exception {
final String buildDirectory = System.getProperty("buildDirectory", ".");
serverHome = buildDirectory + "/" + OrientGraphRemoteTest.class.getSimpleName();
File file = new File(serverHome);
deleteDirectory(file);
file = new File(serverHome);
Assert.assertTrue(file.mkdir());
oldOrientDBHome = System.getProperty("ORIENTDB_HOME");
System.setProperty("ORIENTDB_HOME", serverHome);
server = new OServer(false);
server.startup(OrientGraphRemoteTest.class.getResourceAsStream("/embedded-server-config.xml"));
server.activate();
}
Aggregations