private static ISolrClusterShard BuildShard(ISolrClusterCollection collection, JProperty json)
 {
     var state = GetState(json);
     return new SolrClusterShard {
         Name = json.Name,
         Range = SolrClusterShardRange.Parse((string) json.Value["range"]),
         State = state,
         IsActive = IsActive(state),
         Replicas = BuildReplicas(collection, json.Value["replicas"] as JObject)
     };
 }
Ejemplo n.º 2
0
        private static ISolrClusterShard BuildShard(ISolrClusterCollection collection, JProperty json)
        {
            var state = GetState(json);

            return(new SolrClusterShard {
                Name = json.Name,
                Range = SolrClusterShardRange.Parse((string)json.Value["range"]),
                State = state,
                IsActive = IsActive(state),
                Replicas = BuildReplicas(collection, json.Value["replicas"] as JObject)
            });
        }
 private static ISolrClusterReplica BuildReplica(ISolrClusterCollection collection, JProperty json)
 {
     var baseUrl = (string) json.Value["base_url"];
     var leader = json.Value["leader"];
     var state = GetState(json);
     return new SolrClusterReplica {
         BaseUrl = baseUrl,
         IsLeader = leader != null && (bool) leader,
         Name = json.Name,
         NodeName = (string) json.Value["node_name"],
         State = state,
         IsActive = IsActive(state),
         Url = baseUrl + "/" + collection.Name
     };
 }
Ejemplo n.º 4
0
        private static ISolrClusterReplica BuildReplica(ISolrClusterCollection collection, JProperty json)
        {
            var baseUrl = (string)json.Value["base_url"];
            var leader  = json.Value["leader"];
            var state   = GetState(json);

            return(new SolrClusterReplica {
                BaseUrl = baseUrl,
                IsLeader = leader != null && (bool)leader,
                Name = json.Name,
                NodeName = (string)json.Value["node_name"],
                State = state,
                IsActive = IsActive(state),
                Url = baseUrl + "/" + collection.Name
            });
        }
Ejemplo n.º 5
0
 private static ISolrClusterShards BuildShards(ISolrClusterCollection collection, JObject json)
 {
     return(new SolrClusterShards(
                json.Properties().Select(property => BuildShard(collection, property))));
 }
 private static ISolrClusterShards BuildShards(ISolrClusterCollection collection, JObject json)
 {
     return new SolrClusterShards(
         json.Properties().Select(property => BuildShard(collection, property)));
 }
 private static ISolrClusterReplicas BuildReplicas(ISolrClusterCollection collection, JObject json)
 {
     return new SolrClusterReplicas(
         json.Properties().Select(property => BuildReplica(collection, property)));
 }