|
|
@ -23,6 +23,7 @@ import ( |
|
|
|
"net/rpc" |
|
|
|
"net/rpc" |
|
|
|
"net/url" |
|
|
|
"net/url" |
|
|
|
"path" |
|
|
|
"path" |
|
|
|
|
|
|
|
"strings" |
|
|
|
|
|
|
|
|
|
|
|
"github.com/minio/minio/pkg/disk" |
|
|
|
"github.com/minio/minio/pkg/disk" |
|
|
|
) |
|
|
|
) |
|
|
@ -132,20 +133,20 @@ func newStorageRPC(ep *url.URL) (StorageAPI, error) { |
|
|
|
|
|
|
|
|
|
|
|
// Stringer interface compatible representation of network device.
|
|
|
|
// Stringer interface compatible representation of network device.
|
|
|
|
func (n *networkStorage) String() string { |
|
|
|
func (n *networkStorage) String() string { |
|
|
|
return n.rpcClient.ServerAddr() + ":" + n.rpcClient.ServiceEndpoint() |
|
|
|
// Remove the storage RPC path prefix, internal paths are meaningless.
|
|
|
|
|
|
|
|
serviceEndpoint := strings.TrimPrefix(n.rpcClient.ServiceEndpoint(), storageRPCPath) |
|
|
|
|
|
|
|
return n.rpcClient.ServerAddr() + ":" + serviceEndpoint |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Init - attempts a login to reconnect.
|
|
|
|
// Init - attempts a login to reconnect.
|
|
|
|
func (n *networkStorage) Init() error { |
|
|
|
func (n *networkStorage) Init() error { |
|
|
|
err := n.rpcClient.Login() |
|
|
|
return toStorageErr(n.rpcClient.Login()) |
|
|
|
return toStorageErr(err) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Closes the underlying RPC connection.
|
|
|
|
// Closes the underlying RPC connection.
|
|
|
|
func (n *networkStorage) Close() (err error) { |
|
|
|
func (n *networkStorage) Close() error { |
|
|
|
// Close the underlying connection.
|
|
|
|
// Close the underlying connection.
|
|
|
|
err = n.rpcClient.Close() |
|
|
|
return toStorageErr(n.rpcClient.Close()) |
|
|
|
return toStorageErr(err) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// DiskInfo - fetch disk information for a remote disk.
|
|
|
|
// DiskInfo - fetch disk information for a remote disk.
|
|
|
|