storage.tools
Class StorageToolsManager

java.lang.Object
  extended bystorage.tools.StorageToolsManager

public final class StorageToolsManager
extends java.lang.Object

This class provides methods for setting and tuning the store components.


Constructor Summary
StorageToolsManager(AdvancedStorageManager asm)
          Creates a storage tools' magager from an advanced storage manager.
 
Method Summary
 void createFixedChunk(int chunkNumber, java.io.File file, long maxSize, long offset)
          Creates and loads a fixed chunk in the storage organization.
 void createFlexibleChunk(int chunkNumber, java.io.File file)
          Creates and loads a flexible chunk in the storage organization, the previous content of the file is destoyed.
 void createFlexibleChunk(int chunkNumber, java.io.File file, long maxSize)
          Creates and loads a flexible chunk with a specified maximun size in the storage organization, the previous content of the file is destoyed.
 void createSpace(int segmentNumber, int spaceNumber, int chunkNumber)
          Creates a new space with a associated chunk, the previous content of the file is replaced.
 void dropChunk(int chunkNumber)
          Drop or removes a chunk from the storage organization.
 void dropSpace(int segmentNumber, int spaceNumber)
          Drop or removes a space from the storage organization.
 AdvancedStorageManager getAdvancedStorageManager()
          Returns the underlying advanced storage manager.
 IntermediateStorageManager getIntermediateStorageManager()
          Returns the underlying intermediate storage manager.
 PrimitiveStorageManager getPrimitiveStorageManager()
          Returns the underlying primitive storage manager.
 void loadSettingsFromFile(java.io.File file)
          Loads the storage settings (chunk and space organization) from a file.
 void saveSettingsToFile(java.io.File file)
          Saves the current storage settings (chunk and space organization) to a file.
 void showInfo()
          Show the information of storage organization.
 void trimAllSpaces()
          Execute a trim for all spaces of the storage organization.
 void trimSpace(int segmentNumber, int spaceNumber)
          Reduces the logic size of spaces and if it is posible also reduces the real size of the associated chunk.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StorageToolsManager

public StorageToolsManager(AdvancedStorageManager asm)
Creates a storage tools' magager from an advanced storage manager.

Method Detail

getPrimitiveStorageManager

public PrimitiveStorageManager getPrimitiveStorageManager()
Returns the underlying primitive storage manager.


getIntermediateStorageManager

public IntermediateStorageManager getIntermediateStorageManager()
Returns the underlying intermediate storage manager.


getAdvancedStorageManager

public AdvancedStorageManager getAdvancedStorageManager()
Returns the underlying advanced storage manager.


loadSettingsFromFile

public void loadSettingsFromFile(java.io.File file)
                          throws BadFileFormatException,
                                 java.io.IOException,
                                 PrimitiveStorageException,
                                 IntermediateStorageException,
                                 AdvancedStorageException
Loads the storage settings (chunk and space organization) from a file.

Throws:
BadFileFormatException
java.io.IOException
PrimitiveStorageException
IntermediateStorageException
AdvancedStorageException

saveSettingsToFile

public void saveSettingsToFile(java.io.File file)
                        throws java.io.IOException
Saves the current storage settings (chunk and space organization) to a file.

Throws:
java.io.IOException

showInfo

public void showInfo()
              throws PrimitiveStorageException,
                     IntermediateStorageException,
                     java.io.IOException
Show the information of storage organization.

Throws:
PrimitiveStorageException
IntermediateStorageException
java.io.IOException

trimSpace

public void trimSpace(int segmentNumber,
                      int spaceNumber)
               throws java.io.IOException,
                      PrimitiveStorageException,
                      IntermediateStorageException
Reduces the logic size of spaces and if it is posible also reduces the real size of the associated chunk.

Throws:
java.io.IOException
PrimitiveStorageException
IntermediateStorageException

trimAllSpaces

public void trimAllSpaces()
                   throws java.io.IOException,
                          PrimitiveStorageException,
                          IntermediateStorageException
Execute a trim for all spaces of the storage organization.

Throws:
java.io.IOException
PrimitiveStorageException
IntermediateStorageException

createFixedChunk

public void createFixedChunk(int chunkNumber,
                             java.io.File file,
                             long maxSize,
                             long offset)
                      throws PrimitiveStorageException,
                             java.io.IOException
Creates and loads a fixed chunk in the storage organization.

Throws:
PrimitiveStorageException
java.io.IOException

createFlexibleChunk

public void createFlexibleChunk(int chunkNumber,
                                java.io.File file,
                                long maxSize)
                         throws PrimitiveStorageException,
                                java.io.IOException
Creates and loads a flexible chunk with a specified maximun size in the storage organization, the previous content of the file is destoyed.

Throws:
PrimitiveStorageException
java.io.IOException

createFlexibleChunk

public void createFlexibleChunk(int chunkNumber,
                                java.io.File file)
                         throws PrimitiveStorageException,
                                java.io.IOException
Creates and loads a flexible chunk in the storage organization, the previous content of the file is destoyed.

Throws:
PrimitiveStorageException
java.io.IOException

createSpace

public void createSpace(int segmentNumber,
                        int spaceNumber,
                        int chunkNumber)
                 throws PrimitiveStorageException,
                        IntermediateStorageException,
                        AdvancedStorageException,
                        java.io.IOException
Creates a new space with a associated chunk, the previous content of the file is replaced.

Throws:
PrimitiveStorageException
IntermediateStorageException
AdvancedStorageException
java.io.IOException

dropSpace

public void dropSpace(int segmentNumber,
                      int spaceNumber)
               throws UndroppableSpaceException,
                      AdvancedStorageException
Drop or removes a space from the storage organization.

Throws:
UndroppableSpaceException
AdvancedStorageException

dropChunk

public void dropChunk(int chunkNumber)
               throws UndroppableChunkException,
                      PrimitiveStorageException
Drop or removes a chunk from the storage organization.

Throws:
UndroppableChunkException
PrimitiveStorageException