Examples of ODatabaseRecordInternal


Examples of com.orientechnologies.orient.core.db.record.ODatabaseRecordInternal

  public boolean isIdempotent() {
    return false;
  }

  protected Object executeJsr223Script(final String language, final OCommandContext iContext, final Map<Object, Object> iArgs) {
    ODatabaseRecordInternal db = ODatabaseRecordThreadLocal.INSTANCE.getIfDefined();
    if (db != null && !(db instanceof ODatabaseRecordTx))
      db = db.getUnderlying();

    final OScriptManager scriptManager = Orient.instance().getScriptManager();
    CompiledScript compiledScript = request.getCompiledScript();

    if (compiledScript == null) {
View Full Code Here

Examples of com.orientechnologies.orient.core.db.record.ODatabaseRecordInternal

      final OBinarySerializer keySerializer = determineKeySerializer(indexDefinition);
      final int keySize = determineKeySize(indexDefinition);

      final ORecordBytes identityRecord = new ORecordBytes();
      ODatabaseRecordInternal database = getDatabase();

      final OAbstractPaginatedStorage storageLocalAbstract = (OAbstractPaginatedStorage) database.getStorage().getUnderlying();

      database.save(identityRecord, clusterIndexName);
      identity = identityRecord.getIdentity();

      sbTree.create(indexName, keySerializer, (OBinarySerializer<V>) valueSerializer,
          indexDefinition != null ? indexDefinition.getTypes() : null, storageLocalAbstract, keySize, indexDefinition != null
              && !indexDefinition.isNullValuesIgnored());
View Full Code Here

Examples of com.orientechnologies.orient.core.db.record.ODatabaseRecordInternal

    }
  }

  // TODO: CREATE A REGULAR JSR223 SCRIPT IMPL
  protected Object executeSQL() {
    ODatabaseRecordInternal db = ODatabaseRecordThreadLocal.INSTANCE.getIfDefined();
    if (db != null && !(db instanceof ODatabaseRecordTx))
      db = db.getUnderlying();

    try {

      return executeSQLScript(db, parserText);
View Full Code Here

Examples of com.orientechnologies.orient.core.db.record.ODatabaseRecordInternal

  @Override
  public void deleteWithoutLoad(String indexName) {
    acquireExclusiveLock();
    try {
      final ODatabaseRecordInternal database = getDatabase();
      final OAbstractPaginatedStorage storageLocalAbstract = (OAbstractPaginatedStorage) database.getStorage().getUnderlying();

      sbTree.deleteWithoutLoad(indexName, storageLocalAbstract);
    } finally {
      releaseExclusiveLock();
    }
View Full Code Here

Examples of com.orientechnologies.orient.core.db.record.ODatabaseRecordInternal

   */
  public Object execute(final Map<Object, Object> iArgs) {
    if (clusterName == null)
      throw new OCommandExecutionException("Cannot execute the command because it has not been parsed yet");

    final ODatabaseRecordInternal database = getDatabase();

    // CHECK IF ANY CLASS IS USING IT
    final int clusterId = database.getStorage().getClusterIdByName(clusterName);
    for (OClass iClass : database.getMetadata().getSchema().getClasses()) {
      for (int i : iClass.getClusterIds()) {
        if (i == clusterId)
          // IN USE
          return false;
      }
    }

    database.dropCluster(clusterId, true);
    return true;
  }
View Full Code Here

Examples of com.orientechnologies.orient.core.db.record.ODatabaseRecordInternal

  @Override
  public void load(ORID indexRid, String indexName, OIndexDefinition indexDefinition, OStreamSerializer valueSerializer,
      boolean isAutomatic) {
    acquireExclusiveLock();
    try {
      ODatabaseRecordInternal database = getDatabase();
      final OAbstractPaginatedStorage storageLocalAbstract = (OAbstractPaginatedStorage) database.getStorage().getUnderlying();

      sbTree.load(indexName, determineKeySerializer(indexDefinition), valueSerializer,
          indexDefinition != null ? indexDefinition.getTypes() : null, storageLocalAbstract, determineKeySize(indexDefinition),
          indexDefinition != null && indexDefinition.isNullValuesIgnored());
    } finally {
View Full Code Here

Examples of com.orientechnologies.orient.core.db.record.ODatabaseRecordInternal

     try {
       final byte[] stream = getRecordBytes(iRecord);

       int realLength = stream.length;
       // TODO: This Logic should not be here provide an api in the Serializer for ask for trimmed content.
       final ODatabaseRecordInternal db = ODatabaseRecordThreadLocal.INSTANCE.getIfDefined();
       if (db != null && db instanceof ODatabaseDocument) {
         if (db.getSerializer() instanceof ORecordSerializerSchemaAware2CSV) {
           // TRIM TAILING SPACES (DUE TO OVERSIZE)
           for (int i = stream.length - 1; i > -1; --i) {
             if (stream[i] == 32)
               --realLength;
             else
View Full Code Here

Examples of com.orientechnologies.orient.core.db.record.ODatabaseRecordInternal

  }

  protected void searchInClasses(final boolean iAscendentOrder) {
    final OClass cls = parsedTarget.getTargetClasses().keySet().iterator().next();

    final ODatabaseRecordInternal database = getDatabase();
    database.checkSecurity(ODatabaseSecurityResources.CLASS, ORole.PERMISSION_READ, cls.getName().toLowerCase());

    // NO INDEXES: SCAN THE ENTIRE CLUSTER

    OStorage.LOCKING_STRATEGY locking = context != null && context.getVariable("$locking") != null ? (OStorage.LOCKING_STRATEGY) context
        .getVariable("$locking") : OStorage.LOCKING_STRATEGY.DEFAULT;
View Full Code Here

Examples of com.orientechnologies.orient.core.db.record.ODatabaseRecordInternal

      target = new ORecordIteratorClassDescendentOrder<ORecord>(database, database, cls.getName(), true, request.isUseCache(),
          false, locking).setRange(range[0], range[1]);
  }

  protected void searchInClusters() {
    final ODatabaseRecordInternal database = getDatabase();

    final Set<Integer> clusterIds = new HashSet<Integer>();
    for (String clusterName : parsedTarget.getTargetClusters().keySet()) {
      if (clusterName == null || clusterName.length() == 0)
        throw new OCommandExecutionException("No cluster or schema class selected in query");

      database.checkSecurity(ODatabaseSecurityResources.CLUSTER, ORole.PERMISSION_READ, clusterName.toLowerCase());

      if (Character.isDigit(clusterName.charAt(0))) {
        // GET THE CLUSTER NUMBER
        for (int clusterId : OStringSerializerHelper.splitIntArray(clusterName)) {
          if (clusterId == -1)
            throw new OCommandExecutionException("Cluster '" + clusterName + "' not found");

          clusterIds.add(clusterId);
        }
      } else {
        // GET THE CLUSTER NUMBER BY THE CLASS NAME
        final int clusterId = database.getClusterIdByName(clusterName.toLowerCase());
        if (clusterId == -1)
          throw new OCommandExecutionException("Cluster '" + clusterName + "' not found");

        clusterIds.add(clusterId);
      }
View Full Code Here

Examples of com.orientechnologies.orient.core.db.record.ODatabaseRecordInternal

    return null;
  }

  protected OCluster getCluster() {
    final ODatabaseRecordInternal database = getDatabase();
    if (clusterId > -1) {
      return database.getStorage().getClusterById(clusterId);
    } else {
      return database.getStorage().getClusterById(database.getStorage().getClusterIdByName(clusterName));
    }
  }
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.