public bool TryLoadWatermarkForPartition(int partitionId, out Watermark watermark) { var fileName = FilenameForPartition(partitionId); watermark = null; if (File.Exists(fileName)) { try { var json = File.ReadAllText(fileName); watermark = JsonConvert.DeserializeObject <Watermark>(json); return(true); } catch (Exception) { return(false); } } return(false); }