use of org.apache.hadoop.ipc.RetryCache.CacheEntry in project hadoop by apache.
the class NameNodeRpcServer method rename2.
// ClientProtocol
@Override
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.");
}
namesystem.checkOperation(OperationCategory.WRITE);
CacheEntry cacheEntry = RetryCache.waitForCompletion(retryCache);
if (cacheEntry != null && cacheEntry.isSuccess()) {
// Return previous response
return;
}
boolean success = false;
try {
namesystem.renameTo(src, dst, cacheEntry != null, options);
success = true;
} finally {
RetryCache.setState(cacheEntry, success);
}
metrics.incrFilesRenamed();
}
use of org.apache.hadoop.ipc.RetryCache.CacheEntry in project hadoop by apache.
the class NameNodeRpcServer method rename.
@Deprecated
// ClientProtocol
@Override
public boolean rename(String src, String dst) 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.");
}
namesystem.checkOperation(OperationCategory.WRITE);
CacheEntry cacheEntry = RetryCache.waitForCompletion(retryCache);
if (cacheEntry != null && cacheEntry.isSuccess()) {
// Return previous response
return true;
}
boolean ret = false;
try {
ret = namesystem.renameTo(src, dst, cacheEntry != null);
} finally {
RetryCache.setState(cacheEntry, ret);
}
if (ret) {
metrics.incrFilesRenamed();
}
return ret;
}
use of org.apache.hadoop.ipc.RetryCache.CacheEntry in project hadoop by apache.
the class NameNodeRpcServer method updatePipeline.
// ClientProtocol
@Override
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 previous response
return;
}
boolean success = false;
try {
namesystem.updatePipeline(clientName, oldBlock, newBlock, newNodes, newStorageIDs, cacheEntry != null);
success = true;
} finally {
RetryCache.setState(cacheEntry, success);
}
}
use of org.apache.hadoop.ipc.RetryCache.CacheEntry in project hadoop by apache.
the class NameNodeRpcServer method removeXAttr.
// ClientProtocol
@Override
public void removeXAttr(String src, XAttr xAttr) throws IOException {
checkNNStartup();
namesystem.checkOperation(OperationCategory.WRITE);
CacheEntry cacheEntry = RetryCache.waitForCompletion(retryCache);
if (cacheEntry != null && cacheEntry.isSuccess()) {
// Return previous response
return;
}
boolean success = false;
try {
namesystem.removeXAttr(src, xAttr, cacheEntry != null);
success = true;
} finally {
RetryCache.setState(cacheEntry, success);
}
}
use of org.apache.hadoop.ipc.RetryCache.CacheEntry in project hadoop by apache.
the class NameNodeRpcServer method removeCachePool.
// ClientProtocol
@Override
public void removeCachePool(String cachePoolName) throws IOException {
checkNNStartup();
namesystem.checkOperation(OperationCategory.WRITE);
CacheEntry cacheEntry = RetryCache.waitForCompletion(retryCache);
if (cacheEntry != null && cacheEntry.isSuccess()) {
return;
}
boolean success = false;
try {
namesystem.removeCachePool(cachePoolName, cacheEntry != null);
success = true;
} finally {
RetryCache.setState(cacheEntry, success);
}
}
Aggregations