@Override
 protected BlockWorkerClient createNewResource() {
   long clientId = Utils.getRandomNonNegativeLong();
   return new BlockWorkerClient(
       mWorkerNetAddress,
       ClientContext.getExecutorService(),
       ClientContext.getConf(),
       clientId,
       true,
       ClientContext.getClientMetrics());
 }
 @Override
 public void release(BlockWorkerClient blockWorkerClient) {
   try {
     // Heartbeat to send the client metrics.
     blockWorkerClient.sessionHeartbeat();
   } catch (Exception e) {
     LOG.warn("Failed sending client metrics before releasing the worker client", e);
   }
   blockWorkerClient.createNewSession(Utils.getRandomNonNegativeLong());
   super.release(blockWorkerClient);
 }