/** * Delete the contents of an existing database, and replace it with an * empty one. When using a raw block device for the data file, this method * must be used to format it. */ static _LocalDatabase destroy(DatabaseConfig config) throws IOException { config = config.clone(); if (config.mReadOnly) { throw new IllegalArgumentException("Cannot destroy read-only database"); } _LocalDatabase db = new _LocalDatabase(config, OPEN_DESTROY); db.finishInit(config); return db; }
/** * Open a database, creating it if necessary. */ static _LocalDatabase open(DatabaseConfig config) throws IOException { config = config.clone(); _LocalDatabase db = new _LocalDatabase(config, OPEN_REGULAR); db.finishInit(config); return db; }
/** * Delete the contents of an existing database, and replace it with an * empty one. When using a raw block device for the data file, this method * must be used to format it. */ static _LocalDatabase destroy(DatabaseConfig config) throws IOException { config = config.clone(); if (config.mReadOnly) { throw new IllegalArgumentException("Cannot destroy read-only database"); } _LocalDatabase db = new _LocalDatabase(config, OPEN_DESTROY); try { db.finishInit(config); return db; } catch (Throwable e) { closeQuietly(null, db); throw e; } }
/** * Open a database, creating it if necessary. */ static _LocalDatabase open(DatabaseConfig config) throws IOException { config = config.clone(); _LocalDatabase db = new _LocalDatabase(config, OPEN_REGULAR); try { db.finishInit(config); return db; } catch (Throwable e) { closeQuietly(null, db); throw e; } }
/** * Delete the contents of an existing database, and replace it with an * empty one. When using a raw block device for the data file, this method * must be used to format it. */ static _LocalDatabase destroy(DatabaseConfig config) throws IOException { config = config.clone(); if (config.mReadOnly) { throw new IllegalArgumentException("Cannot destroy read-only database"); } _LocalDatabase db = new _LocalDatabase(config, OPEN_DESTROY); try { db.finishInit(config); return db; } catch (Throwable e) { closeQuietly(db); throw e; } }
/** * Open a database, creating it if necessary. */ static _LocalDatabase open(DatabaseConfig config) throws IOException { config = config.clone(); _LocalDatabase db = new _LocalDatabase(config, OPEN_REGULAR); try { db.finishInit(config); return db; } catch (Throwable e) { closeQuietly(db); throw e; } }
/** * @param config base file is set as a side-effect */ static _Tree openTemp(TempFileManager tfm, DatabaseConfig config) throws IOException { File file = tfm.createTempFile(); config.baseFile(file); config.dataFile(file); config.createFilePath(false); config.durabilityMode(DurabilityMode.NO_FLUSH); _LocalDatabase db = new _LocalDatabase(config, OPEN_TEMP); tfm.register(file, db); db.mCheckpointer.start(false); return db.mRegistry; }
/** * @param config base file is set as a side-effect */ static _Tree openTemp(TempFileManager tfm, DatabaseConfig config) throws IOException { File file = tfm.createTempFile(); config.baseFile(file); config.dataFile(file); config.createFilePath(false); config.durabilityMode(DurabilityMode.NO_FLUSH); _LocalDatabase db = new _LocalDatabase(config, OPEN_TEMP); tfm.register(file, db); db.mCheckpointer = new Checkpointer(db, config); db.mCheckpointer.start(false); return db.mRegistry; }
/** * @param config base file is set as a side-effect */ static _Tree openTemp(TempFileManager tfm, DatabaseConfig config) throws IOException { File file = tfm.createTempFile(); config.baseFile(file); config.dataFile(file); config.createFilePath(false); config.durabilityMode(DurabilityMode.NO_FLUSH); _LocalDatabase db = new _LocalDatabase(config, OPEN_TEMP); tfm.register(file, db); db.mCheckpointer = new Checkpointer(db, config); db.mCheckpointer.start(false); return db.mRegistry; }