if (request instanceof BinaryRequest) {
if (request instanceof GetBucketConfigRequest) {
return selectFirstConnected(endpoints);
} else {
BinaryRequest binaryRequest = (BinaryRequest) request;
short partition = binaryRequest.partition();
if (partition > 0) {
int id = partition % numEndpoints;
Endpoint endpoint = endpoints[id];
if (endpoint != null && endpoint.isState(LifecycleState.CONNECTED)) {
return endpoint;