Examples of OClusterPosition


Examples of com.orientechnologies.orient.core.id.OClusterPosition

        final int index = rnd.nextInt(rids.size());
        final OIdentifiable rid = rids.remove(index);
        bag.remove(rid);
      } else {
        final int positionIndex = rnd.nextInt(300);
        final OClusterPosition position = OClusterPositionFactory.INSTANCE.valueOf(positionIndex);

        final ORecordId recordId = new ORecordId(1, position);
        rids.add(recordId);
        bag.add(recordId);
      }
View Full Code Here

Examples of com.orientechnologies.orient.core.id.OClusterPosition

      clusterId = storage1.getClusterIdByName(clusterName);

      OClusterPosition[] db1Range = storage1.getClusterDataRange(clusterId);
      OClusterPosition[] db2Range = storage2.getClusterDataRange(clusterId);

      final OClusterPosition db1Max = db1Range[1];
      final OClusterPosition db2Max = db2Range[1];

      ODatabaseRecordThreadLocal.INSTANCE.set(databaseDocumentTxOne);
      final ODocument doc1 = new ODocument();
      ODatabaseRecordThreadLocal.INSTANCE.set(databaseDocumentTxTwo);
      final ODocument doc2 = new ODocument();

      final ORecordId rid = new ORecordId(clusterId);

      // TODO why this maximums can be different?
      final OClusterPosition clusterMax = db1Max.compareTo(db2Max) > 0 ? db1Max : db2Max;

      final OStorage storage;

      if (clusterMax.equals(db1Max))
        storage = storage1;
      else
        storage = storage2;

      OPhysicalPosition[] physicalPositions = storage.ceilingPhysicalPositions(clusterId, new OPhysicalPosition(
          OClusterPositionFactory.INSTANCE.valueOf(0)));

      long recordsCounter = 0;
      while (physicalPositions.length > 0) {
        for (OPhysicalPosition physicalPosition : physicalPositions) {
          recordsCounter++;

          final OClusterPosition position = physicalPosition.clusterPosition;
          rid.clusterPosition = position;

          if (isDocumentDatabases() && rid.equals(new ORecordId(storage1.getConfiguration().indexMgrRecordId))
              && rid.equals(new ORecordId(storage2.getConfiguration().indexMgrRecordId)))
            continue;
View Full Code Here

Examples of com.orientechnologies.orient.core.id.OClusterPosition

            final int sessionId = getSessionId();
            final OSBTreeCollectionManager collectionManager = ODatabaseRecordThreadLocal.INSTANCE.get()
                .getSbTreeCollectionManager();
            Callable<Object> response = new Callable<Object>() {
              public Object call() throws Exception {
                final OClusterPosition result;

                try {
                  OStorageRemoteThreadLocal.INSTANCE.get().sessionId = sessionId;
                  beginResponse(network);
                  result = network.readClusterPosition();
View Full Code Here

Examples of com.orientechnologies.orient.core.id.OClusterPosition

        document.save();
        ridTreePerDocument.put(document.getIdentity(), new ConcurrentSkipListSet<ORID>());

        while (true) {
          final OClusterPosition position = lastClusterPosition.get();
          if (position.compareTo(document.getIdentity().getClusterPosition()) < 0) {
            if (lastClusterPosition.compareAndSet(position, document.getIdentity().getClusterPosition()))
              break;
          } else
            break;
        }
View Full Code Here

Examples of com.orientechnologies.orient.core.id.OClusterPosition

  }

  public ORecordId readRID() throws IOException {
    final int clusterId = readShort();

    final OClusterPosition clusterPosition = readClusterPosition();
    return new ORecordId(clusterId, clusterPosition);
  }
View Full Code Here

Examples of com.orientechnologies.orient.core.id.OClusterPosition

    if (debug)
      OLogManager.instance().info(this, "%s - Reading cluster position (%d bytes)....", socket.getRemoteSocketAddress(),
          serializedSize);

    final OClusterPosition clusterPosition = OClusterPositionFactory.INSTANCE.fromStream((InputStream) in);

    updateMetricReceivedBytes(serializedSize);

    if (debug)
      OLogManager.instance().info(this, "%s - Read cluster position: %s", socket.getRemoteSocketAddress(), clusterPosition);
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.