示例#1
0
        public static StorageNode[] QueryStorageNodesForFile(string groupName, string fileid)
        {
            FDFSRequest trackerRequest = QUERY_FETCH_ALL.Instance.GetRequest(groupName, fileid);
            QUERY_FETCH_ALL.Response trackerResponse = new QUERY_FETCH_ALL.Response();
            trackerRequest.GetResponse(trackerResponse);

            List<StorageNode> storageNodes = new List<StorageNode>();
            foreach (string IPStr in trackerResponse.IPStrs)
            {
                StorageNode storage = new StorageNode();
                storage.GroupName = trackerResponse.GroupName;
                storage.EndPoint = new IPEndPoint(IPAddress.Parse(IPStr), trackerResponse.Port);
                storage.StorePathIndex = 0;
                storageNodes.Add(storage);
            }
            return storageNodes.ToArray();
        }
示例#2
0
        public static StorageNode[] QueryStorageNodesForFile(string groupName, string fileid)
        {
            FDFSRequest trackerRequest = QUERY_FETCH_ALL.Instance.GetRequest(groupName, fileid);

            QUERY_FETCH_ALL.Response trackerResponse = new QUERY_FETCH_ALL.Response();
            trackerRequest.GetResponse(trackerResponse);

            List <StorageNode> storageNodes = new List <StorageNode>();

            foreach (string IPStr in trackerResponse.IPStrs)
            {
                StorageNode storage = new StorageNode();
                storage.GroupName      = trackerResponse.GroupName;
                storage.EndPoint       = new IPEndPoint(IPAddress.Parse(IPStr), trackerResponse.Port);
                storage.StorePathIndex = 0;
                storageNodes.Add(storage);
            }
            return(storageNodes.ToArray());
        }