use of org.apache.hadoop.ipc.RetryCache.CacheEntry in project hadoop by apache.
the class NameNodeRpcServer method setXAttr.
// ClientProtocol
@Override
public void setXAttr(String src, XAttr xAttr, EnumSet<XAttrSetFlag> flag) 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.setXAttr(src, xAttr, flag, 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 delete.
// ClientProtocol
@Override
public boolean delete(String src, boolean recursive) throws IOException {
checkNNStartup();
if (stateChangeLog.isDebugEnabled()) {
stateChangeLog.debug("*DIR* Namenode.delete: src=" + src + ", recursive=" + recursive);
}
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.delete(src, recursive, cacheEntry != null);
} finally {
RetryCache.setState(cacheEntry, ret);
}
if (ret)
metrics.incrDeleteFileOps();
return ret;
}
use of org.apache.hadoop.ipc.RetryCache.CacheEntry in project hadoop by apache.
the class NameNodeRpcServer method removeCacheDirective.
// ClientProtocol
@Override
public void removeCacheDirective(long id) throws IOException {
checkNNStartup();
namesystem.checkOperation(OperationCategory.WRITE);
CacheEntry cacheEntry = RetryCache.waitForCompletion(retryCache);
if (cacheEntry != null && cacheEntry.isSuccess()) {
return;
}
boolean success = false;
try {
namesystem.removeCacheDirective(id, 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 saveNamespace.
// ClientProtocol
@Override
public boolean saveNamespace(long timeWindow, long txGap) throws IOException {
checkNNStartup();
CacheEntry cacheEntry = RetryCache.waitForCompletion(retryCache);
if (cacheEntry != null && cacheEntry.isSuccess()) {
// Return previous response
return true;
}
boolean success = false;
try {
namesystem.saveNamespace(timeWindow, txGap);
success = true;
} finally {
RetryCache.setState(cacheEntry, success);
}
return true;
}
use of org.apache.hadoop.ipc.RetryCache.CacheEntry in project hadoop by apache.
the class NameNodeRpcServer method addCachePool.
//ClientProtocol
@Override
public void addCachePool(CachePoolInfo info) 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.addCachePool(info, cacheEntry != null);
success = true;
} finally {
RetryCache.setState(cacheEntry, success);
}
}
Aggregations