Examples of ORecordMetadata


Examples of com.orientechnologies.orient.core.storage.ORecordMetadata

     final ORID rid = channel.readRID();

     beginResponse();
     try {
       final ORecordMetadata metadata = connection.database.getRecordMetadata(rid);
       sendOk(clientTxId);
       channel.writeRID(metadata.getRecordId());
       channel.writeVersion(metadata.getRecordVersion());
     } finally {
       endResponse();
     }
   }
View Full Code Here

Examples of com.orientechnologies.orient.core.storage.ORecordMetadata

    for (int i = 0; i < 5; i++) {
      doc.field("field", i);
      database.save(doc);

      final ORecordMetadata metadata = database.getRecordMetadata(doc.getIdentity());
      assetORIDEquals(doc.getIdentity(), metadata.getRecordId());
      assertEquals(doc.getRecordVersion().getCounter(), metadata.getRecordVersion().getCounter());
    }
  }
View Full Code Here

Examples of com.orientechnologies.orient.core.storage.ORecordMetadata

  public void remove(final ComponentSourceConfigId id) throws IOException {
    ORID rid = convertId(id);

    try (ODatabaseDocumentTx db = openDb()) {
      // if we can't get the metadata, then abort
      ORecordMetadata md = db.getRecordMetadata(rid);
      if (md == null) {
        log.debug("Unable to delete item with RID: {}", rid);
        return;
      }
      // else delete the record
View Full Code Here

Examples of com.orientechnologies.orient.core.storage.ORecordMetadata

      log("Document: {}", doc);

      ORID rid = doc.getIdentity();
      log("RID: {}", rid);

      ORecordMetadata md = db.getRecordMetadata(rid);
      log("Metadata: {}", md);
      assertThat(md, notNullValue());
    }
  }
View Full Code Here

Examples of com.orientechnologies.orient.core.storage.ORecordMetadata

  public void loadNonExistingDocument() throws Exception {
    try (ODatabaseDocumentTx db = createDatabase()) {
      ORID rid = new ORecordId("#1:2"); // NOTE: #1:1 will return a record, #1:2 will return null
      log("RID: {}", rid);

      ORecordMetadata md = db.getRecordMetadata(rid);
      log("Metadata: {}", md);
      assertThat(md, nullValue());

      ORecordInternal record = db.load(rid);
      log("Record: {}", record);
View Full Code Here

Examples of com.orientechnologies.orient.core.storage.ORecordMetadata

  public void remove(final ViewConfigId id) throws IOException {
    ORID rid = convertId(id);

    try (ODatabaseDocumentTx db = openDb()) {
      // if we can't get the metadata, then abort
      ORecordMetadata md = db.getRecordMetadata(rid);
      if (md == null) {
        log.debug("Unable to delete item with RID: {}", rid);
        return;
      }
      // else delete the record
View Full Code Here

Examples of com.orientechnologies.orient.core.storage.ORecordMetadata

      }

      final ORID rid = results.get(0).getIdentity();

      // if we can't get the metadata, then abort
      ORecordMetadata md = db.getRecordMetadata(rid);
      if (md == null) {
        log.debug("Unable to delete item with RID: {}", rid);
        return false;
      }
      // else delete the record
View Full Code Here

Examples of com.orientechnologies.orient.core.storage.ORecordMetadata

  public boolean remove(final CapabilityIdentity id) throws IOException {
    ORID rid = convertId(id);

    try (ODatabaseDocumentTx db = openDb()) {
      // if we can't get the metadata, then abort
      ORecordMetadata md = db.getRecordMetadata(rid);
      if (md == null) {
        log.debug("Unable to delete item with RID: {}", rid);
        return false;
      }
      // else delete the record
View Full Code Here

Examples of com.orientechnologies.orient.core.storage.ORecordMetadata

      try {
        final OPhysicalPosition ppos = cluster.getPhysicalPosition(new OPhysicalPosition(rid.getClusterPosition()));
        if (ppos == null)
          return null;

        return new ORecordMetadata(rid, ppos.recordVersion);
      } finally {
        lockManager.releaseLock(recordLock);
      }
    } catch (IOException ioe) {
      OLogManager.instance().error(this, "Retrieval of record  '" + rid + "' cause: " + ioe.getMessage(), ioe);
View Full Code Here

Examples of com.orientechnologies.orient.core.storage.ORecordMetadata

        try {
          beginResponse(network);
          final ORID responseRid = network.readRID();
          final ORecordVersion responseVersion = network.readVersion();

          return new ORecordMetadata(responseRid, responseVersion);
        } finally {
          endResponse(network);
        }
      } catch (Exception e) {
        handleException(network, "Error on read record " + rid, 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.