public abstract class CollectionContainer extends Object implements IdentifiedDataSerializable
Modifier and Type | Field and Description |
---|---|
static int |
ID_PROMOTION_OFFSET |
static int |
INVALID_ITEM_ID |
protected Map<Long,CollectionItem> |
itemMap |
protected ILogger |
logger |
protected String |
name |
protected NodeEngine |
nodeEngine |
protected Map<Long,TxCollectionItem> |
txMap |
Modifier | Constructor and Description |
---|---|
protected |
CollectionContainer() |
protected |
CollectionContainer(String name,
NodeEngine nodeEngine) |
Modifier and Type | Method and Description |
---|---|
long |
add(Data value) |
Map<Long,Data> |
addAll(List<Data> valueList) |
void |
addAllBackup(Map<Long,Data> valueMap) |
void |
addBackup(long itemId,
Data value) |
Map<Long,Data> |
clear(boolean returnValues) |
void |
clearBackup(Set<Long> itemIdSet) |
void |
commitAdd(long itemId,
Data value) |
void |
commitAddBackup(long itemId,
Data value) |
CollectionItem |
commitRemove(long itemId) |
void |
commitRemoveBackup(long itemId) |
Map<Long,Data> |
compareAndRemove(boolean retain,
Set<Data> valueSet) |
boolean |
contains(Set<Data> valueSet) |
void |
destroy() |
void |
ensureReserve(long itemId) |
List<Data> |
getAll() |
abstract Collection<CollectionItem> |
getCollection() |
abstract CollectionConfig |
getConfig() |
long |
getCurrentId() |
int |
getFactoryId()
Returns DataSerializableFactory factory ID for this class.
|
abstract Map<Long,CollectionItem> |
getMap() |
String |
getName() |
boolean |
hasEnoughCapacity(int delta) |
void |
init(NodeEngine nodeEngine) |
long |
nextId() |
protected abstract void |
onDestroy() |
void |
readData(ObjectDataInput in)
Reads fields from the input stream
|
CollectionItem |
remove(Data value) |
void |
removeBackup(long itemId) |
Long |
reserveAdd(String transactionId,
Data value) |
void |
reserveAddBackup(long itemId,
String transactionId) |
CollectionItem |
reserveRemove(long reservedItemId,
Data value,
String transactionId) |
void |
reserveRemoveBackup(long itemId,
String transactionId) |
void |
rollbackAdd(long itemId) |
void |
rollbackAddBackup(long itemId) |
void |
rollbackRemove(long itemId) |
void |
rollbackRemoveBackup(long itemId) |
void |
rollbackTransaction(String transactionId) |
protected void |
setId(long itemId) |
int |
size() |
void |
writeData(ObjectDataOutput out)
Writes object fields to output stream
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getId
public static final int INVALID_ITEM_ID
public static final int ID_PROMOTION_OFFSET
protected final Map<Long,TxCollectionItem> txMap
protected String name
protected NodeEngine nodeEngine
protected ILogger logger
protected Map<Long,CollectionItem> itemMap
protected CollectionContainer()
protected CollectionContainer(String name, NodeEngine nodeEngine)
public void init(NodeEngine nodeEngine)
public String getName()
public abstract CollectionConfig getConfig()
public abstract Collection<CollectionItem> getCollection()
public abstract Map<Long,CollectionItem> getMap()
public long add(Data value)
public void addBackup(long itemId, Data value)
public CollectionItem remove(Data value)
public void removeBackup(long itemId)
public int size()
public boolean hasEnoughCapacity(int delta)
public void reserveAddBackup(long itemId, String transactionId)
public CollectionItem reserveRemove(long reservedItemId, Data value, String transactionId)
public void reserveRemoveBackup(long itemId, String transactionId)
public void ensureReserve(long itemId)
public void rollbackAdd(long itemId)
public void rollbackAddBackup(long itemId)
public void rollbackRemove(long itemId)
public void rollbackRemoveBackup(long itemId)
public void commitAdd(long itemId, Data value)
public void commitAddBackup(long itemId, Data value)
public CollectionItem commitRemove(long itemId)
public void commitRemoveBackup(long itemId)
public void rollbackTransaction(String transactionId)
public long nextId()
public long getCurrentId()
protected void setId(long itemId)
public void destroy()
protected abstract void onDestroy()
public void writeData(ObjectDataOutput out) throws IOException
DataSerializable
writeData
in interface DataSerializable
out
- outputIOException
- if an I/O error occurs. In particular,
an IOException
may be thrown if the
output stream has been closed.public void readData(ObjectDataInput in) throws IOException
DataSerializable
readData
in interface DataSerializable
in
- inputIOException
- if an I/O error occurs. In particular,
an IOException
may be thrown if the
input stream has been closed.public int getFactoryId()
IdentifiedDataSerializable
getFactoryId
in interface IdentifiedDataSerializable
Copyright © 2022 Hazelcast, Inc.. All Rights Reserved.