public ElasticCluster(ElasticSettings.Cluster cluster) : base(cluster.Name) { SettingsName = cluster.Name; SettingsNodes = cluster.Nodes.Select(n => new ElasticNode(n)).ToList(); // TODO: Profiler ConnectionManager = new ConnectionManager(SettingsNodes.Select(n => n.Url), new ElasticProfilerProvider()); }
public Action <Cache <T> > UpdateFromElastic <T>() where T : ElasticDataObject, new() { return(UpdateCacheItem(description: "Elastic Fetch: " + SettingsName + ":" + typeof(T).Name, getData: () => { var result = new T(); result.PopulateFromConnections(SettingsNodes.Select(n => n.Host + ":" + n.Port)); return result; }, addExceptionData: e => e.AddLoggedData("Cluster", SettingsName) .AddLoggedData("Type", typeof(T).Name))); }