Examples of ORecordId


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

  public OMVRBTreeEntryPersistent(final OMVRBTreePersistent<K, V> iTree, final K key, final V value,
      final OMVRBTreeEntryPersistent<K, V> iParent) {
    super(iTree, key, value, iParent);
    pTree = iTree;

    parentRid = new ORecordId();
    leftRid = new ORecordId();
    rightRid = new ORecordId();

    record = new ORecordBytesLazy(this);

    pageSize = pTree.getPageSize();
View Full Code Here

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

      record.save(pTree.getClusterName());
    }

    // RE-ASSIGN RID
    if (isNew) {
      final ORecordId rid = (ORecordId) record.getIdentity();

      if (left != null) {
        left.parentRid = rid;
        left.markDirty();
      }
View Full Code Here

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

    inStream.setSource(iStream);

    try {
      pageSize = inStream.getAsInteger();

      parentRid = new ORecordId().fromStream(inStream.getAsByteArrayFixed(ORecordId.PERSISTENT_SIZE));
      leftRid = new ORecordId().fromStream(inStream.getAsByteArrayFixed(ORecordId.PERSISTENT_SIZE));
      rightRid = new ORecordId().fromStream(inStream.getAsByteArrayFixed(ORecordId.PERSISTENT_SIZE));

      color = inStream.getAsBoolean();
      init();
      size = inStream.getAsInteger();
View Full Code Here

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

   *
   * @param iFields
   *          Array of field pairs
   */
  public ODocument(final Object[] iFields) {
    _recordId = new ORecordId();
    if (iFields != null && iFields.length > 0)
      for (int i = 0; i < iFields.length; i += 2) {
        field(iFields[i].toString(), iFields[i + 1]);
      }
  }
View Full Code Here

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

    if (ORID.class.isAssignableFrom(iFieldType)) {
      if (iValue instanceof ORID) {
        return (RET) iValue;
      } else if (iValue instanceof String) {
        return (RET) new ORecordId((String) iValue);
      } else if (iValue instanceof ORecord<?>) {
        return (RET) ((ORecord<?>) iValue).getIdentity();
      }
    } else if (ORecord.class.isAssignableFrom(iFieldType)) {
      if (iValue instanceof ORID || iValue instanceof ORecord<?>) {
        return (RET) iValue;
      } else if (iValue instanceof String) {
        return (RET) new ORecordId((String) iValue);
      }
    } else if (Set.class.isAssignableFrom(iFieldType)) {
      if (!(iValue instanceof Set)) {
        // CONVERT IT TO SET
        final Collection<?> newValue;
View Full Code Here

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

    case LINK:
      if (iValue instanceof ORID)
        return iValue.toString();
      else if (iValue instanceof String)
        return new ORecordId((String) iValue);
      else
        return ((ORecord<?>) iValue).getIdentity().toString();

    case EMBEDDED:
      // RECORD
View Full Code Here

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

      // STRING
      return iValue.substring(1, iValue.length() - 1);

    if (iValue.charAt(0) == ORID.PREFIX)
      // RID
      return new ORecordId(iValue);

    boolean integer = true;
    char c;

    for (int index = 0; index < iValue.length(); ++index) {
View Full Code Here

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

    map1.put("map2", (HashMap<?, ?>) map2);

    final Map<String, HashMap<?, ?>> map3 = new HashMap<String, HashMap<?, ?>>();
    map2.put("map3", (HashMap<?, ?>) map3);

    final ORecordId rid = (ORecordId) newDoc.save().getIdentity();

    final ODocument loadedDoc = database.load(rid);

    Assert.assertTrue(newDoc.hasSameContentOf(loadedDoc));
View Full Code Here

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

    doc.save();
    ORID docRid = doc.getIdentity().copy();
    // RELOAD THE DOCUMENT, THIS WILL PUT IT IN L1 CACHE
    doc = database.load(docRid, "*:-1");
    doc = testInvalidFetchPlanInvalidateL1Cache(doc, docRid);
    doc = testInvalidFetchPlanInvalidateL1Cache(doc, new ORecordId(1, 0));
    doc = testInvalidFetchPlanInvalidateL1Cache(doc, new ORecordId(1, 1));
    doc = testInvalidFetchPlanInvalidateL1Cache(doc, new ORecordId(1, 2));
    doc = testInvalidFetchPlanInvalidateL1Cache(doc, new ORecordId(2, 0));
    doc = testInvalidFetchPlanInvalidateL1Cache(doc, new ORecordId(2, 1));
    doc = testInvalidFetchPlanInvalidateL1Cache(doc, new ORecordId(2, 2));
    doc = testInvalidFetchPlanInvalidateL1Cache(doc, new ORecordId(3, 0));
    doc = testInvalidFetchPlanInvalidateL1Cache(doc, new ORecordId(3, 1));
    doc = testInvalidFetchPlanInvalidateL1Cache(doc, new ORecordId(3, 2));
    doc = testInvalidFetchPlanInvalidateL1Cache(doc, new ORecordId(4, 0));
    doc = testInvalidFetchPlanInvalidateL1Cache(doc, new ORecordId(4, 1));
    // CLOSE DB AND RE-TEST THE LOAD TO MAKE SURE
    database.close();
    database = null;
    database = ODatabaseDocumentPool.global().acquire(url, "admin", "admin");
    doc = testInvalidFetchPlanClearL1Cache(doc, docRid);
    doc = testInvalidFetchPlanClearL1Cache(doc, new ORecordId(1, 0));
    doc = testInvalidFetchPlanClearL1Cache(doc, new ORecordId(1, 1));
    doc = testInvalidFetchPlanClearL1Cache(doc, new ORecordId(1, 2));
    doc = testInvalidFetchPlanClearL1Cache(doc, new ORecordId(2, 0));
    doc = testInvalidFetchPlanClearL1Cache(doc, new ORecordId(2, 1));
    doc = testInvalidFetchPlanClearL1Cache(doc, new ORecordId(2, 2));
    doc = testInvalidFetchPlanClearL1Cache(doc, new ORecordId(3, 0));
    doc = testInvalidFetchPlanClearL1Cache(doc, new ORecordId(3, 1));
    doc = testInvalidFetchPlanClearL1Cache(doc, new ORecordId(3, 2));
    doc = testInvalidFetchPlanClearL1Cache(doc, new ORecordId(4, 0));
    doc = testInvalidFetchPlanClearL1Cache(doc, new ORecordId(4, 1));
    doc = database.load(docRid);
    doc.delete();
    database.close();
  }
View Full Code Here

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

  }

  public OSerializableStream fromStream(final byte[] iStream) throws OSerializationException {
    final long timer = OProfiler.getInstance().startChrono();

    final ORID rootRid = new ORecordId();

    try {
      final OMemoryInputStream stream = new OMemoryInputStream(iStream);

      byte protocolVersion = stream.peek();
      if (protocolVersion != -1) {
        // @COMPATIBILITY BEFORE 0.9.25
        stream.getAsByte();
        if (protocolVersion != CURRENT_PROTOCOL_VERSION)
          throw new OSerializationException(
              "The index has been created with a previous version of OrientDB. Soft transitions between version is a featured supported since 0.9.25. In order to use it with this version of OrientDB you need to export and import your database. "
                  + protocolVersion + "<->" + CURRENT_PROTOCOL_VERSION);
      }

      rootRid.fromStream(stream.getAsByteArrayFixed(ORecordId.PERSISTENT_SIZE));

      size = stream.getAsInteger();
      if (protocolVersion == -1)
        // @COMPATIBILITY BEFORE 0.9.25
        lastPageSize = stream.getAsShort();
      else
        lastPageSize = stream.getAsInteger();

      serializerFromStream(stream);

      // LOAD THE ROOT OBJECT AFTER ALL
      if (rootRid.isValid())
        root = loadEntry(null, rootRid);

      return this;

    } catch (Exception e) {
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.