@Override
 protected Client createInstance() throws Exception {
   switch (configuration.getProtocol()) {
     case TRANSPORT:
       return createTransportClient();
     case NODE:
       return createNodeClient();
     default:
       LOGGER.error("Unsupported protocol [{}] for elastic client", configuration.getProtocol());
       throw new IllegalStateException(
           String.format(
               "Unsupported protocol [%s] for elastic client", configuration.getProtocol()));
   }
 }