public GetDB ( string filePath, string>.Dictionary |
||
filePath | string | |
options | string>.Dictionary | |
리턴 | DB |
public void Open(string storeName, string basePath = BASE_PATH, Dictionary <string, string> options = null) { this.storeName = storeName; DBLockManager manager = DBLockManager.Instance; if (!basePath.EndsWith("\\")) { basePath += "\\"; } this.storeBasePath = basePath; // stores the revision history for a given document docStore = manager.GetDB(basePath + storeName + "\\docStore"); // stores the specific revision id and data for a given document sequenceStore = manager.GetDB(basePath + storeName + "\\sequenceStore"); attachStore = manager.GetDB(basePath + storeName + "\\attachStore"); attachBinaryStore = manager.GetDB(basePath + storeName + "\\attachBinaryStore"); docCounter = new DocCounter(basePath + storeName); docCount = docCounter.Get(); sequenceCounter = new SequenceCounter(basePath + storeName); sequenceCount = sequenceCounter.Get(); opened = true; }
public void Init(string storePath, string key, Dictionary <string, string> options = null) { DBLockManager lockManager = DBLockManager.Instance; store = lockManager.GetDB(storePath); this.storePath = storePath; }
public void SetLastSync(string uri, long lastSync) { try { DBLockManager lockManager = DBLockManager.Instance; DB store = lockManager.GetDB(BASE_PATH + this.storeName); store.Put(WriteOptions.Default, uri, lastSync.ToString()); } catch (Exception ee) { Debug.WriteLine(ee.ToString()); } }
public long GetLastSync(string uri) { long result = 0; try { DBLockManager lockManager = DBLockManager.Instance; DB store = lockManager.GetDB(BASE_PATH + this.storeName); result = Convert.ToInt64(store.Get(ReadOptions.Default, uri)); } catch (Exception ee) { Debug.WriteLine(ee.ToString()); } return(result); }