|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
java.lang.Objectorg.csource.fastdfs.StorageClient
public class StorageClient
Storage client for 2 fields file id: group name and filename
| 嵌套类摘要 | |
|---|---|
static class |
StorageClient.UploadBuff
Upload file by file buff |
| 字段摘要 | |
|---|---|
static Base64 |
base64
|
protected byte |
errno
|
protected StorageServer |
storageServer
|
protected TrackerServer |
trackerServer
|
| 构造方法摘要 | |
|---|---|
StorageClient()
constructor using global settings in class ClientGlobal |
|
StorageClient(TrackerServer trackerServer,
StorageServer storageServer)
constructor with tracker server and storage server |
|
| 方法摘要 | |
|---|---|
int |
append_file(String group_name,
String appender_filename,
byte[] file_buff)
append file to storage server (by file buff) |
int |
append_file(String group_name,
String appender_filename,
byte[] file_buff,
int offset,
int length)
append file to storage server (by file buff) |
int |
append_file(String group_name,
String appender_filename,
long file_size,
UploadCallback callback)
append file to storage server (by callback) |
int |
append_file(String group_name,
String appender_filename,
String local_filename)
append file to storage server (by file name) |
int |
delete_file(String group_name,
String remote_filename)
delete file from storage server |
protected int |
do_append_file(String group_name,
String appender_filename,
long file_size,
UploadCallback callback)
append file to storage server |
protected int |
do_modify_file(String group_name,
String appender_filename,
long file_offset,
long modify_size,
UploadCallback callback)
modify appender file to storage server |
protected String[] |
do_upload_file(byte cmd,
String group_name,
String master_filename,
String prefix_name,
String file_ext_name,
long file_size,
UploadCallback callback,
NameValuePair[] meta_list)
upload file to storage server |
byte[] |
download_file(String group_name,
String remote_filename)
download file from storage server |
int |
download_file(String group_name,
String remote_filename,
DownloadCallback callback)
download file from storage server |
byte[] |
download_file(String group_name,
String remote_filename,
long file_offset,
long download_bytes)
download file from storage server |
int |
download_file(String group_name,
String remote_filename,
long file_offset,
long download_bytes,
DownloadCallback callback)
download file from storage server |
int |
download_file(String group_name,
String remote_filename,
long file_offset,
long download_bytes,
String local_filename)
download file from storage server |
int |
download_file(String group_name,
String remote_filename,
String local_filename)
download file from storage server |
FileInfo |
get_file_info(String group_name,
String remote_filename)
get file info decoded from the filename, fetch from the storage if necessary |
NameValuePair[] |
get_metadata(String group_name,
String remote_filename)
get all metadata items from storage server |
byte |
getErrorCode()
get the error code of last call |
int |
modify_file(String group_name,
String appender_filename,
long file_offset,
byte[] file_buff)
modify appender file to storage server (by file buff) |
int |
modify_file(String group_name,
String appender_filename,
long file_offset,
byte[] file_buff,
int buffer_offset,
int buffer_length)
modify appender file to storage server (by file buff) |
int |
modify_file(String group_name,
String appender_filename,
long file_offset,
long modify_size,
UploadCallback callback)
modify appender file to storage server (by callback) |
int |
modify_file(String group_name,
String appender_filename,
long file_offset,
String local_filename)
modify appender file to storage server (by file name) |
protected boolean |
newReadableStorageConnection(String group_name,
String remote_filename)
check storage socket, if null create a new connection |
protected boolean |
newUpdatableStorageConnection(String group_name,
String remote_filename)
check storage socket, if null create a new connection |
protected boolean |
newWritableStorageConnection(String group_name)
check storage socket, if null create a new connection |
FileInfo |
query_file_info(String group_name,
String remote_filename)
get file info from storage server |
protected void |
send_download_package(String group_name,
String remote_filename,
long file_offset,
long download_bytes)
send package to storage server |
protected void |
send_package(byte cmd,
String group_name,
String remote_filename)
send package to storage server |
int |
set_metadata(String group_name,
String remote_filename,
NameValuePair[] meta_list,
byte op_flag)
set metadata items to storage server |
int |
truncate_file(String group_name,
String appender_filename)
truncate appender file to size 0 from storage server |
int |
truncate_file(String group_name,
String appender_filename,
long truncated_file_size)
truncate appender file from storage server |
String[] |
upload_appender_file(byte[] file_buff,
int offset,
int length,
String file_ext_name,
NameValuePair[] meta_list)
upload appender file to storage server (by file buff) |
String[] |
upload_appender_file(byte[] file_buff,
String file_ext_name,
NameValuePair[] meta_list)
upload appender file to storage server (by file buff) |
String[] |
upload_appender_file(String group_name,
byte[] file_buff,
int offset,
int length,
String file_ext_name,
NameValuePair[] meta_list)
upload appender file to storage server (by file buff) |
String[] |
upload_appender_file(String group_name,
byte[] file_buff,
String file_ext_name,
NameValuePair[] meta_list)
upload appender file to storage server (by file buff) |
String[] |
upload_appender_file(String group_name,
long file_size,
UploadCallback callback,
String file_ext_name,
NameValuePair[] meta_list)
upload appender file to storage server (by callback) |
String[] |
upload_appender_file(String local_filename,
String file_ext_name,
NameValuePair[] meta_list)
upload appender file to storage server (by file name) |
protected String[] |
upload_appender_file(String group_name,
String local_filename,
String file_ext_name,
NameValuePair[] meta_list)
upload appender file to storage server (by file name) |
String[] |
upload_file(byte[] file_buff,
int offset,
int length,
String file_ext_name,
NameValuePair[] meta_list)
upload file to storage server (by file buff) |
String[] |
upload_file(byte[] file_buff,
String file_ext_name,
NameValuePair[] meta_list)
upload file to storage server (by file buff) |
protected String[] |
upload_file(byte cmd,
String group_name,
String local_filename,
String file_ext_name,
NameValuePair[] meta_list)
upload file to storage server (by file name) |
String[] |
upload_file(String group_name,
byte[] file_buff,
int offset,
int length,
String file_ext_name,
NameValuePair[] meta_list)
upload file to storage server (by file buff) |
String[] |
upload_file(String group_name,
byte[] file_buff,
String file_ext_name,
NameValuePair[] meta_list)
upload file to storage server (by file buff) |
String[] |
upload_file(String group_name,
long file_size,
UploadCallback callback,
String file_ext_name,
NameValuePair[] meta_list)
upload file to storage server (by callback) |
String[] |
upload_file(String local_filename,
String file_ext_name,
NameValuePair[] meta_list)
upload file to storage server (by file name) |
String[] |
upload_file(String group_name,
String master_filename,
String prefix_name,
byte[] file_buff,
int offset,
int length,
String file_ext_name,
NameValuePair[] meta_list)
upload file to storage server (by file buff, slave file mode) |
String[] |
upload_file(String group_name,
String master_filename,
String prefix_name,
byte[] file_buff,
String file_ext_name,
NameValuePair[] meta_list)
upload file to storage server (by file buff, slave file mode) |
String[] |
upload_file(String group_name,
String master_filename,
String prefix_name,
long file_size,
UploadCallback callback,
String file_ext_name,
NameValuePair[] meta_list)
upload file to storage server (by callback, slave file mode) |
protected String[] |
upload_file(String group_name,
String local_filename,
String file_ext_name,
NameValuePair[] meta_list)
upload file to storage server (by file name) |
String[] |
upload_file(String group_name,
String master_filename,
String prefix_name,
String local_filename,
String file_ext_name,
NameValuePair[] meta_list)
upload file to storage server (by file name, slave file mode) |
| 从类 java.lang.Object 继承的方法 |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| 字段详细信息 |
|---|
public static final Base64 base64
protected TrackerServer trackerServer
protected StorageServer storageServer
protected byte errno
| 构造方法详细信息 |
|---|
public StorageClient()
public StorageClient(TrackerServer trackerServer,
StorageServer storageServer)
trackerServer - the tracker server, can be nullstorageServer - the storage server, can be null| 方法详细信息 |
|---|
public byte getErrorCode()
public String[] upload_file(String local_filename,
String file_ext_name,
NameValuePair[] meta_list)
throws IOException,
MyException
local_filename - local filename to uploadfile_ext_name - file ext name, do not include dot(.), null to extract ext name from the local filenamemeta_list - meta info array
IOException
MyException
protected String[] upload_file(String group_name,
String local_filename,
String file_ext_name,
NameValuePair[] meta_list)
throws IOException,
MyException
group_name - the group name to upload file to, can be emptylocal_filename - local filename to uploadfile_ext_name - file ext name, do not include dot(.), null to extract ext name from the local filenamemeta_list - meta info array
IOException
MyException
protected String[] upload_file(byte cmd,
String group_name,
String local_filename,
String file_ext_name,
NameValuePair[] meta_list)
throws IOException,
MyException
cmd - the commandgroup_name - the group name to upload file to, can be emptylocal_filename - local filename to uploadfile_ext_name - file ext name, do not include dot(.), null to extract ext name from the local filenamemeta_list - meta info array
IOException
MyException
public String[] upload_file(byte[] file_buff,
int offset,
int length,
String file_ext_name,
NameValuePair[] meta_list)
throws IOException,
MyException
file_buff - file content/buffoffset - start offset of the bufflength - the length of buff to uploadfile_ext_name - file ext name, do not include dot(.)meta_list - meta info array
IOException
MyException
public String[] upload_file(String group_name,
byte[] file_buff,
int offset,
int length,
String file_ext_name,
NameValuePair[] meta_list)
throws IOException,
MyException
group_name - the group name to upload file to, can be emptyfile_buff - file content/buffoffset - start offset of the bufflength - the length of buff to uploadfile_ext_name - file ext name, do not include dot(.)meta_list - meta info array
IOException
MyException
public String[] upload_file(byte[] file_buff,
String file_ext_name,
NameValuePair[] meta_list)
throws IOException,
MyException
file_buff - file content/bufffile_ext_name - file ext name, do not include dot(.)meta_list - meta info array
IOException
MyException
public String[] upload_file(String group_name,
byte[] file_buff,
String file_ext_name,
NameValuePair[] meta_list)
throws IOException,
MyException
group_name - the group name to upload file to, can be emptyfile_buff - file content/bufffile_ext_name - file ext name, do not include dot(.)meta_list - meta info array
IOException
MyException
public String[] upload_file(String group_name,
long file_size,
UploadCallback callback,
String file_ext_name,
NameValuePair[] meta_list)
throws IOException,
MyException
group_name - the group name to upload file to, can be emptyfile_size - the file sizecallback - the write data callback objectfile_ext_name - file ext name, do not include dot(.)meta_list - meta info array
IOException
MyException
public String[] upload_file(String group_name,
String master_filename,
String prefix_name,
String local_filename,
String file_ext_name,
NameValuePair[] meta_list)
throws IOException,
MyException
group_name - the group name of master filemaster_filename - the master file name to generate the slave fileprefix_name - the prefix name to generate the slave filelocal_filename - local filename to uploadfile_ext_name - file ext name, do not include dot(.), null to extract ext name from the local filenamemeta_list - meta info array
IOException
MyException
public String[] upload_file(String group_name,
String master_filename,
String prefix_name,
byte[] file_buff,
String file_ext_name,
NameValuePair[] meta_list)
throws IOException,
MyException
group_name - the group name of master filemaster_filename - the master file name to generate the slave fileprefix_name - the prefix name to generate the slave filefile_buff - file content/bufffile_ext_name - file ext name, do not include dot(.)meta_list - meta info array
IOException
MyException
public String[] upload_file(String group_name,
String master_filename,
String prefix_name,
byte[] file_buff,
int offset,
int length,
String file_ext_name,
NameValuePair[] meta_list)
throws IOException,
MyException
group_name - the group name of master filemaster_filename - the master file name to generate the slave fileprefix_name - the prefix name to generate the slave filefile_buff - file content/buffoffset - start offset of the bufflength - the length of buff to uploadfile_ext_name - file ext name, do not include dot(.)meta_list - meta info array
IOException
MyException
public String[] upload_file(String group_name,
String master_filename,
String prefix_name,
long file_size,
UploadCallback callback,
String file_ext_name,
NameValuePair[] meta_list)
throws IOException,
MyException
group_name - the group name to upload file to, can be emptymaster_filename - the master file name to generate the slave fileprefix_name - the prefix name to generate the slave filefile_size - the file sizecallback - the write data callback objectfile_ext_name - file ext name, do not include dot(.)meta_list - meta info array
IOException
MyException
public String[] upload_appender_file(String local_filename,
String file_ext_name,
NameValuePair[] meta_list)
throws IOException,
MyException
local_filename - local filename to uploadfile_ext_name - file ext name, do not include dot(.), null to extract ext name from the local filenamemeta_list - meta info array
IOException
MyException
protected String[] upload_appender_file(String group_name,
String local_filename,
String file_ext_name,
NameValuePair[] meta_list)
throws IOException,
MyException
group_name - the group name to upload file to, can be emptylocal_filename - local filename to uploadfile_ext_name - file ext name, do not include dot(.), null to extract ext name from the local filenamemeta_list - meta info array
IOException
MyException
public String[] upload_appender_file(byte[] file_buff,
int offset,
int length,
String file_ext_name,
NameValuePair[] meta_list)
throws IOException,
MyException
file_buff - file content/buffoffset - start offset of the bufflength - the length of buff to uploadfile_ext_name - file ext name, do not include dot(.)meta_list - meta info array
IOException
MyException
public String[] upload_appender_file(String group_name,
byte[] file_buff,
int offset,
int length,
String file_ext_name,
NameValuePair[] meta_list)
throws IOException,
MyException
group_name - the group name to upload file to, can be emptyfile_buff - file content/buffoffset - start offset of the bufflength - the length of buff to uploadfile_ext_name - file ext name, do not include dot(.)meta_list - meta info array
IOException
MyException
public String[] upload_appender_file(byte[] file_buff,
String file_ext_name,
NameValuePair[] meta_list)
throws IOException,
MyException
file_buff - file content/bufffile_ext_name - file ext name, do not include dot(.)meta_list - meta info array
IOException
MyException
public String[] upload_appender_file(String group_name,
byte[] file_buff,
String file_ext_name,
NameValuePair[] meta_list)
throws IOException,
MyException
group_name - the group name to upload file to, can be emptyfile_buff - file content/bufffile_ext_name - file ext name, do not include dot(.)meta_list - meta info array
IOException
MyException
public String[] upload_appender_file(String group_name,
long file_size,
UploadCallback callback,
String file_ext_name,
NameValuePair[] meta_list)
throws IOException,
MyException
group_name - the group name to upload file to, can be emptyfile_size - the file sizecallback - the write data callback objectfile_ext_name - file ext name, do not include dot(.)meta_list - meta info array
IOException
MyException
public int append_file(String group_name,
String appender_filename,
String local_filename)
throws IOException,
MyException
group_name - the group name of appender fileappender_filename - the appender filenamelocal_filename - local filename to append
IOException
MyException
public int append_file(String group_name,
String appender_filename,
byte[] file_buff)
throws IOException,
MyException
group_name - the group name of appender fileappender_filename - the appender filenamefile_buff - file content/buff
IOException
MyException
public int append_file(String group_name,
String appender_filename,
byte[] file_buff,
int offset,
int length)
throws IOException,
MyException
group_name - the group name of appender fileappender_filename - the appender filenamefile_buff - file content/buffoffset - start offset of the bufflength - the length of buff to append
IOException
MyException
public int append_file(String group_name,
String appender_filename,
long file_size,
UploadCallback callback)
throws IOException,
MyException
group_name - the group name to append file toappender_filename - the appender filenamefile_size - the file sizecallback - the write data callback object
IOException
MyException
public int modify_file(String group_name,
String appender_filename,
long file_offset,
String local_filename)
throws IOException,
MyException
group_name - the group name of appender fileappender_filename - the appender filenamefile_offset - the offset of appender filelocal_filename - local filename to append
IOException
MyException
public int modify_file(String group_name,
String appender_filename,
long file_offset,
byte[] file_buff)
throws IOException,
MyException
group_name - the group name of appender fileappender_filename - the appender filenamefile_offset - the offset of appender filefile_buff - file content/buff
IOException
MyException
public int modify_file(String group_name,
String appender_filename,
long file_offset,
byte[] file_buff,
int buffer_offset,
int buffer_length)
throws IOException,
MyException
group_name - the group name of appender fileappender_filename - the appender filenamefile_offset - the offset of appender filefile_buff - file content/buffbuffer_offset - start offset of the buffbuffer_length - the length of buff to modify
IOException
MyException
public int modify_file(String group_name,
String appender_filename,
long file_offset,
long modify_size,
UploadCallback callback)
throws IOException,
MyException
group_name - the group name to modify file toappender_filename - the appender filenamefile_offset - the offset of appender filemodify_size - the modify sizecallback - the write data callback object
IOException
MyException
protected String[] do_upload_file(byte cmd,
String group_name,
String master_filename,
String prefix_name,
String file_ext_name,
long file_size,
UploadCallback callback,
NameValuePair[] meta_list)
throws IOException,
MyException
cmd - the command codegroup_name - the group name to upload file to, can be emptymaster_filename - the master file name to generate the slave fileprefix_name - the prefix name to generate the slave filefile_ext_name - file ext name, do not include dot(.)file_size - the file sizecallback - the write data callback objectmeta_list - meta info array
IOException
MyException
protected int do_append_file(String group_name,
String appender_filename,
long file_size,
UploadCallback callback)
throws IOException,
MyException
group_name - the group name of appender fileappender_filename - the appender filenamefile_size - the file sizecallback - the write data callback object
IOException
MyException
protected int do_modify_file(String group_name,
String appender_filename,
long file_offset,
long modify_size,
UploadCallback callback)
throws IOException,
MyException
group_name - the group name of appender fileappender_filename - the appender filenamefile_offset - the offset of appender filemodify_size - the modify sizecallback - the write data callback object
IOException
MyException
public int delete_file(String group_name,
String remote_filename)
throws IOException,
MyException
group_name - the group name of storage serverremote_filename - filename on storage server
IOException
MyException
public int truncate_file(String group_name,
String appender_filename)
throws IOException,
MyException
group_name - the group name of storage serverappender_filename - the appender filename
IOException
MyException
public int truncate_file(String group_name,
String appender_filename,
long truncated_file_size)
throws IOException,
MyException
group_name - the group name of storage serverappender_filename - the appender filenametruncated_file_size - truncated file size
IOException
MyException
public byte[] download_file(String group_name,
String remote_filename)
throws IOException,
MyException
group_name - the group name of storage serverremote_filename - filename on storage server
IOException
MyException
public byte[] download_file(String group_name,
String remote_filename,
long file_offset,
long download_bytes)
throws IOException,
MyException
group_name - the group name of storage serverremote_filename - filename on storage serverfile_offset - the start offset of the filedownload_bytes - download bytes, 0 for remain bytes from offset
IOException
MyException
public int download_file(String group_name,
String remote_filename,
String local_filename)
throws IOException,
MyException
group_name - the group name of storage serverremote_filename - filename on storage serverlocal_filename - filename on local
IOException
MyException
public int download_file(String group_name,
String remote_filename,
long file_offset,
long download_bytes,
String local_filename)
throws IOException,
MyException
group_name - the group name of storage serverremote_filename - filename on storage serverfile_offset - the start offset of the filedownload_bytes - download bytes, 0 for remain bytes from offsetlocal_filename - filename on local
IOException
MyException
public int download_file(String group_name,
String remote_filename,
DownloadCallback callback)
throws IOException,
MyException
group_name - the group name of storage serverremote_filename - filename on storage servercallback - call callback.recv() when data arrive
IOException
MyException
public int download_file(String group_name,
String remote_filename,
long file_offset,
long download_bytes,
DownloadCallback callback)
throws IOException,
MyException
group_name - the group name of storage serverremote_filename - filename on storage serverfile_offset - the start offset of the filedownload_bytes - download bytes, 0 for remain bytes from offsetcallback - call callback.recv() when data arrive
IOException
MyException
public NameValuePair[] get_metadata(String group_name,
String remote_filename)
throws IOException,
MyException
group_name - the group name of storage serverremote_filename - filename on storage server
IOException
MyException
public int set_metadata(String group_name,
String remote_filename,
NameValuePair[] meta_list,
byte op_flag)
throws IOException,
MyException
group_name - the group name of storage serverremote_filename - filename on storage servermeta_list - meta item arrayop_flag - flag, can be one of following values: IOException
MyException
public FileInfo get_file_info(String group_name,
String remote_filename)
throws IOException,
MyException
group_name - the group nameremote_filename - the filename
IOException
MyException
public FileInfo query_file_info(String group_name,
String remote_filename)
throws IOException,
MyException
group_name - the group name of storage serverremote_filename - filename on storage server
IOException
MyException
protected boolean newWritableStorageConnection(String group_name)
throws IOException,
MyException
group_name - the group name to upload file to, can be empty
IOException
MyException
protected boolean newReadableStorageConnection(String group_name,
String remote_filename)
throws IOException,
MyException
group_name - the group name of storage serverremote_filename - filename on storage server
IOException
MyException
protected boolean newUpdatableStorageConnection(String group_name,
String remote_filename)
throws IOException,
MyException
group_name - the group name of storage serverremote_filename - filename on storage server
IOException
MyException
protected void send_package(byte cmd,
String group_name,
String remote_filename)
throws IOException
cmd - which command to sendgroup_name - the group name of storage serverremote_filename - filename on storage server
IOException
protected void send_download_package(String group_name,
String remote_filename,
long file_offset,
long download_bytes)
throws IOException
group_name - the group name of storage serverremote_filename - filename on storage serverfile_offset - the start offset of the filedownload_bytes - download bytes
IOException
|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||