public class FileSystemMasterClientServiceProcessor extends FileSystemMasterClientService.Processor
ProcessFunction.process(int, org.apache.thrift.protocol.TProtocol, org.apache.thrift.protocol.TProtocol, I)
method of
ProcessFunction
class. This method has the information of in
protocol from which we can derive IP. However, this method is made final deliberately.
Consequently, it is very hard to subclass ProcessFunction
and override process method to pass IP informaton to Alluxio via arguments.
Based on a), b) and c), we decide to subclass the auto-generated
FileSystemMasterClientService.Processor
class and
override its ProcessFunction.process(int, org.apache.thrift.protocol.TProtocol, org.apache.thrift.protocol.TProtocol, I)
method. In this method, we store
the client IP as a thread-local variable for future use by DefaultFileSystemMaster
.FileSystemMasterClientService.Processor.checkConsistency<I extends FileSystemMasterClientService.Iface>, FileSystemMasterClientService.Processor.completeFile<I extends FileSystemMasterClientService.Iface>, FileSystemMasterClientService.Processor.createDirectory<I extends FileSystemMasterClientService.Iface>, FileSystemMasterClientService.Processor.createFile<I extends FileSystemMasterClientService.Iface>, FileSystemMasterClientService.Processor.free<I extends FileSystemMasterClientService.Iface>, FileSystemMasterClientService.Processor.getFilePath<I extends FileSystemMasterClientService.Iface>, FileSystemMasterClientService.Processor.getMountTable<I extends FileSystemMasterClientService.Iface>, FileSystemMasterClientService.Processor.getNewBlockIdForFile<I extends FileSystemMasterClientService.Iface>, FileSystemMasterClientService.Processor.getStatus<I extends FileSystemMasterClientService.Iface>, FileSystemMasterClientService.Processor.listStatus<I extends FileSystemMasterClientService.Iface>, FileSystemMasterClientService.Processor.loadMetadata<I extends FileSystemMasterClientService.Iface>, FileSystemMasterClientService.Processor.mount<I extends FileSystemMasterClientService.Iface>, FileSystemMasterClientService.Processor.remove<I extends FileSystemMasterClientService.Iface>, FileSystemMasterClientService.Processor.rename<I extends FileSystemMasterClientService.Iface>, FileSystemMasterClientService.Processor.scheduleAsyncPersistence<I extends FileSystemMasterClientService.Iface>, FileSystemMasterClientService.Processor.setAttribute<I extends FileSystemMasterClientService.Iface>, FileSystemMasterClientService.Processor.unmount<I extends FileSystemMasterClientService.Iface>, FileSystemMasterClientService.Processor.updateUfsMode<I extends FileSystemMasterClientService.Iface>
AlluxioService.Processor.getServiceVersion<I extends AlluxioService.Iface>
Constructor and Description |
---|
FileSystemMasterClientServiceProcessor(FileSystemMasterClientService.Iface handler)
Constructs a
FileSystemMasterClientServiceProcessor instance. |
Modifier and Type | Method and Description |
---|---|
static String |
getClientIp()
Retrieves the client IP of current thread.
|
boolean |
process(org.apache.thrift.protocol.TProtocol in,
org.apache.thrift.protocol.TProtocol out) |
public FileSystemMasterClientServiceProcessor(FileSystemMasterClientService.Iface handler)
FileSystemMasterClientServiceProcessor
instance.handler
- user-specified handler to process RPCpublic static String getClientIp()
public boolean process(org.apache.thrift.protocol.TProtocol in, org.apache.thrift.protocol.TProtocol out) throws org.apache.thrift.TException
process
in interface org.apache.thrift.TProcessor
process
in class org.apache.thrift.TBaseProcessor
org.apache.thrift.TException
Copyright © 2023. All Rights Reserved.