use of org.neo4j.exceptions.UnderlyingStorageException in project neo4j by neo4j.
the class MetaDataStore method readAllFields.
private void readAllFields(PageCursor cursor) throws IOException {
do {
creationTimeField = getRecordValue(cursor, Position.TIME);
randomNumberField = getRecordValue(cursor, Position.RANDOM_NUMBER);
versionField = getRecordValue(cursor, Position.LOG_VERSION);
long lastCommittedTxId = getRecordValue(cursor, Position.LAST_TRANSACTION_ID);
lastCommittingTxField.set(lastCommittedTxId);
storeVersionField = getRecordValue(cursor, Position.STORE_VERSION);
getRecordValue(cursor, Position.FIRST_GRAPH_PROPERTY);
latestConstraintIntroducingTxField = getRecordValue(cursor, Position.LAST_CONSTRAINT_TRANSACTION);
upgradeTxIdField = getRecordValue(cursor, Position.UPGRADE_TRANSACTION_ID);
upgradeTxChecksumField = (int) getRecordValue(cursor, Position.UPGRADE_TRANSACTION_CHECKSUM);
upgradeTimeField = getRecordValue(cursor, Position.UPGRADE_TIME);
long lastClosedTransactionLogVersion = getRecordValue(cursor, Position.LAST_CLOSED_TRANSACTION_LOG_VERSION);
long lastClosedTransactionLogByteOffset = getRecordValue(cursor, Position.LAST_CLOSED_TRANSACTION_LOG_BYTE_OFFSET);
lastClosedTx.set(lastCommittedTxId, new long[] { lastClosedTransactionLogVersion, lastClosedTransactionLogByteOffset });
highestCommittedTransaction.set(lastCommittedTxId, (int) getRecordValue(cursor, Position.LAST_TRANSACTION_CHECKSUM), getRecordValue(cursor, Position.LAST_TRANSACTION_COMMIT_TIMESTAMP, UNKNOWN_TX_COMMIT_TIMESTAMP));
upgradeCommitTimestampField = getRecordValue(cursor, Position.UPGRADE_TRANSACTION_COMMIT_TIMESTAMP, BASE_TX_COMMIT_TIMESTAMP);
externalStoreUUID = readExternalStoreUUID(cursor);
databaseUUID = readDatabaseUUID(cursor);
upgradeTransaction = new TransactionId(upgradeTxIdField, upgradeTxChecksumField, upgradeCommitTimestampField);
checkpointLogVersionField = getRecordValue(cursor, CHECKPOINT_LOG_VERSION, 0);
kernelVersion = getRecordValue(cursor, KERNEL_VERSION);
} while (cursor.shouldRetry());
if (cursor.checkAndClearBoundsFlag()) {
throw new UnderlyingStorageException("Out of page bounds when reading all meta-data fields. The page in question is page " + cursor.getCurrentPageId() + " of file " + storageFile.toAbsolutePath() + ", which is " + cursor.getCurrentPageSize() + " bytes in size");
}
}
use of org.neo4j.exceptions.UnderlyingStorageException in project neo4j by neo4j.
the class RecordStorageEngineTest method executeFailingTransaction.
private static Exception executeFailingTransaction(RecordStorageEngine engine) throws IOException {
Exception applicationError = new UnderlyingStorageException("No space left on device");
CommandsToApply txToApply = newTransactionThatFailsWith(applicationError);
try {
engine.apply(txToApply, TransactionApplicationMode.INTERNAL);
fail("Exception expected");
} catch (Exception e) {
assertSame(applicationError, getRootCause(e));
}
return applicationError;
}
Aggregations