ch.systemsx.cisd.openbis.dss.generic.shared.utils
Class Share

java.lang.Object
  extended by ch.systemsx.cisd.openbis.dss.generic.shared.utils.Share

public final class Share
extends java.lang.Object

Represents a share of a segmented store. Holds the root directory of the share as well as the data sets. It is able to calculate the free disk space.


Nested Class Summary
static class Share.ShufflePriority
          different factors that have priority when moving a data set to the share.
 
Field Summary
static java.util.Comparator<ch.systemsx.cisd.openbis.generic.shared.dto.SimpleDataSetInformationDTO> DATA_SET_SIZE_COMPARATOR
           
 
Constructor Summary
Share(java.io.File share, int speed, ch.systemsx.cisd.common.filesystem.IFreeSpaceProvider freeSpaceProvider)
           
Share(ch.systemsx.cisd.openbis.dss.generic.shared.utils.SharesHolder sharesHolderOrNull, java.io.File share, int speed, ch.systemsx.cisd.common.filesystem.IFreeSpaceProvider freeSpaceProvider)
           
 
Method Summary
 void addDataSet(ch.systemsx.cisd.openbis.generic.shared.dto.SimpleDataSetInformationDTO dataSet)
           
 long calculateFreeSpace()
          Calculates the actual free space (in bytes) of the hard disk on which this share resides.
 java.util.List<ch.systemsx.cisd.openbis.generic.shared.dto.SimpleDataSetInformationDTO> getDataSetsOrderedBySize()
          Returns all data sets of this shared ordered by size starting with the largest data set.
 java.util.Set<java.lang.String> getExperimentIdentifiers()
          Returns the set of experiment identifier or an empty set if undefined.
 java.io.File getShare()
          Returns the root directory of this share.
 java.lang.String getShareId()
          Returns the share Id of this share.
 Share.ShufflePriority getShufflePriority()
           
 int getSpeed()
          Returns the speed of this share.
 long getTotalSizeOfDataSets()
          Returns the total size (in bytes) of all data sets.
 boolean isIgnoredForShuffling()
           
 boolean isIncoming()
          Returns true if this is an incoming share.
 boolean isWithdrawShare()
           
 void setExperimentIdentifiers(java.util.Set<java.lang.String> experimentIdentifiers)
           
 void setIgnoredForShuffling(boolean ignoredForShuffling)
           
 void setIncoming(boolean incoming)
           
 void setShufflePriority(Share.ShufflePriority shufflePriority)
           
 void setWithdrawShare(boolean withdrawShare)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DATA_SET_SIZE_COMPARATOR

public static final java.util.Comparator<ch.systemsx.cisd.openbis.generic.shared.dto.SimpleDataSetInformationDTO> DATA_SET_SIZE_COMPARATOR
Constructor Detail

Share

public Share(java.io.File share,
             int speed,
             ch.systemsx.cisd.common.filesystem.IFreeSpaceProvider freeSpaceProvider)

Share

public Share(ch.systemsx.cisd.openbis.dss.generic.shared.utils.SharesHolder sharesHolderOrNull,
             java.io.File share,
             int speed,
             ch.systemsx.cisd.common.filesystem.IFreeSpaceProvider freeSpaceProvider)
Method Detail

getExperimentIdentifiers

public java.util.Set<java.lang.String> getExperimentIdentifiers()
Returns the set of experiment identifier or an empty set if undefined.


setExperimentIdentifiers

public void setExperimentIdentifiers(java.util.Set<java.lang.String> experimentIdentifiers)

getShareId

public java.lang.String getShareId()
Returns the share Id of this share.


getSpeed

public int getSpeed()
Returns the speed of this share.


setIncoming

public void setIncoming(boolean incoming)

isIncoming

public boolean isIncoming()
Returns true if this is an incoming share.


getShare

public java.io.File getShare()
Returns the root directory of this share.


calculateFreeSpace

public long calculateFreeSpace()
Calculates the actual free space (in bytes) of the hard disk on which this share resides.


addDataSet

public void addDataSet(ch.systemsx.cisd.openbis.generic.shared.dto.SimpleDataSetInformationDTO dataSet)

getDataSetsOrderedBySize

public java.util.List<ch.systemsx.cisd.openbis.generic.shared.dto.SimpleDataSetInformationDTO> getDataSetsOrderedBySize()
Returns all data sets of this shared ordered by size starting with the largest data set.


getTotalSizeOfDataSets

public long getTotalSizeOfDataSets()
Returns the total size (in bytes) of all data sets.


getShufflePriority

public Share.ShufflePriority getShufflePriority()

setShufflePriority

public void setShufflePriority(Share.ShufflePriority shufflePriority)

isWithdrawShare

public boolean isWithdrawShare()

setWithdrawShare

public void setWithdrawShare(boolean withdrawShare)

isIgnoredForShuffling

public boolean isIgnoredForShuffling()

setIgnoredForShuffling

public void setIgnoredForShuffling(boolean ignoredForShuffling)