Package com.orientechnologies.orient.core.record.impl

Examples of com.orientechnologies.orient.core.record.impl.ODocument.field()


        if (!manager.isCurrentNodeTheClusterOwner(iRecord.getDatabase().getName(), clusterName)) {
          final ODocument servers = manager.getServersForCluster(iRecord.getDatabase().getName(), clusterName);
          throw new ODistributedException("Can't apply changes to the cluster '" + clusterName
              + "' because the current node is not the owner for that record cluster. Please connect to the server: "
              + servers.field("owner"));
        }
        break;

      case AFTER_CREATE:
        manager.distributeRequest(new OTransactionRecordEntry((ORecordInternal<?>) iRecord, OTransactionRecordEntry.CREATED, null));
View Full Code Here


      return true;

    if (ODistributedRequesterThreadLocal.INSTANCE.get())
      return true;

    return servers.field("owner").equals(getId());

  }

  public ODocument getServersForCluster(final String iDatabaseName, final String iClusterName) {
    // GET THE NODES INVOLVED IN THE UPDATE
View Full Code Here

    final ODocument database = clusterDbConfigurations.get(iDatabaseName);
    if (database == null)
      return null;

    final ODocument clusters = database.field("clusters");
    return (ODocument) (clusters.containsField(iClusterName) ? clusters.field(iClusterName) : clusters.field("*"));
  }

  /**
   * Distributed the request to all the configured nodes. Each node has the responsibility to bring the message early (synch-mode)
   * or using an asynchronous queue.
View Full Code Here

    final ODocument database = clusterDbConfigurations.get(iDatabaseName);
    if (database == null)
      return null;

    final ODocument clusters = database.field("clusters");
    return (ODocument) (clusters.containsField(iClusterName) ? clusters.field(iClusterName) : clusters.field("*"));
  }

  /**
   * Distributed the request to all the configured nodes. Each node has the responsibility to bring the message early (synch-mode)
   * or using an asynchronous queue.
View Full Code Here

      if (servers == null)
        return;

      nodeList = new HashMap<ODistributedServerNodeRemote, ODistributedServerNodeRemote.SYNCH_TYPE>();
      if (servers.field("synch") != null)
        for (String s : (Collection<String>) servers.field("synch")) {
          nodeList.put(nodes.get(s), ODistributedServerNodeRemote.SYNCH_TYPE.SYNCHRONOUS);
        }
      if (servers.field("asynch") != null)
        for (String s : (Collection<String>) servers.field("asynch")) {
View Full Code Here

      if (servers == null)
        return;

      nodeList = new HashMap<ODistributedServerNodeRemote, ODistributedServerNodeRemote.SYNCH_TYPE>();
      if (servers.field("synch") != null)
        for (String s : (Collection<String>) servers.field("synch")) {
          nodeList.put(nodes.get(s), ODistributedServerNodeRemote.SYNCH_TYPE.SYNCHRONOUS);
        }
      if (servers.field("asynch") != null)
        for (String s : (Collection<String>) servers.field("asynch")) {
          nodeList.put(nodes.get(s), ODistributedServerNodeRemote.SYNCH_TYPE.ASYNCHRONOUS);
View Full Code Here

      nodeList = new HashMap<ODistributedServerNodeRemote, ODistributedServerNodeRemote.SYNCH_TYPE>();
      if (servers.field("synch") != null)
        for (String s : (Collection<String>) servers.field("synch")) {
          nodeList.put(nodes.get(s), ODistributedServerNodeRemote.SYNCH_TYPE.SYNCHRONOUS);
        }
      if (servers.field("asynch") != null)
        for (String s : (Collection<String>) servers.field("asynch")) {
          nodeList.put(nodes.get(s), ODistributedServerNodeRemote.SYNCH_TYPE.ASYNCHRONOUS);
        }

    } finally {
View Full Code Here

      if (servers.field("synch") != null)
        for (String s : (Collection<String>) servers.field("synch")) {
          nodeList.put(nodes.get(s), ODistributedServerNodeRemote.SYNCH_TYPE.SYNCHRONOUS);
        }
      if (servers.field("asynch") != null)
        for (String s : (Collection<String>) servers.field("asynch")) {
          nodeList.put(nodes.get(s), ODistributedServerNodeRemote.SYNCH_TYPE.ASYNCHRONOUS);
        }

    } finally {
      lock.releaseSharedLock();
View Full Code Here

    // MERGE CONFIG
    final ODocument cfgDoc = new ODocument().fromJSON(iServerClusterConfiguration);

    Object fieldValue;
    for (String fieldName : cfgDoc.fieldNames()) {
      fieldValue = cfgDoc.field(fieldName);

      ODocument clusterConfig = clusters.field(fieldName);
      if (clusterConfig == null)
        // GET THE CONFIG OF THE NEW SERVER
        clusterConfig = (ODocument) fieldValue;
View Full Code Here

      final ONavigableMap<Object, Set<OIdentifiable>> subSet = map.tailMap(fromKey, isInclusive);
      if (subSet != null) {
        for (Entry<Object, Set<OIdentifiable>> v : subSet.entrySet()) {
          for (OIdentifiable id : v.getValue()) {
            final ODocument document = new ODocument();
            document.field("key", v.getKey());
            document.field("rid", id.getIdentity());
            document.unsetDirty();
            result.add(document);
          }
        }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.