com.kukababy.key.SyncKey Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of dbquery Show documentation
Show all versions of dbquery Show documentation
Unified query of Mongodb and Sql database.
The newest version!
package com.kukababy.key;
import java.util.Iterator;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
/**
*
* 总体描述
*
*
* 1、
* 2、
*
*
* @author Sam [email protected]
* @date 创建时间:2016年3月14日 下午4:51:06
*
*/
public class SyncKey {
private static final ConcurrentMap syncMap = new ConcurrentHashMap();
public static String getSyncKey(String tblName) {
Iterator it = syncMap.keySet().iterator();
String key = null;
for (; it.hasNext();) {
key = it.next();
if (tblName.equals(key)) {
return key ;
}
}
key = tblName.toString();
KeyInfo keyInfo = new KeyInfo();
keyInfo.setOldDt("0");
syncMap.put(key, keyInfo);
return key;
}
public static KeyInfo getSyncKeyInfo(String key) {
return syncMap.get(key);
}
}