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


Java RetryCache.setState方法代码示例

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


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

示例1: startCheckpoint

import org.apache.hadoop.ipc.RetryCache; //导入方法依赖的package包/类
@Override // NamenodeProtocol
public NamenodeCommand startCheckpoint(NamenodeRegistration registration)
    throws IOException {
  checkNNStartup();
  namesystem.checkSuperuserPrivilege();
  verifyRequest(registration);
  if(!nn.isRole(NamenodeRole.NAMENODE))
    throw new IOException("Only an ACTIVE node can invoke startCheckpoint.");

  CacheEntryWithPayload cacheEntry = RetryCache.waitForCompletion(retryCache,
    null);
  if (cacheEntry != null && cacheEntry.isSuccess()) {
    return (NamenodeCommand) cacheEntry.getPayload();
  }
  NamenodeCommand ret = null;
  try {
    ret = namesystem.startCheckpoint(registration, nn.setRegistration());
  } finally {
    RetryCache.setState(cacheEntry, ret != null, ret);
  }
  return ret;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:23,代码来源:NameNodeRpcServer.java

示例2: endCheckpoint

import org.apache.hadoop.ipc.RetryCache; //导入方法依赖的package包/类
@Override // NamenodeProtocol
public void endCheckpoint(NamenodeRegistration registration,
                          CheckpointSignature sig) throws IOException {
  checkNNStartup();
  namesystem.checkSuperuserPrivilege();
  CacheEntry cacheEntry = RetryCache.waitForCompletion(retryCache);
  if (cacheEntry != null && cacheEntry.isSuccess()) {
    return; // Return previous response
  }
  boolean success = false;
  try {
    namesystem.endCheckpoint(registration, sig);
    success = true;
  } finally {
    RetryCache.setState(cacheEntry, success);
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:18,代码来源:NameNodeRpcServer.java

示例3: updatePipeline

import org.apache.hadoop.ipc.RetryCache; //导入方法依赖的package包/类
@Override // ClientProtocol
public void updatePipeline(String clientName, ExtendedBlock oldBlock,
    ExtendedBlock newBlock, DatanodeID[] newNodes, String[] newStorageIDs)
    throws IOException {
  checkNNStartup();
  CacheEntry cacheEntry = RetryCache.waitForCompletion(retryCache);
  if (cacheEntry != null && cacheEntry.isSuccess()) {
    return; // Return previous response
  }

  boolean success = false;
  try {
    namesystem.updatePipeline(clientName, oldBlock, newBlock, newNodes,
        newStorageIDs, cacheEntry != null);
    success = true;
  } finally {
    RetryCache.setState(cacheEntry, success);
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:20,代码来源:NameNodeRpcServer.java

示例4: concat

import org.apache.hadoop.ipc.RetryCache; //导入方法依赖的package包/类
@Override // ClientProtocol
public void concat(String trg, String[] src) throws IOException {
  checkNNStartup();
  CacheEntry cacheEntry = RetryCache.waitForCompletion(retryCache);
  if (cacheEntry != null && cacheEntry.isSuccess()) {
    return; // Return previous response
  }
  boolean success = false;

  try {
    namesystem.concat(trg, src, cacheEntry != null);
    success = true;
  } finally {
    RetryCache.setState(cacheEntry, success);
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:17,代码来源:NameNodeRpcServer.java

示例5: rename2

import org.apache.hadoop.ipc.RetryCache; //导入方法依赖的package包/类
@Override // ClientProtocol
public void rename2(String src, String dst, Options.Rename... options)
    throws IOException {
  checkNNStartup();
  if(stateChangeLog.isDebugEnabled()) {
    stateChangeLog.debug("*DIR* NameNode.rename: " + src + " to " + dst);
  }
  if (!checkPathLength(dst)) {
    throw new IOException("rename: Pathname too long.  Limit "
        + MAX_PATH_LENGTH + " characters, " + MAX_PATH_DEPTH + " levels.");
  }
  CacheEntry cacheEntry = RetryCache.waitForCompletion(retryCache);
  if (cacheEntry != null && cacheEntry.isSuccess()) {
    return; // Return previous response
  }
  boolean success = false;
  try {
    namesystem.renameTo(src, dst, cacheEntry != null, options);
    success = true;
  } finally {
    RetryCache.setState(cacheEntry, success);
  }
  metrics.incrFilesRenamed();
}
 
开发者ID:naver,项目名称:hadoop,代码行数:25,代码来源:NameNodeRpcServer.java

示例6: delete

import org.apache.hadoop.ipc.RetryCache; //导入方法依赖的package包/类
@Override // ClientProtocol
public boolean delete(String src, boolean recursive) throws IOException {
  checkNNStartup();
  if (stateChangeLog.isDebugEnabled()) {
    stateChangeLog.debug("*DIR* Namenode.delete: src=" + src
        + ", recursive=" + recursive);
  }
  CacheEntry cacheEntry = RetryCache.waitForCompletion(retryCache);
  if (cacheEntry != null && cacheEntry.isSuccess()) {
    return true; // Return previous response
  }

  boolean ret = false;
  try {
    ret = namesystem.delete(src, recursive, cacheEntry != null);
  } finally {
    RetryCache.setState(cacheEntry, ret);
  }
  if (ret) 
    metrics.incrDeleteFileOps();
  return ret;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:23,代码来源:NameNodeRpcServer.java

示例7: createSnapshot

import org.apache.hadoop.ipc.RetryCache; //导入方法依赖的package包/类
@Override
public String createSnapshot(String snapshotRoot, String snapshotName)
    throws IOException {
  checkNNStartup();
  if (!checkPathLength(snapshotRoot)) {
    throw new IOException("createSnapshot: Pathname too long.  Limit "
        + MAX_PATH_LENGTH + " characters, " + MAX_PATH_DEPTH + " levels.");
  }
  CacheEntryWithPayload cacheEntry = RetryCache.waitForCompletion(retryCache,
    null);
  if (cacheEntry != null && cacheEntry.isSuccess()) {
    return (String) cacheEntry.getPayload();
  }

  metrics.incrCreateSnapshotOps();
  String ret = null;
  try {
    ret = namesystem.createSnapshot(snapshotRoot, snapshotName,
        cacheEntry != null);
  } finally {
    RetryCache.setState(cacheEntry, ret != null, ret);
  }
  return ret;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:25,代码来源:NameNodeRpcServer.java

示例8: deleteSnapshot

import org.apache.hadoop.ipc.RetryCache; //导入方法依赖的package包/类
@Override
public void deleteSnapshot(String snapshotRoot, String snapshotName)
    throws IOException {
  checkNNStartup();
  metrics.incrDeleteSnapshotOps();
  CacheEntry cacheEntry = RetryCache.waitForCompletion(retryCache);
  if (cacheEntry != null && cacheEntry.isSuccess()) {
    return; // Return previous response
  }
  boolean success = false;
  try {
    namesystem.deleteSnapshot(snapshotRoot, snapshotName, cacheEntry != null);
    success = true;
  } finally {
    RetryCache.setState(cacheEntry, success);
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:18,代码来源:NameNodeRpcServer.java

示例9: renameSnapshot

import org.apache.hadoop.ipc.RetryCache; //导入方法依赖的package包/类
@Override
// ClientProtocol
public void renameSnapshot(String snapshotRoot, String snapshotOldName,
    String snapshotNewName) throws IOException {
  checkNNStartup();
  if (snapshotNewName == null || snapshotNewName.isEmpty()) {
    throw new IOException("The new snapshot name is null or empty.");
  }
  metrics.incrRenameSnapshotOps();
  CacheEntry cacheEntry = RetryCache.waitForCompletion(retryCache);
  if (cacheEntry != null && cacheEntry.isSuccess()) {
    return; // Return previous response
  }
  boolean success = false;
  try {
    namesystem.renameSnapshot(snapshotRoot, snapshotOldName,
        snapshotNewName, cacheEntry != null);
    success = true;
  } finally {
    RetryCache.setState(cacheEntry, success);
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:23,代码来源:NameNodeRpcServer.java

示例10: addCacheDirective

import org.apache.hadoop.ipc.RetryCache; //导入方法依赖的package包/类
@Override // ClientProtocol
public long addCacheDirective(
    CacheDirectiveInfo path, EnumSet<CacheFlag> flags) throws IOException {
  checkNNStartup();
  CacheEntryWithPayload cacheEntry = RetryCache.waitForCompletion
    (retryCache, null);
  if (cacheEntry != null && cacheEntry.isSuccess()) {
    return (Long) cacheEntry.getPayload();
  }

  boolean success = false;
  long ret = 0;
  try {
    ret = namesystem.addCacheDirective(path, flags, cacheEntry != null);
    success = true;
  } finally {
    RetryCache.setState(cacheEntry, success, ret);
  }
  return ret;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:21,代码来源:NameNodeRpcServer.java

示例11: createEncryptionZone

import org.apache.hadoop.ipc.RetryCache; //导入方法依赖的package包/类
@Override // ClientProtocol
public void createEncryptionZone(String src, String keyName)
  throws IOException {
  checkNNStartup();
  final CacheEntry cacheEntry = RetryCache.waitForCompletion(retryCache);
  if (cacheEntry != null && cacheEntry.isSuccess()) {
    return;
  }
  boolean success = false;
  try {
    namesystem.createEncryptionZone(src, keyName, cacheEntry != null);
    success = true;
  } finally {
    RetryCache.setState(cacheEntry, success);
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:17,代码来源:NameNodeRpcServer.java

示例12: setXAttr

import org.apache.hadoop.ipc.RetryCache; //导入方法依赖的package包/类
@Override // ClientProtocol
public void setXAttr(String src, XAttr xAttr, EnumSet<XAttrSetFlag> flag)
    throws IOException {
  checkNNStartup();
  CacheEntry cacheEntry = RetryCache.waitForCompletion(retryCache);
  if (cacheEntry != null && cacheEntry.isSuccess()) {
    return; // Return previous response
  }
  boolean success = false;
  try {
    namesystem.setXAttr(src, xAttr, flag, cacheEntry != null);
    success = true;
  } finally {
    RetryCache.setState(cacheEntry, success);
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:17,代码来源:NameNodeRpcServer.java

示例13: createEncryptionZone

import org.apache.hadoop.ipc.RetryCache; //导入方法依赖的package包/类
@Override // ClientProtocol
public void createEncryptionZone(String src, String keyName)
  throws IOException {
  checkNNStartup();
  namesystem.checkOperation(OperationCategory.WRITE);
  final CacheEntry cacheEntry = RetryCache.waitForCompletion(retryCache);
  if (cacheEntry != null && cacheEntry.isSuccess()) {
    return;
  }
  boolean success = false;
  try {
    namesystem.createEncryptionZone(src, keyName, cacheEntry != null);
    success = true;
  } finally {
    RetryCache.setState(cacheEntry, success);
  }
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:18,代码来源:NameNodeRpcServer.java

示例14: updatePipeline

import org.apache.hadoop.ipc.RetryCache; //导入方法依赖的package包/类
@Override // ClientProtocol
public void updatePipeline(String clientName, ExtendedBlock oldBlock,
    ExtendedBlock newBlock, DatanodeID[] newNodes, String[] newStorageIDs)
    throws IOException {
  checkNNStartup();
  namesystem.checkOperation(OperationCategory.WRITE);
  CacheEntry cacheEntry = RetryCache.waitForCompletion(retryCache);
  if (cacheEntry != null && cacheEntry.isSuccess()) {
    return; // Return previous response
  }

  boolean success = false;
  try {
    namesystem.updatePipeline(clientName, oldBlock, newBlock, newNodes,
        newStorageIDs, cacheEntry != null);
    success = true;
  } finally {
    RetryCache.setState(cacheEntry, success);
  }
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:21,代码来源:NameNodeRpcServer.java

示例15: setErasureCodingPolicy

import org.apache.hadoop.ipc.RetryCache; //导入方法依赖的package包/类
@Override // ClientProtocol
public void setErasureCodingPolicy(String src, ErasureCodingPolicy ecPolicy)
    throws IOException {
  checkNNStartup();
  final CacheEntry cacheEntry = RetryCache.waitForCompletion(retryCache);
  if (cacheEntry != null && cacheEntry.isSuccess()) {
    return;
  }
  boolean success = false;
  try {
    namesystem.setErasureCodingPolicy(src, ecPolicy, cacheEntry != null);
    success = true;
  } finally {
    RetryCache.setState(cacheEntry, success);
  }
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:17,代码来源:NameNodeRpcServer.java


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