Esempio n. 1
0
    def create_connection_context(self):
        '''Creates and seriazlies a IpcConnectionContextProto (not delimited)'''
        context = IpcConnectionContextProto()
        context.userInfo.effectiveUser = self.effective_user
        context.protocol = "org.apache.hadoop.hdfs.protocol.ClientProtocol"

        s_context = context.SerializeToString()
        log_protobuf_message("RequestContext (len: %d)" % len(s_context), context)
        return s_context
Esempio n. 2
0
    def create_connection_context(self):
        '''Creates and seriazlies a IpcConnectionContextProto (not delimited)'''
        context = IpcConnectionContextProto()
        local_user = pwd.getpwuid(os.getuid())[0]
        context.userInfo.effectiveUser = local_user
        context.protocol = self.context_protocol

        s_context = context.SerializeToString()
        log_protobuf_message("RequestContext (len: %d)" % len(s_context),
                             context)
        return s_context