Skip to content

Commit

Permalink
Issue #2874, exclusive lock for atomic operations was added.
Browse files Browse the repository at this point in the history
  • Loading branch information
laa committed Mar 31, 2015
1 parent 4a2f936 commit 8f52efd
Show file tree
Hide file tree
Showing 34 changed files with 713 additions and 676 deletions.
Expand Up @@ -27,6 +27,7 @@
import java.util.Set; import java.util.Set;


import com.orientechnologies.orient.core.config.OGlobalConfiguration; import com.orientechnologies.orient.core.config.OGlobalConfiguration;
import com.orientechnologies.orient.core.db.ODatabaseDocumentInternal;
import com.orientechnologies.orient.core.db.ODatabaseRecordThreadLocal; import com.orientechnologies.orient.core.db.ODatabaseRecordThreadLocal;
import com.orientechnologies.orient.core.db.record.OIdentifiable; import com.orientechnologies.orient.core.db.record.OIdentifiable;
import com.orientechnologies.orient.core.index.hashindex.local.cache.ODiskCache; import com.orientechnologies.orient.core.index.hashindex.local.cache.ODiskCache;
Expand Down Expand Up @@ -229,7 +230,9 @@ public void checkNotEmbedded() {
} }


private void convertToSbTree() { private void convertToSbTree() {
final OIndexRIDContainerSBTree tree = new OIndexRIDContainerSBTree(fileId, durableNonTxMode); final ODatabaseDocumentInternal db = ODatabaseRecordThreadLocal.INSTANCE.get();
final OIndexRIDContainerSBTree tree = new OIndexRIDContainerSBTree(fileId, durableNonTxMode,
(OAbstractPaginatedStorage) db.getStorage());


tree.addAll(underlying); tree.addAll(underlying);


Expand Down
Expand Up @@ -29,7 +29,6 @@
import com.orientechnologies.common.profiler.OProfilerMBean; import com.orientechnologies.common.profiler.OProfilerMBean;
import com.orientechnologies.common.serialization.types.OBooleanSerializer; import com.orientechnologies.common.serialization.types.OBooleanSerializer;
import com.orientechnologies.orient.core.Orient; import com.orientechnologies.orient.core.Orient;
import com.orientechnologies.orient.core.db.ODatabaseRecordThreadLocal;
import com.orientechnologies.orient.core.db.record.OIdentifiable; import com.orientechnologies.orient.core.db.record.OIdentifiable;
import com.orientechnologies.orient.core.index.sbtree.OSBTreeMapEntryIterator; import com.orientechnologies.orient.core.index.sbtree.OSBTreeMapEntryIterator;
import com.orientechnologies.orient.core.index.sbtree.OTreeInternal; import com.orientechnologies.orient.core.index.sbtree.OTreeInternal;
Expand All @@ -51,23 +50,21 @@ public class OIndexRIDContainerSBTree implements Set<OIdentifiable> {


protected static final OProfilerMBean PROFILER = Orient.instance().getProfiler(); protected static final OProfilerMBean PROFILER = Orient.instance().getProfiler();


public OIndexRIDContainerSBTree(long fileId, boolean durableMode) { public OIndexRIDContainerSBTree(long fileId, boolean durableMode, OAbstractPaginatedStorage storage) {
tree = new OSBTreeBonsaiLocal<OIdentifiable, Boolean>(INDEX_FILE_EXTENSION, durableMode); tree = new OSBTreeBonsaiLocal<OIdentifiable, Boolean>(INDEX_FILE_EXTENSION, durableMode, storage);


tree.create(fileId, OLinkSerializer.INSTANCE, OBooleanSerializer.INSTANCE); tree.create(fileId, OLinkSerializer.INSTANCE, OBooleanSerializer.INSTANCE);
} }


public OIndexRIDContainerSBTree(long fileId, OBonsaiBucketPointer rootPointer, boolean durableMode) { public OIndexRIDContainerSBTree(long fileId, OBonsaiBucketPointer rootPointer, boolean durableMode,
tree = new OSBTreeBonsaiLocal<OIdentifiable, Boolean>(INDEX_FILE_EXTENSION, durableMode); OAbstractPaginatedStorage storage) {
tree.load(fileId, rootPointer, (OAbstractPaginatedStorage) ODatabaseRecordThreadLocal.INSTANCE.get().getStorage() tree = new OSBTreeBonsaiLocal<OIdentifiable, Boolean>(INDEX_FILE_EXTENSION, durableMode, storage);
.getUnderlying()); tree.load(fileId, rootPointer);
} }


public OIndexRIDContainerSBTree(String file, OBonsaiBucketPointer rootPointer, boolean durableMode) { public OIndexRIDContainerSBTree(String file, OBonsaiBucketPointer rootPointer, boolean durableMode,
tree = new OSBTreeBonsaiLocal<OIdentifiable, Boolean>(INDEX_FILE_EXTENSION, durableMode); OAbstractPaginatedStorage storage) {

tree = new OSBTreeBonsaiLocal<OIdentifiable, Boolean>(INDEX_FILE_EXTENSION, durableMode, storage);
final OAbstractPaginatedStorage storage = (OAbstractPaginatedStorage) ODatabaseRecordThreadLocal.INSTANCE.get().getStorage()
.getUnderlying();
final long fileId; final long fileId;
try { try {
OAtomicOperation atomicOperation = storage.getAtomicOperationsManager().getCurrentOperation(); OAtomicOperation atomicOperation = storage.getAtomicOperationsManager().getCurrentOperation();
Expand All @@ -78,7 +75,7 @@ public OIndexRIDContainerSBTree(String file, OBonsaiBucketPointer rootPointer, b
} catch (IOException e) { } catch (IOException e) {
throw new OSBTreeException("Exception during loading of sbtree " + file, e); throw new OSBTreeException("Exception during loading of sbtree " + file, e);
} }
tree.load(fileId, rootPointer, storage); tree.load(fileId, rootPointer);
} }


public OBonsaiBucketPointer getRootPointer() { public OBonsaiBucketPointer getRootPointer() {
Expand Down
@@ -1,22 +1,22 @@
/* /*
* *
* * Copyright 2014 Orient Technologies LTD (info(at)orientechnologies.com) * * Copyright 2014 Orient Technologies LTD (info(at)orientechnologies.com)
* * * *
* * Licensed under the Apache License, Version 2.0 (the "License"); * * Licensed under the Apache License, Version 2.0 (the "License");
* * you may not use this file except in compliance with the License. * * you may not use this file except in compliance with the License.
* * You may obtain a copy of the License at * * You may obtain a copy of the License at
* * * *
* * http://www.apache.org/licenses/LICENSE-2.0 * * http://www.apache.org/licenses/LICENSE-2.0
* * * *
* * Unless required by applicable law or agreed to in writing, software * * Unless required by applicable law or agreed to in writing, software
* * distributed under the License is distributed on an "AS IS" BASIS, * * distributed under the License is distributed on an "AS IS" BASIS,
* * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* * See the License for the specific language governing permissions and * * See the License for the specific language governing permissions and
* * limitations under the License. * * limitations under the License.
* * * *
* * For more information: http://www.orientechnologies.com * * For more information: http://www.orientechnologies.com
* *
*/ */


package com.orientechnologies.orient.core.db.record.ridbag.sbtree; package com.orientechnologies.orient.core.db.record.ridbag.sbtree;


Expand All @@ -25,6 +25,7 @@
import java.util.UUID; import java.util.UUID;


import com.orientechnologies.common.serialization.types.OIntegerSerializer; import com.orientechnologies.common.serialization.types.OIntegerSerializer;
import com.orientechnologies.orient.core.db.ODatabaseDocumentInternal;
import com.orientechnologies.orient.core.db.ODatabaseRecordThreadLocal; import com.orientechnologies.orient.core.db.ODatabaseRecordThreadLocal;
import com.orientechnologies.orient.core.db.record.OIdentifiable; import com.orientechnologies.orient.core.db.record.OIdentifiable;
import com.orientechnologies.orient.core.db.record.ridbag.ORidBag; import com.orientechnologies.orient.core.db.record.ridbag.ORidBag;
Expand All @@ -37,19 +38,22 @@
* @author Artem Orobets (enisher-at-gmail.com) * @author Artem Orobets (enisher-at-gmail.com)
*/ */
public class OSBTreeCollectionManagerShared extends OSBTreeCollectionManagerAbstract { public class OSBTreeCollectionManagerShared extends OSBTreeCollectionManagerAbstract {
private final OAbstractPaginatedStorage storage;
private final ThreadLocal<Map<UUID, OBonsaiCollectionPointer>> collectionPointerChanges = new ThreadLocal<Map<UUID, OBonsaiCollectionPointer>>() { private final ThreadLocal<Map<UUID, OBonsaiCollectionPointer>> collectionPointerChanges = new ThreadLocal<Map<UUID, OBonsaiCollectionPointer>>() {
@Override @Override
protected Map<UUID, OBonsaiCollectionPointer> initialValue() { protected Map<UUID, OBonsaiCollectionPointer> initialValue() {
return new HashMap<UUID, OBonsaiCollectionPointer>(); return new HashMap<UUID, OBonsaiCollectionPointer>();
} }
}; };


public OSBTreeCollectionManagerShared() { public OSBTreeCollectionManagerShared() {
super(); ODatabaseDocumentInternal db = ODatabaseRecordThreadLocal.INSTANCE.get();
this.storage = (OAbstractPaginatedStorage) db.getStorage().getUnderlying();
} }


public OSBTreeCollectionManagerShared(int evictionThreshold, int cacheMaxSize) { public OSBTreeCollectionManagerShared(int evictionThreshold, int cacheMaxSize, OAbstractPaginatedStorage storage) {
super(evictionThreshold, cacheMaxSize); super(evictionThreshold, cacheMaxSize);
this.storage = storage;
} }


@Override @Override
Expand All @@ -66,18 +70,20 @@ public OBonsaiCollectionPointer createSBTree(int clusterId, UUID ownerUUID) {


@Override @Override
protected OSBTreeBonsaiLocal<OIdentifiable, Integer> createTree(int clusterId) { protected OSBTreeBonsaiLocal<OIdentifiable, Integer> createTree(int clusterId) {
OSBTreeBonsaiLocal<OIdentifiable, Integer> tree = new OSBTreeBonsaiLocal<OIdentifiable, Integer>(DEFAULT_EXTENSION, true);
OSBTreeBonsaiLocal<OIdentifiable, Integer> tree = new OSBTreeBonsaiLocal<OIdentifiable, Integer>(DEFAULT_EXTENSION, true,
storage);
tree.create(FILE_NAME_PREFIX + clusterId, OLinkSerializer.INSTANCE, OIntegerSerializer.INSTANCE); tree.create(FILE_NAME_PREFIX + clusterId, OLinkSerializer.INSTANCE, OIntegerSerializer.INSTANCE);


return tree; return tree;
} }


@Override @Override
protected OSBTreeBonsai<OIdentifiable, Integer> loadTree(OBonsaiCollectionPointer collectionPointer) { protected OSBTreeBonsai<OIdentifiable, Integer> loadTree(OBonsaiCollectionPointer collectionPointer) {
OSBTreeBonsaiLocal<OIdentifiable, Integer> tree = new OSBTreeBonsaiLocal<OIdentifiable, Integer>(DEFAULT_EXTENSION, true); OSBTreeBonsaiLocal<OIdentifiable, Integer> tree = new OSBTreeBonsaiLocal<OIdentifiable, Integer>(DEFAULT_EXTENSION, true,
storage);


tree.load(collectionPointer.getFileId(), collectionPointer.getRootPointer(), tree.load(collectionPointer.getFileId(), collectionPointer.getRootPointer());
(OAbstractPaginatedStorage) ODatabaseRecordThreadLocal.INSTANCE.get().getStorage().getUnderlying());


return tree; return tree;
} }
Expand Down
Expand Up @@ -26,6 +26,7 @@
import com.orientechnologies.orient.core.index.engine.OSBTreeIndexEngine; import com.orientechnologies.orient.core.index.engine.OSBTreeIndexEngine;
import com.orientechnologies.orient.core.metadata.schema.OClass; import com.orientechnologies.orient.core.metadata.schema.OClass;
import com.orientechnologies.orient.core.record.impl.ODocument; import com.orientechnologies.orient.core.record.impl.ODocument;
import com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage;
import com.orientechnologies.orient.core.storage.impl.local.paginated.base.ODurablePage; import com.orientechnologies.orient.core.storage.impl.local.paginated.base.ODurablePage;


/** /**
Expand Down Expand Up @@ -98,12 +99,13 @@ public OIndexInternal<?> createIndex(ODatabaseDocumentInternal database, String
valueContainerAlgorithm = NONE_VALUE_CONTAINER; valueContainerAlgorithm = NONE_VALUE_CONTAINER;


if (SBTREE_ALGORITHM.equals(algorithm)) if (SBTREE_ALGORITHM.equals(algorithm))
return createSBTreeIndex(indexType, valueContainerAlgorithm, metadata); return createSBTreeIndex(indexType, valueContainerAlgorithm, metadata, (OAbstractPaginatedStorage) database.getStorage());


throw new OConfigurationException("Unsupported type : " + indexType); throw new OConfigurationException("Unsupported type : " + indexType);
} }


private OIndexInternal<?> createSBTreeIndex(String indexType, String valueContainerAlgorithm, ODocument metadata) { private OIndexInternal<?> createSBTreeIndex(String indexType, String valueContainerAlgorithm, ODocument metadata,
OAbstractPaginatedStorage storage) {
Boolean durableInNonTxMode; Boolean durableInNonTxMode;


Object durable = null; Object durable = null;
Expand All @@ -118,16 +120,16 @@ private OIndexInternal<?> createSBTreeIndex(String indexType, String valueContai
durableInNonTxMode = null; durableInNonTxMode = null;


if (OClass.INDEX_TYPE.UNIQUE.toString().equals(indexType)) { if (OClass.INDEX_TYPE.UNIQUE.toString().equals(indexType)) {
return new OIndexUnique(indexType, SBTREE_ALGORITHM, new OSBTreeIndexEngine<OIdentifiable>(durableInNonTxMode), return new OIndexUnique(indexType, SBTREE_ALGORITHM, new OSBTreeIndexEngine<OIdentifiable>(durableInNonTxMode, storage),
valueContainerAlgorithm, metadata); valueContainerAlgorithm, metadata);
} else if (OClass.INDEX_TYPE.NOTUNIQUE.toString().equals(indexType)) { } else if (OClass.INDEX_TYPE.NOTUNIQUE.toString().equals(indexType)) {
return new OIndexNotUnique(indexType, SBTREE_ALGORITHM, new OSBTreeIndexEngine<Set<OIdentifiable>>(durableInNonTxMode), return new OIndexNotUnique(indexType, SBTREE_ALGORITHM, new OSBTreeIndexEngine<Set<OIdentifiable>>(durableInNonTxMode,
valueContainerAlgorithm, metadata); storage), valueContainerAlgorithm, metadata);
} else if (OClass.INDEX_TYPE.FULLTEXT.toString().equals(indexType)) { } else if (OClass.INDEX_TYPE.FULLTEXT.toString().equals(indexType)) {
return new OIndexFullText(indexType, SBTREE_ALGORITHM, new OSBTreeIndexEngine<Set<OIdentifiable>>(durableInNonTxMode), return new OIndexFullText(indexType, SBTREE_ALGORITHM,
valueContainerAlgorithm, metadata); new OSBTreeIndexEngine<Set<OIdentifiable>>(durableInNonTxMode, storage), valueContainerAlgorithm, metadata);
} else if (OClass.INDEX_TYPE.DICTIONARY.toString().equals(indexType)) { } else if (OClass.INDEX_TYPE.DICTIONARY.toString().equals(indexType)) {
return new OIndexDictionary(indexType, SBTREE_ALGORITHM, new OSBTreeIndexEngine<OIdentifiable>(durableInNonTxMode), return new OIndexDictionary(indexType, SBTREE_ALGORITHM, new OSBTreeIndexEngine<OIdentifiable>(durableInNonTxMode, storage),
valueContainerAlgorithm, metadata); valueContainerAlgorithm, metadata);
} }


Expand Down
Expand Up @@ -41,7 +41,6 @@
import com.orientechnologies.orient.core.serialization.serializer.binary.impl.index.OSimpleKeySerializer; import com.orientechnologies.orient.core.serialization.serializer.binary.impl.index.OSimpleKeySerializer;
import com.orientechnologies.orient.core.serialization.serializer.stream.OStreamSerializer; import com.orientechnologies.orient.core.serialization.serializer.stream.OStreamSerializer;
import com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage; import com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage;
import com.orientechnologies.orient.core.storage.impl.local.paginated.base.ODurablePage;


/** /**
* @author Andrey Lomakin * @author Andrey Lomakin
Expand All @@ -58,7 +57,7 @@ public final class OHashTableIndexEngine<V> implements OIndexEngine<V> {


private volatile ORID identity; private volatile ORID identity;


public OHashTableIndexEngine(Boolean durableInNonTxMode) { public OHashTableIndexEngine(Boolean durableInNonTxMode, OAbstractPaginatedStorage storage) {
hashFunction = new OMurmurHash3HashFunction<Object>(); hashFunction = new OMurmurHash3HashFunction<Object>();


boolean durableInNonTx; boolean durableInNonTx;
Expand All @@ -68,7 +67,7 @@ public OHashTableIndexEngine(Boolean durableInNonTxMode) {
durableInNonTx = durableInNonTxMode; durableInNonTx = durableInNonTxMode;


hashTable = new OLocalHashTable<Object, V>(METADATA_FILE_EXTENSION, TREE_FILE_EXTENSION, BUCKET_FILE_EXTENSION, hashTable = new OLocalHashTable<Object, V>(METADATA_FILE_EXTENSION, TREE_FILE_EXTENSION, BUCKET_FILE_EXTENSION,
NULL_BUCKET_FILE_EXTENSION, hashFunction, durableInNonTx); NULL_BUCKET_FILE_EXTENSION, hashFunction, durableInNonTx, storage);
} }


@Override @Override
Expand Down Expand Up @@ -102,8 +101,8 @@ public void create(String indexName, OIndexDefinition indexDefinition, String cl


hashFunction.setValueSerializer(keySerializer); hashFunction.setValueSerializer(keySerializer);
hashTable.create(indexName, keySerializer, (OBinarySerializer<V>) valueSerializer, hashTable.create(indexName, keySerializer, (OBinarySerializer<V>) valueSerializer,
indexDefinition != null ? indexDefinition.getTypes() : null, storageLocalAbstract, indexDefinition != null indexDefinition != null ? indexDefinition.getTypes() : null,
&& !indexDefinition.isNullValuesIgnored()); indexDefinition != null && !indexDefinition.isNullValuesIgnored());
} }


@Override @Override
Expand All @@ -125,9 +124,8 @@ public void delete() {
public void load(ORID indexRid, String indexName, OIndexDefinition indexDefinition, OStreamSerializer valueSerializer, public void load(ORID indexRid, String indexName, OIndexDefinition indexDefinition, OStreamSerializer valueSerializer,
boolean isAutomatic) { boolean isAutomatic) {
identity = indexRid; identity = indexRid;
hashTable.load(indexName, indexDefinition != null ? indexDefinition.getTypes() : null, hashTable.load(indexName, indexDefinition != null ? indexDefinition.getTypes() : null, indexDefinition != null
(OAbstractPaginatedStorage) getDatabase().getStorage().getUnderlying(), && !indexDefinition.isNullValuesIgnored());
indexDefinition != null && !indexDefinition.isNullValuesIgnored());
hashFunction.setValueSerializer(hashTable.getKeySerializer()); hashFunction.setValueSerializer(hashTable.getKeySerializer());
} }


Expand Down
Expand Up @@ -39,7 +39,6 @@
import com.orientechnologies.orient.core.serialization.serializer.binary.impl.index.OSimpleKeySerializer; import com.orientechnologies.orient.core.serialization.serializer.binary.impl.index.OSimpleKeySerializer;
import com.orientechnologies.orient.core.serialization.serializer.stream.OStreamSerializer; import com.orientechnologies.orient.core.serialization.serializer.stream.OStreamSerializer;
import com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage; import com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage;
import com.orientechnologies.orient.core.storage.impl.local.paginated.base.ODurablePage;


/** /**
* @author Andrey Lomakin * @author Andrey Lomakin
Expand All @@ -52,7 +51,7 @@ public class OSBTreeIndexEngine<V> extends OSharedResourceAdaptiveExternal imple
private ORID identity; private ORID identity;
private final OSBTree<Object, V> sbTree; private final OSBTree<Object, V> sbTree;


public OSBTreeIndexEngine(Boolean durableInNonTxMode) { public OSBTreeIndexEngine(Boolean durableInNonTxMode, OAbstractPaginatedStorage storage) {
super(OGlobalConfiguration.ENVIRONMENT_CONCURRENT.getValueAsBoolean(), OGlobalConfiguration.MVRBTREE_TIMEOUT super(OGlobalConfiguration.ENVIRONMENT_CONCURRENT.getValueAsBoolean(), OGlobalConfiguration.MVRBTREE_TIMEOUT
.getValueAsInteger(), true); .getValueAsInteger(), true);


Expand All @@ -63,7 +62,7 @@ public OSBTreeIndexEngine(Boolean durableInNonTxMode) {
else else
durableInNonTx = durableInNonTxMode; durableInNonTx = durableInNonTxMode;


sbTree = new OSBTree<Object, V>(DATA_FILE_EXTENSION, durableInNonTx, NULL_BUCKET_FILE_EXTENSION); sbTree = new OSBTree<Object, V>(DATA_FILE_EXTENSION, durableInNonTx, NULL_BUCKET_FILE_EXTENSION, storage);
} }


@Override @Override
Expand Down Expand Up @@ -98,8 +97,8 @@ public void create(String indexName, OIndexDefinition indexDefinition, String cl
identity = identityRecord.getIdentity(); identity = identityRecord.getIdentity();


sbTree.create(indexName, keySerializer, (OBinarySerializer<V>) valueSerializer, sbTree.create(indexName, keySerializer, (OBinarySerializer<V>) valueSerializer,
indexDefinition != null ? indexDefinition.getTypes() : null, storageLocalAbstract, keySize, indexDefinition != null indexDefinition != null ? indexDefinition.getTypes() : null, keySize,
&& !indexDefinition.isNullValuesIgnored()); indexDefinition != null && !indexDefinition.isNullValuesIgnored());
} finally { } finally {
releaseExclusiveLock(); releaseExclusiveLock();
} }
Expand Down Expand Up @@ -147,7 +146,7 @@ public void deleteWithoutLoad(String indexName) {
final ODatabaseDocumentInternal database = getDatabase(); final ODatabaseDocumentInternal database = getDatabase();
final OAbstractPaginatedStorage storageLocalAbstract = (OAbstractPaginatedStorage) database.getStorage().getUnderlying(); final OAbstractPaginatedStorage storageLocalAbstract = (OAbstractPaginatedStorage) database.getStorage().getUnderlying();


sbTree.deleteWithoutLoad(indexName, storageLocalAbstract); sbTree.deleteWithoutLoad(indexName);
} finally { } finally {
releaseExclusiveLock(); releaseExclusiveLock();
} }
Expand All @@ -162,8 +161,8 @@ public void load(ORID indexRid, String indexName, OIndexDefinition indexDefiniti
final OAbstractPaginatedStorage storageLocalAbstract = (OAbstractPaginatedStorage) database.getStorage().getUnderlying(); final OAbstractPaginatedStorage storageLocalAbstract = (OAbstractPaginatedStorage) database.getStorage().getUnderlying();


sbTree.load(indexName, determineKeySerializer(indexDefinition), valueSerializer, sbTree.load(indexName, determineKeySerializer(indexDefinition), valueSerializer,
indexDefinition != null ? indexDefinition.getTypes() : null, storageLocalAbstract, determineKeySize(indexDefinition), indexDefinition != null ? indexDefinition.getTypes() : null, determineKeySize(indexDefinition), indexDefinition != null
indexDefinition != null && !indexDefinition.isNullValuesIgnored()); && !indexDefinition.isNullValuesIgnored());
} finally { } finally {
releaseExclusiveLock(); releaseExclusiveLock();
} }
Expand Down
Expand Up @@ -32,6 +32,7 @@
import com.orientechnologies.orient.core.metadata.schema.OClass; import com.orientechnologies.orient.core.metadata.schema.OClass;
import com.orientechnologies.orient.core.record.impl.ODocument; import com.orientechnologies.orient.core.record.impl.ODocument;
import com.orientechnologies.orient.core.storage.OStorage; import com.orientechnologies.orient.core.storage.OStorage;
import com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage;
import com.orientechnologies.orient.core.storage.impl.local.paginated.base.ODurablePage; import com.orientechnologies.orient.core.storage.impl.local.paginated.base.ODurablePage;


/** /**
Expand Down Expand Up @@ -99,10 +100,10 @@ public OIndexInternal<?> createIndex(ODatabaseDocumentInternal database, String


final String storageType = storage.getType(); final String storageType = storage.getType();
if (storageType.equals("memory") || storageType.equals("plocal")) if (storageType.equals("memory") || storageType.equals("plocal"))
indexEngine = new OHashTableIndexEngine(durableInNonTxMode); indexEngine = new OHashTableIndexEngine(durableInNonTxMode, (OAbstractPaginatedStorage) database.getStorage());
else if (storageType.equals("distributed")) else if (storageType.equals("distributed"))
// DISTRIBUTED CASE: HANDLE IT AS FOR LOCAL // DISTRIBUTED CASE: HANDLE IT AS FOR LOCAL
indexEngine = new OHashTableIndexEngine(durableInNonTxMode); indexEngine = new OHashTableIndexEngine(durableInNonTxMode, (OAbstractPaginatedStorage) database.getStorage());
else if (storageType.equals("remote")) else if (storageType.equals("remote"))
indexEngine = new ORemoteIndexEngine(); indexEngine = new ORemoteIndexEngine();
else else
Expand Down

0 comments on commit 8f52efd

Please sign in to comment.