tachyon
Class MasterServiceHandler

java.lang.Object
  extended by tachyon.MasterServiceHandler
All Implemented Interfaces:
MasterService.Iface

public class MasterServiceHandler
extends Object
implements MasterService.Iface

The Master server program. It maintains the state of each worker. It never keeps the state of any user.


Constructor Summary
MasterServiceHandler(MasterInfo masterInfo)
           
 
Method Summary
 boolean addCheckpoint(long workerId, int fileId, long fileSizeBytes, String checkpointPath)
           
 List<ClientFileInfo> cmd_ls(String path)
           
 int user_createFile(String filePath)
           
 int user_createRawTable(String path, int columns, ByteBuffer metadata)
           
 void user_deleteById(int id)
           
 void user_deleteByPath(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 filePath)
           
 List<NetAddress> user_getFileLocationsById(int fileId)
           
 List<NetAddress> user_getFileLocationsByPath(String filePath)
           
 int user_getNumberOfFiles(String path)
           
 int user_getRawTableId(String path)
           
 String user_getUnderfsAddress()
           
 long user_getUserId()
           
 NetAddress user_getWorker(boolean random, String host)
           
 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 srcFilePath, String dstFilePath)
           
 void user_unpinFile(int fileId)
           
 void user_updateRawTableMetadata(int tableId, ByteBuffer metadata)
           
 void worker_cacheFile(long workerId, long workerUsedBytes, int fileId, long fileSizeBytes)
           
 Set<Integer> worker_getPinIdList()
           
 Command worker_heartbeat(long workerId, long usedBytes, List<Integer> removedFileIds)
           
 long worker_register(NetAddress workerNetAddress, long totalBytes, long usedBytes, List<Integer> currentFileIds)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MasterServiceHandler

public MasterServiceHandler(MasterInfo masterInfo)
Method Detail

addCheckpoint

public boolean addCheckpoint(long workerId,
                             int fileId,
                             long fileSizeBytes,
                             String checkpointPath)
                      throws FileDoesNotExistException,
                             SuspectedFileSizeException,
                             org.apache.thrift.TException
Specified by:
addCheckpoint in interface MasterService.Iface
Throws:
FileDoesNotExistException
SuspectedFileSizeException
org.apache.thrift.TException

cmd_ls

public List<ClientFileInfo> cmd_ls(String path)
                            throws InvalidPathException,
                                   FileDoesNotExistException,
                                   org.apache.thrift.TException
Specified by:
cmd_ls in interface MasterService.Iface
Throws:
InvalidPathException
FileDoesNotExistException
org.apache.thrift.TException

user_createFile

public int user_createFile(String filePath)
                    throws FileAlreadyExistException,
                           InvalidPathException,
                           org.apache.thrift.TException
Specified by:
user_createFile in interface MasterService.Iface
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
Specified by:
user_createRawTable in interface MasterService.Iface
Throws:
FileAlreadyExistException
InvalidPathException
TableColumnException
org.apache.thrift.TException

user_deleteById

public void user_deleteById(int id)
                     throws org.apache.thrift.TException
Specified by:
user_deleteById in interface MasterService.Iface
Throws:
org.apache.thrift.TException

user_deleteByPath

public void user_deleteByPath(String path)
                       throws InvalidPathException,
                              FileDoesNotExistException,
                              org.apache.thrift.TException
Specified by:
user_deleteByPath in interface MasterService.Iface
Throws:
InvalidPathException
FileDoesNotExistException
org.apache.thrift.TException

user_getWorker

public NetAddress user_getWorker(boolean random,
                                 String host)
                          throws NoLocalWorkerException,
                                 org.apache.thrift.TException
Specified by:
user_getWorker in interface MasterService.Iface
Throws:
NoLocalWorkerException
org.apache.thrift.TException

user_getClientFileInfoById

public ClientFileInfo user_getClientFileInfoById(int id)
                                          throws FileDoesNotExistException,
                                                 org.apache.thrift.TException
Specified by:
user_getClientFileInfoById in interface MasterService.Iface
Throws:
FileDoesNotExistException
org.apache.thrift.TException

user_getClientFileInfoByPath

public ClientFileInfo user_getClientFileInfoByPath(String path)
                                            throws FileDoesNotExistException,
                                                   InvalidPathException,
                                                   org.apache.thrift.TException
Specified by:
user_getClientFileInfoByPath in interface MasterService.Iface
Throws:
FileDoesNotExistException
InvalidPathException
org.apache.thrift.TException

user_getFileLocationsById

public List<NetAddress> user_getFileLocationsById(int fileId)
                                           throws FileDoesNotExistException,
                                                  org.apache.thrift.TException
Specified by:
user_getFileLocationsById in interface MasterService.Iface
Throws:
FileDoesNotExistException
org.apache.thrift.TException

user_getFileLocationsByPath

public List<NetAddress> user_getFileLocationsByPath(String filePath)
                                             throws FileDoesNotExistException,
                                                    InvalidPathException,
                                                    org.apache.thrift.TException
Specified by:
user_getFileLocationsByPath in interface MasterService.Iface
Throws:
FileDoesNotExistException
InvalidPathException
org.apache.thrift.TException

user_getFileId

public int user_getFileId(String filePath)
                   throws InvalidPathException,
                          org.apache.thrift.TException
Specified by:
user_getFileId in interface MasterService.Iface
Throws:
InvalidPathException
org.apache.thrift.TException

user_getRawTableId

public int user_getRawTableId(String path)
                       throws InvalidPathException,
                              org.apache.thrift.TException
Specified by:
user_getRawTableId in interface MasterService.Iface
Throws:
InvalidPathException
org.apache.thrift.TException

user_getClientRawTableInfoById

public ClientRawTableInfo user_getClientRawTableInfoById(int id)
                                                  throws TableDoesNotExistException,
                                                         org.apache.thrift.TException
Specified by:
user_getClientRawTableInfoById in interface MasterService.Iface
Throws:
TableDoesNotExistException
org.apache.thrift.TException

user_getClientRawTableInfoByPath

public ClientRawTableInfo user_getClientRawTableInfoByPath(String path)
                                                    throws TableDoesNotExistException,
                                                           InvalidPathException,
                                                           org.apache.thrift.TException
Specified by:
user_getClientRawTableInfoByPath in interface MasterService.Iface
Throws:
TableDoesNotExistException
InvalidPathException
org.apache.thrift.TException

user_getUserId

public long user_getUserId()
                    throws org.apache.thrift.TException
Specified by:
user_getUserId in interface MasterService.Iface
Throws:
org.apache.thrift.TException

user_getNumberOfFiles

public int user_getNumberOfFiles(String path)
                          throws FileDoesNotExistException,
                                 InvalidPathException,
                                 org.apache.thrift.TException
Specified by:
user_getNumberOfFiles in interface MasterService.Iface
Throws:
FileDoesNotExistException
InvalidPathException
org.apache.thrift.TException

user_getUnderfsAddress

public String user_getUnderfsAddress()
                              throws org.apache.thrift.TException
Specified by:
user_getUnderfsAddress in interface MasterService.Iface
Throws:
org.apache.thrift.TException

user_listFiles

public List<Integer> user_listFiles(String path,
                                    boolean recursive)
                             throws FileDoesNotExistException,
                                    InvalidPathException,
                                    org.apache.thrift.TException
Specified by:
user_listFiles in interface MasterService.Iface
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
Specified by:
user_ls in interface MasterService.Iface
Throws:
FileDoesNotExistException
InvalidPathException
org.apache.thrift.TException

user_mkdir

public int user_mkdir(String path)
               throws FileAlreadyExistException,
                      InvalidPathException,
                      org.apache.thrift.TException
Specified by:
user_mkdir in interface MasterService.Iface
Throws:
FileAlreadyExistException
InvalidPathException
org.apache.thrift.TException

user_outOfMemoryForPinFile

public void user_outOfMemoryForPinFile(int fileId)
                                throws org.apache.thrift.TException
Specified by:
user_outOfMemoryForPinFile in interface MasterService.Iface
Throws:
org.apache.thrift.TException

user_renameFile

public void user_renameFile(String srcFilePath,
                            String dstFilePath)
                     throws FileAlreadyExistException,
                            FileDoesNotExistException,
                            InvalidPathException,
                            org.apache.thrift.TException
Specified by:
user_renameFile in interface MasterService.Iface
Throws:
FileAlreadyExistException
FileDoesNotExistException
InvalidPathException
org.apache.thrift.TException

user_unpinFile

public void user_unpinFile(int fileId)
                    throws FileDoesNotExistException,
                           org.apache.thrift.TException
Specified by:
user_unpinFile in interface MasterService.Iface
Throws:
FileDoesNotExistException
org.apache.thrift.TException

user_updateRawTableMetadata

public void user_updateRawTableMetadata(int tableId,
                                        ByteBuffer metadata)
                                 throws TableDoesNotExistException,
                                        org.apache.thrift.TException
Specified by:
user_updateRawTableMetadata in interface MasterService.Iface
Throws:
TableDoesNotExistException
org.apache.thrift.TException

worker_cacheFile

public void worker_cacheFile(long workerId,
                             long workerUsedBytes,
                             int fileId,
                             long fileSizeBytes)
                      throws FileDoesNotExistException,
                             SuspectedFileSizeException,
                             org.apache.thrift.TException
Specified by:
worker_cacheFile in interface MasterService.Iface
Throws:
FileDoesNotExistException
SuspectedFileSizeException
org.apache.thrift.TException

worker_getPinIdList

public Set<Integer> worker_getPinIdList()
                                 throws org.apache.thrift.TException
Specified by:
worker_getPinIdList in interface MasterService.Iface
Throws:
org.apache.thrift.TException

worker_heartbeat

public Command worker_heartbeat(long workerId,
                                long usedBytes,
                                List<Integer> removedFileIds)
                         throws org.apache.thrift.TException
Specified by:
worker_heartbeat in interface MasterService.Iface
Throws:
org.apache.thrift.TException

worker_register

public long worker_register(NetAddress workerNetAddress,
                            long totalBytes,
                            long usedBytes,
                            List<Integer> currentFileIds)
                     throws org.apache.thrift.TException
Specified by:
worker_register in interface MasterService.Iface
Throws:
org.apache.thrift.TException


Copyright © 2013. All Rights Reserved.