Package org.apache.hadoop.hbase.protobuf.generated.HBaseProtos

Examples of org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.SnapshotDescription


    } catch (UnsupportedOperationException e) {
      throw new ServiceException(e);
    }

    try {
      SnapshotDescription reqSnapshot = request.getSnapshot();
      snapshotManager.restoreSnapshot(reqSnapshot);
      return RestoreSnapshotResponse.newBuilder().build();
    } catch (IOException e) {
      throw new ServiceException(e);
    }
View Full Code Here


   */
  @Override
  public IsRestoreSnapshotDoneResponse isRestoreSnapshotDone(RpcController controller,
      IsRestoreSnapshotDoneRequest request) throws ServiceException {
    try {
      SnapshotDescription snapshot = request.getSnapshot();
      IsRestoreSnapshotDoneResponse.Builder builder = IsRestoreSnapshotDoneResponse.newBuilder();
      boolean done = snapshotManager.isRestoreDone(snapshot);
      builder.setDone(done);
      return builder.build();
    } catch (IOException e) {
View Full Code Here

  /**
   * Check that the snapshot description written in the filesystem matches the current snapshot
   * @param snapshotDir snapshot directory to check
   */
  private void verifySnapshotDescription(Path snapshotDir) throws CorruptedSnapshotException {
    SnapshotDescription found = SnapshotDescriptionUtils.readSnapshotInfo(fs, snapshotDir);
    if (!this.snapshot.equals(found)) {
      throw new CorruptedSnapshotException("Snapshot read (" + found
          + ") doesn't equal snapshot we ran (" + snapshot + ").", snapshot);
    }
  }
View Full Code Here

  }

  @Test(timeout = 300000)
  public void testAsyncFlushSnapshot() throws Exception {
    HBaseAdmin admin = UTIL.getHBaseAdmin();
    SnapshotDescription snapshot = SnapshotDescription.newBuilder().setName("asyncSnapshot")
        .setTable(TABLE_NAME.getNameAsString())
        .setType(SnapshotDescription.Type.FLUSH)
        .build();

    // take the snapshot async
View Full Code Here

        TableName.valueOf("tableWithRefs");
    final String snapshotName = "tableWithRefs";
    final String TEST_FAMILY = Bytes.toString(FAMILY);
    final String TEST_HFILE = "abc";

    final SnapshotDescription sd = SnapshotDescription.newBuilder()
        .setName(snapshotName)
        .setTable(tableWithRefsName.getNameAsString()).build();

    FileSystem fs = TEST_UTIL.getHBaseCluster().getMaster().getMasterFileSystem().getFileSystem();
    Path rootDir = TEST_UTIL.getHBaseCluster().getMaster().getMasterFileSystem().getRootDir();
View Full Code Here

    final MasterFileSystem mfs = util.getHBaseCluster().getMaster().getMasterFileSystem();
    final FileSystem fs = mfs.getFileSystem();

    Path snapshotDir = SnapshotDescriptionUtils.getCompletedSnapshotDir(snapshotName,
                                                                        mfs.getRootDir());
    SnapshotDescription snapshotDesc = SnapshotDescriptionUtils.readSnapshotInfo(fs, snapshotDir);
    final TableName table = TableName.valueOf(snapshotDesc.getTable());

    final ArrayList corruptedFiles = new ArrayList();
    SnapshotReferenceUtil.visitTableStoreFiles(fs, snapshotDir, new FSVisitor.StoreFileVisitor() {
      public void storeFile (final String region, final String family, final String hfile)
          throws IOException {
View Full Code Here

   * Extract the list of files (HFiles/HLogs) to copy using Map-Reduce.
   * @return list of files referenced by the snapshot (pair of path and size)
   */
  private List<Pair<Path, Long>> getSnapshotFiles(final FileSystem fs, final Path snapshotDir)
      throws IOException {
    SnapshotDescription snapshotDesc = SnapshotDescriptionUtils.readSnapshotInfo(fs, snapshotDir);

    final List<Pair<Path, Long>> files = new ArrayList<Pair<Path, Long>>();
    final String table = snapshotDesc.getTable();
    final Configuration conf = getConf();

    // Get snapshot files
    SnapshotReferenceUtil.visitReferencedFiles(fs, snapshotDir,
      new SnapshotReferenceUtil.FileVisitor() {
View Full Code Here

   */
  public void deleteSnapshot(final byte[] snapshotName) throws IOException {
    // make sure the snapshot is possibly valid
    HTableDescriptor.isLegalTableName(snapshotName, true);
    // do the delete
    SnapshotDescription snapshot = SnapshotDescription.newBuilder()
      .setName(Bytes.toString(snapshotName)).build();
    try {
      getMaster().deleteSnapshot(new HSnapshotDescription(snapshot));
    } catch (RemoteException e) {
      throw RemoteExceptionHandler.decodeRemoteException(e);
View Full Code Here

    final byte[] tableWithRefsName = Bytes.toBytes("tableWithRefs");
    final String snapshotName = "tableWithRefs";
    final String TEST_FAMILY = Bytes.toString(FAMILY);
    final String TEST_HFILE = "abc";

    final SnapshotDescription sd = SnapshotDescription.newBuilder()
        .setName(snapshotName).setTable(Bytes.toString(tableWithRefsName)).build();

    FileSystem fs = TEST_UTIL.getHBaseCluster().getMaster().getMasterFileSystem().getFileSystem();
    Path rootDir = TEST_UTIL.getHBaseCluster().getMaster().getMasterFileSystem().getRootDir();
    Path archiveDir = new Path(rootDir, HConstants.HFILE_ARCHIVE_DIRECTORY);
View Full Code Here

    } catch (UnsupportedOperationException e) {
      throw new IOException(e);
    }

    // get the snapshot information
    SnapshotDescription snapshot = SnapshotDescriptionUtils.validate(request.getProto(),
      this.conf);

    snapshotManager.takeSnapshot(snapshot);

    // send back the max amount of time the client should wait for the snapshot to complete
    long waitTime = SnapshotDescriptionUtils.getMaxMasterTimeout(conf, snapshot.getType(),
      SnapshotDescriptionUtils.DEFAULT_MAX_WAIT_TIME);
    return waitTime;
  }
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.SnapshotDescription

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.