Package com.orientechnologies.orient.core.index

Examples of com.orientechnologies.orient.core.index.OIndexException


        diskCache.release(hashStateEntry);
      }

      diskCache.closeFile(fileStateId);
    } catch (IOException e) {
      throw new OIndexException("Error during hash table close", e);
    } finally {
      releaseExclusiveLock();
    }
  }
View Full Code Here


      if (nullKeyIsSupported)
        diskCache.deleteFile(nullBucketFileId);

    } catch (IOException e) {
      throw new OIndexException("Exception during index deletion", e);
    } finally {
      releaseExclusiveLock();
    }
  }
View Full Code Here

      directory.flush();

      if (nullKeyIsSupported)
        diskCache.flushFile(nullBucketFileId);
    } catch (IOException e) {
      throw new OIndexException("Error during hash table flush", e);
    } finally {
      releaseExclusiveLock();
    }
  }
View Full Code Here

  }

  private void checkNullSupport(K key) {
    if (key == null && !nullKeyIsSupported)
      throw new OIndexException("Null keys are not supported.");
  }
View Full Code Here

      // DISTRIBUTED CASE: HANDLE IT AS FOR LOCAL
      indexEngine = new OHashTableIndexEngine(durableInNonTxMode, trackMode);
    else if (storageType.equals("remote"))
      indexEngine = new ORemoteIndexEngine();
    else
      throw new OIndexException("Unsupported storage type : " + storageType);

    if (OClass.INDEX_TYPE.UNIQUE_HASH_INDEX.toString().equals(indexType))
      return new OIndexUnique(indexType, algorithm, indexEngine, valueContainerAlgorithm, metadata);
    else if (OClass.INDEX_TYPE.NOTUNIQUE_HASH_INDEX.toString().equals(indexType))
      return new OIndexNotUnique(indexType, algorithm, indexEngine, valueContainerAlgorithm, metadata);
View Full Code Here

      throw new IllegalArgumentException("Index type is null");

    type = type.toUpperCase();

    if (fields.length == 0) {
      throw new OIndexException("List of fields to index cannot be empty.");
    }

    acquireSchemaReadLock();
    try {
      final Set<String> existingFieldNames = new HashSet<String>();
      OClassImpl currentClass = this;
      do {
        existingFieldNames.addAll(currentClass.properties.keySet());
        currentClass = (OClassImpl) currentClass.getSuperClass();
      } while (currentClass != null);

      for (final String fieldToIndex : fields) {
        final String fieldName = OIndexDefinitionFactory.extractFieldName(fieldToIndex);

        if (!fieldName.equals("@rid") && !existingFieldNames.contains(fieldName.toLowerCase()))
          throw new OIndexException("Index with name : '" + name + "' cannot be created on class : '" + this.name
              + "' because field: '" + fieldName + "' is absent in class definition.");
      }

      final OIndexDefinition indexDefinition = OIndexDefinitionFactory.createIndexDefinition(this, Arrays.asList(fields),
          extractFieldTypes(fields), null);
View Full Code Here

TOP

Related Classes of com.orientechnologies.orient.core.index.OIndexException

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.