Add some missing toString() implementations (#39124)

Sometimes we turn objects into strings for logging or debugging using
`toString()`, but the default implementation is often unhelpful. This change
improves on this in two places I ran into recently.
This commit is contained in:
David Turner 2019-02-19 17:52:25 +00:00
parent 210f34f8e9
commit 0a9574c9d4
2 changed files with 10 additions and 0 deletions

View File

@ -68,4 +68,9 @@ public class ActionListenerResponseHandler<Response extends TransportResponse> i
public Response read(StreamInput in) throws IOException {
return reader.read(in);
}
@Override
public String toString() {
return super.toString() + "/" + listener;
}
}

View File

@ -196,6 +196,11 @@ public class ReplicationOperation<
replicaException, ReplicationOperation.this::decPendingAndFinishIfNeeded,
ReplicationOperation.this::onPrimaryDemoted, throwable -> decPendingAndFinishIfNeeded());
}
@Override
public String toString() {
return "[" + replicaRequest + "][" + shard + "]";
}
});
}