com.hazelcast.queue.impl
Class QueueContainer

java.lang.Object
  extended by com.hazelcast.queue.impl.QueueContainer
All Implemented Interfaces:
DataSerializable, IdentifiedDataSerializable

public class QueueContainer
extends Object
implements IdentifiedDataSerializable

This class contains methods be notable for the Queue. such as pool,peek,clear..


Constructor Summary
QueueContainer(String name)
           
QueueContainer(String name, QueueConfig config, NodeEngine nodeEngine, QueueService service)
           
 
Method Summary
 Map<Long,Data> addAll(Collection<Data> dataList)
           
 void addAllBackup(Map<Long,Data> dataMap)
           
 int backupSize()
           
 void cancelEvictionIfExists()
           
 Map<Long,Data> clear()
           
 void clearBackup(Set<Long> itemIdSet)
           
 Map<Long,Data> compareAndRemove(Collection<Data> dataList, boolean retain)
          This method triggers store load
 void compareAndRemoveBackup(Set<Long> itemIdSet)
           
 boolean contains(Collection<Data> dataSet)
          This method does not trigger store load.
 void destroy()
           
 Map<Long,Data> drain(int maxSize)
           
 void drainFromBackup(Set<Long> itemIdSet)
           
 List<Data> getAsDataList()
          This method triggers store load.
 QueueConfig getConfig()
           
 Data getDataFromMap(long itemId)
           
 int getFactoryId()
          Returns DataSerializableFactory factory id for this class.
 int getId()
          Returns type identifier for this class.
 Deque<QueueItem> getItemQueue()
           
 QueueWaitNotifyKey getOfferWaitNotifyKey()
           
 QueueWaitNotifyKey getPollWaitNotifyKey()
           
 boolean hasEnoughCapacity()
           
 boolean hasEnoughCapacity(int delta)
           
 void init(boolean fromBackup)
           
 boolean isEvictable()
           
 void mapDrainIterator(int maxSize, Map map)
           
 void mapIterateAndRemove(Map map)
           
 long offer(Data data)
           
 void offerBackup(Data data, long itemId)
           
 QueueItem peek()
           
 QueueItem poll()
           
 void pollBackup(long itemId)
           
 void readData(ObjectDataInput in)
          Reads fields from the input stream
 long remove(Data data)
          iterates all items, checks equality with data This method does not trigger store load.
 void removeBackup(long itemId)
           
 void rollbackTransaction(String transactionId)
           
 void setConfig(QueueConfig config, NodeEngine nodeEngine, QueueService service)
           
 void setStats(LocalQueueStatsImpl stats)
           
 int size()
           
 int txMapSize()
           
 boolean txnCommitOffer(long itemId, Data data, boolean backup)
           
 Data txnCommitPoll(long itemId)
           
 Data txnCommitPollBackup(long itemId)
           
 boolean txnEnsureReserve(long itemId)
           
 void txnOfferBackupReserve(long itemId, String transactionId)
           
 long txnOfferReserve(String transactionId)
           
 QueueItem txnPeek(long offerId, String transactionId)
           
 void txnPollBackupReserve(long itemId, String transactionId)
           
 QueueItem txnPollReserve(long reservedOfferId, String transactionId)
           
 boolean txnRollbackOffer(long itemId)
           
 boolean txnRollbackOfferBackup(long itemId)
           
 boolean txnRollbackPoll(long itemId, boolean backup)
           
 void writeData(ObjectDataOutput out)
          Writes object fields to output stream
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QueueContainer

public QueueContainer(String name)

QueueContainer

public QueueContainer(String name,
                      QueueConfig config,
                      NodeEngine nodeEngine,
                      QueueService service)
               throws Exception
Throws:
Exception
Method Detail

init

public void init(boolean fromBackup)

txnEnsureReserve

public boolean txnEnsureReserve(long itemId)

txnPollReserve

public QueueItem txnPollReserve(long reservedOfferId,
                                String transactionId)

txnPollBackupReserve

public void txnPollBackupReserve(long itemId,
                                 String transactionId)

txnCommitPoll

public Data txnCommitPoll(long itemId)

txnCommitPollBackup

public Data txnCommitPollBackup(long itemId)

txnRollbackPoll

public boolean txnRollbackPoll(long itemId,
                               boolean backup)

txnOfferReserve

public long txnOfferReserve(String transactionId)

txnOfferBackupReserve

public void txnOfferBackupReserve(long itemId,
                                  String transactionId)

txnCommitOffer

public boolean txnCommitOffer(long itemId,
                              Data data,
                              boolean backup)

txnRollbackOffer

public boolean txnRollbackOffer(long itemId)

txnRollbackOfferBackup

public boolean txnRollbackOfferBackup(long itemId)

txnPeek

public QueueItem txnPeek(long offerId,
                         String transactionId)

offer

public long offer(Data data)

offerBackup

public void offerBackup(Data data,
                        long itemId)

addAll

public Map<Long,Data> addAll(Collection<Data> dataList)

addAllBackup

public void addAllBackup(Map<Long,Data> dataMap)

peek

public QueueItem peek()

poll

public QueueItem poll()

pollBackup

public void pollBackup(long itemId)

drain

public Map<Long,Data> drain(int maxSize)

mapDrainIterator

public void mapDrainIterator(int maxSize,
                             Map map)

drainFromBackup

public void drainFromBackup(Set<Long> itemIdSet)

size

public int size()

txMapSize

public int txMapSize()

backupSize

public int backupSize()

clear

public Map<Long,Data> clear()

clearBackup

public void clearBackup(Set<Long> itemIdSet)

remove

public long remove(Data data)
iterates all items, checks equality with data This method does not trigger store load.


removeBackup

public void removeBackup(long itemId)

contains

public boolean contains(Collection<Data> dataSet)
This method does not trigger store load.


getAsDataList

public List<Data> getAsDataList()
This method triggers store load.


compareAndRemove

public Map<Long,Data> compareAndRemove(Collection<Data> dataList,
                                       boolean retain)
This method triggers store load


mapIterateAndRemove

public void mapIterateAndRemove(Map map)

compareAndRemoveBackup

public void compareAndRemoveBackup(Set<Long> itemIdSet)

hasEnoughCapacity

public boolean hasEnoughCapacity()

hasEnoughCapacity

public boolean hasEnoughCapacity(int delta)

getItemQueue

public Deque<QueueItem> getItemQueue()

getDataFromMap

public Data getDataFromMap(long itemId)

setConfig

public void setConfig(QueueConfig config,
                      NodeEngine nodeEngine,
                      QueueService service)

getPollWaitNotifyKey

public QueueWaitNotifyKey getPollWaitNotifyKey()

getOfferWaitNotifyKey

public QueueWaitNotifyKey getOfferWaitNotifyKey()

getConfig

public QueueConfig getConfig()

setStats

public void setStats(LocalQueueStatsImpl stats)

cancelEvictionIfExists

public void cancelEvictionIfExists()

isEvictable

public boolean isEvictable()

rollbackTransaction

public void rollbackTransaction(String transactionId)

writeData

public void writeData(ObjectDataOutput out)
               throws IOException
Description copied from interface: DataSerializable
Writes object fields to output stream

Specified by:
writeData in interface DataSerializable
Parameters:
out - output
Throws:
IOException

readData

public void readData(ObjectDataInput in)
              throws IOException
Description copied from interface: DataSerializable
Reads fields from the input stream

Specified by:
readData in interface DataSerializable
Parameters:
in - input
Throws:
IOException

destroy

public void destroy()

getFactoryId

public int getFactoryId()
Description copied from interface: IdentifiedDataSerializable
Returns DataSerializableFactory factory id for this class.

Specified by:
getFactoryId in interface IdentifiedDataSerializable
Returns:
factory id

getId

public int getId()
Description copied from interface: IdentifiedDataSerializable
Returns type identifier for this class. Id should be unique per DataSerializableFactory.

Specified by:
getId in interface IdentifiedDataSerializable
Returns:
type id


Copyright © 2015 Hazelcast, Inc.. All Rights Reserved.