use of org.apache.hadoop.ipc.RetryCache.CacheEntry in project hadoop by apache.
the class NameNodeRpcServer method unsetErasureCodingPolicy.
// ClientProtocol
@Override
public void unsetErasureCodingPolicy(String src) throws IOException {
checkNNStartup();
final CacheEntry cacheEntry = RetryCache.waitForCompletion(retryCache);
if (cacheEntry != null && cacheEntry.isSuccess()) {
return;
}
boolean success = false;
try {
namesystem.unsetErasureCodingPolicy(src, 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 concat.
// ClientProtocol
@Override
public void concat(String trg, String[] src) 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.concat(trg, src, 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 createSymlink.
// ClientProtocol
@Override
public void createSymlink(String target, String link, FsPermission dirPerms, boolean createParent) throws IOException {
checkNNStartup();
namesystem.checkOperation(OperationCategory.WRITE);
CacheEntry cacheEntry = RetryCache.waitForCompletion(retryCache);
if (cacheEntry != null && cacheEntry.isSuccess()) {
// Return previous response
return;
}
/* We enforce the MAX_PATH_LENGTH limit even though a symlink target
* URI may refer to a non-HDFS file system.
*/
if (!checkPathLength(link)) {
throw new IOException("Symlink path exceeds " + MAX_PATH_LENGTH + " character limit");
}
final UserGroupInformation ugi = getRemoteUser();
boolean success = false;
try {
PermissionStatus perm = new PermissionStatus(ugi.getShortUserName(), null, dirPerms);
namesystem.createSymlink(target, link, perm, createParent, 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 deleteSnapshot.
@Override
public void deleteSnapshot(String snapshotRoot, String snapshotName) throws IOException {
checkNNStartup();
if (snapshotName == null || snapshotName.isEmpty()) {
throw new IOException("The snapshot name is null or empty.");
}
namesystem.checkOperation(OperationCategory.WRITE);
metrics.incrDeleteSnapshotOps();
CacheEntry cacheEntry = RetryCache.waitForCompletion(retryCache);
if (cacheEntry != null && cacheEntry.isSuccess()) {
// Return previous response
return;
}
boolean success = false;
try {
namesystem.deleteSnapshot(snapshotRoot, snapshotName, 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 setErasureCodingPolicy.
// ClientProtocol
@Override
public void setErasureCodingPolicy(String src, String ecPolicyName) throws IOException {
checkNNStartup();
final CacheEntry cacheEntry = RetryCache.waitForCompletion(retryCache);
if (cacheEntry != null && cacheEntry.isSuccess()) {
return;
}
boolean success = false;
try {
namesystem.setErasureCodingPolicy(src, ecPolicyName, cacheEntry != null);
success = true;
} finally {
RetryCache.setState(cacheEntry, success);
}
}
Aggregations