public V GetValue(DateTime time, string key) { AvroRandomAccessReader <V> reader = GetReader(ValueLocationStrategy.GetLocation(time, key)); if (reader == null) { throw new Exception(string.Format("Document could not be located: {0} - {1}", time, key)); } return(reader.Get(key)); }
public bool TryGetDocument(DateTime time, string key, out V value) { AvroRandomAccessReader <V> reader = GetReader(ValueLocationStrategy.GetLocation(time, key)); if (reader != null) { value = reader.Get(key); return(true); } value = default(V); return(false); }
private AvroRandomAccessReader <V> GetReader(string location) { if (File.Exists(location)) { lock (mLocIndexes) { AvroRandomAccessIndex <V> index; mLocIndexes.TryGetValue(location, out index); var reader = new AvroRandomAccessReader <V>(ValueDef, location, index); if (index == null) { mLocIndexes.Add(location, reader.Index); } return(reader); } } return(null); }