[client] prohibit copying/assigning of ResourceMetrics

Since ResourceMetrics contains a raw pointer, it makes it dangerous
since its auto-generated copy constructor and assignment operator
are not private.  Somebody could write something like

  {
    KuduScanner scanner();
    {
      ResouceMetrics m = session->GetResourceMetrics();
      ...
    }
    // Continue scanning activity with the 'scanner'.
    ...
  }

  or

  {
    KuduSession session(...);
    {
      ResouceMetrics m = session->GetWriteOpMetrics();
      ...
    }
    // Continue writing activity with the 'session'.
    ...
  }

and hit a silent memory corruption issue since that's the use-after-free
condition for the KuduScanner and KuduSession instances when the data
behind the raw pointer in ResourceMetrics::data_ is accessed later on.

This patch breaks the ABI compatibility for the kudu_client C++ library,
but this would surface only if there is a dangerous code like above
in the Kudu application linked with the library.  It's much worse having
such a hidden memory corruption issue in an application than hitting
a build breakage due to a linkage error which is quite simple to fix.

This is a follow-up to ece7b5653998db318e4baa5d57f27ba3a836731d.

Change-Id: I602cc4e194a975752687d13d525e44043955a5cf
Reviewed-on: http://gerrit.cloudera.org:8080/18510
Tested-by: Alexey Serbin <alexey@apache.org>
Reviewed-by: Riza Suminto <riza.suminto@cloudera.com>
Reviewed-by: Attila Bukor <abukor@apache.org>
1 file changed