Search in sources :

Example 21 with CacheEntry

use of org.apache.hadoop.ipc.RetryCache.CacheEntry in project hadoop by apache.

the class NameNodeRpcServer method modifyCachePool.

// ClientProtocol
@Override
public void modifyCachePool(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.modifyCachePool(info, cacheEntry != null);
        success = true;
    } finally {
        RetryCache.setState(cacheEntry, success);
    }
}
Also used : CacheEntry(org.apache.hadoop.ipc.RetryCache.CacheEntry)

Example 22 with CacheEntry

use of org.apache.hadoop.ipc.RetryCache.CacheEntry in project hadoop by apache.

the class NameNodeRpcServer method endCheckpoint.

// NamenodeProtocol
@Override
public void endCheckpoint(NamenodeRegistration registration, CheckpointSignature sig) throws IOException {
    checkNNStartup();
    namesystem.checkSuperuserPrivilege();
    CacheEntry cacheEntry = RetryCache.waitForCompletion(retryCache);
    if (cacheEntry != null && cacheEntry.isSuccess()) {
        // Return previous response
        return;
    }
    boolean success = false;
    try {
        namesystem.endCheckpoint(registration, sig);
        success = true;
    } finally {
        RetryCache.setState(cacheEntry, success);
    }
}
Also used : CacheEntry(org.apache.hadoop.ipc.RetryCache.CacheEntry)

Aggregations

CacheEntry (org.apache.hadoop.ipc.RetryCache.CacheEntry)22 IOException (java.io.IOException)5 HashMap (java.util.HashMap)2 LightWeightCache (org.apache.hadoop.util.LightWeightCache)2 Test (org.junit.Test)2 PermissionStatus (org.apache.hadoop.fs.permission.PermissionStatus)1 FSNamesystem (org.apache.hadoop.hdfs.server.namenode.FSNamesystem)1 UserGroupInformation (org.apache.hadoop.security.UserGroupInformation)1