Esempio n. 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
            });
        }
Esempio n. 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);
        }
Esempio n. 3
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 });
 }
Esempio n. 4
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;
        }