Search in sources :

Example 1 with OHashTableIndexEngine

use of com.orientechnologies.orient.core.index.engine.OHashTableIndexEngine in project orientdb by orientechnologies.

the class OHashIndexFactory method createIndexEngine.

@Override
public OIndexEngine createIndexEngine(final String algoritm, final String name, final Boolean durableInNonTxMode, final OStorage storage, final int version, final Map<String, String> engineProperties) {
    OIndexEngine indexEngine;
    final String storageType = storage.getType();
    if (storageType.equals("memory") || storageType.equals("plocal"))
        indexEngine = new OHashTableIndexEngine(name, durableInNonTxMode, (OAbstractPaginatedStorage) storage, version);
    else if (storageType.equals("distributed"))
        // DISTRIBUTED CASE: HANDLE IT AS FOR LOCAL
        indexEngine = new OHashTableIndexEngine(name, durableInNonTxMode, (OAbstractPaginatedStorage) storage.getUnderlying(), version);
    else if (storageType.equals("remote"))
        indexEngine = new ORemoteIndexEngine(name);
    else
        throw new OIndexException("Unsupported storage type: " + storageType);
    return indexEngine;
}
Also used : OIndexException(com.orientechnologies.orient.core.index.OIndexException) OHashTableIndexEngine(com.orientechnologies.orient.core.index.engine.OHashTableIndexEngine) OIndexEngine(com.orientechnologies.orient.core.index.OIndexEngine) ORemoteIndexEngine(com.orientechnologies.orient.core.index.engine.ORemoteIndexEngine) OAbstractPaginatedStorage(com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage)

Aggregations

OIndexEngine (com.orientechnologies.orient.core.index.OIndexEngine)1 OIndexException (com.orientechnologies.orient.core.index.OIndexException)1 OHashTableIndexEngine (com.orientechnologies.orient.core.index.engine.OHashTableIndexEngine)1 ORemoteIndexEngine (com.orientechnologies.orient.core.index.engine.ORemoteIndexEngine)1 OAbstractPaginatedStorage (com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage)1