Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
HDFS >> mail # user >> Custom Socket Factory


Copy link to this message
-
Re: Custom Socket Factory
Hi Todd,

Thanks for your response. I will give it a try.
Our CustomSocketFactory allows us to grab a CustomSocket.
The main logic of our custom socket is to translate the End-Points coming to API(private IP to public IP):
void java.net.Socket.connect(SocketAddress endpoint, int timeout)

Cheers,
Subroto Sanyal

On May 31, 2012, at 8:29 PM, Todd Lipcon wrote:

> Hi Subroto,
>
> You'll need to implement the "getChannel()" method in such a way that
> it returns a SocketChannel implementation -- and then implement the
> appropriate methods in that class to read/write ByteBuffers.
>
> Out of curiosity, what is your custom socket factory doing?
>
> -Todd
>
> On Tue, May 29, 2012 at 5:49 AM, Subroto <[EMAIL PROTECTED]> wrote:
>> I missed to mention that my custom socket factory returns a Custom Socket as
>> well. :-(
>>
>> Cheers,
>> Subroto Sanyal
>>
>> On May 29, 2012, at 2:46 PM, Subroto wrote:
>>
>> Hi,
>>
>> As part of the fix HDFS-2129 it is mentioned:
>> " If you use a custom socket factory, it must generate sockets that have
>> associated Channels."
>> Does hadoop provide any sample implementation of the same?
>> Actually I use custom socket factory which is now not working with 0.23.1.
>> There is an option to use legacy BlockReader
>> (dfs.client.use.legacy.blockreader) but, I am planning to upgrade my custom
>> socket factory rather than failing back to the old approach.
>>
>> Request some guidance in this direction….
>>
>> Cheers,
>> Subroto Sanyal
>>
>>
>
>
>
> --
> Todd Lipcon
> Software Engineer, Cloudera