当前位置: 首页>>代码示例>>Java>>正文


Java MetaEditor.mutateMetaTable方法代码示例

本文整理汇总了Java中org.apache.hadoop.hbase.catalog.MetaEditor.mutateMetaTable方法的典型用法代码示例。如果您正苦于以下问题:Java MetaEditor.mutateMetaTable方法的具体用法?Java MetaEditor.mutateMetaTable怎么用?Java MetaEditor.mutateMetaTable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.hadoop.hbase.catalog.MetaEditor的用法示例。


在下文中一共展示了MetaEditor.mutateMetaTable方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: offlineParentInMetaAndputMetaEntries

import org.apache.hadoop.hbase.catalog.MetaEditor; //导入方法依赖的package包/类
private void offlineParentInMetaAndputMetaEntries(CatalogTracker catalogTracker,
    HRegionInfo parent, HRegionInfo splitA, HRegionInfo splitB,
    ServerName serverName, List<Mutation> metaEntries) throws IOException {
  List<Mutation> mutations = metaEntries;
  HRegionInfo copyOfParent = new HRegionInfo(parent);
  copyOfParent.setOffline(true);
  copyOfParent.setSplit(true);

  //Put for parent
  Put putParent = MetaEditor.makePutFromRegionInfo(copyOfParent);
  MetaEditor.addDaughtersToPut(putParent, splitA, splitB);
  mutations.add(putParent);
  
  //Puts for daughters
  Put putA = MetaEditor.makePutFromRegionInfo(splitA);
  Put putB = MetaEditor.makePutFromRegionInfo(splitB);

  addLocation(putA, serverName, 1); //these are new regions, openSeqNum = 1 is fine.
  addLocation(putB, serverName, 1);
  mutations.add(putA);
  mutations.add(putB);
  MetaEditor.mutateMetaTable(catalogTracker, mutations);
}
 
开发者ID:tenggyut,项目名称:HIndex,代码行数:24,代码来源:SplitTransaction.java

示例2: preMergeCommit

import org.apache.hadoop.hbase.catalog.MetaEditor; //导入方法依赖的package包/类
@Override
public void preMergeCommit(ObserverContext<RegionServerCoprocessorEnvironment> ctx,
    HRegion regionA, HRegion regionB, List<Mutation> metaEntries) throws IOException {
  preMergeBeforePONRCalled = true;
  RegionServerCoprocessorEnvironment environment = ctx.getEnvironment();
  HRegionServer rs = (HRegionServer) environment.getRegionServerServices();
  List<HRegion> onlineRegions =
      rs.getOnlineRegions(TableName.valueOf("testRegionServerObserver_2"));
  rmt = new RegionMergeTransaction(onlineRegions.get(0), onlineRegions.get(1), true);
  if (!rmt.prepare(rs)) {
    LOG.error("Prepare for the region merge of table "
        + onlineRegions.get(0).getTableDesc().getNameAsString()
        + " failed. So returning null. ");
    ctx.bypass();
    return;
  }
  mergedRegion = rmt.stepsBeforePONR(rs, rs, false);
  rmt.prepareMutationsForMerge(mergedRegion.getRegionInfo(), regionA.getRegionInfo(),
    regionB.getRegionInfo(), rs.getServerName(), metaEntries);
  MetaEditor.mutateMetaTable(rs.getCatalogTracker(), metaEntries);
}
 
开发者ID:tenggyut,项目名称:HIndex,代码行数:22,代码来源:TestRegionServerObserver.java

示例3: mergeRegionsAndPutMetaEntries

import org.apache.hadoop.hbase.catalog.MetaEditor; //导入方法依赖的package包/类
private void mergeRegionsAndPutMetaEntries(CatalogTracker catalogTracker,
    HRegionInfo mergedRegion, HRegionInfo regionA, HRegionInfo regionB, ServerName serverName,
    List<Mutation> metaEntries) throws IOException {
  prepareMutationsForMerge(mergedRegion, regionA, regionB, serverName, metaEntries);
  MetaEditor.mutateMetaTable(catalogTracker, metaEntries);
}
 
开发者ID:tenggyut,项目名称:HIndex,代码行数:7,代码来源:RegionMergeTransaction.java


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