Package org.rostore.v2.container
Class Container
java.lang.Object
org.rostore.v2.container.Container
- All Implemented Interfaces:
AutoCloseable
,Closeable
Container class to manage access to the set of keys and their values.
This class combines several shards.
-
Constructor Summary
ModifierConstructorDescriptionprotected
Container
(ContainerListOperations containerListOperations, String name, ContainerMeta containerMeta) This constructor creates a new container.protected
Container
(ContainerListOperations containerListOperations, String name, ContainerDescriptor descriptor) This one opens up the container if it has already been created. -
Method Summary
Modifier and TypeMethodDescriptionstatic final void
checkFreeSpaceToCreateContainer
(String name, Media media, ContainerMeta containerMeta) void
close()
Closes the container and removes any references of it from theContainerListOperations
protected void
Useclose()
to close the containers.This is the major (parent) class that manages the list of containersThe container descriptor defines the persistence model of the container.getName()
The name of the container.getShard
(int shardIndex) Requests the shard by index.Provides a status of this entityprotected void
remove()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.rostore.v2.media.Closeable
checkOpened
-
Constructor Details
-
Container
protected Container(ContainerListOperations containerListOperations, String name, ContainerDescriptor descriptor) This one opens up the container if it has already been created.- Parameters:
containerListOperations
- the over-class that manges the container listname
- the name of the containerdescriptor
- the container metadata
-
Container
protected Container(ContainerListOperations containerListOperations, String name, ContainerMeta containerMeta) This constructor creates a new container.This function creates the
ContainerDescriptor
that should be stored on the container list as a value and opened again on the container-open operation- Parameters:
containerListOperations
- the over-class that manges the container listname
- the name of the containercontainerMeta
- the metadata of the container
-
-
Method Details
-
getBlockAllocation
-
getName
The name of the container.- Returns:
- the name of the container
-
getDescriptor
The container descriptor defines the persistence model of the container.- Returns:
- the container descriptor.
-
getContainerListOperations
This is the major (parent) class that manages the list of containers- Returns:
- the over-class
-
checkFreeSpaceToCreateContainer
public static final void checkFreeSpaceToCreateContainer(String name, Media media, ContainerMeta containerMeta) -
remove
protected void remove() -
getShard
Requests the shard by index.- Parameters:
shardIndex
- the shard's index- Returns:
- the container's shard
-
closeInternal
protected void closeInternal()Useclose()
to close the containers. -
close
public void close()Closes the container and removes any references of it from theContainerListOperations
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-
getStatus
Description copied from interface:Closeable
Provides a status of this entity
-