final ConnectionType connectionType = ConnectionType.valueOf(memcachedNodesManager.isCouchbaseBucketConfig(), username, password);
if (connectionType.isCouchbaseBucketConfig()) {
return createCouchbaseClient(memcachedNodesManager, memcachedProtocol, username, password, operationTimeout, maxReconnectDelay,
statistics);
}
final ConnectionFactory connectionFactory = createConnectionFactory(memcachedNodesManager, connectionType, memcachedProtocol,
username, password, operationTimeout, maxReconnectDelay, statistics);
return new MemcachedClient(connectionFactory, memcachedNodesManager.getAllMemcachedAddresses());
} catch (final Exception e) {
throw new RuntimeException("Could not create memcached client", e);
}