当前位置: 首页>>代码示例>>Java>>正文


Java MemCachedClient类代码示例

本文整理汇总了Java中com.whalin.MemCached.MemCachedClient的典型用法代码示例。如果您正苦于以下问题:Java MemCachedClient类的具体用法?Java MemCachedClient怎么用?Java MemCachedClient使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


MemCachedClient类属于com.whalin.MemCached包,在下文中一共展示了MemCachedClient类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getMemcachedClient

import com.whalin.MemCached.MemCachedClient; //导入依赖的package包/类
protected MemCachedClient getMemcachedClient() {
  String memcachedAddr = System.getProperty("memcached.addr");
  String[] servers = {memcachedAddr};
  SockIOPool pool = SockIOPool.getInstance(POOL_NAME);
  pool.setServers(servers);
  /*
  pool.setFailover( true );
  pool.setInitConn( 10 );
  pool.setMinConn( 5 );
  pool.setMaxConn( 250 );
  pool.setMaintSleep( 30 );
  pool.setNagle( false );
  pool.setSocketTO( 3000 );
  pool.setAliveCheck( true );
  */
  pool.initialize();
  return new MemCachedClient(POOL_NAME, true, false);
}
 
开发者ID:ApptuitAI,项目名称:JInsight,代码行数:19,代码来源:WhalinMemcachedInstrumentationTest.java

示例2: getMemcachedClient

import com.whalin.MemCached.MemCachedClient; //导入依赖的package包/类
protected MemCachedClient getMemcachedClient() {
  String memcachedAddr = System.getProperty("memcached.addr");
  String[] servers = {memcachedAddr};
  SockIOPool pool = SockIOPool.getInstance(POOL_NAME);
  pool.setServers(servers);
  /*
  pool.setFailover( true );
  pool.setInitConn( 10 );
  pool.setMinConn( 5 );
  pool.setMaxConn( 250 );
  pool.setMaintSleep( 30 );
  pool.setNagle( false );
  pool.setSocketTO( 3000 );
  pool.setAliveCheck( true );
  */
  pool.initialize();
  return new MemCachedClient(POOL_NAME, true, true);
}
 
开发者ID:ApptuitAI,项目名称:JInsight,代码行数:19,代码来源:BinaryWhalinMemcachedInstrumentationTest.java

示例3: create

import com.whalin.MemCached.MemCachedClient; //导入依赖的package包/类
/**
 * Inits the.
 *
 * @param conf
 *          the conf
 * @return the i cache system
 */
public static ICacheSystem create(String server) {

  MemCache f = new MemCache();

  f.url = server.substring(Cache.MEMCACHED.length());

  SockIOPool pool = SockIOPool.getInstance();
  pool.setServers(new String[] { f.url });
  pool.setFailover(true);
  pool.setInitConn(10);
  pool.setMinConn(5);
  pool.setMaxConn(1000);
  pool.setMaintSleep(30);
  pool.setNagle(false);
  pool.setSocketTO(3000);
  pool.setAliveCheck(true);
  pool.initialize();

  f.memCachedClient = new MemCachedClient();

  return f;
}
 
开发者ID:giiwa,项目名称:giiwa,代码行数:30,代码来源:MemCache.java

示例4: init

import com.whalin.MemCached.MemCachedClient; //导入依赖的package包/类
private void init() {
	SockIOPool pool = SockIOPool.getInstance(poolName);
	pool.setServers(hostAndPort);
	pool.setWeights(hostWeight);
	pool.setInitConn(initConn);
	pool.setMinConn(minConn);
	pool.setMaxConn(maxConn);
	pool.setMaxIdle(maxIdleTime);
	pool.setMaintSleep(maintSleepTime);
	pool.setNagle(socketNagle);
	pool.setSocketTO(socketReadTimeOut);
	pool.setSocketConnectTO(socketConnectTimeOut);
	
	pool.setHashingAlg(SockIOPool.NATIVE_HASH);
	pool.setFailover(failover);
	pool.setFailback(failback);

	pool.initialize();
	memCachedClient = new MemCachedClient(poolName);
	memCachedClient.setPrimitiveAsString(primitiveAsString);
}
 
开发者ID:sogou-biztech,项目名称:compass,代码行数:22,代码来源:MyMemCache.java

示例5: start

import com.whalin.MemCached.MemCachedClient; //导入依赖的package包/类
/**
 * 
 */
@Start
public void start() {
    String path = plugin.getConfig(FILE_CONF, "");
    Properties _conf = MemcachedFactory.load(new File(path));
    if (_conf == null) {
        LOG.error("Not found memcached.file {}", path);
        return;
    }

    String pname = _conf.getProperty("mem.name");

    SockIOPool _pool = createPool(_conf);
    _pool.initialize();
    LOG.info("SockIOPool {} initialize successfully!", pname);

    mcc = new MemCachedClient(pname);
}
 
开发者ID:dzh,项目名称:jframe,代码行数:21,代码来源:MemcachedServiceImpl.java

示例6: ContactMemcachedClient

import com.whalin.MemCached.MemCachedClient; //导入依赖的package包/类
/**
* Initialize connection
*/
public ContactMemcachedClient() {
 
	SockIOPool pool = SockIOPool.getInstance();
	pool.setServers(servers);
	pool.setWeights( weights );
	if (!pool.isInitialized()) {
		pool.setInitConn(5);
		pool.setMinConn(5);
		pool.setMaxConn(250);
		pool.initialize();
	}
	MemCachedClient memCachedClient = new MemCachedClient();
	this.memcachedClient = memCachedClient;
}
 
开发者ID:PacktPublishing,项目名称:MySQL-8-for-Big-Data,代码行数:18,代码来源:ContactMemcachedClient.java

示例7: addRulesForOperation

import com.whalin.MemCached.MemCachedClient; //导入依赖的package包/类
private void addRulesForOperation(String methodName) {
  addRule(MemCachedClient.class, methodName, "AT ENTRY",
      "onOperationStart(\"" + methodName + "\", $0)");
  addRule(MemCachedClient.class, methodName, "AT EXIT",
      "onOperationEnd(\"" + methodName + "\", $0)");
  addRule(MemCachedClient.class, methodName, "AT EXCEPTION EXIT",
      "onOperationError(\"" + methodName + "\", $0)");
}
 
开发者ID:ApptuitAI,项目名称:JInsight,代码行数:9,代码来源:WhalinmemcachedRuleSet.java

示例8: getMemcachedCache

import com.whalin.MemCached.MemCachedClient; //导入依赖的package包/类
/**
 * 从系统容器中获取MemcachedCache实例
 * 
 * @param cacheId
 * @return
 */
public static MemCachedClient getMemcachedCache(String cacheId) {
	TangYuanCache tangYuanCache = CacheComponent.getInstance().getCache(cacheId);
	if (null != tangYuanCache) {
		MemcachedCache memcachedCache = (MemcachedCache) tangYuanCache;
		return memcachedCache.getCachedClient();
	}
	return null;
}
 
开发者ID:xsonorg,项目名称:tangyuan2,代码行数:15,代码来源:MemcachedHelper.java

示例9: getMcc

import com.whalin.MemCached.MemCachedClient; //导入依赖的package包/类
public MemCachedClient getMcc() {
	if (mcc == null) {
		mcc = initMcc();
	}

	return mcc;
}
 
开发者ID:tanhaichao,项目名称:leopard,代码行数:8,代码来源:MemcacheImpl.java

示例10: initMcc

import com.whalin.MemCached.MemCachedClient; //导入依赖的package包/类
protected synchronized MemCachedClient initMcc() {
	if (mcc != null) {
		return mcc;
	}
	String[] servers = new String[] { server };
	return initMemCachedClient(servers, maxConn, sanitizeKeys);
}
 
开发者ID:tanhaichao,项目名称:leopard,代码行数:8,代码来源:MemcacheImpl.java

示例11: connect

import com.whalin.MemCached.MemCachedClient; //导入依赖的package包/类
@Override
public void connect() throws IOException
{
  pool = SockIOPool.getInstance();
  if (serverAddresses.isEmpty()) {
    pool.setServers(new String[]{"localhost:11211"});
  } else {
    pool.setServers(serverAddresses.toArray(new String[] {}));
  }
  pool.initialize();
  memcacheClient = new MemCachedClient();
}
 
开发者ID:apache,项目名称:apex-malhar,代码行数:13,代码来源:MemcacheStore.java

示例12: onOperationStart

import com.whalin.MemCached.MemCachedClient; //导入依赖的package包/类
public void onOperationStart(String op, MemCachedClient client) {
  beginTimedOperation(getOperationId(op));
}
 
开发者ID:ApptuitAI,项目名称:JInsight,代码行数:4,代码来源:WhalinmemcachedRuleHelper.java

示例13: onOperationEnd

import com.whalin.MemCached.MemCachedClient; //导入依赖的package包/类
public void onOperationEnd(String op, MemCachedClient client) {
  endTimedOperation(getOperationId(op), getTimerForOp(op));
}
 
开发者ID:ApptuitAI,项目名称:JInsight,代码行数:4,代码来源:WhalinmemcachedRuleHelper.java

示例14: onOperationError

import com.whalin.MemCached.MemCachedClient; //导入依赖的package包/类
public void onOperationError(String op, MemCachedClient client) {
  endTimedOperation(getOperationId(op), getTimerForOp(op));
}
 
开发者ID:ApptuitAI,项目名称:JInsight,代码行数:4,代码来源:WhalinmemcachedRuleHelper.java

示例15: getCachedClient

import com.whalin.MemCached.MemCachedClient; //导入依赖的package包/类
public MemCachedClient getCachedClient() {
	return cachedClient;
}
 
开发者ID:xsonorg,项目名称:tangyuan2,代码行数:4,代码来源:MemcachedCache.java


注:本文中的com.whalin.MemCached.MemCachedClient类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。