public LogIndex(LogStore store, string name, Func<NeithLog, string> getKeyFunc) { Name = name; GetKeyFunc = getKeyFunc; IndexDir = store.DataDir.PathCombine("index", name).GetFullPath(); Index = new PersistentDictionary<string, IndexValue>(IndexDir); }
public static IEnumerable<NeithLog> WhereKey( this LogIndex index, string key,LogStore store) { return index.Index .Where(a => a.Key.StartsWith(key)) .Select(a => a.Value.ToLog(store)); }
public static NeithLog ToLog(this LogIndex.IndexValue value, LogStore store) { return store.Dic[value.UtcTime]; }
private void InitStoreTask() { // ログの保存処理 store = LogStore.Instance; storeTask = Observable .FromEventPattern<NeithLogEventArgs>(this, "Receive") .SubscribeOn(Scheduler.ThreadPool) .Subscribe(a => Store.Store(a.EventArgs.Log)); }