sam.io
Class ParallelIO

java.lang.Object
  |
  +--sam.io.ParallelIO

public class ParallelIO
extends java.lang.Object

Multi-threaded implementation of InputStream and OutputStream


Nested Class Summary
static class ParallelIO.Exception
          Exception thrown in case of errors in ParallelIO
 class ParallelIO.GatherInputStream
          Class for gathring buffered writes from multiple threads.
 class ParallelIO.GatherOutputStream
          Class for gathring buffered writes from multiple threads.
protected  class ParallelIO.IOProcessor
          Abstraction for processors which actually do the job
 class ParallelIO.ScatterInputStream
          Class for scattering buffered reads accross multiple threads.
 class ParallelIO.ScatterOutputStream
          Class for scattering buffered writes accross multiple threads.
 
Constructor Summary
ParallelIO()
           
 
Method Summary
static ParallelIO.IOProcessor getCurrentProcessor()
          Gets the current IOProcessor
protected  void grantToken(long token)
           
static void main(java.lang.String[] args)
           
static void register(ParallelIO.IOProcessor ioprocessor)
          Registers specified IOProcessor as the current one
protected  void requestToken(long token)
          Waits for specified token be ready to be processed
static int split(int n, int p)
          Splits n bytes into p parts
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ParallelIO

public ParallelIO()
Method Detail

register

public static void register(ParallelIO.IOProcessor ioprocessor)
                     throws ParallelIO.Exception
Registers specified IOProcessor as the current one

ParallelIO.Exception

getCurrentProcessor

public static ParallelIO.IOProcessor getCurrentProcessor()
                                                  throws ParallelIO.Exception
Gets the current IOProcessor

ParallelIO.Exception

requestToken

protected void requestToken(long token)
                     throws ParallelIO.Exception
Waits for specified token be ready to be processed

ParallelIO.Exception

grantToken

protected void grantToken(long token)
                   throws ParallelIO.Exception
ParallelIO.Exception

split

public static int split(int n,
                        int p)
                 throws ParallelIO.Exception
Splits n bytes into p parts

Returns:
the part size
ParallelIO.Exception

main

public static void main(java.lang.String[] args)