• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java SnapshotCreationException类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.apache.hadoop.hbase.snapshot.SnapshotCreationException的典型用法代码示例。如果您正苦于以下问题:Java SnapshotCreationException类的具体用法?Java SnapshotCreationException怎么用?Java SnapshotCreationException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



SnapshotCreationException类属于org.apache.hadoop.hbase.snapshot包,在下文中一共展示了SnapshotCreationException类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: snapshotTable

import org.apache.hadoop.hbase.snapshot.SnapshotCreationException; //导入依赖的package包/类
/**
 * Take a snapshot using the specified handler.
 * On failure the snapshot temporary working directory is removed.
 * NOTE: prepareToTakeSnapshot() called before this one takes care of the rejecting the
 *       snapshot request if the table is busy with another snapshot/restore operation.
 * @param snapshot the snapshot description
 * @param handler the snapshot handler
 */
private synchronized void snapshotTable(SnapshotDescription snapshot,
    final TakeSnapshotHandler handler) throws HBaseSnapshotException {
  try {
    handler.prepare();
    this.executorService.submit(handler);
    this.snapshotHandlers.put(TableName.valueOf(snapshot.getTable()), handler);
  } catch (Exception e) {
    // cleanup the working directory by trying to delete it from the fs.
    Path workingDir = SnapshotDescriptionUtils.getWorkingSnapshotDir(snapshot, rootDir);
    try {
      if (!this.master.getMasterFileSystem().getFileSystem().delete(workingDir, true)) {
        LOG.error("Couldn't delete working directory (" + workingDir + " for snapshot:" +
            ClientSnapshotDescriptionUtils.toString(snapshot));
      }
    } catch (IOException e1) {
      LOG.error("Couldn't delete working directory (" + workingDir + " for snapshot:" +
          ClientSnapshotDescriptionUtils.toString(snapshot));
    }
    // fail the snapshot
    throw new SnapshotCreationException("Could not build snapshot handler", e, snapshot);
  }
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:31,代码来源:SnapshotManager.java


示例2: takeSnapshotAsync

import org.apache.hadoop.hbase.snapshot.SnapshotCreationException; //导入依赖的package包/类
/**
 * Take a snapshot without waiting for the server to complete that snapshot (asynchronous)
 * <p>
 * Only a single snapshot should be taken at a time, or results may be undefined.
 * @param snapshot snapshot to take
 * @return response from the server indicating the max time to wait for the snapshot
 * @throws IOException if the snapshot did not succeed or we lose contact with the master.
 * @throws SnapshotCreationException if snapshot creation failed
 * @throws IllegalArgumentException if the snapshot request is formatted incorrectly
 */
@Override
public SnapshotResponse takeSnapshotAsync(SnapshotDescription snapshot) throws IOException,
    SnapshotCreationException {
  ClientSnapshotDescriptionUtils.assertSnapshotRequestIsValid(snapshot);
  final SnapshotRequest request = SnapshotRequest.newBuilder().setSnapshot(snapshot)
      .build();
  // run the snapshot on the master
  return executeCallable(new MasterCallable<SnapshotResponse>(getConnection()) {
    @Override
    public SnapshotResponse call(int callTimeout) throws ServiceException {
      PayloadCarryingRpcController controller = rpcControllerFactory.newController();
      controller.setCallTimeout(callTimeout);
      return master.snapshot(controller, request);
    }
  });
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:27,代码来源:HBaseAdmin.java


示例3: snapshotTable

import org.apache.hadoop.hbase.snapshot.SnapshotCreationException; //导入依赖的package包/类
/**
 * Take a snapshot using the specified handler.
 * On failure the snapshot temporary working directory is removed.
 * NOTE: prepareToTakeSnapshot() called before this one takes care of the rejecting the
 *       snapshot request if the table is busy with another snapshot/restore operation.
 * @param snapshot the snapshot description
 * @param handler the snapshot handler
 */
private synchronized void snapshotTable(SnapshotDescription snapshot,
    final TakeSnapshotHandler handler) throws HBaseSnapshotException {
  try {
    handler.prepare();
    this.executorService.submit(handler);
    this.snapshotHandlers.put(snapshot.getTable(), handler);
  } catch (Exception e) {
    // cleanup the working directory by trying to delete it from the fs.
    Path workingDir = SnapshotDescriptionUtils.getWorkingSnapshotDir(snapshot, rootDir);
    try {
      if (!this.master.getMasterFileSystem().getFileSystem().delete(workingDir, true)) {
        LOG.error("Couldn't delete working directory (" + workingDir + " for snapshot:" +
            SnapshotDescriptionUtils.toString(snapshot));
      }
    } catch (IOException e1) {
      LOG.error("Couldn't delete working directory (" + workingDir + " for snapshot:" +
          SnapshotDescriptionUtils.toString(snapshot));
    }
    // fail the snapshot
    throw new SnapshotCreationException("Could not build snapshot handler", e, snapshot);
  }
}
 
开发者ID:fengchen8086,项目名称:LCIndex-HBase-0.94.16,代码行数:31,代码来源:SnapshotManager.java


示例4: snapshotTable

import org.apache.hadoop.hbase.snapshot.SnapshotCreationException; //导入依赖的package包/类
/**
 * Take a snapshot using the specified handler.
 * On failure the snapshot temporary working directory is removed.
 * NOTE: prepareToTakeSnapshot() called before this one takes care of the rejecting the
 *       snapshot request if the table is busy with another snapshot/restore operation.
 * @param snapshot the snapshot description
 * @param handler the snapshot handler
 */
private synchronized void snapshotTable(SnapshotDescription snapshot,
    final TakeSnapshotHandler handler) throws HBaseSnapshotException {
  try {
    handler.prepare();
    this.executorService.submit(handler);
    this.snapshotHandlers.put(TableName.valueOf(snapshot.getTable()), handler);
  } catch (Exception e) {
    // cleanup the working directory by trying to delete it from the fs.
    Path workingDir = SnapshotDescriptionUtils.getWorkingSnapshotDir(snapshot, rootDir);
    try {
      if (!this.master.getMasterFileSystem().getFileSystem().delete(workingDir, true)) {
        LOG.error("Couldn't delete working directory (" + workingDir + " for snapshot:" +
            ClientSnapshotDescriptionUtils.toString(snapshot));
      }
    } catch (IOException e1) {
      LOG.error("Couldn't delete working directory (" + workingDir + " for snapshot:" +
          ClientSnapshotDescriptionUtils.toString(snapshot));
    }
    // fail the snapshot
    throw new SnapshotCreationException("Could not build snapshot handler", e,
      ProtobufUtil.createSnapshotDesc(snapshot));
  }
}
 
开发者ID:apache,项目名称:hbase,代码行数:32,代码来源:SnapshotManager.java


示例5: completeSnapshot

import org.apache.hadoop.hbase.snapshot.SnapshotCreationException; //导入依赖的package包/类
/**
 * Reset the manager to allow another snapshot to proceed
 *
 * @param snapshotDir final path of the snapshot
 * @param workingDir directory where the in progress snapshot was built
 * @param fs {@link FileSystem} where the snapshot was built
 * @throws SnapshotCreationException if the snapshot could not be moved
 * @throws IOException the filesystem could not be reached
 */
public void completeSnapshot(Path snapshotDir, Path workingDir, FileSystem fs)
    throws SnapshotCreationException, IOException {
  LOG.debug("Sentinel is done, just moving the snapshot from " + workingDir + " to "
      + snapshotDir);
  if (!fs.rename(workingDir, snapshotDir)) {
    throw new SnapshotCreationException("Failed to move working directory(" + workingDir
        + ") to completed directory(" + snapshotDir + ").");
  }
  finished = true;
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:20,代码来源:TakeSnapshotHandler.java


示例6: takeSnapshotAsync

import org.apache.hadoop.hbase.snapshot.SnapshotCreationException; //导入依赖的package包/类
/**
 * Take a snapshot without waiting for the server to complete that snapshot (asynchronous)
 * <p>
 * Only a single snapshot should be taken at a time, or results may be undefined.
 * @param snapshot snapshot to take
 * @return response from the server indicating the max time to wait for the snapshot
 * @throws IOException if the snapshot did not succeed or we lose contact with the master.
 * @throws SnapshotCreationException if snapshot creation failed
 * @throws IllegalArgumentException if the snapshot request is formatted incorrectly
 */
@Override
public SnapshotResponse takeSnapshotAsync(SnapshotDescription snapshot) throws IOException,
    SnapshotCreationException {
  ClientSnapshotDescriptionUtils.assertSnapshotRequestIsValid(snapshot);
  final SnapshotRequest request = SnapshotRequest.newBuilder().setSnapshot(snapshot)
      .build();
  // run the snapshot on the master
  return executeCallable(new MasterCallable<SnapshotResponse>(getConnection()) {
    @Override
    public SnapshotResponse call(int callTimeout) throws ServiceException {
      return master.snapshot(null, request);
    }
  });
}
 
开发者ID:grokcoder,项目名称:pbase,代码行数:25,代码来源:HBaseAdmin.java


示例7: takeSnapshotAsync

import org.apache.hadoop.hbase.snapshot.SnapshotCreationException; //导入依赖的package包/类
/**
 * Take a snapshot without waiting for the server to complete that snapshot (asynchronous)
 * <p>
 * Only a single snapshot should be taken at a time, or results may be undefined.
 * @param snapshot snapshot to take
 * @return response from the server indicating the max time to wait for the snapshot
 * @throws IOException if the snapshot did not succeed or we lose contact with the master.
 * @throws SnapshotCreationException if snapshot creation failed
 * @throws IllegalArgumentException if the snapshot request is formatted incorrectly
 */
public SnapshotResponse takeSnapshotAsync(SnapshotDescription snapshot) throws IOException,
    SnapshotCreationException {
  ClientSnapshotDescriptionUtils.assertSnapshotRequestIsValid(snapshot);
  final SnapshotRequest request = SnapshotRequest.newBuilder().setSnapshot(snapshot)
      .build();
  // run the snapshot on the master
  return executeCallable(new MasterCallable<SnapshotResponse>(getConnection()) {
    @Override
    public SnapshotResponse call() throws ServiceException {
      return master.snapshot(null, request);
    }
  });
}
 
开发者ID:tenggyut,项目名称:HIndex,代码行数:24,代码来源:HBaseAdmin.java


示例8: takeSnapshotAsync

import org.apache.hadoop.hbase.snapshot.SnapshotCreationException; //导入依赖的package包/类
/**
 * Take a snapshot without waiting for the server to complete that snapshot (asynchronous)
 * <p>
 * Only a single snapshot should be taken at a time, or results may be undefined.
 * @param snapshot snapshot to take
 * @return response from the server indicating the max time to wait for the snapshot
 * @throws IOException if the snapshot did not succeed or we lose contact with the master.
 * @throws SnapshotCreationException if snapshot creation failed
 * @throws IllegalArgumentException if the snapshot request is formatted incorrectly
 */
public SnapshotResponse takeSnapshotAsync(SnapshotDescription snapshot) throws IOException,
    SnapshotCreationException {
  ClientSnapshotDescriptionUtils.assertSnapshotRequestIsValid(snapshot);
  final SnapshotRequest request = SnapshotRequest.newBuilder().setSnapshot(snapshot)
      .build();
  // run the snapshot on the master
  return executeCallable(new MasterCallable<SnapshotResponse>(getConnection()) {
    @Override
    public SnapshotResponse call(int callTimeout) throws ServiceException {
      return master.snapshot(null, request);
    }
  });
}
 
开发者ID:shenli-uiuc,项目名称:PyroDB,代码行数:24,代码来源:HBaseAdmin.java


示例9: snapshot

import org.apache.hadoop.hbase.snapshot.SnapshotCreationException; //导入依赖的package包/类
public void snapshot(final String snapshotName,
                     final String tableName) throws IOException,
    SnapshotCreationException, IllegalArgumentException {
  snapshot(snapshotName, TableName.valueOf(tableName),
      SnapshotDescription.Type.FLUSH);
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:7,代码来源:HBaseAdmin.java


示例10: snapshot

import org.apache.hadoop.hbase.snapshot.SnapshotCreationException; //导入依赖的package包/类
@Override
public void snapshot(String string, TableName tn) throws IOException, SnapshotCreationException, IllegalArgumentException {
  wrappedHbaseAdmin.snapshot(string, tn);
}
 
开发者ID:dvimont,项目名称:ColumnManagerForHBase,代码行数:5,代码来源:MAdmin.java


示例11: takeSnapshotAsync

import org.apache.hadoop.hbase.snapshot.SnapshotCreationException; //导入依赖的package包/类
@Override
public SnapshotResponse takeSnapshotAsync(SnapshotDescription sd) throws IOException, SnapshotCreationException {
  return wrappedHbaseAdmin.takeSnapshotAsync(sd);
}
 
开发者ID:dvimont,项目名称:ColumnManagerForHBase,代码行数:5,代码来源:MAdmin.java


示例12: snapshot

import org.apache.hadoop.hbase.snapshot.SnapshotCreationException; //导入依赖的package包/类
@Override
public void snapshot(String snapshotName, TableName tableName)
    throws IOException, SnapshotCreationException, IllegalArgumentException {
  throw new UnsupportedOperationException("snapshot");  // TODO
}
 
开发者ID:dmmcerlean,项目名称:cloud-bigtable-client,代码行数:6,代码来源:BigtableAdmin.java



注:本文中的org.apache.hadoop.hbase.snapshot.SnapshotCreationException类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java XSElementDecl类代码示例发布时间:2022-05-21
下一篇:
Java Consumer类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap