Package net.spy.memcached

Examples of net.spy.memcached.MemcachedClient.shutdown()


      for (int j = 0; j < BYTES.length; j++) {
        int repeats = getReapts(i);
        test(memcachedClient, BYTES[j], THREADS[i], repeats, true);
      }
    }
    memcachedClient.shutdown();

  }

  private static void warmUp(MemcachedClient memcachedClient)
      throws Exception {
View Full Code Here


  }

  final static synchronized  void shutdownClient( long clientHandle )
  {
    MemcachedClient client = clients.get( clientHandle );
    client.shutdown();
    clients.remove( Long.valueOf( clientHandle ) ) ;
  }
 
  protected static synchronized long getHandle()
  {
View Full Code Here

    String extraPath = "/tmp";
    // Flush the memcache servers before setting the values
    MemcachedClient myMCC;
    myMCC = new MemcachedClient(AddrUtil.getAddresses(ipAddress));
    myMCC.flush();
    myMCC.shutdown();

    // Number of maptask has to be one else some values get converted to
    // null in memcache.
    // TODO : Check why this happens
    int mapTasks = Integer.parseInt(args[2]); // Integer.parseInt(args[2]);
View Full Code Here

            assertEquals("700", stats.get("get_hits"));
            assertEquals("300", stats.get("get_misses"));
            assertEquals("100", stats.get("delete_hits"));
            assertEquals("100", stats.get("delete_misses"));
        } finally {
            client.shutdown();
        }
    }

    @Test
    public void testMemcacheWithIMap() throws IOException, InterruptedException, ExecutionException {
View Full Code Here

            future.get();
            for (int i = 0; i < 100; i++) {
                assertEquals(null, client.get(prefix + String.valueOf(i)));
            }
        } finally {
            client.shutdown();
        }
    }

    @Test
    public void testIncrementAndDecrement() throws IOException, ExecutionException, InterruptedException {
View Full Code Here

            assertEquals("100", stats.get("incr_hits"));
            assertEquals("20", stats.get("incr_misses"));
            assertEquals("100", stats.get("decr_hits"));
            assertEquals("30", stats.get("decr_misses"));
        } finally {
            client.shutdown();
        }
    }

    @Test
    public void testMemcacheAppendPrepend() throws IOException, ExecutionException, InterruptedException {
View Full Code Here

            }
            for (int i = 1; i < 100; i++) {
                assertEquals("prepend" + String.valueOf(i) + "append", client.get(String.valueOf(i)));
            }
        } finally {
            client.shutdown();
        }
    }

    @Test
    public void testQuit() throws IOException {
View Full Code Here

    @Test
    public void testQuit() throws IOException {
        final HazelcastInstance instance = Hazelcast.newHazelcastInstance(config);
        MemcachedClient client = getMemcacheClient(instance);
        client.shutdown();
    }

    @Test
    public void testMemcacheTTL() throws IOException, ExecutionException, InterruptedException {
        final HazelcastInstance instance = Hazelcast.newHazelcastInstance(config);
View Full Code Here

                public void run() throws Exception {
                    assertEquals(null, client.get(String.valueOf(0)));
                }
            });
        } finally {
            client.shutdown();
        }
    }
}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.