@Override public Long call(ODatabaseDocumentInternal database) { return database.getStorage().count(cluster2Id); } });
@Override public Long call(ODatabaseDocumentInternal database) { return database.getStorage().count(cluster1Id); } });
@Override public long[] call(ODatabaseDocumentInternal database) { return database.getStorage().getClusterDataRange(clusterId1); } });
@Override public long[] call(ODatabaseDocumentInternal database) { return database.getStorage().getClusterDataRange(clusterId1); } });
@Override public String call(ODatabaseDocumentInternal database) { return database.getStorage().getType(); } });
@Override public String call(ODatabaseDocumentInternal database) { return database.getStorage().getType(); } });
public boolean autoRecreateIndexesAfterCrash(ODatabaseDocumentInternal database) { if (rebuildCompleted) return false; final OStorage storage = database.getStorage(); if (storage instanceof OAbstractPaginatedStorage) { OAbstractPaginatedStorage paginatedStorage = (OAbstractPaginatedStorage) storage; return paginatedStorage.wereDataRestoredAfterOpen() && paginatedStorage.wereNonTxOperationsPerformedInPreviousOpen(); } return false; }
@Override public void close() { clearOwner(); if (internal != null) { delegateStorage = internal.getStorage(); internal.close(); internal = null; } }
@Override public ORawBuffer call(ODatabaseDocumentInternal database) { return database.getStorage().readRecord(rid, null, true, false, null).getResult(); } });
@Override public ORawBuffer call(ODatabaseDocumentInternal database) { return database.getStorage().readRecord(rid2, null, true, false, null).getResult(); } });
private void updateRangesOnLiveUpdate() { if (liveUpdated) { final long[] range = database.getStorage().getClusterDataRange(current.getClusterId()); firstClusterEntry = range[0]; lastClusterEntry = range[1]; } } }
public static DateFormat getDateFormatInstance() { final ODatabaseDocumentInternal db = ODatabaseRecordThreadLocal.instance().getIfDefined(); if (db != null && !db.isClosed()) return db.getStorage().getConfiguration().getDateFormatInstance(); else return new SimpleDateFormat(DEF_DATE_FORMAT); }
private static Locale getServerLocale() { ODatabaseDocumentInternal db = ODatabaseRecordThreadLocal.instance().get(); OStorage storage = db.getStorage(); OStorageConfiguration configuration = storage.getConfiguration(); return configuration.getLocaleInstance(); }
@Override public int getSerializedSize() { int result = 2 * OLongSerializer.LONG_SIZE + 3 * OIntegerSerializer.INT_SIZE; if (ODatabaseRecordThreadLocal.instance().get().getStorage() instanceof OStorageProxy || ORecordSerializationContext.getContext() == null) { result += getChangesSerializedSize(); } return result; }
protected void checkForSystemClusters(final ODatabaseDocumentInternal iDatabase, final int[] iClusterIds) { for (int clId : iClusterIds) { final OCluster cl = iDatabase.getStorage().getClusterById(clId); if (cl != null && cl.isSystemCluster()) { final OSecurityUser dbUser = iDatabase.getUser(); if (dbUser == null || dbUser.allow(ORule.ResourceGeneric.SYSTEM_CLUSTERS, null, ORole.PERMISSION_READ) != null) // AUTHORIZED break; } } }
public static String getDateTimeFormat() { final ODatabaseDocumentInternal db = ODatabaseRecordThreadLocal.instance().getIfDefined(); if (db != null && !db.isClosed()) return db.getStorage().getConfiguration().getDateTimeFormat(); else return DEF_DATETIME_FORMAT; }
public static String getDateFormat() { final ODatabaseDocumentInternal db = ODatabaseRecordThreadLocal.instance().getIfDefined(); if (db != null && !db.isClosed()) return db.getStorage().getConfiguration().getDateFormat(); else return DEF_DATE_FORMAT; }
protected void dumpDistributedConfiguration(final boolean iForce) { if (currentDatabase == null) return; final OStorage stg = currentDatabase.getStorage(); if (stg instanceof OStorageRemote) { final ODocument distributedCfg = ((OStorageRemote) stg).getClusterConfiguration(); if (distributedCfg != null && !distributedCfg.isEmpty()) { message("\n\nDISTRIBUTED CONFIGURATION:\n" + distributedCfg.toJSON("prettyPrint")); } else if (iForce) message("\n\nDISTRIBUTED CONFIGURATION: none (OrientDB is running in standalone mode)"); } }
protected void setEncryptionInternal(ODatabaseDocumentInternal database, final String iValue) { for (int cl : getClusterIds()) { final OCluster c = database.getStorage().getClusterById(cl); if (c != null) try { c.set(OCluster.ATTRIBUTES.ENCRYPTION, iValue); } catch (IOException e) { OLogManager.instance().error(this, "Can not set value of encryption parameter to '%s'", e, iValue); } } }
private void distributedDropIndex(final String iName) { String dropIndexDDL = "DROP INDEX `" + iName + "`"; //noinspection deprecation getDatabase().command(new OCommandSQL(dropIndexDDL)).execute(); ORecordInternal .setIdentity(delegate.getDocument(), new ORecordId(getDatabase().getStorage().getConfiguration().getIndexMgrRecordId())); reload(); }