Exemple #1
0
        public static void AddRoleInfoEntry(string roleId, string ip, int port, bool isMaster)
        {
            RoleInfoDataSource rids = new RoleInfoDataSource();

            rids.AddRoleInfoEntity(new RoleInfoEntity()
            {
                RoleId = roleId, IPString = ip, Port = port, IsSolrMaster = isMaster
            });
        }
Exemple #2
0
        private static IPEndPoint GetEndpoint(RoleInstance instance, bool bMaster)
        {
            IPEndPoint endpoint;

            RoleInfoDataSource rids = new RoleInfoDataSource();

            if (bMaster)
            {
                endpoint = rids.GetMasterEndpoint();
            }
            else
            {
                endpoint = rids.GetSlaveEndpoint(instance.Id);
            }

            if (!CheckEndpoint(endpoint))
            {
                return(null);
            }

            return(endpoint);
        }
 public static void AddRoleInfoEntry(string roleId, string ip, int port, bool isMaster)
 {
     RoleInfoDataSource rids = new RoleInfoDataSource();
     rids.AddRoleInfoEntity(new RoleInfoEntity() { RoleId = roleId, IPString = ip, Port = port, IsSolrMaster = isMaster });
 }
        private static IPEndPoint GetEndpoint(RoleInstance instance, bool bMaster)
        {
            IPEndPoint endpoint;

            RoleInfoDataSource rids = new RoleInfoDataSource();

            if (bMaster)
                endpoint = rids.GetMasterEndpoint();
            else
                endpoint = rids.GetSlaveEndpoint(instance.Id);

            if (!CheckEndpoint(endpoint))
                return null;

            return endpoint;
        }