org.jgroups.blocks
Class GridFilesystem

java.lang.Object
  extended by org.jgroups.blocks.GridFilesystem

public class GridFilesystem
extends java.lang.Object

Entry point for GridFile and GridInputStream / GridOutputStream

Author:
Bela Ban

Field Summary
protected  ReplCache<java.lang.String,byte[]> data
           
protected  int default_chunk_size
           
protected  short default_repl_count
           
protected  ReplCache<java.lang.String,GridFile.Metadata> metadata
           
 
Constructor Summary
GridFilesystem(ReplCache<java.lang.String,byte[]> data, ReplCache<java.lang.String,GridFile.Metadata> metadata)
           
GridFilesystem(ReplCache<java.lang.String,byte[]> data, ReplCache<java.lang.String,GridFile.Metadata> metadata, short default_repl_count, int default_chunk_size)
          Creates an instance.
 
Method Summary
 java.io.File getFile(java.io.File parent, java.lang.String child)
           
 java.io.File getFile(java.io.File parent, java.lang.String child, int chunk_size)
           
 java.io.File getFile(java.lang.String pathname)
           
 java.io.File getFile(java.lang.String pathname, int chunk_size)
           
 java.io.File getFile(java.lang.String parent, java.lang.String child)
           
 java.io.File getFile(java.lang.String parent, java.lang.String child, int chunk_size)
           
 java.io.InputStream getInput(java.io.File pathname)
           
 java.io.InputStream getInput(java.lang.String pathname)
           
 java.io.OutputStream getOutput(GridFile file)
           
 java.io.OutputStream getOutput(java.lang.String pathname)
           
 java.io.OutputStream getOutput(java.lang.String pathname, boolean append)
           
 java.io.OutputStream getOutput(java.lang.String pathname, boolean append, short repl_count, int chunk_size)
           
 void remove(java.lang.String path, boolean synchronous)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

data

protected final ReplCache<java.lang.String,byte[]> data

metadata

protected final ReplCache<java.lang.String,GridFile.Metadata> metadata

default_chunk_size

protected final int default_chunk_size

default_repl_count

protected final short default_repl_count
Constructor Detail

GridFilesystem

public GridFilesystem(ReplCache<java.lang.String,byte[]> data,
                      ReplCache<java.lang.String,GridFile.Metadata> metadata,
                      short default_repl_count,
                      int default_chunk_size)
Creates an instance. The data and metadata caches should already have been setup and started

Parameters:
data -
metadata -
default_chunk_size -

GridFilesystem

public GridFilesystem(ReplCache<java.lang.String,byte[]> data,
                      ReplCache<java.lang.String,GridFile.Metadata> metadata)
Method Detail

getFile

public java.io.File getFile(java.lang.String pathname)

getFile

public java.io.File getFile(java.lang.String pathname,
                            int chunk_size)

getFile

public java.io.File getFile(java.lang.String parent,
                            java.lang.String child)

getFile

public java.io.File getFile(java.lang.String parent,
                            java.lang.String child,
                            int chunk_size)

getFile

public java.io.File getFile(java.io.File parent,
                            java.lang.String child)

getFile

public java.io.File getFile(java.io.File parent,
                            java.lang.String child,
                            int chunk_size)

getOutput

public java.io.OutputStream getOutput(java.lang.String pathname)
                               throws java.io.IOException
Throws:
java.io.IOException

getOutput

public java.io.OutputStream getOutput(java.lang.String pathname,
                                      boolean append)
                               throws java.io.IOException
Throws:
java.io.IOException

getOutput

public java.io.OutputStream getOutput(java.lang.String pathname,
                                      boolean append,
                                      short repl_count,
                                      int chunk_size)
                               throws java.io.IOException
Throws:
java.io.IOException

getOutput

public java.io.OutputStream getOutput(GridFile file)
                               throws java.io.IOException
Throws:
java.io.IOException

getInput

public java.io.InputStream getInput(java.lang.String pathname)
                             throws java.io.FileNotFoundException
Throws:
java.io.FileNotFoundException

getInput

public java.io.InputStream getInput(java.io.File pathname)
                             throws java.io.FileNotFoundException
Throws:
java.io.FileNotFoundException

remove

public void remove(java.lang.String path,
                   boolean synchronous)


Copyright © 1998-2012 Bela Ban / Red Hat. All Rights Reserved.