Search in sources :

Example 1 with ORemoteIndexEngine

use of com.orientechnologies.orient.core.index.engine.ORemoteIndexEngine 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)

Example 2 with ORemoteIndexEngine

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

the class ODefaultIndexFactory method createIndexEngine.

@Override
public OIndexEngine createIndexEngine(String algorithm, String name, Boolean durableInNonTxMode, OStorage storage, int version, Map<String, String> engineProperties) {
    final OIndexEngine indexEngine;
    final String storageType = storage.getType();
    if (storageType.equals("memory") || storageType.equals("plocal"))
        indexEngine = new OSBTreeIndexEngine(name, durableInNonTxMode, (OAbstractPaginatedStorage) storage, version);
    else if (storageType.equals("distributed"))
        // DISTRIBUTED CASE: HANDLE IT AS FOR LOCAL
        indexEngine = new OSBTreeIndexEngine(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 : OSBTreeIndexEngine(com.orientechnologies.orient.core.index.engine.OSBTreeIndexEngine) ORemoteIndexEngine(com.orientechnologies.orient.core.index.engine.ORemoteIndexEngine) OAbstractPaginatedStorage(com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage)

Aggregations

ORemoteIndexEngine (com.orientechnologies.orient.core.index.engine.ORemoteIndexEngine)2 OAbstractPaginatedStorage (com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage)2 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 OSBTreeIndexEngine (com.orientechnologies.orient.core.index.engine.OSBTreeIndexEngine)1