public class TrackerClient extends Object
Modifier and Type | Field and Description |
---|---|
protected byte |
errno |
protected TrackerGroup |
tracker_group |
Constructor and Description |
---|
TrackerClient()
constructor with global tracker group
|
TrackerClient(TrackerGroup tracker_group)
constructor with specified tracker group
|
Modifier and Type | Method and Description |
---|---|
boolean |
deleteStorage(String groupName,
String storageIpAddr)
delete a storage server from the global FastDFS cluster
|
boolean |
deleteStorage(TrackerGroup trackerGroup,
String groupName,
String storageIpAddr)
delete a storage server from the FastDFS cluster
|
TrackerServer |
getConnection()
get a connection to tracker server
|
byte |
getErrorCode()
get the error code of last call
|
StorageServer |
getFetchStorage(TrackerServer trackerServer,
String groupName,
String filename)
query storage server to download file
|
StorageServer |
getFetchStorage1(TrackerServer trackerServer,
String file_id)
query storage server to download file
|
ServerInfo[] |
getFetchStorages(TrackerServer trackerServer,
String groupName,
String filename)
get storage servers to download file
|
ServerInfo[] |
getFetchStorages1(TrackerServer trackerServer,
String file_id)
get storage servers to download file
|
protected ServerInfo[] |
getStorages(TrackerServer trackerServer,
byte cmd,
String groupName,
String filename)
query storage server to download file
|
StorageServer |
getStoreStorage(TrackerServer trackerServer)
query storage server to upload file
|
StorageServer |
getStoreStorage(TrackerServer trackerServer,
String groupName)
query storage server to upload file
|
StorageServer[] |
getStoreStorages(TrackerServer trackerServer,
String groupName)
query storage servers to upload file
|
StorageServer |
getUpdateStorage(TrackerServer trackerServer,
String groupName,
String filename)
query storage server to update file (delete file or set meta data)
|
StructGroupStat[] |
listGroups(TrackerServer trackerServer)
list groups
|
StructStorageStat[] |
listStorages(TrackerServer trackerServer,
String groupName)
query storage server stat info of the group
|
StructStorageStat[] |
listStorages(TrackerServer trackerServer,
String groupName,
String storageIpAddr)
query storage server stat info of the group
|
protected TrackerGroup tracker_group
protected byte errno
public TrackerClient()
public TrackerClient(TrackerGroup tracker_group)
tracker_group
- the tracker group objectpublic byte getErrorCode()
public TrackerServer getConnection() throws IOException
IOException
public StorageServer getStoreStorage(TrackerServer trackerServer) throws IOException
trackerServer
- the tracker serverIOException
public StorageServer getStoreStorage(TrackerServer trackerServer, String groupName) throws IOException
trackerServer
- the tracker servergroupName
- the group name to upload file to, can be emptyIOException
public StorageServer[] getStoreStorages(TrackerServer trackerServer, String groupName) throws IOException
trackerServer
- the tracker servergroupName
- the group name to upload file to, can be emptyIOException
public StorageServer getFetchStorage(TrackerServer trackerServer, String groupName, String filename) throws IOException
trackerServer
- the tracker servergroupName
- the group name of storage serverfilename
- filename on storage serverIOException
public StorageServer getUpdateStorage(TrackerServer trackerServer, String groupName, String filename) throws IOException
trackerServer
- the tracker servergroupName
- the group name of storage serverfilename
- filename on storage serverIOException
public ServerInfo[] getFetchStorages(TrackerServer trackerServer, String groupName, String filename) throws IOException
trackerServer
- the tracker servergroupName
- the group name of storage serverfilename
- filename on storage serverIOException
protected ServerInfo[] getStorages(TrackerServer trackerServer, byte cmd, String groupName, String filename) throws IOException
trackerServer
- the tracker servercmd
- command code, ProtoCommon.TRACKER_PROTO_CMD_SERVICE_QUERY_FETCH_ONE or
ProtoCommon.TRACKER_PROTO_CMD_SERVICE_QUERY_UPDATEgroupName
- the group name of storage serverfilename
- filename on storage serverIOException
public StorageServer getFetchStorage1(TrackerServer trackerServer, String file_id) throws IOException
trackerServer
- the tracker serverfile_id
- the file id(including group name and filename)IOException
public ServerInfo[] getFetchStorages1(TrackerServer trackerServer, String file_id) throws IOException
trackerServer
- the tracker serverfile_id
- the file id(including group name and filename)IOException
public StructGroupStat[] listGroups(TrackerServer trackerServer) throws IOException
trackerServer
- the tracker serverIOException
public StructStorageStat[] listStorages(TrackerServer trackerServer, String groupName) throws IOException
trackerServer
- the tracker servergroupName
- the group name of storage serverIOException
public StructStorageStat[] listStorages(TrackerServer trackerServer, String groupName, String storageIpAddr) throws IOException
trackerServer
- the tracker servergroupName
- the group name of storage serverstorageIpAddr
- the storage server ip address, can be null or emptyIOException
public boolean deleteStorage(String groupName, String storageIpAddr) throws IOException
groupName
- the group name of storage serverstorageIpAddr
- the storage server ip addressIOException
public boolean deleteStorage(TrackerGroup trackerGroup, String groupName, String storageIpAddr) throws IOException
trackerGroup
- the tracker server groupgroupName
- the group name of storage serverstorageIpAddr
- the storage server ip addressIOException
Copyright © 2018 lodsve. All rights reserved.