Package com.orientechnologies.orient.core.record

Examples of com.orientechnologies.orient.core.record.ORecord


    current.clusterId = clusterIds[currentClusterIdx];

    resetCurrentPosition();
    prevPosition();

    final ORecord record = getRecord();
    currentRecord = readCurrentRecord(record, 0);

    if (currentRecord != null && !include(currentRecord)) {
      currentRecord = null;
      hasPrevious();
View Full Code Here


   * Return the record to use for the operation.
   *
   * @return the record to use for the operation.
   */
  protected ORecord getRecord() {
    final ORecord record;
    if (reusedRecord != null) {
      // REUSE THE SAME RECORD AFTER HAVING RESETTED IT
      record = reusedRecord;
      record.reset();
    } else
      record = null;
    return record;
  }
View Full Code Here

    ORecordOperation e = allEntries.get(rid);
    if (e != null)
      return e;

    if (rid.isTemporary()) {
      final ORecord record = temp2persistent.get(rid);
      if (record != null && !record.getIdentity().equals(rid))
        rid = record.getIdentity();
    }

    e = recordEntries.get(rid);
    if (e != null)
      return e;
View Full Code Here

    for (Object key : linked.keySet()) {
      final Object o = linked.get(key);

      if (o instanceof OIdentifiable) {
        final ORecord r = ((OIdentifiable) o).getRecord();
        if (r != null) {
          if (r instanceof ODocument) {
            // GO RECURSIVELY
            final ODocument d = (ODocument) r;
            final Integer fieldDepthLevel = parsedRecords.get(d.getIdentity());
View Full Code Here

    if (!isEnabled()) {
      return null;
    }
    // DELEGATE TO THE 2nd LEVEL CACHE

    ORecord record;
    record = underlying.get(rid);

    if (record != null)
      Orient.instance().getProfiler().updateCounter(CACHE_HIT, "Record found in Level1 Cache", 1L, "db.*.cache.level1.cache.found");
    else
View Full Code Here

    for (int i = total; i > 0; --i) {
      database.getDictionary().put("key-" + (originalSize + i), database.newInstance().value("test-dictionary-" + i));
    }

    for (int i = total; i > 0; --i) {
      ORecord record = database.getDictionary().get("key-" + (originalSize + i));
      record.toString().equals("test-dictionary-" + i);
    }

    Assert.assertEquals(database.getDictionary().size(), originalSize + total);

    database.close();
View Full Code Here

     final String fetchPlan = urlParts.length > 3 ? urlParts[3] : null;

     iRequest.data.commandInfo = "Load document";

     final ORecord rec;

     final int parametersPos = urlParts[2].indexOf('?');
     final String rid = parametersPos > -1 ? urlParts[2].substring(0, parametersPos) : urlParts[2];

     try {
       db = getProfiledDatabaseInstance(iRequest);

       rec = db.load(new ORecordId(rid), fetchPlan);
       if (rec == null)
         iResponse.send(OHttpUtils.STATUS_NOTFOUND_CODE, "Not Found", OHttpUtils.CONTENT_JSON, "Record with id '" + urlParts[2]
             + "' was not found.", null);
       else if (iRequest.httpMethod.equals("HEAD"))
         // JUST SEND HTTP CODE 200
         iResponse.send(OHttpUtils.STATUS_OK_CODE, OHttpUtils.STATUS_OK_DESCRIPTION, null, null,
             OHttpUtils.HEADER_ETAG + rec.getVersion());
       else {
         final String ifNoneMatch = iRequest.getHeader("If-None-Match");
         if (ifNoneMatch != null && rec.getRecordVersion().toString().equals(ifNoneMatch)) {
           // SAME CONTENT, DON'T SEND BACK RECORD
           iResponse.send(OHttpUtils.STATUS_OK_NOMODIFIED_CODE, OHttpUtils.STATUS_OK_NOMODIFIED_DESCRIPTION, null, null,
               OHttpUtils.HEADER_ETAG + rec.getVersion());
         }

         // SEND THE DOCUMENT BACK
         iResponse.writeRecord(rec, fetchPlan, null);
       }
View Full Code Here

    final String fetchPlan = urlParts.length > 4 ? urlParts[4] : null;

    iRequest.data.commandInfo = "Load document";

    final ORecord rec;
    try {

      db = getProfiledDatabaseInstance(iRequest);
      if (db.getMetadata().getSchema().getClass(urlParts[2]) == null) {
        throw new IllegalArgumentException("Invalid class '" + urlParts[2] + "'");
View Full Code Here

     ODatabaseDocumentTx db = null;

     try {
       db = getProfiledDatabaseInstance(iRequest);

       final ORecord record = db.getDictionary().get(urlParts[2]);
       if (record == null)
         throw new ORecordNotFoundException("Key '" + urlParts[2] + "' was not found in the database dictionary");

       iResponse.writeRecord(record);
View Full Code Here

     final ORecordId rid = new ORecordId(channel.readShort(), ORID.CLUSTER_POS_INVALID);
     final byte[] buffer = channel.readBytes();
     final byte recordType = channel.readByte();
     final byte mode = channel.readByte();

     final ORecord record = createRecord(connection.database, rid, buffer, recordType);

     if (mode < 2) {
       beginResponse();
       try {
         sendOk(clientTxId);
         channel.writeClusterPosition(record.getIdentity().getClusterPosition());
         if (connection.data.protocolVersion >= 11)
           channel.writeVersion(record.getRecordVersion());

         if (connection.data.protocolVersion >= 20)
           sendCollectionChanges();
       } finally {
         endResponse();
View Full Code Here

TOP

Related Classes of com.orientechnologies.orient.core.record.ORecord

Copyright © 2018 www.massapicom. 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.