Exemplo n.º 1
0
  protected OrientGraphFactory getGraphFactory() {
    log.debug("try to get GraphFactory");

    if (this.graphFactory == null || this.graphFactory.getDatabase().isClosed()) {
      OGlobalConfiguration.CLIENT_CHANNEL_MAX_POOL.setValue(50000);
      open();
    }

    log.debug("return GraphFactory");

    return this.graphFactory;
  }
Exemplo n.º 2
0
  protected void openRemoteDatabase() throws IOException {
    minPool = OGlobalConfiguration.CLIENT_CHANNEL_MIN_POOL.getValueAsInteger();
    maxPool = OGlobalConfiguration.CLIENT_CHANNEL_MAX_POOL.getValueAsInteger();

    if (connectionOptions != null && connectionOptions.size() > 0) {
      if (connectionOptions.containsKey(PARAM_MIN_POOL))
        minPool = Integer.parseInt(connectionOptions.get(PARAM_MIN_POOL).toString());
      if (connectionOptions.containsKey(PARAM_MAX_POOL))
        maxPool = Integer.parseInt(connectionOptions.get(PARAM_MAX_POOL).toString());
    }

    setSessionId(-1);
    createConnectionPool();

    OChannelBinaryClient network = null;
    try {
      network = beginRequest(OChannelBinaryProtocol.REQUEST_DB_OPEN);

      network.writeString(name).writeString(connectionUserName).writeString(connectionUserPassword);

    } finally {
      endRequest(network);
    }

    final int sessionId;

    try {
      beginResponse(network);

      sessionId = network.readInt();

      OLogManager.instance().debug(null, "Client connected with session id: " + sessionId);

      readDatabaseInformation(network);

      // READ CLUSTER CONFIGURATION
      clusterConfiguration = new ODocument(network.readBytes());

    } finally {
      endResponse(network);
    }

    setSessionId(sessionId);

    defaultClusterId = clustersIds.get(OStorage.CLUSTER_DEFAULT_NAME);

    status = STATUS.OPEN;
  }
 public SimulateOperationsAgainstServer() {
   OGlobalConfiguration.CLIENT_CHANNEL_MAX_POOL.setValue(threads + 5);
   OGlobalConfiguration.STORAGE_KEEP_OPEN.setValue(true);
 }