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


Java CheckpointSignature类代码示例

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


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

示例1: convert

import org.apache.hadoop.hdfs.server.namenode.CheckpointSignature; //导入依赖的package包/类
public static CheckpointSignatureProto convert(CheckpointSignature s) {
  return CheckpointSignatureProto.newBuilder()
      .setBlockPoolId(s.getBlockpoolID())
      .setCurSegmentTxId(s.getCurSegmentTxId())
      .setMostRecentCheckpointTxId(s.getMostRecentCheckpointTxId())
      .setStorageInfo(PBHelper.convert((StorageInfo) s)).build();
}
 
开发者ID:naver,项目名称:hadoop,代码行数:8,代码来源:PBHelper.java

示例2: rollEditLog

import org.apache.hadoop.hdfs.server.namenode.CheckpointSignature; //导入依赖的package包/类
@Override
public RollEditLogResponseProto rollEditLog(RpcController unused,
    RollEditLogRequestProto request) throws ServiceException {
  CheckpointSignature signature;
  try {
    signature = impl.rollEditLog();
  } catch (IOException e) {
    throw new ServiceException(e);
  }
  return RollEditLogResponseProto.newBuilder()
      .setSignature(PBHelper.convert(signature)).build();
}
 
开发者ID:naver,项目名称:hadoop,代码行数:13,代码来源:NamenodeProtocolServerSideTranslatorPB.java

示例3: rollEditLog

import org.apache.hadoop.hdfs.server.namenode.CheckpointSignature; //导入依赖的package包/类
@Override
public CheckpointSignature rollEditLog() throws IOException {
  try {
    return PBHelper.convert(rpcProxy.rollEditLog(NULL_CONTROLLER,
        VOID_ROLL_EDITLOG_REQUEST).getSignature());
  } catch (ServiceException e) {
    throw ProtobufHelper.getRemoteException(e);
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:10,代码来源:NamenodeProtocolTranslatorPB.java

示例4: endCheckpoint

import org.apache.hadoop.hdfs.server.namenode.CheckpointSignature; //导入依赖的package包/类
@Override
public void endCheckpoint(NamenodeRegistration registration,
    CheckpointSignature sig) throws IOException {
  EndCheckpointRequestProto req = EndCheckpointRequestProto.newBuilder()
      .setRegistration(PBHelper.convert(registration))
      .setSignature(PBHelper.convert(sig)).build();
  try {
    rpcProxy.endCheckpoint(NULL_CONTROLLER, req);
  } catch (ServiceException e) {
    throw ProtobufHelper.getRemoteException(e);
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:13,代码来源:NamenodeProtocolTranslatorPB.java

示例5: testSharedEditsMissingLogs

import org.apache.hadoop.hdfs.server.namenode.CheckpointSignature; //导入依赖的package包/类
/**
 * Test for the case where the shared edits dir doesn't have
 * all of the recent edit logs.
 */
@Test
public void testSharedEditsMissingLogs() throws Exception {
  removeStandbyNameDirs();
  
  CheckpointSignature sig = nn0.getRpcServer().rollEditLog();
  assertEquals(3, sig.getCurSegmentTxId());
  
  // Should have created edits_1-2 in shared edits dir
  URI editsUri = cluster.getSharedEditsDir(0, 1);
  File editsDir = new File(editsUri);
  File editsSegment = new File(new File(editsDir, "current"),
      NNStorage.getFinalizedEditsFileName(1, 2));
  GenericTestUtils.assertExists(editsSegment);

  // Delete the segment.
  assertTrue(editsSegment.delete());
  
  // Trying to bootstrap standby should now fail since the edit
  // logs aren't available in the shared dir.
  LogCapturer logs = GenericTestUtils.LogCapturer.captureLogs(
      LogFactory.getLog(BootstrapStandby.class));
  try {
    int rc = BootstrapStandby.run(
        new String[]{"-force"},
        cluster.getConfiguration(1));
    assertEquals(BootstrapStandby.ERR_CODE_LOGS_UNAVAILABLE, rc);
  } finally {
    logs.stopCapturing();
  }
  GenericTestUtils.assertMatches(logs.getOutput(),
      "FATAL.*Unable to read transaction ids 1-3 from the configured shared");
}
 
开发者ID:naver,项目名称:hadoop,代码行数:37,代码来源:TestBootstrapStandby.java

示例6: testConvertCheckpointSignature

import org.apache.hadoop.hdfs.server.namenode.CheckpointSignature; //导入依赖的package包/类
@Test
public void testConvertCheckpointSignature() {
  CheckpointSignature s = new CheckpointSignature(
      getStorageInfo(NodeType.NAME_NODE), "bpid", 100, 1);
  CheckpointSignatureProto sProto = PBHelper.convert(s);
  CheckpointSignature s1 = PBHelper.convert(sProto);
  assertEquals(s.getBlockpoolID(), s1.getBlockpoolID());
  assertEquals(s.getClusterID(), s1.getClusterID());
  assertEquals(s.getCTime(), s1.getCTime());
  assertEquals(s.getCurSegmentTxId(), s1.getCurSegmentTxId());
  assertEquals(s.getLayoutVersion(), s1.getLayoutVersion());
  assertEquals(s.getMostRecentCheckpointTxId(),
      s1.getMostRecentCheckpointTxId());
  assertEquals(s.getNamespaceID(), s1.getNamespaceID());
}
 
开发者ID:naver,项目名称:hadoop,代码行数:16,代码来源:TestPBHelper.java

示例7: testSharedEditsMissingLogs

import org.apache.hadoop.hdfs.server.namenode.CheckpointSignature; //导入依赖的package包/类
/**
 * Test for the case where the shared edits dir doesn't have
 * all of the recent edit logs.
 */
@Test
public void testSharedEditsMissingLogs() throws Exception {
  removeStandbyNameDirs();

  CheckpointSignature sig = nn0.getRpcServer().rollEditLog();
  assertEquals(3, sig.getCurSegmentTxId());

  // Should have created edits_1-2 in shared edits dir
  URI editsUri = cluster.getSharedEditsDir(0, maxNNCount - 1);
  File editsDir = new File(editsUri);
  File currentDir = new File(editsDir, "current");
  File editsSegment = new File(currentDir,
      NNStorage.getFinalizedEditsFileName(1, 2));
  GenericTestUtils.assertExists(editsSegment);
  GenericTestUtils.assertExists(currentDir);

  // Delete the segment.
  assertTrue(editsSegment.delete());

  // Trying to bootstrap standby should now fail since the edit
  // logs aren't available in the shared dir.
  LogCapturer logs = GenericTestUtils.LogCapturer.captureLogs(
      LogFactory.getLog(BootstrapStandby.class));
  try {
    assertEquals(BootstrapStandby.ERR_CODE_LOGS_UNAVAILABLE, forceBootstrap(1));
  } finally {
    logs.stopCapturing();
  }
  GenericTestUtils.assertMatches(logs.getOutput(),
      "FATAL.*Unable to read transaction ids 1-3 from the configured shared");
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:36,代码来源:TestBootstrapStandby.java

示例8: finalizeCheckpoint

import org.apache.hadoop.hdfs.server.namenode.CheckpointSignature; //导入依赖的package包/类
private void finalizeCheckpoint(CheckpointSignature sig) 
    throws IOException{

  try {
    File imageFile = fsImage.storage.getFsImageName(
        StorageLocationType.LOCAL, sig.mostRecentCheckpointTxId);
    InjectionHandler.processEvent(InjectionEvent.STANDBY_BEFORE_PUT_IMAGE,
        imageFile);
    
    // start a thread to validate image while uploading the image to primary
    createImageValidation(imageFile);
    
    // copy image to primary namenode
    uploadImage(sig.mostRecentCheckpointTxId);

    // check if the image is valid
    checkImageValidation();
    
    // make transaction to primary namenode to switch edit logs
    LOG.info("Standby: Checkpointing - Roll fsimage on primary namenode.");
    InjectionHandler.processEventIO(InjectionEvent.STANDBY_BEFORE_ROLL_IMAGE);
      
    assertState(
        StandbyIngestState.NOT_INGESTING,
        StandbyIngestState.INGESTING_EDITS);
    
    primaryNamenode.rollFsImage(new CheckpointSignature(fsImage));
    setLastRollSignature(null);      
    LOG.info("Standby: Checkpointing - Checkpoint done. New Image Size: "
        + fsImage.getFsImageName(StorageLocationType.LOCAL).length());
    checkpointStatus("Completed");
  } finally {
    interruptImageValidation();
  }
}
 
开发者ID:rhli,项目名称:hadoop-EAR,代码行数:36,代码来源:Standby.java

示例9: testConvertCheckpointSignature

import org.apache.hadoop.hdfs.server.namenode.CheckpointSignature; //导入依赖的package包/类
@Test
public void testConvertCheckpointSignature() {
  CheckpointSignature s = new CheckpointSignature(getStorageInfo(), "bpid",
      100, 1);
  CheckpointSignatureProto sProto = PBHelper.convert(s);
  CheckpointSignature s1 = PBHelper.convert(sProto);
  assertEquals(s.getBlockpoolID(), s1.getBlockpoolID());
  assertEquals(s.getClusterID(), s1.getClusterID());
  assertEquals(s.getCTime(), s1.getCTime());
  assertEquals(s.getCurSegmentTxId(), s1.getCurSegmentTxId());
  assertEquals(s.getLayoutVersion(), s1.getLayoutVersion());
  assertEquals(s.getMostRecentCheckpointTxId(),
      s1.getMostRecentCheckpointTxId());
  assertEquals(s.getNamespaceID(), s1.getNamespaceID());
}
 
开发者ID:ict-carch,项目名称:hadoop-plus,代码行数:16,代码来源:TestPBHelper.java


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