Tabnine Logo
SystemTableBackup
Code IndexAdd Tabnine to your IDE (free)

How to use
SystemTableBackup
in
com.moz.fiji.schema.avro

Best Java code snippets using com.moz.fiji.schema.avro.SystemTableBackup (Showing top 6 results out of 315)

origin: com.moz.fiji.schema/fiji-schema-cassandra

/** {@inheritDoc} */
@Override
public void fromBackup(SystemTableBackup backup) throws IOException {
 final State state = mState.get();
 Preconditions.checkState(state == State.OPEN,
   "Cannot restore backup to SystemTable instance in state %s.", state);
 LOG.info(String.format("Restoring system table from backup with %d entries.",
   backup.getEntries().size()));
 for (SystemTableEntry entry : backup.getEntries()) {
  putValue(entry.getKey(), entry.getValue().array());
 }
 // TODO: Flush?
 //mTable.flushCommits();
}
origin: com.moz.fiji.schema/fiji-schema-cassandra

/** {@inheritDoc} */
@Override
public SystemTableBackup toBackup() throws IOException {
 final State state = mState.get();
 Preconditions.checkState(state == State.OPEN,
   "Cannot backup SystemTable instance in state %s.", state);
 ArrayList<SystemTableEntry> backupEntries = new ArrayList<SystemTableEntry>();
 CloseableIterable<SimpleEntry<String, byte[]>> entries = getAll();
 for (SimpleEntry<String, byte[]> entry : entries) {
  backupEntries.add(SystemTableEntry.newBuilder()
    .setKey(entry.getKey())
    .setValue(ByteBuffer.wrap(entry.getValue()))
    .build());
 }
 return SystemTableBackup.newBuilder().setEntries(backupEntries).build();
}
origin: com.moz.fiji.schema/fiji-schema

/** {@inheritDoc} */
@Override
public SystemTableBackup toBackup() throws IOException {
 final State state = mState.get();
 Preconditions.checkState(state == State.OPEN,
   "Cannot backup SystemTable instance in state %s.", state);
 ArrayList<SystemTableEntry> backupEntries = new ArrayList<SystemTableEntry>();
 CloseableIterable<SimpleEntry<String, byte[]>> entries = getAll();
 for (SimpleEntry<String, byte[]> entry : entries) {
  backupEntries.add(SystemTableEntry.newBuilder()
    .setKey(entry.getKey())
    .setValue(ByteBuffer.wrap(entry.getValue()))
    .build());
 }
 return SystemTableBackup.newBuilder().setEntries(backupEntries).build();
}
origin: com.moz.fiji.schema/fiji-schema

/** {@inheritDoc} */
@Override
public void fromBackup(SystemTableBackup backup) throws IOException {
 final State state = mState.get();
 Preconditions.checkState(state == State.OPEN,
   "Cannot restore backup to SystemTable instance in state %s.", state);
 LOG.info(String.format("Restoring system table from backup with %d entries.",
   backup.getEntries().size()));
 for (SystemTableEntry entry : backup.getEntries()) {
  putValue(entry.getKey(), entry.getValue().array());
 }
 mTable.flushCommits();
}
origin: com.moz.fiji.schema/fiji-schema

 /**
  * Restores all SystemTable entries from the backup.
  *
  * @param backup the deserialized backup of the metadata.
  * @param fiji the connected Fiji instance.
  * @throws IOException if there is an error communicating with HBase.
  */
 public void restoreSystemVars(MetadataBackup backup, Fiji fiji) throws IOException {
  // Restore all System table entries from the file.
  final FijiSystemTable systemTable = fiji.getSystemTable();
  LOG.info("Restoring system table entries...");
  systemTable.fromBackup(backup.getSystemTable());
  LOG.info(String.format("Restored %d entries.", backup.getSystemTable().getEntries().size()));
 }
}
origin: com.moz.fiji.schema/fiji-schema-cassandra

 /**
  * Restores all SystemTable entries from the backup.
  *
  * @param backup the deserialized backup of the metadata.
  * @param fiji the connected Fiji instance.
  * @throws java.io.IOException if there is an error communicating with HBase.
  */
 public void restoreSystemVars(MetadataBackup backup, Fiji fiji) throws IOException {
  // Restore all System table entries from the file.
  final FijiSystemTable systemTable = fiji.getSystemTable();
  LOG.info("Restoring system table entries...");
  systemTable.fromBackup(backup.getSystemTable());
  LOG.info(String.format("Restored %d entries.", backup.getSystemTable().getEntries().size()));
 }
}
com.moz.fiji.schema.avroSystemTableBackup

Most used methods

  • getEntries
  • newBuilder

Popular in Java

  • Reactive rest calls using spring rest template
  • getResourceAsStream (ClassLoader)
  • putExtra (Intent)
  • getSystemService (Context)
  • GridLayout (java.awt)
    The GridLayout class is a layout manager that lays out a container's components in a rectangular gri
  • BufferedImage (java.awt.image)
    The BufferedImage subclass describes an java.awt.Image with an accessible buffer of image data. All
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • ArrayList (java.util)
    ArrayList is an implementation of List, backed by an array. All optional operations including adding
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • Reflections (org.reflections)
    Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t
  • Top PhpStorm plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now