/** {@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(); }
/** {@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(); }
/** * 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())); } }
/** * 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())); } }