@Override
    public Set<StorageConfig> getStoreStorageSet(String groupName) throws FdfsException {
        Socket socket = getSocket();
        InputStream is = null;
        OutputStream os = null;
        try {
            os = socket.getOutputStream();
            is = socket.getInputStream();
            byte cmd = 0, errorNo = 0;
            if (Strings.isBlank(groupName)) {
                cmd = TRACKER_PROTO_CMD_SERVICE_QUERY_STORE_WITHOUT_GROUP_ALL;
            }
            else {
                cmd = TRACKER_PROTO_CMD_SERVICE_QUERY_STORE_WITH_GROUP_ALL;
            }
            byte[] request = Messages.createRequest(groupName, fdfsClientConfig.getCharset(), cmd, errorNo);
            os.write(request);
            // -1 jump over header check
            ResponseBody responseBody = Messages.readResponse(is, -1);
            errorNo = responseBody.getErrorNo();
            if (errorNo != 0) {
                return null;
            }
            byte[] body = responseBody.getBody();
            if (body.length < TRACKER_QUERY_STORAGE_STORE_BODY_LEN) {
                throw new IllegalStateException("invalid body.length, errorCode: " + ERR_NO_EINVAL);
            }
            int ipPortLength = body.length - (FDFS_GROUP_NAME_MAX_LEN + 1);
            int recordLength = FDFS_IPADDR_SIZE - 1 + FDFS_PROTO_PKG_LEN_SIZE;
            if (ipPortLength % recordLength != 0) {
                throw new IllegalStateException("invalid body.length, errorCode: " + ERR_NO_EINVAL);
            }
            int serverCount = ipPortLength / recordLength;
            if (serverCount > 16) {
                throw new IllegalStateException("invalid body.length, errorCode: " + ERR_NO_ENOSPC);
            }
            byte storePathIndex = body[body.length - 1];
            ReadByteArrayFragment response = new ReadByteArrayFragment(body);
            response.skip(FDFS_GROUP_NAME_MAX_LEN);
            Set<StorageConfig> set = new HashSet<StorageConfig>();
            for (int i = 0; i < serverCount; i++) {
                String addr = response.readString(0, FDFS_IPADDR_SIZE - 1).trim();
                long port = response.readLong();
                InetSocketAddress inetSocketAddress = new InetSocketAddress(addr, (int) port);
                StorageConfig storageConfig = new StorageConfig();
                storageConfig.setInetSocketAddress(inetSocketAddress);
                storageConfig.setStorePathIndex(storePathIndex);
                set.add(storageConfig);
            }
            return set;
        } catch (Exception e) {
            String msg = "getStoreStorageSet fail, groupName=[{}], socket=[{}]";
            msg = Strings.format(msg, groupName, socket);
            throw new FdfsException(msg + e.getMessage(), e);
        } finally {
            closeSocket(socket, is, os);
        }
    }