private OIndexInternal<?> createShardedIndex(final String name, final String indexType, final String valueContainerAlgorithm, final ODocument metadata, final OAbstractPaginatedStorage storage, final int version) { final int binaryFormatVersion = storage.getConfiguration().getBinaryFormatVersion(); if (OClass.INDEX_TYPE.UNIQUE.toString().equals(indexType)) { return new OIndexUnique(name, indexType, AUTOSHARDING_ALGORITHM, version, storage, valueContainerAlgorithm, metadata, binaryFormatVersion); } else if (OClass.INDEX_TYPE.NOTUNIQUE.toString().equals(indexType)) { return new OIndexNotUnique(name, indexType, AUTOSHARDING_ALGORITHM, version, storage, valueContainerAlgorithm, metadata, binaryFormatVersion); } throw new OConfigurationException("Unsupported type: " + indexType); }
private static OIndexInternal<?> createSBTreeIndex(String name, String indexType, String valueContainerAlgorithm, ODocument metadata, OAbstractPaginatedStorage storage, int version, String algorithm) { final int binaryFormatVersion = storage.getConfiguration().getBinaryFormatVersion(); if (OClass.INDEX_TYPE.UNIQUE.toString().equals(indexType)) { return new OIndexUnique(name, indexType, algorithm, version, storage, valueContainerAlgorithm, metadata, binaryFormatVersion); } else if (OClass.INDEX_TYPE.NOTUNIQUE.toString().equals(indexType)) { return new OIndexNotUnique(name, indexType, algorithm, version, storage, valueContainerAlgorithm, metadata, binaryFormatVersion); } else if (OClass.INDEX_TYPE.FULLTEXT.toString().equals(indexType)) { return new OIndexFullText(name, indexType, algorithm, version, storage, valueContainerAlgorithm, metadata, binaryFormatVersion); } else if (OClass.INDEX_TYPE.DICTIONARY.toString().equals(indexType)) { return new OIndexDictionary(name, indexType, algorithm, version, storage, valueContainerAlgorithm, metadata, binaryFormatVersion); } throw new OConfigurationException("Unsupported type: " + indexType); }
public OIndexInternal<?> createIndex(String name, OStorage storage, String indexType, String algorithm, String valueContainerAlgorithm, ODocument metadata, int version) throws OConfigurationException { if (version < 0) version = getLastVersion(); if (valueContainerAlgorithm == null) valueContainerAlgorithm = ODefaultIndexFactory.NONE_VALUE_CONTAINER; final int binaryFormatVersion = storage.getConfiguration().getBinaryFormatVersion(); if (OClass.INDEX_TYPE.UNIQUE_HASH_INDEX.toString().equals(indexType)) return new OIndexUnique(name, indexType, algorithm, version, (OAbstractPaginatedStorage) storage.getUnderlying(), valueContainerAlgorithm, metadata, binaryFormatVersion); else if (OClass.INDEX_TYPE.NOTUNIQUE_HASH_INDEX.toString().equals(indexType)) return new OIndexNotUnique(name, indexType, algorithm, version, (OAbstractPaginatedStorage) storage.getUnderlying(), valueContainerAlgorithm, metadata, binaryFormatVersion); else if (OClass.INDEX_TYPE.FULLTEXT_HASH_INDEX.toString().equals(indexType)) return new OIndexFullText(name, indexType, algorithm, version, (OAbstractPaginatedStorage) storage.getUnderlying(), valueContainerAlgorithm, metadata, binaryFormatVersion); else if (OClass.INDEX_TYPE.DICTIONARY_HASH_INDEX.toString().equals(indexType)) return new OIndexDictionary(name, indexType, algorithm, version, (OAbstractPaginatedStorage) storage.getUnderlying(), valueContainerAlgorithm, metadata, binaryFormatVersion); throw new OConfigurationException("Unsupported type: " + indexType); }