use of com.orientechnologies.orient.core.storage.OStorage in project orientdb by orientechnologies.
the class OPropertyImpl method setLinkedType.
public OProperty setLinkedType(final OType linkedType) {
getDatabase().checkSecurity(ORule.ResourceGeneric.SCHEMA, ORole.PERMISSION_UPDATE);
checkLinkTypeSupport(getType());
acquireSchemaWriteLock();
try {
final ODatabaseDocumentInternal database = getDatabase();
final OStorage storage = database.getStorage();
if (storage instanceof OStorageProxy) {
final String cmd = String.format("alter property %s linkedtype %s", getFullNameQuoted(), linkedType);
database.command(new OCommandSQL(cmd)).execute();
} else if (isDistributedCommand()) {
final String cmd = String.format("alter property %s linkedtype %s", getFullNameQuoted(), linkedType);
final OCommandSQL commandSQL = new OCommandSQL(cmd);
commandSQL.addExcludedNode(((OAutoshardedStorage) storage).getNodeId());
database.command(commandSQL).execute();
setLinkedTypeInternal(linkedType);
} else
setLinkedTypeInternal(linkedType);
} finally {
releaseSchemaWriteLock();
}
return this;
}
use of com.orientechnologies.orient.core.storage.OStorage in project orientdb by orientechnologies.
the class OPropertyImpl method setCustom.
public OPropertyImpl setCustom(final String name, final String value) {
getDatabase().checkSecurity(ORule.ResourceGeneric.SCHEMA, ORole.PERMISSION_UPDATE);
acquireSchemaWriteLock();
try {
final String cmd = String.format("alter property %s custom %s=%s", getFullNameQuoted(), name, quoteString(value));
final ODatabaseDocumentInternal database = getDatabase();
final OStorage storage = database.getStorage();
if (storage instanceof OStorageProxy) {
database.command(new OCommandSQL(cmd)).execute();
} else if (isDistributedCommand()) {
final OCommandSQL commandSQL = new OCommandSQL(cmd);
commandSQL.addExcludedNode(((OAutoshardedStorage) storage).getNodeId());
database.command(commandSQL).execute();
setCustomInternal(name, value);
} else
setCustomInternal(name, value);
} finally {
releaseSchemaWriteLock();
}
return this;
}
use of com.orientechnologies.orient.core.storage.OStorage in project orientdb by orientechnologies.
the class OIndexManagerAbstract method getServerLocale.
protected Locale getServerLocale() {
ODatabaseDocumentInternal db = getDatabase();
OStorage storage = db.getStorage();
OStorageConfiguration configuration = storage.getConfiguration();
return configuration.getLocaleInstance();
}
use of com.orientechnologies.orient.core.storage.OStorage in project orientdb by orientechnologies.
the class OIndexManagerShared method autoRecreateIndexesAfterCrash.
public boolean autoRecreateIndexesAfterCrash() {
if (rebuildCompleted)
return false;
final ODatabaseDocumentInternal database = ODatabaseRecordThreadLocal.INSTANCE.get();
final OStorage storage = database.getStorage().getUnderlying();
if (storage instanceof OAbstractPaginatedStorage) {
OAbstractPaginatedStorage paginatedStorage = (OAbstractPaginatedStorage) storage;
return paginatedStorage.wereDataRestoredAfterOpen() && paginatedStorage.wereNonTxOperationsPerformedInPreviousOpen();
}
return false;
}
use of com.orientechnologies.orient.core.storage.OStorage in project orientdb by orientechnologies.
the class OIndexDefinitionFactory method getServerLocale.
private static Locale getServerLocale() {
ODatabaseDocumentInternal db = ODatabaseRecordThreadLocal.INSTANCE.get();
OStorage storage = db.getStorage();
OStorageConfiguration configuration = storage.getConfiguration();
return configuration.getLocaleInstance();
}
Aggregations