@Override public void setCacheSizeMax(int kb) { if (database.isPersistent()) { database.setCacheSize(kb); } }
@Override public long getFileWriteCountTotal() { if (!database.isPersistent()) { return 0; } PageStore p = database.getPageStore(); if (p != null) { return p.getWriteCountTotal(); } // TODO remove this method when removing the page store // (the MVStore doesn't support it) return 0; }
/** * Construct a new row list for this session. * * @param session the session */ public RowList(Session session) { this.session = session; if (session.getDatabase().isPersistent()) { maxMemory = session.getDatabase().getMaxOperationMemory(); } else { maxMemory = 0; } }
public Value getTransactionId() { if (database.getMvStore() != null) { if (transaction == null) { return ValueNull.INSTANCE; } return ValueString.get(Long.toString(getTransaction().getId())); } if (!database.isPersistent()) { return ValueNull.INSTANCE; } if (undoLog.size() == 0) { return ValueNull.INSTANCE; } return ValueString.get(firstUncommittedLog + "-" + firstUncommittedPos + "-" + id); }
PageStore store = null; Store mvStore = null; if (db.isPersistent()) { store = db.getPageStore(); if (store != null) {
@Override public int getCacheSizeMax() { if (!database.isPersistent()) { return 0; } PageStore p = database.getPageStore(); if (p != null) { return p.getCache().getMaxMemory(); } return database.getMvStore().getStore().getCacheSize() * 1024; }
@Override public int getCacheSize() { if (!database.isPersistent()) { return 0; } PageStore p = database.getPageStore(); if (p != null) { return p.getCache().getMemory(); } return database.getMvStore().getStore().getCacheSizeUsed() * 1024; }
@Override public long getFileWriteCount() { if (!database.isPersistent()) { return 0; } PageStore p = database.getPageStore(); if (p != null) { return p.getWriteCount(); } return database.getMvStore().getStore().getFileStore().getReadCount(); }
@Override public long getFileReadCount() { if (!database.isPersistent()) { return 0; } PageStore p = database.getPageStore(); if (p != null) { return p.getReadCount(); } return database.getMvStore().getStore().getFileStore().getReadCount(); }
@Override public long getFileSize() { if (!database.isPersistent()) { return 0; } PageStore p = database.getPageStore(); if (p != null) { return p.getPageCount() * p.getPageSize() / 1024; } return database.getMvStore().getStore().getFileStore().size(); }
/** * Construct a local result object. * * @param session the session * @param expressions the expression array * @param visibleColumnCount the number of visible columns */ public LocalResult(Session session, Expression[] expressions, int visibleColumnCount) { this.session = session; if (session == null) { this.maxMemoryRows = Integer.MAX_VALUE; } else { Database db = session.getDatabase(); if (db.isPersistent() && !db.isReadOnly()) { this.maxMemoryRows = session.getDatabase().getMaxMemoryRows(); } else { this.maxMemoryRows = Integer.MAX_VALUE; } } rows = New.arrayList(); this.visibleColumnCount = visibleColumnCount; rowId = -1; this.expressions = expressions; }
public PageDelegateIndex(RegularTable table, int id, String name, IndexType indexType, PageDataIndex mainIndex, boolean create, Session session) { IndexColumn[] cols = IndexColumn.wrap( new Column[] { table.getColumn(mainIndex.getMainIndexColumn())}); this.initBaseIndex(table, id, name, cols, indexType); this.mainIndex = mainIndex; if (!database.isPersistent() || id < 0) { throw DbException.throwInternalError("" + name); } PageStore store = database.getPageStore(); store.addIndex(this); if (create) { store.addMeta(this, session); } }
memoryUndo++; if (memoryUndo > database.getMaxMemoryUndo() && database.isPersistent() && !database.isMultiVersion()) { if (file == null) { database.isPersistent() && !database.isMultiVersion()) { if (file == null) {
public RegularTable(CreateTableData data) { super(data); nextAnalyze = database.getSettings().analyzeAuto; this.isHidden = data.isHidden; boolean b = false; for (Column col : getColumns()) { if (DataType.isLargeObject(col.getType())) { b = true; break; } } containsLargeObject = b; if (data.persistData && database.isPersistent()) { mainIndex = new PageDataIndex(this, data.id, IndexColumn.wrap(getColumns()), IndexType.createScan(data.persistData), data.create, data.session); scanIndex = mainIndex; } else { mainIndex = null; scanIndex = new ScanIndex(this, data.id, IndexColumn.wrap(getColumns()), IndexType.createScan(data.persistData)); } indexes.add(scanIndex); traceLock = database.getTrace(Trace.LOCK); }
private void backupTo(String fileName) { Database db = session.getDatabase(); if (!db.isPersistent()) { throw DbException.get(ErrorCode.DATABASE_IS_NOT_PERSISTENT);
this.store = database.getPageStore(); store.addIndex(this); if (!database.isPersistent()) { throw DbException.throwInternalError(table.getName());
if (!database.isPersistent() || id < 0) { throw DbException.throwInternalError("" + indexName);
if (!db.isPersistent()) { data.persistIndexes = false;
boolean persistent = db.isPersistent(); Table table = getSchema().findTableOrView(session, tableName); if (table == null) {
case SetTypes.LOG: { int value = getIntValue(); if (database.isPersistent() && value != database.getLogMode()) { session.getUser().checkAdmin(); database.setLogMode(value);