MCPcopy Create free account
hub / github.com/grpc/grpc-java / ErrorEntry

Class ErrorEntry

grpclb/src/main/java/io/grpc/grpclb/GrpclbState.java:1115–1146  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1113 }
1114
1115 @VisibleForTesting
1116 static final class ErrorEntry implements RoundRobinEntry {
1117 final PickResult result;
1118
1119 ErrorEntry(Status status) {
1120 result = PickResult.withError(status);
1121 }
1122
1123 @Override
1124 public PickResult picked(PickSubchannelArgs args) {
1125 return result;
1126 }
1127
1128 @Override
1129 public int hashCode() {
1130 return Objects.hashCode(result);
1131 }
1132
1133 @Override
1134 public boolean equals(Object other) {
1135 if (!(other instanceof ErrorEntry)) {
1136 return false;
1137 }
1138 return Objects.equal(result, ((ErrorEntry) other).result);
1139 }
1140
1141 @Override
1142 public String toString() {
1143 // This is printed in logs. Only include useful information.
1144 return result.getStatus().toString();
1145 }
1146 }
1147
1148 /**
1149 * Entry that wraps a child LB's picker for PICK_FIRST mode delegation.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected