/** * @return Memcache client. * @throws Exception If start failed. */ private MemcachedClientIF startClient() throws Exception { int port = customPort != null ? customPort : IgniteConfiguration.DFLT_TCP_PORT; return new MemcachedClient(new BinaryConnectionFactory(), F.asList(new InetSocketAddress(LOC_HOST, port))); }
/** * Get a tap client operating on the specified memcached locations. * * @param addrs the socket addrs * @throws IOException if connections cannot be established */ public TapConnectionProvider(List<InetSocketAddress> addrs) throws IOException { this(new BinaryConnectionFactory(), addrs); }
/** * Get a tap client operating on the specified memcached locations. * * @param addrs the socket addrs * @throws IOException if connections cannot be established */ public TapConnectionProvider(List<InetSocketAddress> addrs) throws IOException { this(new BinaryConnectionFactory(), addrs); }
/** * Get a tap client operating on the specified memcached locations. * * @param addrs the socket addrs * @throws IOException if connections cannot be established */ public TapConnectionProvider(List<InetSocketAddress> addrs) throws IOException { this(new BinaryConnectionFactory(), addrs); }
/** * Get a tap client operating on the specified memcached locations. * * @param ia the memcached locations * @throws IOException if connections cannot be established */ public TapConnectionProvider(InetSocketAddress... ia) throws IOException { this(new BinaryConnectionFactory(), Arrays.asList(ia)); }
/** * Get a tap client operating on the specified memcached locations. * * @param ia the memcached locations * @throws IOException if connections cannot be established */ public TapConnectionProvider(InetSocketAddress... ia) throws IOException { this(new BinaryConnectionFactory(), Arrays.asList(ia)); }
/** * Get a tap client operating on the specified memcached locations. * * @param ia the memcached locations * @throws IOException if connections cannot be established */ public TapConnectionProvider(InetSocketAddress... ia) throws IOException { this(new BinaryConnectionFactory(), Arrays.asList(ia)); }
@Override protected MemcachedClient createMemcachedClient() throws IOException, UnknownHostException { List<InetSocketAddress> addrs = new ArrayList<InetSocketAddress>(); addrs.add(new InetSocketAddress(SocketCreator.getLocalHost(), PORT)); MemcachedClient client = new MemcachedClient(new BinaryConnectionFactory(), addrs); return client; }
/** * Constructor using a default Memcached Client. * * @throws IOException if the memcached client fails to start */ @Inject public MemDataCache() throws IOException { this(new MemcachedClient(new BinaryConnectionFactory(), AddrUtil.getAddresses(SERVER_CONFIG))); }
public Cache<K, V> getCache(int timeout, String type) { if (_cache == null) { _log.info("creating initial " + type + " cache with timeout " + timeout + "..."); _cache = CacheBuilder.newBuilder().expireAfterWrite(timeout, TimeUnit.SECONDS).build(); _log.info("done"); } if (memcache==null && useMemcached) { try { // TODO this appears to leak connections if addr does not exist memcache = new MemcachedClient( new BinaryConnectionFactory(), AddrUtil.getAddresses(addr)); } catch (Exception e) { } } if (_disabled) _cache.invalidateAll(); return _cache; }