tachyon
Class MasterClient

java.lang.Object
  extended by tachyon.MasterClient

public class MasterClient
extends Object

The master server client side. Since MasterService.Client is not thread safe, this class has to guarantee thread safe.


Constructor Summary
MasterClient(InetSocketAddress masterAddress)
           
 
Method Summary
 boolean addCheckpoint(long workerId, int fileId, long fileSizeBytes, String checkpointPath)
           
 void close()
           
 long getUserId()
           
 boolean isConnected()
           
 List<ClientFileInfo> ls(String folder)
           
 boolean open()
           
 int user_createFile(String path)
           
 int user_createRawTable(String path, int columns, ByteBuffer metadata)
           
 void user_delete(int fileId)
           
 void user_delete(String path)
           
 ClientFileInfo user_getClientFileInfoById(int id)
           
 ClientFileInfo user_getClientFileInfoByPath(String path)
           
 ClientRawTableInfo user_getClientRawTableInfoById(int id)
           
 ClientRawTableInfo user_getClientRawTableInfoByPath(String path)
           
 int user_getFileId(String path)
           
 List<NetAddress> user_getFileLocations(int id)
           
 int user_getNumberOfFiles(String folderPath)
           
 int user_getRawTableId(String path)
           
 String user_getUnderfsAddress()
           
 NetAddress user_getWorker(boolean random, String hostname)
           
 List<Integer> user_listFiles(String path, boolean recursive)
           
 List<String> user_ls(String path, boolean recursive)
           
 int user_mkdir(String path)
           
 void user_outOfMemoryForPinFile(int fileId)
           
 void user_renameFile(String srcPath, String dstPath)
           
 void user_unpinFile(int id)
           
 void user_updateRawTableMetadata(int id, ByteBuffer metadata)
           
 void worker_cachedFile(long workerId, long workerUsedBytes, int fileId, long fileSizeBytes)
           
 Set<Integer> worker_getPinIdList()
           
 Command worker_heartbeat(long workerId, long usedBytes, List<Integer> removedPartitionList)
           
 long worker_register(NetAddress workerNetAddress, long totalBytes, long usedBytes, List<Integer> currentFileList)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MasterClient

public MasterClient(InetSocketAddress masterAddress)
Method Detail

close

public void close()

ls

public List<ClientFileInfo> ls(String folder)
                        throws InvalidPathException,
                               FileDoesNotExistException,
                               org.apache.thrift.TException
Throws:
InvalidPathException
FileDoesNotExistException
org.apache.thrift.TException

getUserId

public long getUserId()
               throws org.apache.thrift.TException
Throws:
org.apache.thrift.TException

isConnected

public boolean isConnected()

open

public boolean open()

addCheckpoint

public boolean addCheckpoint(long workerId,
                             int fileId,
                             long fileSizeBytes,
                             String checkpointPath)
                      throws FileDoesNotExistException,
                             SuspectedFileSizeException,
                             org.apache.thrift.TException
Parameters:
workerId - if -1, means the checkpoint is added directly by underlayer fs.
fileId -
fileSizeBytes -
checkpointPath -
Returns:
Throws:
FileDoesNotExistException
SuspectedFileSizeException
org.apache.thrift.TException

user_createFile

public int user_createFile(String path)
                    throws FileAlreadyExistException,
                           InvalidPathException,
                           org.apache.thrift.TException
Throws:
FileAlreadyExistException
InvalidPathException
org.apache.thrift.TException

user_createRawTable

public int user_createRawTable(String path,
                               int columns,
                               ByteBuffer metadata)
                        throws FileAlreadyExistException,
                               InvalidPathException,
                               TableColumnException,
                               org.apache.thrift.TException
Throws:
FileAlreadyExistException
InvalidPathException
TableColumnException
org.apache.thrift.TException

user_delete

public void user_delete(String path)
                 throws FileDoesNotExistException,
                        InvalidPathException,
                        org.apache.thrift.TException
Throws:
FileDoesNotExistException
InvalidPathException
org.apache.thrift.TException

user_delete

public void user_delete(int fileId)
                 throws FileDoesNotExistException,
                        org.apache.thrift.TException
Throws:
FileDoesNotExistException
org.apache.thrift.TException

user_getClientFileInfoByPath

public ClientFileInfo user_getClientFileInfoByPath(String path)
                                            throws FileDoesNotExistException,
                                                   InvalidPathException,
                                                   org.apache.thrift.TException
Throws:
FileDoesNotExistException
InvalidPathException
org.apache.thrift.TException

user_getClientFileInfoById

public ClientFileInfo user_getClientFileInfoById(int id)
                                          throws FileDoesNotExistException,
                                                 org.apache.thrift.TException
Throws:
FileDoesNotExistException
org.apache.thrift.TException

user_getFileId

public int user_getFileId(String path)
                   throws InvalidPathException,
                          org.apache.thrift.TException
Throws:
InvalidPathException
org.apache.thrift.TException

user_getRawTableId

public int user_getRawTableId(String path)
                       throws InvalidPathException,
                              org.apache.thrift.TException
Throws:
InvalidPathException
org.apache.thrift.TException

user_getFileLocations

public List<NetAddress> user_getFileLocations(int id)
                                       throws FileDoesNotExistException,
                                              org.apache.thrift.TException
Throws:
FileDoesNotExistException
org.apache.thrift.TException

user_getWorker

public NetAddress user_getWorker(boolean random,
                                 String hostname)
                          throws NoLocalWorkerException,
                                 org.apache.thrift.TException
Throws:
NoLocalWorkerException
org.apache.thrift.TException

user_getClientRawTableInfoByPath

public ClientRawTableInfo user_getClientRawTableInfoByPath(String path)
                                                    throws TableDoesNotExistException,
                                                           InvalidPathException,
                                                           org.apache.thrift.TException
Throws:
TableDoesNotExistException
InvalidPathException
org.apache.thrift.TException

user_getClientRawTableInfoById

public ClientRawTableInfo user_getClientRawTableInfoById(int id)
                                                  throws TableDoesNotExistException,
                                                         org.apache.thrift.TException
Throws:
TableDoesNotExistException
org.apache.thrift.TException

user_getNumberOfFiles

public int user_getNumberOfFiles(String folderPath)
                          throws FileDoesNotExistException,
                                 InvalidPathException,
                                 org.apache.thrift.TException
Throws:
FileDoesNotExistException
InvalidPathException
org.apache.thrift.TException

user_getUnderfsAddress

public String user_getUnderfsAddress()
                              throws org.apache.thrift.TException
Throws:
org.apache.thrift.TException

user_listFiles

public List<Integer> user_listFiles(String path,
                                    boolean recursive)
                             throws FileDoesNotExistException,
                                    InvalidPathException,
                                    org.apache.thrift.TException
Throws:
FileDoesNotExistException
InvalidPathException
org.apache.thrift.TException

user_ls

public List<String> user_ls(String path,
                            boolean recursive)
                     throws FileDoesNotExistException,
                            InvalidPathException,
                            org.apache.thrift.TException
Throws:
FileDoesNotExistException
InvalidPathException
org.apache.thrift.TException

user_mkdir

public int user_mkdir(String path)
               throws FileAlreadyExistException,
                      InvalidPathException,
                      org.apache.thrift.TException
Throws:
FileAlreadyExistException
InvalidPathException
org.apache.thrift.TException

user_outOfMemoryForPinFile

public void user_outOfMemoryForPinFile(int fileId)
                                throws org.apache.thrift.TException
Throws:
org.apache.thrift.TException

user_renameFile

public void user_renameFile(String srcPath,
                            String dstPath)
                     throws FileAlreadyExistException,
                            FileDoesNotExistException,
                            InvalidPathException,
                            org.apache.thrift.TException
Throws:
FileAlreadyExistException
FileDoesNotExistException
InvalidPathException
org.apache.thrift.TException

user_unpinFile

public void user_unpinFile(int id)
                    throws FileDoesNotExistException,
                           org.apache.thrift.TException
Throws:
FileDoesNotExistException
org.apache.thrift.TException

user_updateRawTableMetadata

public void user_updateRawTableMetadata(int id,
                                        ByteBuffer metadata)
                                 throws TableDoesNotExistException,
                                        org.apache.thrift.TException
Throws:
TableDoesNotExistException
org.apache.thrift.TException

worker_cachedFile

public void worker_cachedFile(long workerId,
                              long workerUsedBytes,
                              int fileId,
                              long fileSizeBytes)
                       throws FileDoesNotExistException,
                              SuspectedFileSizeException,
                              org.apache.thrift.TException
Throws:
FileDoesNotExistException
SuspectedFileSizeException
org.apache.thrift.TException

worker_heartbeat

public Command worker_heartbeat(long workerId,
                                long usedBytes,
                                List<Integer> removedPartitionList)
                         throws org.apache.thrift.TException
Throws:
org.apache.thrift.TException

worker_getPinIdList

public Set<Integer> worker_getPinIdList()
                                 throws org.apache.thrift.TException
Throws:
org.apache.thrift.TException

worker_register

public long worker_register(NetAddress workerNetAddress,
                            long totalBytes,
                            long usedBytes,
                            List<Integer> currentFileList)
                     throws org.apache.thrift.TException
Throws:
org.apache.thrift.TException


Copyright © 2013. All Rights Reserved.