Codota Logo
BackupEngine.createNewBackup
Code IndexAdd Codota to your IDE (free)

How to use
createNewBackup
method
in
org.rocksdb.BackupEngine

Best Java code snippets using org.rocksdb.BackupEngine.createNewBackup (Showing top 4 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
ScheduledThreadPoolExecutor s =
  • Codota Iconnew ScheduledThreadPoolExecutor(corePoolSize)
  • Codota IconThreadFactory threadFactory;new ScheduledThreadPoolExecutor(corePoolSize, threadFactory)
  • Codota IconString str;new ScheduledThreadPoolExecutor(1, new ThreadFactoryBuilder().setNameFormat(str).build())
  • Smart code suggestions by Codota
}
origin: ethereum/ethereumj

public void backup() {
  resetDbLock.readLock().lock();
  if (logger.isTraceEnabled()) logger.trace("~> RocksDbDataSource.backup(): " + name);
  Path path = backupPath();
  path.toFile().mkdirs();
  try (BackupableDBOptions backupOptions = new BackupableDBOptions(path.toString());
     BackupEngine backups = BackupEngine.open(Env.getDefault(), backupOptions)) {
    backups.createNewBackup(db, true);
    if (logger.isTraceEnabled()) logger.trace("<~ RocksDbDataSource.backup(): " + name + " done");
  } catch (RocksDBException e) {
    logger.error("Failed to backup database '{}'", name, e);
    hintOnTooManyOpenFiles(e);
    throw new RuntimeException(e);
  } finally {
    resetDbLock.readLock().unlock();
  }
}
origin: org.rocksdb/rocksdbjni

/**
 * Captures the state of the database in the latest backup
 *
 * Just a convenience for {@link #createNewBackup(RocksDB, boolean)} with
 * the flushBeforeBackup parameter set to false
 *
 * @param db The database to backup
 *
 * Note - This method is not thread safe
 *
 * @throws RocksDBException thrown if a new backup could not be created
 */
public void createNewBackup(final RocksDB db) throws RocksDBException {
 createNewBackup(db, false);
}
origin: org.rocksdb/rocksdbjni

/**
 * Captures the state of the database in the latest backup
 *
 * @param db The database to backup
 * @param flushBeforeBackup When true, the Backup Engine will first issue a
 *                          memtable flush and only then copy the DB files to
 *                          the backup directory. Doing so will prevent log
 *                          files from being copied to the backup directory
 *                          (since flush will delete them).
 *                          When false, the Backup Engine will not issue a
 *                          flush before starting the backup. In that case,
 *                          the backup will also include log files
 *                          corresponding to live memtables. The backup will
 *                          always be consistent with the current state of the
 *                          database regardless of the flushBeforeBackup
 *                          parameter.
 *
 * Note - This method is not thread safe
 *
 * @throws RocksDBException thrown if a new backup could not be created
 */
public void createNewBackup(
  final RocksDB db, final boolean flushBeforeBackup)
  throws RocksDBException {
 assert (isOwningHandle());
 createNewBackup(nativeHandle_, db.nativeHandle_, flushBeforeBackup);
}
origin: jwplayer/southpaw

/**
 * Backups the DB to a local path.
 * @param backupPath - The local backup path
 */
protected void backup(String backupPath) throws RocksDBException {
  File file = new File(backupPath);
  if(!file.exists()) file.mkdir();
  BackupableDBOptions backupOptions = new BackupableDBOptions(backupPath)
      .setShareTableFiles(true)
      .setMaxBackgroundOperations(parallelism);
  BackupEngine backupEngine = BackupEngine.open(Env.getDefault(), backupOptions);
  backupEngine.createNewBackup(rocksDB, true);
  backupEngine.purgeOldBackups(backupsToKeep);
  backupEngine.close();
  backupOptions.close();
}
org.rocksdbBackupEnginecreateNewBackup

Javadoc

Captures the state of the database in the latest backup Just a convenience for #createNewBackup(RocksDB,boolean) with the flushBeforeBackup parameter set to false

Popular methods of BackupEngine

  • getBackupInfo
  • open
    Opens a new Backup Engine
  • restoreDbFromLatestBackup
    Restore the database from the latest backup
  • purgeOldBackups
  • <init>
  • close
  • createNewBackupWithMetadata
    Captures the state of the database in the latest backup along with application specific metadata.
  • deleteBackup
  • garbageCollect
  • getCorruptedBackups
  • isOwningHandle
  • restoreDbFromBackup
  • isOwningHandle,
  • restoreDbFromBackup

Popular in Java

  • Creating JSON documents from java classes using gson
  • getContentResolver (Context)
  • getSystemService (Context)
  • runOnUiThread (Activity)
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • KeyStore (java.security)
    This class represents an in-memory collection of keys and certificates. It manages two types of entr
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • Stream (java.util.stream)
    A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
  • JLabel (javax.swing)
  • JPanel (javax.swing)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now