public void setDefaultClusterName(final String defaultClusterName) { acquireExclusiveLock(); try { this.defaultClusterName = defaultClusterName; } finally { releaseExclusiveLock(); } }
void clearMetadata() { acquireExclusiveLock(); try { indexes.clear(); classPropertyIndex.clear(); } finally { releaseExclusiveLock(); } }
@Override public OIndexManagerAbstract reload() { acquireExclusiveLock(); try { return super.reload(); } finally { releaseExclusiveLock(); } }
void setDirty() { acquireExclusiveLock(); try { document.setDirty(); } finally { releaseExclusiveLock(); } }
@Override public void fromStream(ODocument iDocument) { //This is the only case where the write locking make sense enabling it using super super.acquireExclusiveLock(); try { super.fromStream(iDocument); } finally { super.releaseExclusiveLock(); } }
private OIndex<?> createDictionaryIfNeeded() { acquireExclusiveLock(); try { OIndex<?> idx = getIndex(DICTIONARY_NAME); return idx != null ? idx : createDictionary(); } finally { releaseExclusiveLock(); } }
void addIndexInternal(final OIndex<?> index) { acquireExclusiveLock(); try { final Locale locale = getServerLocale();
@Override public Object call() { acquireExclusiveLock(); try { boolean saved = false; for (int retry = 0; retry < 10; retry++) try { toStream(); document.save(); saved = true; break; } catch (OConcurrentModificationException e) { OLogManager.instance().debug(this, "concurrent modification while saving index manager configuration", e); reload(null, true); } if (!saved) OLogManager.instance().error(this, "failed to save the index manager configuration after 10 retries", null); return null; } finally { releaseExclusiveLock(); } } });
public OIndexManagerAbstract load(ODatabaseDocumentInternal database) { if (!autoRecreateIndexesAfterCrash(database)) { acquireExclusiveLock(); try { if (database.getStorage().getConfiguration().getIndexMgrRecordId() == null) // @COMPATIBILITY: CREATE THE INDEX MGR create(database); // RELOAD IT ((ORecordId) document.getIdentity()).fromString(database.getStorage().getConfiguration().getIndexMgrRecordId()); super.reload("*:-1 index:0"); } finally { releaseExclusiveLock(); } } return this; }
public void create(ODatabaseDocumentInternal database) { acquireExclusiveLock(); try { try { save(OMetadataDefault.CLUSTER_INTERNAL_NAME); } catch (Exception e) { OLogManager.instance().error(this, "Error during storing of index manager metadata," + " will try to allocate new document to store index manager metadata", e); // RESET RID TO ALLOCATE A NEW ONE if (ORecordId.isPersistent(document.getIdentity().getClusterPosition())) { document.getIdentity().reset(); save(OMetadataDefault.CLUSTER_INTERNAL_NAME); } } database.getStorage().setIndexMgrRecordId(document.getIdentity().toString()); OIndexFactory factory = OIndexes.getFactory(OClass.INDEX_TYPE.DICTIONARY.toString(), null); createIndex(DICTIONARY_NAME, OClass.INDEX_TYPE.DICTIONARY.toString(), new OSimpleKeyIndexDefinition(factory.getLastVersion(), OType.STRING), null, null, null); } finally { releaseExclusiveLock(); } }