protected void clearInternal() {
   ClientMessage request = CacheClearCodec.encodeRequest(nameWithPrefix);
   try {
     invoke(request);
     if (statisticsEnabled) {
       statistics.setLastUpdateTime(System.currentTimeMillis());
       // We don't support count stats of removing all entries.
     }
   } catch (Throwable t) {
     throw ExceptionUtil.rethrowAllowedTypeFirst(t, CacheException.class);
   }
 }
 protected void removeAllInternal() {
   final int partitionCount = clientContext.getPartitionService().getPartitionCount();
   final int completionId = nextCompletionId();
   registerCompletionLatch(completionId, partitionCount);
   ClientMessage request = CacheRemoveAllCodec.encodeRequest(nameWithPrefix, completionId);
   try {
     invoke(request);
     waitCompletionLatch(completionId, null);
     if (statisticsEnabled) {
       statistics.setLastUpdateTime(System.currentTimeMillis());
       // We don't support count stats of removing all entries.
     }
   } catch (Throwable t) {
     deregisterCompletionLatch(completionId);
     throw ExceptionUtil.rethrowAllowedTypeFirst(t, CacheException.class);
   }
 }