public abstract class SpaceDef
extends java.lang.Object
Space
. Can be used to define a Space.
Metaspace
and should conform to the following rules:
Modifier and Type | Class and Description |
---|---|
static class |
SpaceDef.CachePolicy
Cache policies
|
static class |
SpaceDef.DistributionPolicy
Space distribution policies
|
static class |
SpaceDef.EvictionPolicy |
static class |
SpaceDef.LockScope |
static class |
SpaceDef.PersistencePolicy |
static class |
SpaceDef.PersistenceType |
static class |
SpaceDef.ReplicationPolicy |
static class |
SpaceDef.SpaceState |
static class |
SpaceDef.UpdateTransport
Transport to use to send Update messages
|
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_ENTRY_TTL
Default timeout value of TTL_FOREVER for entry TTL.
|
static int |
DEFAULT_LOCK_TTL
Default timeout value of TTL_FOREVER milliseconds for Lock TTL.
|
static int |
DEFAULT_LOCK_WAIT
Default timeout value of NO_WAIT for Lock Wait.
|
static int |
NO_CAPACITY
Capacity of the space
|
static int |
NO_WAIT
Timeout value for TTL or locks.
|
static int |
REPLICATE_ALL
Sets the replication count to 'replicate on all nodes'.
|
static int |
TTL_FOREVER
Timeout value for TTL.
|
static int |
USE_DEFINED
Use Defined value in SpaceDef for the options object
|
static int |
WAIT_FOREVER
Timeout value for locks.
|
Constructor and Description |
---|
SpaceDef() |
Modifier and Type | Method and Description |
---|---|
abstract void |
addIndexDef(IndexDef indexDef)
Adds indexDef to SpaceDef, overwrites if an IndexDef by that name already exists
|
static SpaceDef |
create()
Returns a new SpaceDef instance.
|
static SpaceDef |
create(java.lang.String spaceName)
Returns a new SpaceDef instance.
|
static SpaceDef |
create(java.lang.String spaceName,
int replication,
java.util.List<FieldDef> fieldDefs)
Takes space name, replication count and list of field defs and returns a new SpaceDef instance.
|
abstract SpaceDef.CachePolicy |
getCachePolicy() |
abstract long |
getCapacity()
Returns the capacity of the space (in maximum number of entries per seeder)
|
abstract Tuple |
getContext()
Retrieve the user specific attributes in SpaceDef
|
abstract java.util.Collection<java.lang.String> |
getDistributionFields() |
abstract SpaceDef.DistributionPolicy |
getDistributionPolicy()
Returns the distribution policy.
|
abstract SpaceDef.EvictionPolicy |
getEvictionPolicy()
Returns the eviction policy of the space definition
|
abstract FieldDef |
getFieldDef(java.lang.String name)
Get the Field Definition for the field name provided.
|
abstract java.util.Collection<FieldDef> |
getFieldDefs()
Returns a collection of Field Definitions associated with Space Definition.
|
abstract IndexDef |
getIndexDef(java.lang.String indexName) |
abstract java.util.Collection<IndexDef> |
getIndexDefList()
Returns a collection of Index definitions associated with the Space definition
|
abstract KeyDef |
getKeyDef() |
abstract SpaceDef.LockScope |
getLockScope() |
abstract long |
getLockTTL()
Returns the time to live of locks on entries in the Space.
|
abstract long |
getLockWait()
Returns the amount of time a put, update, take/remove or lock operations
will wait for the lock to be cleared if the entry is currently locked.
|
abstract int |
getMinSeederCount()
Returns the minimum number of seeders before persistence interface calls onLoad
|
abstract java.lang.String |
getName()
Returns the space name of the space.
|
abstract int |
getNumFieldDefs()
Returns number of fields associated with Space Definition.
|
abstract SpaceDef.DistributionPolicy |
getPersistenceDistributionPolicy()
Returns the distribution policy for persistence.
|
abstract SpaceDef.PersistencePolicy |
getPersistencePolicy()
Returns PersistencePolicy of the space
|
abstract SpaceDef.PersistenceType |
getPersistenceType()
Returns the persistence type
|
abstract int |
getPhaseCount() |
abstract long |
getPhaseInterval() |
abstract long |
getReadTimeout() |
abstract int |
getReplicationCount()
Returns the replication count.
|
abstract SpaceDef.ReplicationPolicy |
getReplicationPolicy()
Returns replication policy
|
abstract long |
getSpaceWait()
Returns the amount of time space operations will wait for space to become READY
|
abstract long |
getTTL()
Returns the TTL for the entries in the Space.
|
abstract SpaceDef.UpdateTransport |
getUpdateTransport()
Returns the transport used for udpate messages
|
abstract int |
getVirtualNodeCount() |
abstract long |
getWriteTimeout() |
abstract boolean |
isForgetOldValue() |
abstract boolean |
isHostAwareReplication() |
abstract boolean |
isRouted() |
abstract void |
putFieldDef(FieldDef fieldDef)
Associates a field definition to the space definition.
|
abstract IndexDef |
removeIndexDef(java.lang.String name)
Remove index from Space, removes the index from space if exists
|
abstract SpaceDef |
setCachePolicy(SpaceDef.CachePolicy cachePolicy) |
abstract SpaceDef |
setCapacity(long capacity) |
abstract SpaceDef |
setContext(Tuple tuple)
Container user specific attributes in SpaceDef
|
abstract void |
setDistributionFields(java.lang.String... fieldNames)
Set distribution key field names, must be a subset of key field names
|
abstract SpaceDef |
setDistributionPolicy(SpaceDef.DistributionPolicy distributionPolicy)
Sets the Space distribution policy.
|
abstract SpaceDef |
setEvictionPolicy(SpaceDef.EvictionPolicy evictionPolicy)
Sets the eviction policy of space definition
|
abstract SpaceDef |
setForgetOldValue(boolean forgetOldValue) |
abstract SpaceDef |
setHostAwareReplication(boolean hostAwareReplication) |
abstract void |
setKey(java.lang.String... fieldNames)
Set key field names
|
abstract void |
setKeyDef(KeyDef keyDef)
Set key def
|
abstract SpaceDef |
setLockScope(SpaceDef.LockScope lockScope) |
abstract SpaceDef |
setLockTTL(long ttl)
Number of milliseconds until lock is automatically cleared.
|
abstract SpaceDef |
setLockWait(long timeout)
Sets the amount of time a put, update, take/remove or lock operations
will wait for the lock to be cleared if the entry is currently locked.
|
abstract SpaceDef |
setMinSeederCount(int count)
Sets the minimum seeder count needed for persistence API, before starting
to load tuples into space
|
abstract SpaceDef |
setName(java.lang.String name)
Sets the space name.
|
abstract SpaceDef |
setPersistenceDistributionPolicy(SpaceDef.DistributionPolicy distributionPolicy)
Sets the Space persistence distribution policy.
|
abstract SpaceDef |
setPersistencePolicy(SpaceDef.PersistencePolicy policy)
Sets the persistence policy of the space
|
abstract SpaceDef |
setPersistenceType(SpaceDef.PersistenceType persistenceType)
Sets the persistence type
|
abstract SpaceDef |
setPhaseCount(int phaseCount)
Number of phases for each seeder joining/leaving a space
|
abstract SpaceDef |
setPhaseInterval(long interval)
Pause after each phase before starting next phase
|
abstract SpaceDef |
setReadTimeout(long timeout) |
abstract SpaceDef |
setReplicationCount(int count)
Sets the replication count.
|
abstract SpaceDef |
setReplicationPolicy(SpaceDef.ReplicationPolicy replicationPolicy)
Sets whether space can be synchronously replicated or not.
|
abstract SpaceDef |
setRouted(boolean isRouted) |
abstract SpaceDef |
setSpaceWait(long spaceWait)
Sets the amount of time space opeations will wait until space becomes READY
|
abstract SpaceDef |
setTTL(long ttl)
Sets the TTL for the entries in the Space in milliseconds.
|
abstract SpaceDef |
setUpdateTransport(SpaceDef.UpdateTransport updateTransport)
Update transport to be used either UNICAST or MULTICAST
|
abstract SpaceDef |
setVirtualNodeCount(int nodeCount) |
abstract SpaceDef |
setWriteTimeout(long timeout) |
abstract void |
takeFieldDef(FieldDef fieldDef)
Allows removing a field definition associated with SpaceDef.
|
public static final int NO_WAIT
public static final int WAIT_FOREVER
public static final int USE_DEFINED
public static final int NO_CAPACITY
public static final int TTL_FOREVER
public static final int REPLICATE_ALL
public static final int DEFAULT_ENTRY_TTL
public static final int DEFAULT_LOCK_TTL
public static final int DEFAULT_LOCK_WAIT
public static SpaceDef create()
public static SpaceDef create(java.lang.String spaceName)
spaceName
- space namepublic static SpaceDef create(java.lang.String spaceName, int replication, java.util.List<FieldDef> fieldDefs)
spaceName
- space namereplication
- degree of replicationfieldDefs
- Array List of field defspublic abstract java.lang.String getName()
public abstract SpaceDef setName(java.lang.String name)
name
- Space Namepublic abstract long getCapacity()
public abstract SpaceDef setCapacity(long capacity)
capacity
- Capacity of the space (in maximum number of entries per seeder)public abstract SpaceDef.EvictionPolicy getEvictionPolicy()
public abstract SpaceDef setEvictionPolicy(SpaceDef.EvictionPolicy evictionPolicy)
evictionPolicy
- eviction policy of the space definitionpublic abstract SpaceDef.PersistenceType getPersistenceType()
public abstract SpaceDef setPersistenceType(SpaceDef.PersistenceType persistenceType)
persistenceType
- public abstract int getMinSeederCount()
public abstract SpaceDef setMinSeederCount(int count)
count
- Minimum number of seeders requiredpublic abstract SpaceDef.DistributionPolicy getPersistenceDistributionPolicy()
public abstract SpaceDef setPersistenceDistributionPolicy(SpaceDef.DistributionPolicy distributionPolicy)
distributionPolicy
- Distribution policy can be either DISTRIBUTED or NON_DISTRIBUTEDpublic abstract SpaceDef.PersistencePolicy getPersistencePolicy()
SpaceDef.PersistencePolicy
public abstract SpaceDef setPersistencePolicy(SpaceDef.PersistencePolicy policy)
policy
- PersistencePolicy to set SpaceDef.PersistencePolicy
public abstract int getReplicationCount()
public abstract SpaceDef setReplicationCount(int count)
count
- degree of replication. The default is 0.public abstract SpaceDef.ReplicationPolicy getReplicationPolicy()
public abstract SpaceDef setReplicationPolicy(SpaceDef.ReplicationPolicy replicationPolicy)
replicationPolicy
- replication policy to be usedpublic abstract SpaceDef.DistributionPolicy getDistributionPolicy()
public abstract SpaceDef setDistributionPolicy(SpaceDef.DistributionPolicy distributionPolicy)
distributionPolicy
- Distribution policy can be either DISTRIBUTED or NON_DISTRIBUTEDpublic abstract SpaceDef setUpdateTransport(SpaceDef.UpdateTransport updateTransport)
updateTransport
- Update transport to be used either UNICAST or MULTICASTpublic abstract SpaceDef.UpdateTransport getUpdateTransport()
public abstract long getTTL()
public abstract SpaceDef setTTL(long ttl)
ttl
- in milliseconds. WAIT_FOREVER represents never expire.public abstract long getLockTTL()
public abstract SpaceDef setLockTTL(long ttl)
ttl
- in milliseconds. WAIT_FOREVER represents lock forever.public abstract long getLockWait()
public abstract SpaceDef setLockWait(long timeout)
timeout
- in milliseconds. '-1' represents wait forever.public abstract long getSpaceWait()
public abstract SpaceDef setSpaceWait(long spaceWait)
public abstract SpaceDef.LockScope getLockScope()
public abstract SpaceDef setLockScope(SpaceDef.LockScope lockScope)
public abstract java.util.Collection<FieldDef> getFieldDefs()
public abstract int getNumFieldDefs()
public abstract void takeFieldDef(FieldDef fieldDef)
fieldDef
- field definitionpublic abstract void putFieldDef(FieldDef fieldDef)
fieldDef
- field Definitionpublic abstract FieldDef getFieldDef(java.lang.String name)
name
- field namepublic abstract void setKeyDef(KeyDef keyDef)
keyDef
- public abstract void setKey(java.lang.String... fieldNames)
fieldNames
- key field namespublic abstract KeyDef getKeyDef()
public abstract void setDistributionFields(java.lang.String... fieldNames)
fieldNames
- distribution key field namespublic abstract java.util.Collection<java.lang.String> getDistributionFields()
public abstract SpaceDef setContext(Tuple tuple)
tuple
- Tuple that contains key-value pairspublic abstract Tuple getContext()
public abstract void addIndexDef(IndexDef indexDef)
indexDef
- IndexDef to be addedpublic abstract IndexDef removeIndexDef(java.lang.String name)
name
- Index namepublic abstract IndexDef getIndexDef(java.lang.String indexName)
indexName
- Index name to getpublic abstract java.util.Collection<IndexDef> getIndexDefList()
public abstract SpaceDef setPhaseCount(int phaseCount)
phaseCount
- Phase countpublic abstract int getPhaseCount()
public abstract SpaceDef setPhaseInterval(long interval)
interval
- time to waitpublic abstract long getPhaseInterval()
public abstract SpaceDef setWriteTimeout(long timeout)
timeout
- write timeoutpublic abstract long getWriteTimeout()
public abstract SpaceDef setReadTimeout(long timeout)
timeout
- read timeoutpublic abstract long getReadTimeout()
public abstract SpaceDef setVirtualNodeCount(int nodeCount)
public abstract int getVirtualNodeCount()
public abstract SpaceDef setCachePolicy(SpaceDef.CachePolicy cachePolicy)
public abstract SpaceDef.CachePolicy getCachePolicy()
public abstract SpaceDef setForgetOldValue(boolean forgetOldValue)
public abstract boolean isForgetOldValue()
public abstract SpaceDef setHostAwareReplication(boolean hostAwareReplication)
public abstract boolean isHostAwareReplication()
public abstract SpaceDef setRouted(boolean isRouted)
public abstract boolean isRouted()
Copyright (c) 2013 TIBCO Software Inc. All rights reserved.